// JavaScript Document
function Submitcheck(){
  String.prototype.trim= function(){  
      return this.replace(/(^\s*)|(\s*$)/g, "");  
  }
   if (document.reg.Email.value.trim().length==0){
      alert("Email不能为空！");
      document.reg.Email.focus();
      return false;
   }
    if(!isEmail(document.reg.Email.value.trim())){
	document.reg.Email.focus();
    alert("Email格式错误！");
    return false;
	}
   if (document.reg.PassWord.value.trim().length==0){
      alert("密码不能为空！");
      document.reg.PassWord.focus();
      return false;
   }
   if (document.reg.PassWord.value.trim().length<6){
      alert("密码不能少于6位！");
      document.reg.PassWord.focus();
      return false;
   }
   if (document.reg.PassWord.value.trim()!=document.reg.PassWord2.value.trim()){
      alert("两次密码不一致！");
      document.reg.PassWord.focus();
      return false;
   }
   if (document.reg.checkcode.value.trim().length==0){
      alert("验证码不能为空！");
      document.reg.checkcode.focus();
      return false;
   }
return true;
}



function isEmail(s){
var patrn=/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; 
if (!patrn.exec(s)) return false;
return true; 
}
