/************************************/
/*	File Index						*/
/*									*/
/*	Project PkMasti.com				*/
/*									*/
/*	Designed & Devolpemnet by 		*/
/*	MMHAQ Networks					*/
/*	http://www.mmhaq.net			*/
/*	email: info@mmhaq.net			*/
/*	ContactNo. +92-321-4829771		*/
/*									*/
/************************************/

function GetXmlHttpObject()
{
	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;
}

// Check user availability
	function CheckAvail()
	{
		xmlHttp=GetXmlHttpObject()
		// if browser not found
		if (xmlHttp==null)
		{
			 alert ("Browser does not support HTTP Request")
			 return
		 } 
		 // Server Url
		var url="include/userchk.php"
		// Query string variable 
		url=url+"?username="+document.getElementById("username").value;//+"&fname="+document.getElementById("txtFirstName").value+"&lname="+document.getElementById("txtLastName").value;
		// Call back function for check response state.
		xmlHttp.onreadystatechange=usernamechk 
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}
	function usernamechk() 
	{ 
		document.getElementById("divAvail").innerHTML="<img src=images/loading.gif />";
		
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
			// Assign server reponse to div.
			 document.getElementById("divAvail").innerHTML=xmlHttp.responseText 
		 } 
	}
