// JavaScript Document
function geturlhtml(url){
  var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  xmlhttp.Open("POST", url, false);
  xmlhttp.Send();
  var txt=xmlhttp.responseText;
  xmlhttp=null;
  return txt;
}
function convertnum(str){
	str=str.replace(/１/g,"1");
	str=str.replace(/２/g,"2");
	str=str.replace(/３/g,"3");
	str=str.replace(/４/g,"4");
	str=str.replace(/５/g,"5");
	str=str.replace(/６/g,"6");
	str=str.replace(/７/g,"7");
	str=str.replace(/８/g,"8");
	str=str.replace(/９/g,"9");
	str=str.replace(/０/g,"0");
	str=str.replace(/－/g,"-");
	str=str.replace(/ /g,"");
	return str  
}

function ck_companyname(){
	
	var companyname=document.getElementById("companyname").value;
	companyname=companyname.replace(/\s/g,"");
	
	if(/^[^~!@#$%^&*_+{}|:"<>?`\;',./\[\]]*$/.test(companyname)){		
		var key=["锦江","錦江"];
		for(i=0;i<key.length;i++){
			var ss = companyname.indexOf(key[i]);
			if(ss>=0){
			 document.getElementById("companyname").focus;
			 companyname_err.innerHTML="<font color=red>企业名称非法！</font>";
			 return false;}				
		}			
	}else{	
		document.getElementById("companyname").focus;
		companyname_err.innerHTML="<font color=red>企业名称非法！</font>";
		return false;
	}	
	
url="/comp/checkreg.asp?action=companyname&var="+document.getElementById("companyname").value;
txt=geturlhtml(url);

eval(txt);
  if (errmsg=="yes"){
   companyname_err.innerHTML="<img src=/pers/images/ok.gif>";  
   }else{
   companyname_err.innerHTML=msg;	   
   }

}

function ck_tel(){
 if (document.getElementById("c_contactphone1").value.length>4||document.getElementById("c_contactphone1").value.length<3){
	 
	 c_contactphone_err.innerHTML="<font color=red>区号位数不正确！</font>";
	 return false;
	 }
 if (document.getElementById("c_contactphone2").value.length<7||document.getElementById("c_contactphone1").value.length>8){
	
	 c_contactphone_err.innerHTML="<font color=red>电话号码位数不正确！</font>";
	 return false;
	 }
	c_contactphone_err.innerHTML="<img src=/pers/images/ok.gif>";
   
}

function ck_contactperson()
{
  if (document.getElementById("contactperson").value.length<2){
	contactperson_err.innerHTML="<font color=red>确保招聘联系人姓名！</font>";

	}else{
		contactperson_err.innerHTML="<img src=/pers/images/ok.gif>";
   }

}

function ck_jiedao(){
if (document.getElementById("jiedao").value.length<6){
jiedao_err.innerHTML="<font color=red>公司地址不能少于6个字</font>";

}else{jiedao_err.innerHTML="<img src=/pers/images/ok.gif>"; }	
}

function limitnum(cc){
xx=document.getElementById(cc).value;
xx=xx.replace(/[^\d]/g,'');
document.getElementById(cc).value=xx;
}

function ck_mailbox(){
	mailbox1=document.getElementById("mailbox").value;
if (!(mailbox1.indexOf("@")>1&&mailbox1.indexOf(".")>1)){mailbox_err.innerHTML="<FONT color=red>邮箱地址不合法！</FONT>";return false;}
    txt=geturlhtml("/comp/checkreg.asp?action=email&var="+mailbox1);
    eval(txt);
	if (errmsg=="yes"){mailbox_err.innerHTML="<img src=/pers/images/ok.gif>"; }else{

	mailbox_err.innerHTML=msg;
	}
}

function ck_username(){
	username1=document.getElementById("username").value;
	 if (document.reg.username.value.length<5 || document.reg.username.value.length>20){
    username_err.innerHTML="<font color=red>确保5-20位字符！</font>";

	return false;
    }
	if (is_zw(document.reg.username.value)){
    username_err.innerHTML="<font color=red>不可输写中文！</font>";
   
	return false;
    }
	
	txt=geturlhtml("/comp/checkreg.asp?action=username&var="+username1);
eval(txt);
    if (errmsg=="yes"){username_err.innerHTML="<img src=/pers/images/ok.gif>"; }else{

	username_err.innerHTML=msg;
	}

}





function ck_password(){

if (document.reg.password.value==""){
 password_err.innerHTML="<font color=red>密码不可为空！</font>";
 
 return false;
 }
 if (document.reg.password.value==document.reg.username.value ){
 password_err.innerHTML="<font color=red>密码不可与用户名相同！</font>";

 return false;
  } 
 if (document.reg.password.value.length<6 ){
 password_err.innerHTML="<font color=red>密码不可低于6位！</font>";
 
 return false;
 }
password_err.innerHTML="<img src=/pers/images/ok.gif>";
}

function ck_password1(){

if (document.reg.password1.value==""){
password1_err.innerHTML="<font color=red>确认密码不可为空！</font>";

 return false;
 }
 if (document.reg.pword.value!=document.reg.password.value){
password1_err.innerHTML="<font color=red>两次输入的密码不同！</font>";

 return false;
  } 
password1_err.innerHTML="<img src=/pers/images/ok.gif>";
}

function ck_shouji(){
shouji1=document.getElementById("shouji").value;
if (shouji1==""){return false;}
if (shouji1.length!=11){
 shouji_err.innerHTML="<font color=red>11位号，前面无需加0！</font>";
	
}else{
shouji_err.innerHTML="<img src=/pers/images/ok.gif>";

}

}
