function AjaxRequest(v_url)
{
    var xmlHTTP = new ActiveXObject("Microsoft.XMLHTTP");
    
    xmlHTTP.open("POST", v_url, false);
    xmlHTTP.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    xmlHTTP.send("");
    return xmlHTTP.responseText;
}

function openWindow(v_url, v_name, v_features)
{
	window.open(v_url, v_name, v_features);
}

// 显示输入框上方的错误提示
function SpanAlert(v_id, v_msg)
{
	var obj = document.getElementById(v_id);
	if (obj==null || obj.innerHTML==null)
		return;

	if(v_msg==null || v_msg=="")
		v_msg = "";
	else
		v_msg = v_msg + "<BR>";

	obj.innerHTML = v_msg;
}

// 显示右侧帮助框
function DisplayHelp(v_idx)
{
	if (document.getElementById("help1")!=null)	document.getElementById("help1").style.display = "none";
	if (document.getElementById("help2")!=null) document.getElementById("help2").style.display = "none";
	if (document.getElementById("help3")!=null) document.getElementById("help3").style.display = "none";

	var obj = document.getElementById("help" + v_idx);
	if (v_idx>0 && obj!=null)
		obj.style.display = "";
}

// 显示推荐对话框
function DisplayRecommendDlg(v_dis, v_step)
{
	document.getElementById("login").style.visibility  = "hidden";
	document.getElementById("tbFloatWait").style.display = "none";
	document.getElementById("tbFloatMain").style.display = "none";

	if (v_dis)
	{
		document.getElementById("login").style.visibility  = "visible";

		if (v_step == 1)
			document.getElementById("tbFloatWait").style.display = "";
		else
			document.getElementById("tbFloatMain").style.display = "";
	}
}
function CheckRegEmail(pvEmail)
{
	var reg = /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/;
	if (reg.test(pvEmail))
	{
	    if(pvEmail.length>=50)
	    {
	        return 2;   //长度超过 50 
	    }
	    if(pvEmail.length>4)
	    {
	        var lvMailPostfix=pvEmail.substring(pvEmail.length-4,pvEmail.length).toUpperCase();
	        var lvMailPostfix1=pvEmail.substring(pvEmail.length-3,pvEmail.length).toUpperCase();
	        if(lvMailPostfix==".COM" || lvMailPostfix==".NET" || lvMailPostfix==".ORG"  || lvMailPostfix1==".CN")
	        {
	            var lvCheckPostfix=pvEmail.substring(pvEmail.indexOf("@")).toUpperCase();
	            var lvExcludeArray=new Array(); //Exclude Mail address No.5130 邮箱地址过滤 
	            lvExcludeArray.push("@QQ.GD");
	            lvExcludeArray.push("@PP.COM");
	            lvExcludeArray.push("@TOM.COM");
	            lvExcludeArray.push("@123.COM");
	            lvExcludeArray.push("@136.COM");
	            lvExcludeArray.push("@QQ.COM.CN");
	            lvExcludeArray.push("@168.COM");
	            lvExcludeArray.push("@SIAN.COM");
	            lvExcludeArray.push("@Q.COM");
	            
	            for(var i=0;i<lvExcludeArray.length;i++)
	            {
	                if(lvExcludeArray[i]==lvCheckPostfix)
	                {
	                    return 4;
	                }
	            }
	            return 0;
	        }
	        else
	        {
	            return 3;   //不允许的邮箱地址
	        }
	    }
    }
	else
	{
		return 1;   //格式不对
    }
}
//检查邮件是否存在
function isExistEmail(pvCheckRealMail)
{
	var sPtid = document.getElementById("UserEmailId").value;
	if(sPtid=="注册后该邮箱地址可用于今后的密码找回")
	{
	    sPtid="";
	}
    if(CheckRegEmail(sPtid)==0)
    {
	    var sSid = (document.getElementById("sessionid")!=null)?document.getElementById("sessionid").value:"";
	    var url = "ExistPtid.ashx?username="+sPtid+"&sid="+sSid+"&new=1&CHECK_TYPE=1&skip_mail="+pvCheckRealMail;
	    var sRet = AjaxRequest(url);
	    return (sRet.indexOf("EXIST")>=0);
	}
	else
	{
	    return false;
	}
}
//检查手机是否存在
function isExistMobile()
{
	var sPtid = document.getElementById("UserCellphoneId").value;
    if(sPtid=="注册后该手机号码可用于今后的密码找回")
    {
        sPtid="";
    }
	
    var reg1=/^1[3][0-9]\d{8}$/;
    var reg2=/^1[5][089]\d{8}$/;

    if(reg1.test(sPtid) || reg2.test(sPtid) )
    {
	    var sSid = (document.getElementById("sessionid")!=null)?document.getElementById("sessionid").value:"";
	    var url = "ExistPtid.ashx?username="+sPtid+"&sid="+sSid+"&new=1&CHECK_TYPE=2";
	    var sRet = AjaxRequest(url);
	    return (sRet.indexOf("EXIST")>=0);
	}
	else
	{
	    return false;
	}
}
// 检查通行证是否存在
function isExistPtid()
{
	//if (!CheckPtid())
	//	return false;

	var sPtid = document.getElementById("username").value;
	var sSid = (document.getElementById("sessionid")!=null)?document.getElementById("sessionid").value:"";
	var url = "ExistPtid.ashx?username="+sPtid+"&sid="+sSid+"&new=1";
	var sRet = AjaxRequest(url);

	if(sRet.indexOf("EXIST") >= 0)
		return true;
	else
		return false;
}

