// JavaScript Document
var xmlHttp

function showUsr(str)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	}
	var url="getusers.php";
	url=url+"?q="+str;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged ;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function showFName(str)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	}
	var url="getfname.php";
	url=url+"?p="+str;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChangedF ;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function showLName(str)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	}
	var url="getlname.php";
	url=url+"?l="+str;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChangedL ;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function showPwdErr(str1, str2)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	}
	var url="getPwdErr.php";
	url=url+"?c="+str1;
	url=url+"&d="+str2;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChangedPwd;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function stateChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("txtHint").innerHTML=xmlHttp.responseText ;
		var isemailerror = document.getElementById("isemailerror").value;
		if(isemailerror == 1)
		{
			document.myForm.SubmitButtonCont.disabled = true; 
		myForm.CEmail.focus();
		
		}
		else if(isemailerror == 0)
			{
				document.myForm.SubmitButtonCont.disabled = false; 
				}
		
	} 
}
function stateChangedF() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		document.getElementById("txtFHint").innerHTML=xmlHttp.responseText ;
	} 
}
function stateChangedL() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		document.getElementById("txtLHint").innerHTML=xmlHttp.responseText ;
	} 
}
function stateChangedPwd() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		document.getElementById("txtPwd").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;
}