var countryid;
function getXMLHTTP() 
{
		var xmlhttp=false;	
		try
		{
			xmlhttp=new XMLHttpRequest();
		}
		catch(e)	
		{		
			try
			{			
				xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e)
			{
				try
				{
				req = new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch(e1)
				{
					xmlhttp=false;
				}
			}
		}
		 	
		return xmlhttp;
    }
	
		function check_availability(emailid,divid) 
	{		
	//alert(emailid);
		var strURL="check_availability.php?emailid="+emailid;
	//	alert(strURL);
		var req = getXMLHTTP();
		if (req)
		 {
			  req.onreadystatechange = function()
			   {
				 //  alert(req.readyState );
				if (req.readyState == 4)
				 {
					if (req.status == 200) 
					
					{	//alert(req.responseText);	
					
						document.getElementById(divid).innerHTML=req.responseText;	
						if(document.getElementById(divid).innerHTML!="")
						{
							document.getElementById('email').value='';	
							document.getElementById('email').focus();	
						}
					} 
					else 
					{
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}		
	}
	
	
	
	////////////////                 change password ////////////////////////////
	
	
		function check_password(old_pass,divid) 
	{		
	//alert(emailid);
		var strURL="check_password.php?old_pass="+old_pass;
	//	alert(strURL);
		var req = getXMLHTTP();
		if (req)
		 {
			  req.onreadystatechange = function()
			   {
				 //  alert(req.readyState );
				if (req.readyState == 4)
				 {
					if (req.status == 200) 
					
					{	//alert(req.responseText);	
					
						document.getElementById(divid).innerHTML=req.responseText;	
						if(document.getElementById(divid).innerHTML=="")
						{
							document.getElementById('old_pass').value='';	
							//document.getElementById('old_pass').focus();	
						}
					} 
					else 
					{
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}		
	}
	
	
	////////////////  States ////////////////////////////
	var strURL="getStates.php?cid="+countryid;
	
function getCountryStates(countryid) 
{
  xmlhttp=getXMLHTTP();
  if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url="getStates.php";
url=url+"?cid="+countryid;
url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=GettingStates;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}





function GettingStates()
{
	if (xmlhttp.readyState==4)
	{
	document.getElementById("div_states").innerHTML=xmlhttp.responseText;
	}
}

function getHorseCountryStates(countryid) 
{
	//alert("hi");
  xmlhttp=getXMLHTTP();
  if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url="getStates.php";
url=url+"?hcid="+countryid;
url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=GettingHorseStates;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}

function GettingHorseStates()
{
	if (xmlhttp.readyState==4)
	{
	document.getElementById("div_horse_states").innerHTML=xmlhttp.responseText;
	}
}

function EntireSearch_text(search_text)
{
	
  xmlhttp=getXMLHTTP();
  if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url="getStates.php";
url=url+"?stxt="+search_text;
url=url+"&sid="+Math.random();
//alert(url);
//alert('hello'+search_text);
xmlhttp.onreadystatechange=GettingSearchText;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}

function GettingSearchText()
{
	if (xmlhttp.readyState==4)
	{
	 document.getElementById("Search_text_span").innerHTML=xmlhttp.responseText;
    }
}


function getadtype(gender)
{
	//alert(gender);
  xmlhttp=getXMLHTTP();
  if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url="getStates.php";
url=url+"?adtype="+gender;
url=url+"&sid="+Math.random();
///alert(url);
//alert('hello'+search_text);
xmlhttp.onreadystatechange=GettingHeightByGender123;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}

function getrealAddtype(gender)
{
	//alert(gender);
  xmlhttp=getXMLHTTP();
  if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url="getStates.php";
url=url+"?adrealtype="+gender;
url=url+"&sid="+Math.random();
///alert(url);
//alert('hello'+search_text);
xmlhttp.onreadystatechange=GettingHeightByGender123;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}
function GetHeight(gender)
{
if(document.form.category.value=="select")
{
document.form.hands_high.disabled=true;
}else
{
document.form.hands_high.disabled=false;
}
	//alert(gender);
  xmlhttp=getXMLHTTP();
  if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url="getStates.php";
url=url+"?gender="+gender;
url=url+"&sid="+Math.random();
//alert(url);
//alert('hello'+search_text);
xmlhttp.onreadystatechange=GettingHeightByGender;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}
function GetTack(tackgender)
{
	//alert(tackgender);
  xmlhttp=getXMLHTTP();
  if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url="getStates.php";
url=url+"?tackgender="+tackgender;
url=url+"&sid="+Math.random();
//alert(url);
//alert('hello'+search_text);
xmlhttp.onreadystatechange=GettingTackByGender;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}
function GettingTackByGender()
{
   if(xmlhttp.readyState==4)
	{
		document.getElementById("GetTack").innerHTML=xmlhttp.responseText;
    }	
}
function Gettingsalary()
{
	if (xmlhttp.readyState==4)
	{
	document.getElementById("div_salary").innerHTML=xmlhttp.responseText;
	}
}
function Gettingtext()
{
	if (xmlhttp.readyState==4)
	{
	document.getElementById("div_salary").innerHTML=xmlhttp.responseText;
	}
}

function CheckSalary123(salaryid) 
{
	
	xmlhttp=getXMLHTTP();
  if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
 if(salaryid==1){
var url="dropdowntext.php";
url=url+"?hcid="+salaryid;
url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=Gettingsalary;
}
else{var url="testarea.php";
url=url+"?hcid="+salaryid;
url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=Gettingtext;
 }
xmlhttp.open("GET",url,true);
xmlhttp.send(null);

}
function GetSubcategory(gender)
{
	//alert(gender);
  xmlhttp=getXMLHTTP();
  if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url="getStates.php";
url=url+"?subcategory="+gender;
url=url+"&sid="+Math.random();
//alert(url);
//alert('hello'+search_text);
xmlhttp.onreadystatechange=GettingSubcategory;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}

function GettingSubcategory()
{
   if(xmlhttp.readyState==4)
	{
	 document.getElementById("SubCategory").innerHTML=xmlhttp.responseText;
    }	
}
function GettingHeightByGender()
{
   if(xmlhttp.readyState==4)
	{
	 document.getElementById("GetHeight").innerHTML=xmlhttp.responseText;
    }	
}
function GettingHeightByGender123()
{
   if(xmlhttp.readyState==4)
	{
	 document.getElementById("Gettype").innerHTML=xmlhttp.responseText;
    }	
}



