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 
	if(str != '')
		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 
	if(str!='')
	{
		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";	
	}		
 } 
}


function getCharges(str)
{	
	xmlHttp=GetXmlHttpObject();
	if(str == '')
		return false;
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}
	var url="chkuser.php?delday="+str	
	xmlHttp.onreadystatechange=function Charges() 
	{
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{
			var Response = xmlHttp.responseText;	
			if(Response != '')
			{
				document.getElementById("div_Charges").innerHTML = Response ;		
			}
			else
			{
				document.getElementById("div_Charges").innerHTML = "0" ;
			}
		}	
	}
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}