// 点击检查通行证按钮
function RecommendPtid()
{
	if (!CheckPtid())
		return false;

	DisplayRecommendDlg(true, 1);

	var sPtid = document.getElementById("username").value;
	var sSid = (document.getElementById("sessionid")!=null)?document.getElementById("sessionid").value:"";
	var sFrom = document.getElementById("txtRegisterFrom").value;
	var url = "GetRecommendUserName.ashx?username="+sPtid+"&sid="+sSid+"&from="+sFrom;
	var sRet = AjaxRequest(url);
	SpanAlert("desc", sRet);

	if(sRet.indexOf("[RECOMMENDED]") >= 0)
	{
		DisplayRecommendDlg(true, 2);
		DealRecommendFloat(sRet);
	}
	else if(sRet.indexOf("CONGRATULATIONS") >= 0)
	{
		DisplayRecommendDlg(false);
		SpanAlert("errPtid", "恭喜您，这个帐号还没有被注册！");
		return true;
	}
	else
	{
		DisplayRecommendDlg(false);
		SpanAlert("errPtid",  "该通行证已存在，请重新选择合适的盛大通行证。建议在通行证后加后缀来尝试，比如加上您的生日："+sPtid+"0828，或是您的电话区号：" +sPtid+"021，或是您所在地区的邮编："+sPtid+"201203！");
	}

	return false;
}

// 显示推荐的用户名
function DealRecommendFloat(v_ret)
{
	v_ret = v_ret.replace("[RECOMMENDED]", "");
	var arrRet = v_ret.split(",");
	var recname1 = arrRet[0];
	var recname2 = arrRet[1];
	var sdidname = arrRet[2];

	document.getElementById("hidRecName001").value = GetDescryptedUserName(recname1);
	document.getElementById("hidRecName002").value = GetDescryptedUserName(recname2);
	document.getElementById("hidRecRule001").value = GetUserNameCreateReasonNum(recname1);
	document.getElementById("hidRecRule002").value = GetUserNameCreateReasonNum(recname2);

	document.getElementById("trname0").style.display = "none";
	document.getElementById("trname1").style.display = "none";
	document.getElementById("trname2").style.display = "none";

	if(recname1 != "")
	{
		document.getElementById("trname1").style.display = "";
		document.getElementById("floatname1").innerHTML = GetDescryptedUserName(recname1);
		document.getElementById("floatnameDesc1").innerHTML = "　（" + GetUserNameCreateReason(recname1) + "）";
	}

	if(recname2 != "")
	{
		document.getElementById("trname2").style.display = "";
		document.getElementById("floatname2").innerHTML = GetDescryptedUserName(recname2);
		document.getElementById("floatnameDesc2").innerHTML = "　（" + GetUserNameCreateReason(recname2) + "）";
	}

	if(sdidname!="" && sdidname!="0[0]")
	{
		var sdid = GetDescryptedUserName(sdidname);
		document.getElementById("trname0").style.display = "";
		document.getElementById("floatname0").innerHTML = sdid+".sdo";
		document.getElementById("floatnameDesc0").innerHTML = "　（" + GetUserNameCreateReason(sdidname) + "）";

		document.getElementById("regsdid").value = sdid;
		document.getElementById("chksdid").value = "false";
	}

	document.getElementById("floatUserName").innerHTML = document.getElementById("username").value;
	document.getElementById("radioname1").checked = true;
	document.getElementById("customname").value = "";
	document.getElementById("customname").disabled = true;
}

