   
var xmlHttp

/* //TEMPLATE ONLY
//dara 06November2007 used in affiliates/form_login.php   
function validateLogin()  
{  
    post = "?username=" + document.getElementById('username').value;
    post = post + "&password=" + document.getElementById('password').value;;
    url = "ajax/validate_login.php" + post;
      
    xmlHttp=GetXmlHttpObject()
    
    if (xmlHttp==null)
      {
      alert ("Your browser does not support AJAX!");
      return;
      } 
                  
    xmlHttp.onreadystatechange = validateLogin_x; 
    xmlHttp.open("GET", url, true);
    xmlHttp.send(null); 
} 

//dara 06November2007 used in affiliates/form_login.php, called by function validateLogin() 
function validateLogin_x() 
{     
    if (xmlHttp.readyState==4)
    {    
        var pos = xmlHttp.responseText.indexOf('##') + 2;   
        var status = xmlHttp.responseText.substring(pos, pos + 1);  
        var len = xmlHttp.responseText.length;  
        
        if (status == "1") document.getElementById('form_login').submit();        
        else if (status == "0") { //if error
            document.getElementById('login_error').style.display = ''; 
            document.getElementById('login_error').innerHTML = xmlHttp.responseText.substring(pos + 1, len); 
        }        
    } //end if readyState                                                         
}                               
*/
function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
	    {
	    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	    }
	  catch (e)
	    {
	    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	    }
	  }
	return xmlHttp;
}