var flag
var xmlHttp 
function doSearchCBP(string) 
{ 
	document.getElementById('results').style.visibility = 'visible'; 
	xmlHttp=GetXmlHttpObject(); 
		if (xmlHttp==null) 
		{ 
		alert ("Your browser does not support AJAX!"); 
		return; 
		} 
	var url="scripts/ajax_search/getresults.php"+"?query="+string;
	xmlHttp.onreadystatechange=stateChanged; 
	xmlHttp.open("GET",url,true); 
	xmlHttp.send(null);
	
	flag = "show";
}
function delayRemove()
{
	setTimeout("removeLayer()",5000);
}

function keepLayer()
{
	document.getElementById('results').style.visibility = 'visible';
}
function removeLayer()
{
	document.getElementById('results').style.visibility = 'hidden'; 
}

function stateChanged() 
{
	if (xmlHttp.readyState==4) 
	{ 
		document.getElementById("results").innerHTML=xmlHttp.responseText; 
	}
}

function GetXmlHttpObject() 
{ 
	var xmlHttp=null; 
	try 
	{ 
		xmlHttp=new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari
	}
	catch (e) 
	{ 
		try
		{ 
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer 
		} 
		catch (e) 
		{
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); 
		}
	} 
	return xmlHttp;
}
