var xmlHttp

function showUser(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="Email_Search.php3"
var userVal
url=url+"?q="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 //document.getElementById("txtHint").innerHTML=xmlHttp.responseText 
 userVal=xmlHttp.responseText
 if (userVal == 3)
{drop_list.SubmitButton.disabled=true;
document.getElementById("txtHint").innerHTML=""
} 
else if (userVal == 2)
{drop_list.SubmitButton.disabled=true;
document.getElementById("txtHint").innerHTML='Not found. <a href="https://www.tcsdcc.com/public_html/Zen/index.php?main_page=login"> Please Create an Account Here </a><br> Or if you misstyped click here to <INPUT TYPE=BUTTON OnClick="clearBox();" VALUE="clear the textbox">';
} 
else
{drop_list.SubmitButton.disabled=false;
document.getElementById("txtHint").innerHTML='User Found. If this isn\'t you:<br><br><INPUT TYPE=BUTTON OnClick="window.open(\'https://www.tcsdcc.com/public_html/Zen/index.php?main_page=login\');" VALUE="Not you?">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE=BUTTON OnClick="clearBox();" VALUE="Misstyped?">'
document.getElementById("search").value=userVal.split(' ').join('')
document.getElementById("search").readOnly=true;  
}
 } 
 
}

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;
}