// 点击推荐单选按钮
function ClickRadioName()
{
	if (document.getElementById("radioname0").checked)
		document.getElementById("chksdid").value = "true";
	else
		document.getElementById("chksdid").value = "false";

	if(document.getElementById("radioname3").checked)
		document.getElementById("customname").disabled = false;
	else
		document.getElementById("customname").disabled = true;
}

// 点击推荐对话框“确认”按钮
function AcceptRecname()
{
	DisplayRecommendDlg(false);
	var type = GetCheckedRadio("radioname").value;

	switch(type)
	{
		case "0":
			sPtid = document.getElementById("floatname0").innerHTML;
			document.getElementById("username").disabled = true;
			document.getElementById("check").disabled = true;
			break;

		case "1":
			sPtid = document.getElementById("floatname1").innerHTML;
			break;

		case "2":
			sPtid = document.getElementById("floatname2").innerHTML;
			break;

		case "3":
			sPtid = document.getElementById("customname").value;
			document.getElementById("username").value = sPtid;
			RecommendPtid();
			return;

		default:
			return;
	}

	document.getElementById("username").value = sPtid;
}

// 点击推荐好友注册
function OnChkRecEmail()
{
	if (document.getElementById("chkRecommend").checked)
	{
		document.getElementById("tbOptionRec").style.display = "";
	}
	else
		document.getElementById("tbOptionRec").style.display = "none";
}

function OnMoreEmail(v_idx)
{
	if(v_idx == 1)
	{
		for (i=2; i<=5; i++)
		{
			if(document.getElementById("trEmailTo"+i).style.display == "none")
			{
				document.getElementById("trEmailTo"+i).style.display = "";
				break;
			}
		}
	}
	else
	{
		document.getElementById("txtEmailTo"+v_idx).value = "";
		document.getElementById("trEmailTo"+v_idx).style.display = "none";
		SpanAlert("errEmailTo"+v_idx, "");
	}
}

function CheckEmailTo(v_idx)
{
	var reg = /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/;
	var sEmail = trim(document.getElementById("txtEmailTo"+v_idx).value);
	document.getElementById("txtEmailTo"+v_idx).value = sEmail;

	if (!reg.test(sEmail))
		SpanAlert("errEmailTo"+v_idx, "请输入有效邮箱地址！");
	else
		SpanAlert("errEmailTo"+v_idx, "");
}

// 检查用户输入
function CheckPtid()
{
	var sPtid = trim(document.getElementById("username").value);
	var objDesc = "errPtid";
	SpanAlert(objDesc, "");

	if (sPtid == "")
	{
		SpanAlert(objDesc, "");
		return false;
	}

	var reg = /^[a-z0-9]{4,16}$/i;
	if (!reg.test(sPtid))
	{
		//SpanAlert(objDesc, "用户名长度为4-16位小写字母及数字！");
		return false;
	}

	reg = /^[a-z]{1}/i;
	if (!reg.test(sPtid))
	{
		//SpanAlert(objDesc, "用户名必须以小写字母开头！");
		return false;
	}

	return true;
}

function CheckPassword()
{
	var sValue = trim(document.getElementById("password").value);
	if(sValue !=document.getElementById("password").value)
	{
	    document.getElementById("password").value = sValue;
	}
	if (sValue == "" || sValue=="请输入您的密码！")
	{
		return false;
	}
    var lvPwdLevel=lvPwdStrenth.getLevel(sValue);
    return lvPwdLevel>0;
	
	/*
	var reg = /^[A-Za-z0-9]{4,10}$/i;
	if (!reg.test(sValue))
	{
		return false;
	}
	return true;
	*/
}
function CheckRePassword()
{
	var sValue1 = trim(document.getElementById("password").value);
	var sValue2 = trim(document.getElementById("repassword").value);

 	if (sValue1 != sValue2 && sValue1!="" )
	{
		return false;
	}
	return true;
}

