var xmlHttp
/*
	email: mail can kiem tra trong database
*/
function email_existed(email)
{ 
		//alert("======================== day ne: "+value);
		xmlHttp=GetXmlHttpObject5();
		if (xmlHttp==null)
		{
			alert("Browser does not support HTTP Request");
			return;
		} 
		var url="email_existed.php";
		url=url+"?email="+email;
		//alert("khong the chiu noi " + url);
		xmlHttp.onreadystatechange=stateChanged5; 
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
}
function stateChanged5() 
{ 
	
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		//alert(xmlHttp.responseText);
		
		//document.getElementById("test").innerHTML=xmlHttp.responseText;
		tmp = xmlHttp.responseText;
		if(tmp.indexOf("existed") == -1){
			document.getElementById("email_available").innerHTML="<font color='blue' class='F11-130'><strong>"+tmp+"</strong></font>";
		}else{
			document.getElementById("email_available").innerHTML="<font color='red' class='F11-130'><strong>"+tmp+"</strong></font>";
			document.getElementById("mailaddress").value = "";
		}
		
		
		//document.getElementById("phones").innerHTML="";
		//document.getElementById("desired_city_choose").innerHTML=xmlHttp.responseText.length==0?"":"";
		//alert(document.getElementById("city_code").value);
		//get_districts(document.getElementById("city_code").value);
	} 
} 

function GetXmlHttpObject5()
{ 
	var objXMLHttp=null
	if (window.XMLHttpRequest)
	{
	objXMLHttp=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
	objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
}