var xmlHttp

function ScreenNameEmailKeyUp(str,txt,typ)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url="ajScreenNameCheck.aspx?typ="+typ+"&qv="+str+"&sid="+Math.random();
	if (typ=="email") 
	{
		if(str.length > 0)
		{
			//document.getElementById('spanReqToLog').style.display  = "none";
			document.getElementById('spanEmReq').style.display  = "none";
		}
			
		xmlHttp.onreadystatechange=emailChanged;		
	}
	else if (typ=="sc") 
	{
		if(str.length > 0)
			document.getElementById('spanSNReq').style.display = "none";
			
		xmlHttp.onreadystatechange=screennameChanged;
	}
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function screennameChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") document.getElementById('txtSCAvilable').innerHTML=xmlHttp.responseText
	
} 

function emailChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") document.getElementById('txtEmailAvilable').innerHTML=xmlHttp.responseText
	
} 

function GetXmlHttpObject()
{ 
	var objXMLHttp=null
	if (window.XMLHttpRequest)objXMLHttp=new XMLHttpRequest()
	else if (window.ActiveXObject)	objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	return objXMLHttp
}

function clearReq(str,spn)
{
	if(str.length > 0)
		document.getElementById(spn).style.display  = "none";
}
