var prntObj;
var bDelVers = 0;

function showResult(str, epsa, m, pObj, bDVer)
{
	if(bDelVers != bDVer ) return;

	oSrcObj = getelementbyid(m);
	if (str.length < 3 || str.length > 20 || epsa=="False" || !oSrcObj)
	{ 
		end_livesearch(m);
  	return;
	}
	
	prntObj = getElementPosition(pObj);

	var url="1/livesearch.asp?q="+str+"&p="+pObj;
	doAJAXRequestGET(url, stateChanged);
	
	if (oSrcObj)
	{
		oSrcObj.style.top  = (prntObj.top + prntObj.height + 1) + 'px';
		oSrcObj.style.left = (prntObj.left + 1) + 'px';
  }
}

function showResultDelayed(str, epsa, m, pObj) {
	bDelVers++;
	setTimeout('showResult(\''+str+'\', \''+epsa+'\', \''+m+'\', \''+pObj+'\', '+bDelVers+')', iPSADelay);
}

function gosearch(part, inpt)
{
	prntObj = getelementbyid(inpt);
 	prntObj.value = part;
 	oSrcObj = getelementbyid("livesearch");
 	end_livesearch("livesearch");
  return;
}

function end_livesearch(n)
{
	var o = getelementbyid(n);
  o.innerHTML = '';
  switchDiv(o,false);
  return;
}

function SetBlured()
{
	window.setTimeout('autoclose()', 200);
}

function autoclose()
{
	end_livesearch('livesearch');
}

function stateChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
		oSrcObj.innerHTML=xmlHttp.responseText;
		switchDiv(oSrcObj,true);
	}
}
