// JavaScript Document
	function checkemail(str){ 
	var sReg = /[_a-zA-Z\d\-\.]+@[_a-zA-Z\d\-]+(\.[_a-zA-Z\d\-]+)+$/; 
	if ( ! sReg.test(str) ) 
	{ 
		alert("Email地址错误！请重新输入。"); 
		return false; 
	} 

		return true; 
	}
	//校验登录名：只能输入6-20个以字母开头、可带数字的字串 
	function isRegisterUserName(s)   
	{   
	var patrn=/^[a-zA-Z]{1}([a-zA-Z0-9]){5,19}$/;   
	if (!patrn.exec(s)) return false  
	return true  
	} 
function checkAll()
{
	//-----------------------------------------------UserID
	if(document.forms[0]["UserID"].value=="")
	{
		alert("用户名称不能为空！");
		return false;
	}
	if(!isRegisterUserName(document.forms[0]["UserID"].value))
	{
		alert("用户名要以字母开头！");
		return false;
	}
	if(document.forms[0]["UserID"].value.length>20 || document.forms[0]["UserID"].value.length<6)
	{
		alert("用户名长度不符合要求！");
		return false;
	}
	//----------------------------------------------Password
	if(document.forms[0]["Password"].value=="")
	{
		alert("密码不能为空！");
		return false;
	}
	if(document.forms[0]["Password"].value.length<6 || document.forms[0]["Password"].value.length>12)
	{
		alert("密码长度不在允许的范围内！");
		return false;
	}
	//----------------------------------------------RPassword
	if(document.forms[0]["RPassword"].value=="")
	{
		alert("确认密码不能为空！");
		return false;
	}
	if(document.forms[0]["RPassword"].value.length<6 || document.forms[0]["RPassword"].value.length>12)
	{
		alert("确认密码长度不在允许的范围内！");
		return false;
	}
	//----------------------------------------------Password == RPassword
	if(document.forms[0]["Password"].value != document.forms[0]["RPassword"].value)
	{
		alert("密码和确认密码不一致！");
		return false;
	}
	//-----------------------------------------------
	if(document.forms[0]["EMail"].value=="")
	{
		alert("您提供的邮箱地址不能为空！");
		return false;
	}
	if(checkemail(document.forms[0]["EMail"].value)==false)
	{
		return false;
	}
	
	//----------------------------------------------AccessPwd
	if(document.forms[0]["AccessPwd"].value=="")
	{
		alert("提彩密码不能为空！");
		return false;
	}
	if(document.forms[0]["AccessPwd"].value.length<4 || document.forms[0]["AccessPwd"].value.length>6)
	{
		alert("提彩密码长度不在允许的范围内！");
		return false;
	}
	//----------------------------------------------RAccessPwd
	if(document.forms[0]["RAccessPwd"].value=="")
	{
		alert("提彩确认密码不能为空！");
		return false;
	}
	if(document.forms[0]["RAccessPwd"].value.length<4 || document.forms[0]["RAccessPwd"].value.length>6)
	{
		alert("提彩确认密码长度不在允许的范围内！");
		return false;
	}
	//----------------------------------------------AccessPwd == RAccessPwd
	if(document.forms[0]["AccessPwd"].value != document.forms[0]["RAccessPwd"].value)
	{
		alert("提彩密码和提彩确认密码不一致！");
		return false;
	}
	//-----------------------------------------------Alias
	if(document.forms[0]["Alias"].value=="")
	{
		alert("您提供的昵称不能为空！");
		return false;
	}
	//------------------------------------------------cb1
	if(!document.forms[0]["cb1"].checked)
	{
		alert("您是否满十八岁？");
		return false;
	}
	//------------------------------------------------cb2
	if(!document.forms[0]["cb2"].checked)
	{
		alert("您是否同意用户协议？");
		return false;
	}
	//------------------------------------------------
	if(document.forms[0]["validatecode"].value=="")
	{
		alert("验证码不能为空！");
		return false;
	}
	//
	document.getElementById("Submit1").disabled=true;
	return true;
}
function OpenProtocol()
{
	window.open("Protocol.htm");
}
