
<!-- javascript applet
function FieldIsEmpty(field)
{
	if ( field.value == "" ) return false;
	return true;
}

function StrCmp(str1,str2)
{
	if ( str1.length != str2.length ) return false;
	for ( var i=0; i< str1.length; i++ )
		if ( str1.charAt(i) != str2.charAt(i) ) return false;
	return true;
}

function AllAreNum(str)
{
	for ( var i=0; i< str.length; i++)
		if ( !(str.charAt(i)<='9' && str.charAt(i)>='0') ) return false;
	return true;
}

function VerifyFormInput()
{
	if ( FieldIsEmpty(document.regist.UserName) == false )
	{
		alert("必须填写用户帐号!");
		return false;
	}
	if ( FieldIsEmpty(document.regist.Password) == false )
	{
		alert("请输入您的密码!");
		return false;
	}
	if ( document.regist.Password.value.length < 6 )
	{
		alert("密码长度最少为6个字符!");
		return false;
	}
	if ( FieldIsEmpty(document.regist.PasswordConfirm) == false )
	{
		alert("请重复输入一次密码，以便验证!");
		return false;
	}
	if ( StrCmp(document.regist.Password.value,document.regist.PasswordConfirm.value) == false )
	{
		alert("密码验证错误!");
		return false;
	}
	if ( FieldIsEmpty(document.regist.Name) == false )
	{
		alert("请输入您的姓名!");
		return false;
	}
/*
	if ( FieldIsEmpty(document.regist.Unit) == false )
	{
		alert("请输入您的单位名称!");
		return false;
	}
	if ( FieldIsEmpty(document.regist.Address) == false )
	{
		alert("请输入您的通讯地址，以便与您联系!");
		return false;
	}
	if ( FieldIsEmpty(document.regist.PostCode) == false )
	{
		alert("请输入您的邮政编码!");
		return false;
	}
	if ( AllAreNum(document.regist.PostCode.value) == false )
	{
		alert("邮政编码错误!");
		return false;
	}
	if ( document.regist.PostCode.value.length != 6)
	{
		alert("邮政编码长度应该为六位!");
		return false;
	}
	if ( FieldIsEmpty(document.regist.Telephone) == false )
	{
		alert("请输入您的联系电话!");
		return false;
	}
	if ( FieldIsEmpty(document.regist.Fax) == false )
	{
		alert("请输入您的传真号码!");
		return false;
	}
*/
	if ( FieldIsEmpty(document.regist.Email) == false )
	{
		alert("请输入您的E-Mail 地址!");
		return false;
	}
	if( document.regist.Email.value != "" ) 
	{
		if ( document.regist.Email.value.indexOf('@') == -1 )
		{
			alert("E-Mail 地址格式错误!");
			return false;
		}
	}
	return true;
}

function FormProc()
{
	if ( VerifyFormInput() == true )
	{
		if ( confirm("确定输入正确，开始进行注册吗?" ) )
			document.regist.submit();
	}
}

function QuitProc()
{
	if( confirm("真的放弃注册吗?") )
		history.back();
}
//end of javascript -->