function CheckExcode()
{
	var sValue =trim(document.getElementById("attcode2").value);
	document.getElementById("attcode2").value = sValue;

	var objDesc = "errExcode";
	SpanAlert(objDesc, "");

	if (sValue == "")
	{
		//SpanAlert(objDesc, "请输入验证码！");
		return false;
	}

	var reg = /^\d{6}$/i;
	if (!reg.test(sValue))
	{
		//SpanAlert(objDesc, "验证码必须为6个数字！");
		return false;
	}

	return true;
}
function GetPasswordExErrorInfo()
{
     var lvPwd=document.getElementById("password").value;
     var lvPwdLevel=lvPwdStrenth.getLevel(lvPwd);
     if(lvPwdLevel==0)
     {
        if(lvPwdStrenth.getErrorId()==2)
	    {
	        return "对不起，您的密码过于简单";
	    }
	    else
	    {
	        return lvPwdStrenth.getDescription();
	    }
     }
     else
     {
        return "对不起，两次输入的密码不一致"
     }
}
function CheckForm4EmailNoAlert()
{ 
	if (!CheckPasswordEx())
	{
		return false;
	}
	if (!CheckExcode())
	{
		return false;
	}
	var sPtid = document.getElementById("UserEmailId").value;
	if(sPtid=="注册后该邮箱地址可用于今后的密码找回")
	{
	    sPtid="";
	}
    var lvCheckRegMailResut=CheckRegEmail(sPtid);
    if(lvCheckRegMailResut!=0)
    {
        return false;
    }
	if(document.getElementById("password").value==sPtid)
	{
	    return false;
	}
	//检查有无输入的资料
	if(CheckPTInfo4PTNoAlert(true,false)==false) //姓名，身份证，
	{
	    return false;
	}
	/*
	if(isExistEmail('no'))
	{
	    return false;
	}*/
    return true;
}
function CheckForm4Email()
{
	if (!CheckPasswordEx())
	{
		alert(GetPasswordExErrorInfo());
		return false;
	}
	if (!CheckExcode())
	{
		alert("请正确输入验证码！");
		document.getElementById("attcode2").focus();
		return false;
	}
	//neil
	var sPtid = document.getElementById("UserEmailId").value;
	if(sPtid=="注册后该邮箱地址可用于今后的密码找回")
	{
	    sPtid="";
	}
    var lvCheckRegMailResut=CheckRegEmail(sPtid);
    if(lvCheckRegMailResut!=0)
    {
        var lvMsg="请您输入正确的邮箱地址";
        if(lvCheckRegMailResut==1)
        {
            lvMsg="请您输入正确的邮箱地址";
        }
        else if(lvCheckRegMailResut==2)
        {
            lvMsg="邮箱通行证帐号应在50个字符以内";
        }
        else if(lvCheckRegMailResut==3)
        {
            lvMsg="邮箱后缀应为COM、NET、ORG、CN";
        }
        else if(lvCheckRegMailResut==4)
        {
            //lvMsg="邮箱"+sPtid.substring(sPtid.indexOf("@"))+"不被支持";
            lvMsg="该邮件帐号已被注册或不存在";            
        }
        alert(lvMsg);
        return false;
    }
    /*
    //check the two email id is same    
    var sPtid2=document.getElementById("UserEmailId2").value;
    if(sPtid!=sPtid2)
    {
        alert("请正确输入邮箱地址，并确保两次输入的邮箱地址一致！");
        return false;
    }
	*/
	if(document.getElementById("password").value==sPtid)
	{
	    alert("密码不能与用户名相同！");
	    return false;
	}
	
	//检查有无输入的资料
	if(CheckPTInfo4PT(true,false)==false) //姓名，身份证，
	{
	    return false;
	}
	if(isExistEmail('no'))
	{
	    alert("该邮件帐号已被注册或不存在");
	    return false;
	}
    return true;
}
function CheckForm4MobileNoAlert()
{
	if (!CheckPasswordEx()) return false;
	if (!CheckExcode()) return false;
	if(document.getElementById("password").value==sPtid) return false;
	if(CheckPTInfo4PTNoAlert(false,true)==false)  return false;
    var sPtid=document.getElementById("UserCellphoneId").value;
    if(sPtid=="注册后该手机号码可用于今后的密码找回")
    {
        sPtid="";
    }
    if(sPtid=="") return false;

    var reg1=/^1[3][0-9]\d{8}$/;
    var reg2=/^1[5][089]\d{8}$/;
    if(reg1.test(sPtid) || reg2.test(sPtid) )
    {
	    /* if(isExistMobile()) return false; */
    }
    else
    {
        return false;
    }	    
    return true;
}
function CheckForm4Mobile()
{
	if (!CheckPasswordEx())
	{
		alert(GetPasswordExErrorInfo());
		return false;
	}
	if (!CheckExcode())
	{
		alert("请正确输入验证码！");
		document.getElementById("attcode2").focus();
		return false;
	}
	if(document.getElementById("password").value==sPtid)
	{
	    alert("密码不能与用户名相同！");
	    return false;
	}	
	//检查有无输入的资料
	if(CheckPTInfo4PT(false,true)==false) //姓名，身份证，
	{
	    return false;
	}
	//neil
    var sPtid=document.getElementById("UserCellphoneId").value;
    if(sPtid=="注册后该手机号码可用于今后的密码找回")
    {
        sPtid="";
    }
    if(sPtid=="")
    {
        alert("此项为必填，请输入手机号码");
        return false;
    }
    /*
    //check the two phone id is same
    var sPtid2=document.getElementById("UserCellphoneId2").value;
    if(sPtid!=sPtid2)
    {
        alert("请正确输入手机号码，并确保两次输入的手机号码一致！");
        return false;
    }
    */
    
    var reg1=/^1[3][0-9]\d{8}$/;
    var reg2=/^1[5][089]\d{8}$/;
    
    if(reg1.test(sPtid) || reg2.test(sPtid) )
    {
	    if(isExistMobile())
	    {
	        alert("该手机帐号已存在");
	        return false;
	    }
    }
    else
    {
        if(sPtid.length==11)
        {
            alert("非常抱歉，目前支持号段为130-139、150、158、159");                   
        }
        else
        {
            alert("请您填写真实的手机号码");
        }
        return false;
    }	    
    return true;
}
function CheckForm4PTNoAlert(v_ignore)
{
	if (!v_ignore)
	{
		v_ignore = 0;
    }
	if (!CheckPasswordEx())
	{
		return false;
	}
	if (!CheckExcode())
	{
		return false;
	}
	if(document.getElementById("password").value==document.getElementById("username").value)
	{
	    return false;
	}
	//检查有无输入的资料
	if(CheckPTInfo4PTNoAlert(true,true)==false) //姓名，身份证，
	{
	    return false;
	}
	if (!CheckPtid() && (v_ignore&0x01)==0)
	{
		return false;
	}
	/*  
	if (isExistPtid() && (v_ignore&0x02)==0)
	{
		return false;
	}
	*/
    return true;
}
function CheckForm4PT(v_ignore)
{
	if (!v_ignore)
	{
		v_ignore = 0;
    }
	if (!CheckPasswordEx())
	{
		alert(GetPasswordExErrorInfo());
		return false;
	}
	if (!CheckExcode())
	{
		alert("对不起，请正确输入验证码");
		document.getElementById("attcode2").focus();
		return false;
	}
	
	if(document.getElementById("password").value==document.getElementById("username").value)
	{
	    alert("对不起，请勿使用与用户名相同的密码");
	    return false;
	}
	
	//检查有无输入的资料
	if(CheckPTInfo4PT(true,true)==false) //姓名，身份证，
	{
	    return false;
	}

	if (!CheckPtid() && (v_ignore&0x01)==0)
	{
		alert("对不起，请正确输入您的盛大通行证帐号");
		document.getElementById("username").focus();
		return false;
	}

	if (isExistPtid() && (v_ignore&0x02)==0)
	{
		alert("对不起，该通行帐号已存在");
		document.getElementById("username").focus();
		return false;
	}
    return true;
}



