// JavaScript Document

function help(id,lang)
{
  var url = "ajax/help_ajax.php?id="+id+"&lang="+lang;

  sendRequest(url);
}
var xmlHttp;

function createXMLHttpRequest()
{
	try 
  { 
    return new ActiveXObject("Msxml2.XMLHTTP"); 
  } 
  catch (e) 
  {
    try 
    { 
      return new ActiveXObject("Microsoft.XMLHTTP"); 
    } 
    catch (e) 
    {
      try 
      { 
        return new XMLHttpRequest(); 
      } 
      catch(e) 
      {
      	alert("Your browser does not support AJAX!");
	      return null;
      }
    }
  }
}

function stateChanged() 
{ 
  if (xmlHttp.readyState==4)
  { 
    document.getElementById('help_content').innerHTML=xmlHttp.responseText;
  }
}

// Helper function to perform request; synchronous to keep it simple for now
function sendRequest(url)
{
	xmlHttp = createXMLHttpRequest();

	if (xmlHttp)
	{
	  xmlHttp.onreadystatechange=stateChanged;
		xmlHttp.open("GET", url, true);
		xmlHttp.send("");
		//return xmlhttp.responseText;
	}
}
