
var xmlHttp, Obj, prntObj
delay=5000;
frame=30;
hex=0;

function showResult(str, epsa, m, pObj)
{
 prntObj = getElementPosition(pObj);
 var w = document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
 var s_l = self.pageXOffset || (document.documentElement && document.documentElement.scrollLeft) || (document.body && document.body.scrollLeft);
 if (m!=null)
	{
 		Obj=getelementbyid(m);
	}
 if (str.length < 3 || str.length > 20 || epsa=="False")
 { 
	Obj.innerHTML="";
  Obj.style.border="0px";
  Obj.style.display = 'none';
  return
 }
 	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
 	{
 		alert ("Browser does not support HTTP Request");
 		return
 	} 
	var url="/1/livesearch.asp";
	url=url+"?q="+str;
	url=url+"&p="+pObj;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	
	if (Obj!=null)
	{
  	Obj.style.top = prntObj.top + prntObj.height +1;
  	Obj.style.left = prntObj.left;
  	switchDiv(Obj,true);
  	//changecontent();
  }

}
function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
	Obj.innerHTML=xmlHttp.responseText;
 } 
}

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;
}
function gosearch(part, inpt)
{
	prntObj = getelementbyid(inpt);
 	prntObj.value = part;
 	Obj = getelementbyid("livesearch");
 	end_livesearch("livesearch");
  return;
}
function sel(row)
{
	row.style.cursor = 'default';
 	row.style.background = '#007f9f';
}
function unsel(row)
{
	row.style.background =  'infobackground';
}
function end_livesearch(n)
{
	var n = getelementbyid(n);
  n.innerHTML="";
  n.style.border="0px";
  n.style.display = 'none';
  return
}

function changecontent()
{
	frame=30;
	hex=0;
	setTimeout("colorfade()",delay);
}

function colorfade() 
{ 
	if(frame>0) 
	{ 
		hex+=9;
		if(document.getElementById("fscroller") != null)
		document.getElementById("fscroller").style.color= "rgb(255,"+hex+","+(hex - 1 )+")"; // Set color value.
		frame--;
		setTimeout("colorfade()",80); 
	}
	else
	{
		if(document.getElementById("fscroller") != null)
		document.getElementById("fscroller").style.color= "rgb(255,255,225)";
	} 
}

function SetBlured()
{
	window.setTimeout('autoclose()', 200);
}

function autoclose()
{
	end_livesearch('livesearch');
}

