//----------------------------------------
//	name:	ValidateRegistStep1.js
//	desc:	Validate data of frmRegistStep1
//	auth:	alex
//	date:	2007-3-5
//----------------------------------------
function ValidateForm(theForm)
{
	theForm.systemTest.value="on";

	if ((theForm.IDName.value.length<4 || theForm.IDName.value.length>=50))
	{
		alert("请正确输入“用户名”信息");
		theForm.IDName.focus();
		return false;
	}
	var IDPattern = /^[a-zA-Z0-9@._-]+$/; 
	if (!IDPattern.test(theForm.IDName.value))
	{
		alert("请正确输入“用户名”信息");
		theForm.IDName.focus();
		return false;	
	}

	if ((theForm.eMail.value.length<4 || theForm.eMail.value.length>=50))
	{
		alert("请正确输入“E-Mail”信息");
		theForm.eMail.focus();
		return false;
	}
    var emailpattern = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
	if (!emailpattern.test(theForm.eMail.value))
	{
		alert("请正确输入“E-Mail”信息");
		theForm.eMail.focus();
		return false;	
	}
	if ((!theForm.userType[0].checked) && (!theForm.userType[1].checked))
	{
		alert("请选择您的“用户类型”，用户类型将决定服务内容");
		theForm.userType[0].focus();
		return false;
	}
	
	theForm.frmSubmit.disabled=true;
}