function CheckPasswordEx()
{
	var sValue = trim(document.getElementById("password").value);
	document.getElementById("password").value = sValue;
	if (sValue == "")
	{
		return false;
	}
	var lvPwdLevel=lvPwdStrenth.getLevel(sValue);
	if(lvPwdLevel==0)
	{
	    return false;
	}
	/*
	var reg = /^[A-Za-z0-9]{4,10}$/i;
	if (!reg.test(sValue))
	{
		return false;
	}
	*/

	var sValue1 = trim(document.getElementById("password").value);
	var sValue2 = trim(document.getElementById("repassword").value);

 	if (sValue1 != sValue2 && sValue1!="" )
	{
		return false;
	}
	return true;
}
function CheckForm(v_ignore)
{
	if (!v_ignore)
		v_ignore = 0;

	if (!CheckPassword())
	{
		alert(GetPasswordExErrorInfo());
		//document.getElementById("password").focus();
		return false;
	}

	if (!CheckExcode())
	{
		alert("请正确输入验证码！");
		document.getElementById("attcode2").focus();
		return false;
	}

	if (!CheckPtid() && (v_ignore&0x01)==0)
	{
		alert("对不起，请正确输入您的盛大通行证帐号");
		document.getElementById("username").focus();
		return false;
	}

	if (isExistPtid() && (v_ignore&0x02)==0)
	{
		alert("该通行证帐号已存在！");
		document.getElementById("username").focus();
		return false;
	}

	var obj = document.getElementById("submitflag");
	if (obj != null)
	{
		if (obj.value == "0")
			obj.value = "1";
		else
			return false;
	}

	return true;
}

