/* ******************************************/
/*	www.KOOLPOETRY.com Project				*/
/*	SingUp From Validation Code				*/
/*	Mob: 0092- 321 4829771					*/
/*	www.MMHAQ.net All Copy Right			*/
/* ******************************************/

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 
		 } 
	}
// Check Sub Category
	function SubCategory()
	{
		xmlHttp=GetXmlHttpObject()
		// if browser not found
		if (xmlHttp==null)
		{
			 alert ("Browser does not support HTTP Request")
			 return
		 } 
		 // Server Url
		var url="include/subcategory.php"
		// Query string variable 
		url=url+"?catid="+document.getElementById("category").value;//+"&fname="+document.getElementById("txtFirstName").value+"&lname="+document.getElementById("txtLastName").value;
		// Call back function for check response state.
		xmlHttp.onreadystatechange=categoryfind
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}
	function categoryfind() 
	{ 
		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 
		 } 
	}

