var gStr, t, delay = 1000;
var xmlHttp=GetXmlHttpObject();

function showProduct(str)
{
	gStr = str;
	clearTimeout(t);
	t=setTimeout("showProduct2()",delay);
}

function showProduct2()
{
	var str = gStr;
	if (str.length == 0)
	{
		return;
	}
	if (xmlHttp==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	}
	var url="SEARCH.php";
	url=url+"?q="+str;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=function()
	{ 
		/*if (xmlHttp.readyState==0)
		{
			document.getElementById("searchResult22").innerHTML = "The request is not initialized...";
		}
		if (xmlHttp.readyState==1)
		{
			document.getElementById("searchResult22").innerHTML = "The request has been set up...";
		}
		if (xmlHttp.readyState==2)
		{
			document.getElementById("searchResult22").innerHTML = "The request has been sent...";
		}*/
		if (xmlHttp.readyState==3)
		{
			document.getElementById("searchResult").innerHTML = "Searching...";
		}		
		if (xmlHttp.readyState==4)
		{
			if(xmlHttp.responseText == '443565465564645653744dfgfdhhfgftunbdardsdjnbAr3t5tb5656')
			{
				document.location = 'mailto:mseipel@fatsac.com';
			}
			else
			{
				document.getElementById("searchResult").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;
}
