//Ajax script for autocomplete

// Get the HTTP Object
function getHTTPObject(){
  if (window.ActiveXObject)
      return new ActiveXObject("Microsoft.XMLHTTP");
  else if (window.XMLHttpRequest)
      return new XMLHttpRequest();
  else {
      alert("Your browser does not support AJAX.");
      return null;
  }
}

function showHint_h(str){
  if (str.length==0){
      document.getElementById('txtHint_h').innerHTML="";
      return;
  }else if(str.length>=2){
      xmlHttp=getHTTPObject();

      var url="../ajax/gethint_header.php?q="+str+"&sid"+Math.random();
      xmlHttp.onreadystatechange=stateChanged_h;
      xmlHttp.open("GET",url,true);
      xmlHttp.send(null);
 }
}

function stateChanged_h(){
  if (xmlHttp.readyState==4){
      document.getElementById("txtHint_h").innerHTML=xmlHttp.responseText;
      //document.getElementById("txt").value=xmlHttp.responseText;
  }
}

function mouseOver(){
//alert("test");
document.mo.backgoundColor ="#84DFC1";
}

function mouseOut(){
document.mo.backgoundColor ="#FFF";
}
