function chkuname(uname){
  var filter=/^\s*[.A-Za-z0-9_-_@_.___-]{3,50}\s*$/;
  if (!filter.test(uname)) { return false; }
  return true;
}
function chkuPassword(password){
  var filter=/^\s*[.A-Za-z0-9_-]{4,20}\s*$/;
  if (!filter.test(password)) { return false; }
  return true;
}
function chkuname(name){
  var filter=/^\s*[.A-Za-z0-9_-]{4,20}\s*$/;
  if (!filter.test(name)) { return false; }
  return true;
}
function chkEmail(Email) {
  if (Email.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
    return true;
  else
    return false;
}
function chkPostalcode(Postalcode){
  var filter=/^\d{6}$/;
  if (filter.test(Postalcode)) { return false ; }
  return true;
}
/////////////////////////////////////////////////
function showNotice(obj){
	var objMsg=document.getElementById(obj.name+"_Msg");
	if(objMsg.className!="warning"&&(objMsg.innerHTML!="")&&(objMsg.innerHTML!="&nbsp;"))	
		objMsg.className="notice";
}
function chechUserName(objId){
    var obj = document.getElementById(objId.name+"_Msg");
    var NameID = document.getElementById("NameIDok");
	if(!chkuname(objId.value)){
		 obj.innerHTML = "用户名长度为4位以上，不能有中文";
         obj.className="warning";
         NameID.value = "0";
		 return;
	 }
	else{	   
	  if(Qiying.WebModules.Ajax.ComLogo.ComLogoName(objId.value).value){
	   obj.className="message"; 
	   obj.innerHTML="<font color=#33cc66>恭喜您，用户名"+objId.value+"是有效的！</font>";
	   NameID.value = "2";
	  }
	  else{
	   obj.className="warning";
	   obj.innerHTML="用户名"+objId.value+"已经存在";
	   NameID.value = "1";
	  }	  
	  return;
	}	
}
function chechUserPassword(objId){
    var obj = document.getElementById(objId.name+"_Msg");
    if(!chkuPassword(objId.value)){
		 obj.innerHTML = "密码长度为4-20位，只能由英文字母、数字组成，中间不能有空格。";
         obj.className="warning";
		 return;
	 }
	else{
	    obj.className="message"; 
	    obj.innerHTML="<font color=#33cc66>密码有效！</font>";
	} 
}
function chechUserPassword2(objId){
    var obj = document.getElementById(objId.name+"_Msg");
    var objId2 = document.getElementById("password1");
    if((objId.value!=objId2.value)||!chkuPassword(objId.value)){
		 obj.innerHTML = "确认密码要与密码完全一致，注意英文字母大小写。";
         obj.className="warning";
		 return;
	 }
	else{
	    obj.className="message"; 
	    obj.innerHTML="<font color=#33cc66>确认密码有效！</font>";
	} 
}
function chechanswer(objId){
    var obj = document.getElementById(objId.name+"_Msg");
    if(!chkuPassword(objId.value)){
		 obj.innerHTML = "请输入密码保护问题的答案（4字节以上）。";
         obj.className="warning";
		 return;
	 }
	else{
	    obj.className="message"; 
	    obj.innerHTML="<font color=#33cc66>密码保护问题的答案有效！</font>";
	} 
}
function chechanswer2(objId){
    var obj = document.getElementById(objId.name+"_Msg");
    var objId2 = document.getElementById("CorporationKind");
    if((objId.value!=objId2.value)||!chkuPassword(objId.value)){
		 obj.innerHTML = "请再次准确输入密码保护问题的答案（4字节以上）。";
         obj.className="warning";
		 return;
	 }
	else{
	    obj.className="message"; 
	    obj.innerHTML="<font color=#33cc66>确认的密码保护问题的答案有效！</font>";
	} 
}
function chechUserCorporationWay(objId){
    var obj = document.getElementById(objId.name+"_Msg");
    if(objId.value==""){
		 obj.innerHTML = "密码找回的问题必须填写。";
         obj.className="warning";
		 return;
	 }
	else{
	    obj.className="message"; 
	    obj.innerHTML="<font color=#33cc66>密码提示问题有效！</font>";
	} 
}
function chechUserComName(objId){
    var obj = document.getElementById(objId.name+"_Msg");
    if(objId.value==""){
		 obj.innerHTML = "贵校名称必须填写。";
         obj.className="warning";
		 return;
	 }
	else{
	    obj.className="message"; 
	    obj.innerHTML="<font color=#33cc66>贵校名称有效！</font>";
	} 
}
function chechUserEmail(objId){
    var obj = document.getElementById(objId.name+"_Msg");
	if(!chkEmail(objId.value)){
		 obj.innerHTML = "E-mail格式不正确,E-mail是你今后使用本网的重要工具。";
         obj.className="warning";
		 return;
	 }
	else{
	    obj.className="message"; 
	    obj.innerHTML="<font color=#33cc66>E-mail有效！</font>";
	} 
}
function chechUserCorporationKind(objId){
    var obj = document.getElementById(objId.name+"_Msg");
    if(!chkuname(objId.value)){
		 obj.innerHTML = "请正确填写密码提示问题的答案（4字节以上）。";
         obj.className="warning";
		 return;
	 }
	else{
	    obj.className="message"; 
	    obj.innerHTML="<font color=#33cc66>密码提示问题的答案有效！</font>";
	} 
}
function chechUserCorporationBankroll(objId){
    var obj = document.getElementById(objId.name+"_Msg");
    var objId2 = document.getElementById("CorporationKind");
    if((objId.value!=objId2.value)||!chkuname(objId.value)){
		 obj.innerHTML = "请正确填密码提示问题的确认答案（4字节以上）。";
         obj.className="warning";
		 return;
	 }
	else{
	    obj.className="message"; 
	    obj.innerHTML="<font color=#33cc66>密码提示问题的确认答案有效！</font>";
	} 
}

function chechcode(objId){
    var obj = document.getElementById(objId.name+"_Msg");
    if(objId.value==""){
		 obj.innerHTML = "注册验证码必须填写。";
         obj.className="warning";
		 return;
	 }
	else{
	    obj.className="message"; 
	    obj.innerHTML="<font color=#33cc66>注册验证码有效！</font>";
	} 
}

function chechUserEmployee(objId){
    var obj = document.getElementById(objId.name+"_Msg");
    if(objId.selectedIndex==0){
		 obj.innerHTML = "雇员人数必须填写。";
         obj.className="warning";
		 return;
	 }
	else{
	    obj.className="message"; 
	    obj.innerHTML="<font color=#33cc66>雇员人数有效！</font>";
	} 
}

function chechUserBrief(objId){
    var obj = document.getElementById(objId.name+"_Msg");
    if(objId.value==""){
		 obj.innerHTML = "学校简介必须填写。";
         obj.className="warning";
		 return;
	 }
	else{
	    obj.className="message"; 
	    obj.innerHTML="<font color=#33cc66>学校简介有效！</font>";
	} 
}
function chechUserAddress(objId){
    var obj = document.getElementById(objId.name+"_Msg");
    if(objId.value==""){
		 obj.innerHTML = "通讯地址必须填写。";
         obj.className="warning";
		 return;
	 }
	else{
	    obj.className="message"; 
	    obj.innerHTML="<font color=#33cc66>通讯地址有效！</font>";
	} 
}
function chechUserPostalcode(objId){
    var obj = document.getElementById(objId.name+"_Msg");
    if(objId.value==""||chkPostalcode(objId.value)){
		 obj.innerHTML = "邮政编码必须正确填写,如510288，六位数字";
         obj.className="warning";
		 return;
	 }
	else{
	    obj.className="message"; 
	    obj.innerHTML="<font color=#33cc66>邮政编码有效！</font>";
	} 
}
function showNotice1(obj){
	var objMsg=document.getElementById(obj.name+"_Msg");
	if(objMsg.className!="warning"){	
		objMsg.className="notice";
		objMsg.innerHTML="最大字符数4000,请尽可能详细填写资料，以确保贵校的资料顺利通过本站审核";
	}
}
function chechUserLinkman(objId){
    var obj = document.getElementById(objId.name+"_Msg");
    if(objId.value==""){
		 obj.innerHTML = "联系人必须填写。";
         obj.className="warning";
		 return;
	 }
	else{
	    obj.className="message"; 
	    obj.innerHTML="<font color=#33cc66>联系人有效！</font>";
	} 
}
function chechUserTel(objId){
    var obj = document.getElementById(objId.name+"_Msg");
    if(objId.value==""){
		 obj.innerHTML = "联系电话必须填写。";
         obj.className="warning";
		 return;
	 }
	else{
	    obj.className="message"; 
	    obj.innerHTML="<font color=#33cc66>联系电话有效！</font>";
	} 
}

function newYanzheng(){
    if(document.getElementById("sNickName").value==""){
       alert('用户名必须正确填写');
       Form1.sNickName.focus();
       return false;
    }
    var pas1 = document.getElementById("password1") ;
    var pas2 = document.getElementById("password2") ;
    if(!chkuPassword(pas1.value)){
     alert('密码必须正确填写！');
     Form1.password1.focus();
     return false;
    }
    if(!chkuPassword(pas2.value)||pas2.value!=pas1.value){
     alert('确认密码必须正确填写！');
     Form1.password2.focus();
     return false;
    }
    var emailID = document.getElementById("EmailIDok");
        if(document.getElementById("Email").value==""){
       alert('email名必须正确填写');
       Form1.Email.focus();
       return false;
    }
    var pas11 = document.getElementById("CorporationKind") ;
    var pas12 = document.getElementById("CorporationBankroll") ;
    if(!chkuPassword(pas11.value)){
     alert('密码提示问题的答案必须正确填写！');
     Form1.CorporationKind.focus();
     return false;
    }
    if(!chkuPassword(pas12.value)||pas12.value!=pas11.value){
     alert('密码提示问题的确认答案必须正确填写！');
     Form1.CorporationBankroll.focus();
     return false;
    }
    if(document.getElementById("code").value==""){
       alert('注册验证码必须填写');
       Form1.code.focus();
       return false;
    }
    if(document.getElementById("comName").value==""){
       alert('贵校名称必须填写');
       Form1.comName.focus();
       return false;
    }
    if(document.getElementById("CorporationWay").selectedIndex==0){
       alert('所属行业必须选择');
       Form1.CorporationWay.focus();
       return false;
    }
    if(document.getElementById("CorporationKind").selectedIndex==0){
       alert('企业性质必须选择');
       Form1.CorporationKind.focus();
       return false;
    }
    if(document.getElementById("CorporationBankroll").selectedIndex==0){
       alert('注册资金必须选择');
       Form1.CorporationBankroll.focus();
       return false;
    }
    if(document.getElementById("CorporationEmployee").selectedIndex==0){
       alert('雇员人数必须选择');
       Form1.CorporationEmployee.focus();
       return false;
    }
    if(document.getElementById("CorporationBrief").value==""){
       alert('公司简介必须填写');
       Form1.CorporationBrief.focus();
       return false;
    }
    if(document.getElementById("CorporationAddress").value==""){
       alert('通讯地址必须填写');
       Form1.CorporationAddress.focus();
       return false;
    }
    var Postalcode1 = document.getElementById("CorporationPostalcode") ;
    if(Postalcode1.value==""||chkPostalcode(Postalcode1.value)){
       alert('邮政编码必须正确填写');
       Form1.CorporationPostalcode.focus();
       return false;
    }
    if(document.getElementById("CorporationLinkman").value==""){
       alert('联系人必须填写');
       Form1.CorporationLinkman.focus();
       return false;
    }
    if(document.getElementById("CorporationTel").value==""){
       alert('联系电话必须填写');
       Form1.CorporationTel.focus();
       return false;
    }
    return true;
}