var xmlHttp;
var idd;

function showResultID(idnum)
{
idd=idnum;
xmlHttp=GetXmlHttpObjectID()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 } 

var url="phpscripts/updateid.php";
url=url+"?q="+idnum
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChangedID ;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
} 

function stateChangedID() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 

if (xmlHttp.responseText=="nope"){

 document.getElementById('wrong').innerHTML="This ID is in use or is incorrect.";
 }
 else  {document.getElementById('idimage').src="http://www.hockeywidgets.com/hockeyfan/players/"+xmlHttp.responseText+".png";
 document.getElementById('smalljit').src="http://www.hockeywidgets.com/hockeyfan/mini/"+xmlHttp.responseText+".png";
 document.getElementById('wrong').innerHTML="";
 
  
 
 }


 
 } 
}
function GetXmlHttpObjectID()
{
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;
}