function CheckForm2(v_ignore)
{
	if (!v_ignore)
		v_ignore = 0;

	if (!CheckPassword())
	{
		alert(GetPasswordExErrorInfo());
		//document.getElementById("password").focus();
		return false;
	}

	//防沉迷身份证检查
	//var obj = document.getElementById("realname");
	var obj = document.getElementById("ProtectName");
	if (obj!=null && !CheckUsername2(obj.value))
	{
		alert("您的真实姓名未填或者不规范！");
		//document.getElementById("realname").focus();
		obj.focus();
		return false;
	}

	//obj = document.getElementById("idcard");
	obj = document.getElementById("ProtectIdcard");	
	if (obj!=null && !CheckIdcard3(obj.value))
	{
		alert("您的身份证号码未填或者不规范！");
		//document.getElementById("idcard").focus();
		obj.focus();
		return false;
	}

	if (!CheckExcode())
	{
		alert("请正确输入验证码！");
		document.getElementById("attcode2").focus();
		return false;
	}

	if (!CheckPtid() && (v_ignore&0x01)==0)
	{
		alert("对不起，请正确输入您的盛大通行证帐号");
		document.getElementById("username").focus();
		return false;
	}

	if (isExistPtid() && (v_ignore&0x02)==0)
	{
		alert("该通行证帐号已存在！");
		document.getElementById("username").focus();
		return false;
	}

	return true;
}

function CheckPwdLength(v_event)
{
	var key = v_event.keyCode;
	if (key==8 || key==46)
	{
		SpanAlert("errPassword", "");
		return;
	}

	var pwd = myGetValueById("password");
	if (GetStrLen(pwd) >= 10)
	{
		SpanAlert("errPassword", "你试图输入超长密码，盛大通行证的密码长度应为4-10个字符！");
	}
	else
	{
		SpanAlert("errPassword", "");
	}
}

function CheckPwdLength2(v_event)
{
	var key = v_event.keyCode;
	if (key==8 || key==46)
	{
		return;
	}

	var pwd = myGetValueById("password");
	if (GetStrLen(pwd) >= 10)
	{
		alert("你试图输入超长密码，盛大通行证的密码长度应为4-10个字符！");
	}
}

function onBlurRealname()
{
	//var bRet = CheckUsername2(document.getElementById("realname").value);
	var obj = document.getElementById("ProtectName");
	if (obj==null)
	{
			return;		
	}
	var bRet = CheckUsername2(obj.value);
	if (!bRet)
		SpanAlert("errRealname", "您的真实姓名未填或者不规范！");
	else
		SpanAlert("errRealname", "");
}

function onBlurIdcard()
{	
	//var bRet = CheckIdcard3(document.getElementById("idcard").value);
	var obj = document.getElementById("ProtectIdcard");
	if (obj==null)
	{
			return;		
	}
  var bRet = CheckIdcard3(obj.value);
	if (!bRet)
		SpanAlert("errIdcard", "您的身份证号码未填或者不规范！");
	else
		SpanAlert("errIdcard", "");
}

function OpenNewWindow(v_type)
{
	window.open("pop_7.asp", "", "width=650,height=300");
}

function ResetSubmitFlag()
{
	var obj = document.getElementById("submitflag");
	if (obj != null)
	{
		obj.value = "0";
	}
	timerID = setTimeout("ResetSubmitFlag()", 2000);
}