var xmlHttp
var temp;
function showResult(str)
{
	$("#loader_id").fadeIn();
	$("#cx").hide();
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	 {
	 alert ("Browser does not support HTTP Request")
	 return
	 } 
	 
	 	
	if (str.length==0)
	 { 
		
		str=" "
		stateChanged();
	 }
	var url="livesearch.php5"
	url=url+"?q="+str
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
} 

function stateChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
			$(".fadein").fadeOut('', function(){
											
											
											if (xmlHttp.responseText!=temp)
											{
												document.getElementById("livesearch"). innerHTML=xmlHttp.responseText;
												document.getElementById("livesearch"). style.border="0px solid #ffffff";
												$("#livesearch").fadeIn();
												temp=xmlHttp.responseText;
											}
											$("#loader_id").fadeOut();
										});
												

	 } 
}
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;
}



