var xmlHttp;

function showHint(str)
{
if (str.length==0)
  { 
  document.getElementById("txtHint").innerHTML="";
  return;
  }
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)

  {
  alert ("Browser does not support HTTP Request");
  return;
  } 
var url="include/getHint.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
showResults(str)
} 

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 
 document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
 document.getElementById("hint").style.display="block";
  } 
}

function showResults(str1)
{
if (str1.length==0)
  { 
  document.getElementById("txtQA").innerHTML="";
  return;
  }
xmlHttp_1=GetXmlHttpObject_1();
if (xmlHttp_1==null)

  {
  alert ("Browser does not support HTTP Request");
  return;
  } 
var url_1="include/showResult.php";
url_1=url_1+"?q1="+str1;
url_1=url_1+"&sid="+Math.random();
xmlHttp_1.onreadystatechange=stateChanged_0;

xmlHttp_1.open("GET",url_1,true);
xmlHttp_1.send(null);
} 

function stateChanged_0() 
{ 
if (xmlHttp_1.readyState==4 || xmlHttp_1.readyState=="complete")
 { 
 document.getElementById("txtQA").innerHTML="Searching ...";
 setTimeout('document.getElementById("txtQA").innerHTML=xmlHttp_1.responseText', 5000);
  } 
}

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;
}


function GetXmlHttpObject_1()
{
var xmlHttp_1=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp_1=new XMLHttpRequest();
 }
catch (e)
 {
 // Internet Explorer
 try
  {
  xmlHttp_1=new ActiveXObject("Msxml2.XMLHTTP");

  }
 catch (e)
  {
  xmlHttp_1=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp_1;
}
