function Inint_AJAX() {
	try { return new ActiveXObject("Msxml2.XMLHTTP");  } catch(e) {} //IE
	try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {} //IE
	try { return new XMLHttpRequest(); } catch(e) {} //Native Javascript
	alert("XMLHttpRequest not supported");
	return null;
};

var req = Inint_AJAX();
	
function checkemail(inputEmail){	
req.open("GET","js1/checkemail.php?action=checkemail&inputEmail="+inputEmail);
req.onreadystatechange = function() {
if (req.readyState==4) {
if (req.status==200) {
var ret=req.responseText;
ret = ret.split("#");
if (ret[0] == "error") {
alert("Error");
}else if(ret[0]=="not"){
document.getElementById("resultemail").innerHTML="คุณสามารถใช้อีเมล์นี้ได้ค่ะ";//ไม่โชว์ตารางการสมัครสมาชิก

}else if (ret[0] == "complete"){
document.getElementById("resultemail").innerHTML="คุณไม่สามารถใช้อีเมล์นี้ได้ อีเมลล์ซ้ำค่ะ กรุณากรอกอีเมล์ใหม่";//ไม่โชว์ตารางการสมัครสมาชิก
document.Fromfuntong.inputEmail.focus();
} else {
//alert(ret);
}
}  
}
else{
document.getElementById("resultemail").innerHTML="กรุณารอสักครู่ ระบบกำลังทำการตรวจสอบอีเมล์ของท่านค่ะ่";//ไม่โชว์ตารางการสมัครสมาชิก
}
};
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
req.send(null);
}//function addGroupSubject(code,name,des,UserFile){
	
