//----  联动 -----------
function setSort(s1,s2)
{
        param=s1.selectedIndex-1;
          if(param>=0)
          {
                s2.options.length=0;
			 s2.options.length++;
             s2.options[0].text="请选择";
             s2.options[0].value="";
                for(i=0;i<p_array[param].length;i++)
                {
                        s2.options.length++;
                        s2.options[i+1].text=p_array[param][i];
                        s2.options[i+1].value=p_array_id[param][i];
                }
          }else
          {
             s2.options.length=0;
             s2.options.length++;
             s2.options[0].text="请选择";
             s2.options[0].value="";
          }
}

function CheckSubmit(){
	var strMsg = "";
	strMsg = strMsg + Validate( "TrueName", "中文姓名","NotEmpty");
	if (isNumeric(document.getElementById("TrueName").value) && document.getElementById("TrueName").value!="")
	{
		strMsg = strMsg + "中文姓名不能输入数字！\n"
	}
	strMsg = strMsg + Validate( "Sex", "性别","NotEmpty");
	strMsg = strMsg + Validate( "Birthday", "年龄","NotEmpty");
	strMsg = strMsg + Validate( "QuHao", "区号","NotEmpty");
	//if (document.all("QuHao").value == "000")
	//{
	//	strMsg = strMsg + Validate( "iptQuHao", "区号","NotEmpty Numeric");
	//}
	strMsg = strMsg + Validate( "HomePhone", "固定电话","NotEmpty PhoneOther");
	//strMsg = strMsg + Validate( "Ext", "分机号码","Numeric");
	if (document.getElementById("Mobile").value =="")
	{
		strMsg = strMsg + "手机号不能为空，请输入！\n"
	}
	if (!isNumeric(document.getElementById("Mobile").value) || (!checkLength(document.getElementById("Mobile").value,"L=11")) || (document.getElementById("Mobile").value.substr(0,2)!="13" && document.getElementById("Mobile").value.substr(0,2)!="15" && document.getElementById("Mobile").value.substr(0,3)!="189"))
	//if (!isNumeric(document.getElementById("Mobile").value) || (!checkLength(document.getElementById("Mobile").value,"L=11")) || (document.getElementById("Mobile").value.substr(0,3)!="130" && document.getElementById("Mobile").value.substr(0,3)!="131" && document.getElementById("Mobile").value.substr(0,3)!="132" && document.getElementById("Mobile").value.substr(0,3)!="133" && document.getElementById("Mobile").value.substr(0,3)!="134" && document.getElementById("Mobile").value.substr(0,3)!="135" && document.getElementById("Mobile").value.substr(0,3)!="136" && document.getElementById("Mobile").value.substr(0,3)!="137" && document.getElementById("Mobile").value.substr(0,3)!="138" && document.getElementById("Mobile").value.substr(0,3)!="139" && document.getElementById("Mobile").value.substr(0,3)!="158" && document.getElementById("Mobile").value.substr(0,3)!="159"))
	//if (!isNumeric(document.all("Mobile").value) || (!checkLength(document.all("Mobile").value,"L=11")))
	{
		strMsg = strMsg + "必须具有正确的手机格式，如 13352340671！\n"	
	}
	//strMsg = strMsg + Validate( "Mobile", "手机","NotEmpty Mobile");
	//strMsg += Validate( "ZipCode", "邮编 of Contact", "PostalCode");
	strMsg = strMsg + Validate( "AreaCenterName", "找到离你最近的中心","NotEmpty");
	strMsg = strMsg + Validate( "Email", "E-mail","NotEmpty Email");
	strMsg = strMsg + Validate( "code", "验证码","NotEmpty");

	//strMsg = strMsg + Validate( "UserName", "用户名","NotEmpty");
	//strMsg = strMsg + Validate( "UserPassword", "密码","NotEmpty");
	//strMsg = strMsg + Validate( "Question", "密码问题","NotEmpty");
	//strMsg = strMsg + Validate( "Answer", "密码答案","NotEmpty");

	if (!(strMsg==""))
	{
		alert(strMsg);
		return false;
	}
	return true;
}

function CheckTiSuperBagSubmit(){
	var strMsg = "";
	strMsg = strMsg + Validate( "TrueName", "姓名","NotEmpty");
	if (isNumeric(document.getElementById("TrueName").value) && document.getElementById("TrueName").value!="")
	{
		strMsg = strMsg + "姓名不能输入数字！\n"
	}
	if (document.getElementById("Mobile").value =="")
	{
		strMsg = strMsg + "手机号不能为空，请输入！\n"
	}
	if (!isNumeric(document.getElementById("Mobile").value) || (!checkLength(document.getElementById("Mobile").value,"L=11")) || (document.getElementById("Mobile").value.substr(0,2)!="13" && document.getElementById("Mobile").value.substr(0,2)!="15" && document.getElementById("Mobile").value.substr(0,3)!="189"))
	{
		strMsg = strMsg + "必须具有正确的手机格式，如 13352340671！\n"	
	}
	strMsg = strMsg + Validate( "QuHao", "区号","NotEmpty");
	strMsg = strMsg + Validate( "HomePhone", "固定电话","NotEmpty PhoneOther");
	strMsg = strMsg + Validate( "code", "验证码","NotEmpty");
	if (strMsg != "")
	{
		alert(strMsg);
		return false;
	}
	return true;
}

function CheckQuHao()
{
	if (document.getElementById("QuHao").value=="" || (document.getElementById("iptQuHao").value=="" && document.forms["form1"].QuHao.options[document.forms["form1"].QuHao.selectedIndex].text=="其他"))
	{
		alert("用户必须选择选项之一或填写区号");
		if(document.forms["form1"].QuHao.options[document.forms["form1"].QuHao.selectedIndex].text=="其他")
		{
			document.getElementById("iptQuHao").focus();
		}
		else
		{
			document.getElementById("QuHao").focus();
		}
		return false;
	}
	else if (document.getElementById("iptQuHao").value!="" && !isNumeric(document.getElementById("iptQuHao").value))
	{
		//alert("区号必须是数字");
		//document.getElementById("iptQuHao").focus();
		//return false;
	}
}


function showNextPage()
{
	var returnValue = window.showModalDialog("registerNextPage.asp?RecordName="+RecordName+"&ReportID="+ReportID,"dialogHeight:694px;dialogWidth:528px;resizable:no;status:no;help:no");
}


function In_QuHao(){
	if(document.forms["form1"].QuHao.options[document.forms["form1"].QuHao.selectedIndex].text=="其他"){
		sQuHao.style.display="none";
		iQuHao.style.display="";
		document.getElementById("iptQuHao").focus();
	}else{
		sQuHao.style.display="";
		iQuHao.style.display="none";
	}
}