﻿// JavaScript Document
//--------------------------------------------------------------------
/* 验证码 */
function checkUserCode(regcode){	
	var xmlhttp;
	try{
		xmlhttp=new XMLHttpRequest();
		}
	catch(e){
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	xmlhttp.onreadystatechange=function(){
	if (xmlhttp.readyState==4){
		if (xmlhttp.status==200){
			var data=xmlhttp.responseText;
			code_result(data);
			}
		else{
			gel('CodeFocus').innerHTML='<img src="images/yesno.gif"/> <font color=#ff0000>验证码校验失败,请联系管理员</font>';
			}
		}
	else{
		gel('CodeFocus').innerHTML='<img src="images/yesno.gif"/> <font color=#ff0000>正在进行验证码校验...</font>';
		}
	}
	xmlhttp.open("post", "Check_Data.asp?part=3", true);
	xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
	xmlhttp.send("regcode="+escape(regcode));
}
function code_result(data){
	if(data==1){
		gel('CodeFocus').innerHTML='<img src="images/yesok.gif"/>';
		this.checkCode = true;
	}else{
		gel('CodeFocus').innerHTML='<img src="images/yesno.gif"/> <font color=#ff0000>验证码错误</font>';
	}
}
/* 验证码 */

/* 检测用户ID */
function checkid(regid){	
	var xmlhttp;
	try{
		xmlhttp=new XMLHttpRequest();
		}
	catch(e){
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	xmlhttp.onreadystatechange=function(){
	if (xmlhttp.readyState==4){
		if (xmlhttp.status==200){
			var data=xmlhttp.responseText;
			id_result(data);
		}
		else{
			gel('UserIDFocus').innerHTML='<img src="images/yesno.gif"/> <font color=#ff0000>用户名检测失败,请联系管理员</font>';
		}
		}
	else{
		gel('UserIDFocus').innerHTML='<img src="images/loading.gif" /> <font color=#333333>正在进行用户名校验...<font>';
		}
	}
	xmlhttp.open("post", "Check_Data.asp?part=1", true);
	xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
	xmlhttp.send("regid="+escape(regid));
}
function id_result(data){
	if(data==1){
		gel('UserIDFocus').innerHTML='<img src="images/yesok.gif"/>';
		this.checkID = true;
	} else {
		gel('UserIDFocus').innerHTML='<img src="images/yesno.gif"/> <font color=#ff0000>该用户名已经被注册</font>';
	}
}
/* 检测用户ID */

/* 检测用户Email */
function checkeUmail(regemail){	
	var xmlhttp;
	try{
		xmlhttp=new XMLHttpRequest();
		}
	catch(e){
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	xmlhttp.onreadystatechange=function(){
	if (xmlhttp.readyState==4){
		if (xmlhttp.status==200){
			var data=xmlhttp.responseText;
			id_resultemail(data);
		}
		else{
			gel('UserEmailFocus').innerHTML='<img src="images/yesno.gif"/> <font color=#ff0000>邮箱检测失败,请联系管理员</font>';
		}
		}
	else{
		gel('UserEmailFocus').innerHTML='<img src="images/loading.gif" /> <font color=#333333>正在进行邮箱校验...<font>';
		}
	}
	xmlhttp.open("post", "Check_Data.asp?part=2", true);
	xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
	xmlhttp.send("regemail="+escape(regemail));
}
function id_resultemail(data){
	if(data==1){
		gel('UserEmailFocus').innerHTML='<img src="images/yesok.gif"/>';
		this.checkEmail = true;
	} else {
		gel('UserEmailFocus').innerHTML='<img src="images/yesno.gif"/> <font color=#ff0000>该邮箱已经被注册</font>';
	}
}
/* 检测用户Email */

/* 检测用户手机号码 */
function checkeUMoblie(regmoblie){	
	var xmlhttp;
	try{
		xmlhttp=new XMLHttpRequest();
		}
	catch(e){
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	xmlhttp.onreadystatechange=function(){
	if (xmlhttp.readyState==4){
		if (xmlhttp.status==200){
			var data=xmlhttp.responseText;
			id_resultmoblie(data);
		}
		else{
			gel('UserMoblieFocus').innerHTML='<img src="images/yesno.gif"/> <font color=#ff0000>手机号码检测失败,请联系管理员</font>';
		}
		}
	else{
		gel('UserMoblieFocus').innerHTML='<img src="images/loading.gif" /> <font color=#333333>正在进行手机号码校验...<font>';
		}
	}
	xmlhttp.open("post", "Check_Data.asp?part=4", true);
	xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
	xmlhttp.send("regmoblie="+escape(regmoblie));
}
function id_resultmoblie(data){
	if(data==1){
		gel('UserMoblieFocus').innerHTML='<img src="images/yesok.gif"/>';
		this.checkMoblie = true;
	} else {
		gel('UserMoblieFocus').innerHTML='<img src="images/yesno.gif"/> <font color=#ff0000>该手机号码已经被注册</font>';
	}
}
/* 检测用户手机号码 */

function  LeftMain(jpage)  {
   if (!jpage) {
     jpage=1;
   } 
   var xmlhttp;
   if (window.ActiveXObject) {
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
   }else if(window.XMLHttpRequest)  {
      xmlhttp=new XMLHttpRequest();
   }
   if (xmlhttp) {
        xmlhttp.onreadystatechange=function () {
		  if(xmlhttp.readyState==4)  {
             if(xmlhttp.status==200)  {
	            var jobPage=unescape(xmlhttp.responseText);
				     show(jobPage);
	         }else {
		       alert("error");
	         }
          }
		}  
	    xmlhttp.open("get","JobPage.asp?page="+escape(jpage));
		xmlhttp.send(null);
    }		
}
function show(text) {
	document.getElementById("JobLeftMain").innerHTML = text;
}