<!--
//强制填写数字。
function regInput(obj, reg, inputStr)
{
	var docSel = document.selection.createRange()
	if (docSel.parentElement().tagName != "INPUT")	return false
	oSel = docSel.duplicate()
	oSel.text = ""
	var srcRange = obj.createTextRange()
	oSel.setEndPoint("StartToStart", srcRange)
	var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
	return reg.test(str)
}

//函数名：fucCheckTEL。
//功能介绍：检查是否为电话号码。
//参数说明：要检查的字符串。
//返回值：1为是合法，0为不合法。
function fucCheckTEL(TEL)
{
	var i,j,strTemp;
	strTemp="0123456789";
	for (i=0;i<TEL.length;i++)
	{
		j=strTemp.indexOf(TEL.charAt(i));	
		if (j==-1)
		{
			//说明有字符不合法
			return 0;
		}
	}
	//说明合法
	return 1;
}

//检验表单内容。
function CheckForm()
{

	if (FormOrder.DomainName.value.length == 0)
	{
		alert("对不起，域名名称不能为空！");
		FormOrder.DomainName.focus();
		return false;
	}

	if ((FormOrder.CompanyName.value.length > 0) && (FormOrder.CompanyCard.value.length == 0))
	{
		alert("对不起，营业执照号码不能为空！");
		FormOrder.CompanyCard.focus();
		return false;
	}

	if ((FormOrder.CompanyCard.value.length > 0) && ( FormOrder.CompanyName.value.length== 0))
	{
		alert("对不起，公司名称不能为空！");
		FormOrder.CompanyName.focus();
		return false;
	}

	if (FormOrder.ContactPerson.value.length == 0)
	{
		alert("对不起，联系人不能为空！");
		FormOrder.ContactPerson.focus();
		return false;
	}
	else
	{
		var StrName=FormOrder.ContactPerson.value;
		var ValidName="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~!@#$%^&*()_+|-=\{}[]:\";'<>?,./";

		for(i=0;i<StrName.length;i++)

			if (ValidName.indexOf(StrName.charAt(i)) != -1)
			{
				alert("对不起，联系人姓名不能含有非法字符！");
				FormOrder.ContactPerson.focus();
				return false;
			}

	}

	if ((FormOrder.IDCard.value.length != 15) && (FormOrder.IDCard.value.length != 18))
	{
		alert("对不起，身份证号码长度必须是15位或18位！");
		FormOrder.IDCard.focus();
		return false;
	}

	if (FormOrder.TelCode.value.length == 0)
	{
		alert("对不起，固定电话所在区号不能为空！");
		FormOrder.TelCode.focus();
		return false;
	}

	if (fucCheckTEL(FormOrder.TelCode.value) == 0)
	{
		alert("对不起，固定电话所在区号必须是数字！");
		FormOrder.TelCode.focus();
		return false;
	}

	if ((FormOrder.telephone.value.length != 7) && (FormOrder.telephone.value.length != 8))
	{
		alert("对不起，固定电话被叫号码的长度必须是7位或8位！");
		FormOrder.telephone.focus();
		return false;
	}

	if (fucCheckTEL(FormOrder.telephone.value) == 0)
	{
		alert("对不起，固定电话被叫号码必须是数字！");
		FormOrder.telephone.focus();
		return false;
	}

	if ((FormOrder.FaxCode.value.length != 0) && (fucCheckTEL(FormOrder.FaxCode.value) == 0))
	{
		alert("对不起，传真所在区号必须是数字！");
		FormOrder.TelCode.focus();
		return false;
	}

	if (FormOrder.fax.value.length != 0)
	{

		if ((FormOrder.fax.value.length != 7) && (FormOrder.fax.value.length != 8))
		{
			alert("对不起，传真被叫号码的长度必须是7位或8位！");
			FormOrder.fax.focus();
			return false;
		}

		if (fucCheckTEL(FormOrder.fax.value) == 0)
		{
			alert("对不起，传真被叫号码必须是数字！");
			FormOrder.fax.focus();
			return false;
		}

	}

	if (FormOrder.CellPhone.value.length != 11)
	{
		alert("对不起，手机号码长度必须是11位！");
		FormOrder.CellPhone.focus();
		return false;
	}

	if (fucCheckTEL(FormOrder.CellPhone.value) == 0)
	{
		alert("对不起，手机号码必须是数字！");
		FormOrder.CellPhone.focus();
		return false;
	}

	if (FormOrder.MailBox.value.length != 0)
	{
		if (
         FormOrder.MailBox.value.charAt(0) == "." ||        
         FormOrder.MailBox.value.charAt(0) == "@"||       
         FormOrder.MailBox.value.indexOf('@', 0) == -1 || 
         FormOrder.MailBox.value.indexOf('.', 0) == -1 || 
         FormOrder.MailBox.value.lastIndexOf("@") == FormOrder.MailBox.value.length-1 || 
         FormOrder.MailBox.value.lastIndexOf(".") == FormOrder.MailBox.value.length-1
		 )
		{
			alert("对不起，电子邮箱书写格式不正确！");
			FormOrder.MailBox.focus();
			return false;
		}
	}
	else
	{
		alert("对不起，电子邮箱不能为空！");
		FormOrder.MailBox.focus();
		return false;
	}

	if ((FormOrder.QQ.value.length != 0) && (fucCheckTEL(FormOrder.QQ.value) == 0))
	{
		alert("对不起，QQ号码必须是数字！");
		FormOrder.QQ.focus();
		return false;
	}

	if (FormOrder.address.value.length == 0)
	{
		alert("对不起，详细地址不能为空！");
		FormOrder.address.focus();
		return false;
	}

	if (FormOrder.ValidateCode.value.length == 0)
	{
		alert("对不起，验证码不能为空！");
		FormOrder.ValidateCode.focus();
		return false;
	}

	return true;
}
//-->
