//var xmlHttp = null;

function checkUser(str)
{ 
//   alert('got here'); 
//   return;
xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="test.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();

 xmlHttp.onreadystatechange=stateChanged;
 xmlHttp.open("GET",url,true);
 xmlHttp.send(null);





}

function stateChanged() 
{
   //alert("got here");
   //alert(xmlHttp);
  // return;
   if (xmlHttp.readyState==4)
   {
       try
       { 
          document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
       }

       catch(e)
       {
           //just ignore it , this is for IE only
       }
   }

  

}

function GetXmlHttpObject()
{
var xmlHttp=null;


try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e) 
{

}

   if( xmlHttp !=null)
   {
      return xmlHttp;
   }
 
  // Internet Explorer
try
{
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
    
}

  if( xmlHttp !=null)
   {
      return xmlHttp;
   }

try
{

  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}

catch(e)
{

}

   
  
return xmlHttp;
}
