var xmlHttp;

function getXMLHttp() {
	var xmlHttp1;
	try {  // Firefox, Opera 8.0+, Safari
		xmlHttp1=new XMLHttpRequest();
	} catch (e) {
		// Internet Explorer
		try {
			xmlHttp1=new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlHttp1=new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {
				alert("Your browser does not support AJAX!");
				return null;
			}
		}
	}
	return xmlHttp1;
}

function check(name,path)
{	
   xmlHttp = null;
    xmlHttp = getXMLHttp();

    if(xmlHttp == null)
        return;


var url=path+"/checkusername.php?name="+name;
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged()
{
 if(xmlHttp.readyState == 4 && xmlHttp.status == 200){
//	 alert(xmlHttp.responseText);

	
	if(xmlHttp.responseText == 1){
		document.getElementById("empty123").value = "";
		document.getElementById("change").innerHTML="Un Available";
		document.getElementById("empty123").focus();
	}else{
		document.getElementById("change").innerHTML=xmlHttp.responseText;
	}
  }
}



function checkbride(name,path)
{	
   xmlHttp = null;
    xmlHttp = getXMLHttp();

    if(xmlHttp == null)
        return;


var url=path+"/checkbrideusername.php?name="+name;
xmlHttp.onreadystatechange=statebrideChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function statebrideChanged()
{
 if(xmlHttp.readyState == 4 && xmlHttp.status == 200){
//	 alert(xmlHttp.responseText);

	
	if(xmlHttp.responseText == 1){
		document.getElementById("empty12345").value = "";
		document.getElementById("changebride").innerHTML="Un Available";
		document.getElementById("empty12345").focus();
	}else{
		document.getElementById("changebride").innerHTML=xmlHttp.responseText;
	}
  }
}




function getcity(country,path)
{	
   xmlHttp = null;
    xmlHttp = getXMLHttp();

    if(xmlHttp == null)
        return;


var url=path+"/getcity.php?country="+country;
xmlHttp.onreadystatechange=stategetcity;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stategetcity()
{
 if(xmlHttp.readyState == 4 && xmlHttp.status == 200){
//	 alert(xmlHttp.responseText);
document.getElementById("citylist").innerHTML=xmlHttp.responseText;
  }
}
