var xmlHttp

function showSearch(str)
{
	if (str.length<=1)
	{ 
		document.getElementById("result_div").innerHTML="";
		document.getElementById("result_div").style.visibility="hidden";
		return;
	}
	else if (document.getElementById("result_div").innerHTML == "")
	{
		document.getElementById("result_div").style.visibility="visible";
		document.getElementById("result_div").innerHTML = '<div id="inner_result_div">searching...</div>';
	}
	else
	{
		document.getElementById("result_div").style.visibility="visible";
		if(document.getElementById("inner_result_div").innerHTML.indexOf("searching...") == -1)
			document.getElementById("inner_result_div").innerHTML += "searching...";
	}

	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) { return; } 

	var url="/search.asp?s="+str+"&rnd="+Math.random();
	xmlHttp.onreadystatechange=function() { 
		if (xmlHttp.readyState==4)
			document.getElementById('inner_result_div').innerHTML = xmlHttp.responseText
	}
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
} 

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;
}