function ajaxlookup(updateval,remoteScript, destControl)
{ 
   //***** Code to get the current 5 char string that is seconds and milliseconds
   dateval=new Date();
   secondval=String(dateval.getSeconds());
   millival=String(dateval.getMilliseconds());
   while (secondval.length < 2)
   {
   	secondval = "0" + "" + secondval;
   }
   
   while (millival.length < 3)
   {
   	millival = "0" + "" + millival;
   }
	 //**************************************************
	 
	 
 	 //If we're updating, only set the global val and exit
   if (updateval==1)
   {
    	 ajaxlookup.lastupdate = secondval + "" + millival;
			 if (typeof ajaxlookup.lastinterval != "undefined")
			 {
			 	clearInterval(ajaxlookup.lastinterval);
			 }
  		 ajaxlookup.lastinterval = window.setInterval("ajaxlookup(0,'" + remoteScript + "','" + destControl + "')",400);
   }
 
 	 //If we're not updating, only continue if nothing has been typed for 400 ms
   var temp= secondval + "" + millival;

   if (parseInt(temp - 400) < parseInt(ajaxlookup.lastupdate))
   {
	 	return false;
	 }
   if (typeof ajaxlookup.lastinterval != "undefined")
	 {
	 	clearInterval(ajaxlookup.lastinterval);
	 }	 
  window.setTimeout('ajaxlookup',1000);
	showResults(remoteScript,destControl);
}


function showResults(remoteScript,destControl)
  {
  var xmlHttp;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      try
        {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      catch (e)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }

    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
          document.getElementById(destControl).innerHTML=xmlHttp.responseText;
        }
      }
    xmlHttp.open("GET",remoteScript,true);
    xmlHttp.send(null);
  }
