var xmlHttp

function chkuser(str)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
 	{
 		alert ("Browser does not support HTTP Request")
 		return
 	}
var url="chkuser.php"
url=url+"?username="+str
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged() 
{ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 	response = xmlHttp.responseText		
	if(response == "True")
	{
		document.getElementById("chkuserid").innerHTML="<font color=#FF0000>This username already exists, choose another</font>" 
		document.frm.flg.value = "False";	
		//alert(document.getElementById("chkuserid").innerHTML)			
	}
	else
	{		
		document.getElementById("chkuserid").innerHTML="";
		document.frm.flg.value = "True";	
	}		
 } 
}

function chkOldPass(str)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
 	{
 		alert ("Browser does not support HTTP Request")
 		return
 	}
var url="chkuser.php"
url=url+"?password="+str
xmlHttp.onreadystatechange=stateChgPass 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChgPass() 
{ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 	response = xmlHttp.responseText	
	if(response == "True")
	{
		document.getElementById("chkPassid").innerHTML="";
		document.frm.flg.value = "True";				
	}
	else
	{		
		document.getElementById("chkPassid").innerHTML="<font color=#FF0000>Invalid old password</font>" 
		document.frm.flg.value = "False";	
	}		
 } 
}
