var xmlhttp;

function showSearchResult(str)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url="AjaxSearch.php";
url=url+"?q="+str;
/*if(osCsid==1){
	url=url+"&t=1";
}else{
	url=url+"&osCsid="+osCsid;
}*/
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}

function stateChanged()
{
	if (xmlhttp.readyState==4)
	{
/*		document.getElementById("txtstyle").style.marginTop="0px;";*/
		if(xmlhttp.responseText.length==0){
				document.getElementById("txttable").style.backgroundColor="";
				document.getElementById("txttable").style.border="";
		}else{
				document.getElementById("txttable").style.backgroundColor="#E8E8E8";
				document.getElementById("txttable").style.border="groove";
		}
		
		
		//style="border-left:groove;border-top:groove;border-right:groove;border-bottom:groove;background-color:#E0E0E0;"
		document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
		
	}
}

function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}
