  function   isChinese(name)   //中文值检测
      {  
      
       for(i   =   0;   i   <   name.length;   i++)   {  
          if(name.charCodeAt(i)   >   128){
          return   true;
           }else{
           alert('请正确输入单位名称（中文）');
           return   false;
           }
           }
        
}
 function   isEnglish(name)   //英文值检测
 {  
 if(name.length   !=   0){
   
  for(i   =   0;   i   <   name.length;   i++)   {  
  if(name.charCodeAt(i)   >   128){
      alert('请正确输入单位名称（英文）');
     return   false;}
 
  
}
}else{
return   true;
}
}


  function checkAge(frm){
      if(frm.length<1||frm.length>3)
              {
                alert("年龄不符合实际！");
               return false;
              }
            else
              { 
            
             for(var i=0; i<frm.length; i++)
            {
            if(frm.charAt(i)<'0' || frm.charAt(i)>'9')
           {
            alert("年龄只能是数字");
                 return false;
           }
         }
       }

           return true;
  
  
  
  }
  
  
  function checkCode(frm)  {
     if(frm.length!=0){
                if(frm.length !=6)
              {
                alert("邮政编码号必须是6位");
               return false;
              }
            else
              { 
            
             for(var i=0; i<frm.length; i++)
            {
            if(frm.charAt(i)<'0' || frm.charAt(i)>'9')
           {
            alert("邮政编码只能是数字");
                 return false;
           }
         }
       }

           return true;
     }else{
           return true;
     }
           
        
}
 function checkPhone(frm) {
 if(frm.length!=0){
                if(frm.length <7||frm.length>20)
              {  
               
                 alert("电话(传真)号码不符合实际");
                 return false;
              }
            else
              { 
         
             for(var i=0; i<frm.length; i++)
            {
            if(frm.charAt(i)<'0' || frm.charAt(i)>'9')
           {
            alert("电话号码只能是数字");
                 return false;
           }
         }
       }

           
  }else{
    return true;
  }
}
 
function checkMobile( frm ){
    if(frm.length!=0){
    	  if(frm.length !=11)
              {
                alert("手机号码号必须是11位");
               return false;
              }
            else{ 
             for(var i=0; i<frm.length; i++)
            {
            	if(frm.charAt(i)<'0' || frm.charAt(i)>'9')
           		{
            	alert("手机号码只能是数字");
                 return false;
           		}
         	}
       		}
       		return true;
    }
    else{
    return true;
    }        
}
function checkEmail1(strEmail) {
  if(strEmail.length!=0)
   {
     if (strEmail.charAt(0)=="." ||        
          strEmail.charAt(0)=="@"||       
          strEmail.indexOf('@', 0) == -1 || 
          strEmail.indexOf('.', 0) == -1 || 
          strEmail.lastIndexOf("@")==strEmail.length-1 || 
          strEmail.lastIndexOf(".")==strEmail.length-1)
      {
       alert("Email地址格式不正确！");
       return false;
       }
      
    }
else
   {
    return true; 
    }

}

function IdCardRegCheck(str)  
 {  
   
  var reg = /^([0-9]{15}|[0-9]{18})$/;  
  var flag = reg.test(str);  
  if(flag==true){
  return true;
  }
  else{
  alert('身份证不合法！');
  return false;
  }
 }  


