function checkpwd(form)
	{
       if(form.firstpwd.value.length<6){
		    alert("原始密码不能小于6位！")
			form.firstpwd.focus()
			return false;
	    }
       if(form.userpassword.value.length<6){
		    alert("密码不能小于6位！")
			form.userpassword.focus()
			return false;
	    }
       if(form.userpassword.value!=form.reuserpassword.value){
		    alert("两次密码不一致！")
			form.reuserpassword.focus()
			return false;
	    }
}  
function checklogin(form)
	{
       if(form.username.value.length<3){
		    alert("用户名不能小于3位！")
			form.username.focus()
			return false;
	    }
       if(form.userpassword.value.length<6){
		    alert("密码不能小于6位！")
			form.userpassword.focus()
			return false;
	    }
}  
function checkgetpwd(form)
	{
       if(form.username.value.length<3){
		    alert("用户名不能小于3位！")
			form.username.focus()
			return false;
	    }
		if(!isEmail(form.email.value)){
		  alert("请填写正确的电子邮箱 ！")
		  form.email.focus()
		  return false;
		}
}  
function checkreg(form)
	{
       if(form.username.value.length<3){
		    alert("用户名不能小于3位！")
			form.username.focus()
			return false;
	    }
       if(form.userpassword.value.length<6){
		    alert("密码不能小于6位！")
			form.userpassword.focus()
			return false;
	    }
       if(form.userpassword.value!=form.reuserpassword.value){
		    alert("两次密码不一致！")
			form.reuserpassword.focus()
			return false;
	    }
       if(form.realname.value.length<1){
		    alert("真实姓名不能为空！")
			form.realname.focus()
			return false;
	    }
       if(form.phone.value.length<3){
		    alert("联系电话不能为空！")
			form.phone.focus()
			return false;
	    }
		if(!isEmail(form.email.value)){
		  alert("请填写正确的电子邮箱 ！")
		  form.email.focus()
		  return false;
		}
}  
function isEmail(s)
{
        if (s.length > 100)
                return false;
         var regu = "^(([0-9a-zA-Z]+)|([0-9a-zA-Z]+[_.0-9a-zA-Z-]*[_.0-9a-zA-Z]+))@([a-zA-Z0-9-]+[.])+([a-zA-Z]{2}|net|NET|com|COM|gov|GOV|mil|MIL|org|ORG|edu|EDU|int|INT|INFO|info|tom|TOM)$";
         var re = new RegExp(regu);
         if (s.search(re) != -1)
              return true;
          else 
             return false;
}

function isDigital(checkStr)
{
var checkOK = "0123456789";
var allValid = true;
if (checkStr.length<1)
 allValid=false;
  for (i=0;i<checkStr.length;i++)
  {
    ch=checkStr.charAt(i);
    for(j=0;j<checkOK.length;j++)
      if(ch==checkOK.charAt(j))
        break;
    if(j==checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  return allValid;
}


