function check_username(basePath) {
    //var filter_ga = new RegExp("/^[HMhm]{1}([0-9]{10}|[0-9]{8})$/");//港澳通行证正则
    //var filter_hz = new RegExp("/^1[45][0-9]{7}$|G[0-9]{8}$|P\.[0-9]{7}$|S[0-9]{7,8}$|D[0-9]{7,8}$/");//护照正则

    var filter_ga = /^[a-zA-Z0-9]{5,21}$/; //港澳通行证
    var filter_hz = /^[A-Z0-9]{3,21}$/;  //护照
    var filter_gajm = /^[HM]{1}([0-9]{10})$/; //港澳居民来往内地通行证
    //身份证注册类型
    if ($registertype == "sfz") {
        var certno = $("#certNo").val().replace(/^\s+|\s+$/g, "");//去空格
        //非空判断
        if (certno.length < 1) {
            document.getElementById("certNotip").innerHTML = '<span class="cin1">请输入身份证号码。</span>';
            $("#jhtip").hide();
            return false;
        } else {
            //选择身份证注册，就用身份证的规则验证。
            if (validateIdCard(certno) != true) {
                document.getElementById("certNotip").innerHTML = '<span class="cin1">身份证不合法，请您重新输入。</span>';
                $("#jhtip").hide();
                return false;
            } else {
                //先验证是否为待激活 为待激活的话 则不再进行下面的判断
                $.ajax({
                    headers: {
                        'Accept': 'application/json',
                        'Content-Type': 'application/json'
                    },
                    url: window.location.origin + "/aip/v1/gov/govperson/check",
                    type: "POST",
                    data: JSON.stringify({ "phone": certno, "certificateNum": certno }),
                    success: function (user) {
                        //user={"phone":"15675876313","certificateNum":"430722199510097111"};
                        if (user != null) {
                            debugger;
                            //激活手机号
                            $jhsjh = user.phone;
                            $jhzjh = user.certificateNum;
                            //提示用户激活
                            $("#jhtip").show();
                            document.getElementById("certNotip").innerHTML = '';                           
                            document.getElementById("hqyzmtip").innerHTML = '点击获取验证码，短信将发送至您的<span>[' + $jhsjh.substring(0, 3) + '****' + $jhsjh.substring(7) + ']</span>手机号上，请您注意查收';
                        } else {
                            //重复注册		
                            $.ajax({
                                headers: {
                                    'Accept': 'application/json',
                                    'Content-Type': 'application/json'
                                },
                                url: basePath + "/aip/v1/gov/person/check",
                                type: "POST",
                                data: JSON.stringify({ "certificateNum": certno, "certificateType": "idcard" }),
                                success: function (msg) {
                                    msg = $.trim(msg);
                                    var obj = eval("(" + msg + ")");
                                    if (obj == false) {
                                        document.getElementById("certNotip").innerHTML = '<span class="cin1">您输入的身份证号码已注册，请您重新输入。</span>';
                                        $("#jhtip").hide();
                                        certno_success = false;
                                    } else {
                                        certno_success = true;
                                        //根据身份证第17位 自动选择性别
                                        debugger;
                                        var num_sex=certno.substring(16,17);
                                        if(num_sex%2 ==0){
                                            //偶数 选择女 
                                            $('.hylb-box4 h6 span').text("女");
			                                $('.hylb-box4 h6 span').attr("value","2");
                                        }else{
                                            //奇数 选择男
                                            $('.hylb-box4 h6 span').text("男");
			                                $('.hylb-box4 h6 span').attr("value","1");
                                        }
                                        document.getElementById("certNotip").innerHTML = '<span class="rin1">您输入的身份证符合规范。</span>';
                                        $("#jhtip").hide();
                                    }
                                    return false;
                                },
                                error: function (msg) {
                                    debugger;
                                    certno_success = false;
                                    document.getElementById("certNotip").innerHTML = '<span class="gin1">验证身份证号码是否合法过程中发生错误，请稍后再试。</span>';
                                    $("#jhtip").hide();
                                    return false;
                                }
                            });
                        }
                    },
                    error: function (msg) {
                        // document.getElementById("legalphonetip").innerHTML='<span class="rin1">'+msg+'</span>';
                        // isSuccess = false;
                    }
                });

                return true;
            }
        }
    }
    //护照
    else if ($registertype == "hz") {
        var hzbh = $("#hzbh").val().replace(/^\s+|\s+$/g, "");//去空格
        //非空判断
        if (hzbh.length < 1) {
            document.getElementById("hzbhtip").innerHTML = '<span class="cin1">请输入护照编号。</span>';
            return false;
        } else if (filter_hz.test(hzbh)) {
            $.ajax({
                headers: {
                    'Accept': 'application/json',
                    'Content-Type': 'application/json'
                },
                url: basePath + "/aip/v1/gov/person/check",
                type: "POST",
                data: JSON.stringify({ "certificateNum": hzbh, "certificateType": "passport" }),
                success: function (msg) {
                    msg = $.trim(msg);
                    var obj = eval("(" + msg + ")");
                    if (obj == false) {
                        document.getElementById("hzbhtip").innerHTML = '<span class="cin1">您输入的护照号码已注册，请重新输入。</span>';
                    } else {
                        document.getElementById("hzbhtip").innerHTML = '<span class="rin1">您输入的护照符合规范。</span>';
                    }
                },
                error: function () {
                    document.getElementById("hzbhtip").innerHTML = '<span class="gin1">验证护照号码是否合法过程中发生错误，请稍后再试。</span>';
                }
            });
            return true;
        } else {
            document.getElementById("hzbhtip").innerHTML = '<span class="cin1">请输入2位以上合法的护照号码。</span>';
            return false;
        }
    }
    //港澳通行证
    else if ($registertype == "gatxz") {
        var gatxzbh = $("#gatxzbh").val().replace(/^\s+|\s+$/g, "");//去空格
        //非空判断
        if (gatxzbh.length < 1) {
            document.getElementById("gatxztip").innerHTML = '<span class="cin1">请输入港澳通行证编号。</span>';
            return false;
        } else if (filter_ga.test(gatxzbh)) {
            $.ajax({
                headers: {
                    'Accept': 'application/json',
                    'Content-Type': 'application/json'
                },
                url: basePath + "/aip/v1/gov/person/check",
                type: "POST",
                data: JSON.stringify({ "certificateNum": gatxzbh, "certificateType": "kongAocard" }),
                success: function (msg) {
                    msg = $.trim(msg);
                    var obj = eval("(" + msg + ")");
                    if (obj == false) {
                        document.getElementById("gatxztip").innerHTML = '<span class="cin1">您输入的港澳通行证已注册，请重新输入。</span>';
                    } else {
                        document.getElementById("gatxztip").innerHTML = '<span class="rin1">您输入的港澳通行证符合规范。</span>';
                    }
                },
                error: function () {
                    document.getElementById("gatxztip").innerHTML = '<span class="gin1">验证港澳通行证是否合法过程中发生错误，请稍后再试。</span>';
                }
            });
            return true;
        } else {
            document.getElementById("gatxztip").innerHTML = '<span class="cin1">请输入2位以上合法的港澳通行证。</span>';
            return false;
        }
    }
    //港澳居民来往内地通行证
    else if ($registertype == "gajm") {
        var gajmbh = $("#gajmbh").val().replace(/^\s+|\s+$/g, "");//去空格
        //非空判断
        if (gajmbh.length < 1) {
            document.getElementById("gajmbhtip").innerHTML = '<span class="cin1">请输入港澳居民来往内地通行证编号。</span>';
            return false;
        } else if (filter_gajm.test(gajmbh)) {
            $.ajax({
                headers: {
                    'Accept': 'application/json',
                    'Content-Type': 'application/json'
                },
                url: basePath + "/aip/v1/gov/person/check",
                type: "POST",
                data: JSON.stringify({ "certificateNum": gajmbh, "certificateType": "gajmcard" }),
                success: function (msg) {
                    msg = $.trim(msg);
                    var obj = eval("(" + msg + ")");
                    if (obj == false) {
                        gajm_success = false;
                        document.getElementById("gajmbhtip").innerHTML = '<span class="cin1">您输入的港澳居民来往内地通行证已注册，请重新输入。</span>';
                    } else {
                        gajm_success = true;
                        document.getElementById("gajmbhtip").innerHTML = '<span class="rin1">您输入的港澳居民来往内地通行证符合规范。</span>';
                    }
                },
                error: function () {
                    gajm_success = false;
                    document.getElementById("gajmbhtip").innerHTML = '<span class="gin1">验证港澳居民来往内地通行证是否合法过程中发生错误，请稍后再试。</span>';
                }
            });
            return true;
        } else {
            document.getElementById("gajmbhtip").innerHTML = '<span class="cin1">请输入2位以上合法的港澳居民来往内地通行证。</span>';
            return false;
        }
    }
    //台湾居民来往大陆通行证
    else if ($registertype == "twjm") {
        var twjmbh = $("#twjmbh").val().replace(/^\s+|\s+$/g, "");//去空格
        //非空判断
        if (twjmbh.length < 1) {
            document.getElementById("twjmbhtip").innerHTML = '<span class="cin1">请输入台湾居民来往大陆通行证编号。</span>';
            return false;
        } else if (filter_ga.test(twjmbh)) {
            $.ajax({
                headers: {
                    'Accept': 'application/json',
                    'Content-Type': 'application/json'
                },
                url: basePath + "/aip/v1/gov/person/check",
                type: "POST",
                data: JSON.stringify({ "certificateNum": twjmbh, "certificateType": "twjmcard" }),
                success: function (msg) {
                    msg = $.trim(msg);
                    var obj = eval("(" + msg + ")");
                    if (obj == false) {
                        twjm_success = false;
                        document.getElementById("twjmbhtip").innerHTML = '<span class="cin1">您输入的台湾居民来往大陆通行证已注册，请重新输入。</span>';
                    } else {
                        twjm_success = true;
                        document.getElementById("twjmbhtip").innerHTML = '<span class="rin1">您输入的台湾居民来往大陆通行证符合规范。</span>';
                    }
                },
                error: function () {
                    twjm_success = false;
                    document.getElementById("twjmbhtip").innerHTML = '<span class="gin1">验证台湾居民来往大陆通行证是否合法过程中发生错误，请稍后再试。</span>';
                }
            });
            return true;
        } else {
            document.getElementById("twjmbhtip").innerHTML = '<span class="cin1">请输入2位以上合法的台湾居民来往大陆通行证。</span>';
            return false;
        }
    }
    //外国人永久居留身份证
    else if ($registertype == "wgyjjlxk") {
        var yjjlxkbh = $("#yjjlxkbh").val().replace(/^\s+|\s+$/g, "");//去空格
        //非空判断
        if (yjjlxkbh.length < 1) {
            document.getElementById("yjjlxkbhtip").innerHTML = '<span class="cin1">请输入外国人永久居留身份证编号。</span>';
            return false;
        } else if (filter_ga.test(yjjlxkbh)) {
            $.ajax({
                headers: {
                    'Accept': 'application/json',
                    'Content-Type': 'application/json'
                },
                url: basePath + "/aip/v1/gov/person/check",
                type: "POST",
                data: JSON.stringify({ "certificateNum": yjjlxkbh, "certificateType": "yjjlxkcard" }),
                success: function (msg) {
                    msg = $.trim(msg);
                    var obj = eval("(" + msg + ")");
                    if (obj == false) {
                        document.getElementById("yjjlxkbhtip").innerHTML = '<span class="cin1">您输入的外国人永久居留身份证已注册，请重新输入。</span>';
                    } else {
                        document.getElementById("yjjlxkbhtip").innerHTML = '<span class="rin1">您输入的外国人永久居留身份证符合规范。</span>';
                    }
                },
                error: function () {
                    document.getElementById("yjjlxkbhtip").innerHTML = '<span class="gin1">验证外国人永久居留身份证是否合法过程中发生错误，请稍后再试。</span>';
                }
            });
            return true;
        } else {
            document.getElementById("yjjlxkbhtip").innerHTML = '<span class="cin1">请输入2位以上合法的外国人永久居留身份证。</span>';
            return false;
        }
    }
    //外国人居留证或居留许可
    else if ($registertype == "wgjlxk") {
        var jlxkbh = $("#jlxkbh").val().replace(/^\s+|\s+$/g, "");//去空格
        //非空判断
        if (jlxkbh.length < 1) {
            document.getElementById("jlxkbhtip").innerHTML = '<span class="cin1">请输入居留证或居留许可编号。</span>';
            return false;
        } else if (filter_ga.test(jlxkbh)) {
            $.ajax({
                headers: {
                    'Accept': 'application/json',
                    'Content-Type': 'application/json'
                },
                url: basePath + "/aip/v1/gov/person/check",
                type: "POST",
                data: JSON.stringify({ "certificateNum": jlxkbh, "certificateType": "jlxkcard" }),
                success: function (msg) {
                    msg = $.trim(msg);
                    var obj = eval("(" + msg + ")");
                    if (obj == false) {
                        document.getElementById("jlxkbhtip").innerHTML = '<span class="cin1">您输入的居留证或居留许可已注册，请重新输入。</span>';
                    } else {
                        document.getElementById("jlxkbhtip").innerHTML = '<span class="rin1">您输入的居留证或居留许可符合规范。</span>';
                    }
                },
                error: function () {
                    document.getElementById("jlxkbhtip").innerHTML = '<span class="gin1">验证居留证或居留许可是否合法过程中发生错误，请稍后再试。</span>';
                }
            });
            return true;
        } else {
            document.getElementById("jlxkbhtip").innerHTML = '<span class="cin1">请输入2位以上合法的居留证或居留许可。</span>';
            return false;
        }
    }
}

$('#xsjhmb').click(function () {
    //显示激活面板
    $("#jhform").show();
});

//用户账号激活
function yhzhjh() {
    
    if(!checkActiveName() || !checkActiveCertNo()){
		return;
	}
    
    var certEffDate = $("#jhcertEffDate").val().replace(/^\s+|\s+$/g, "");
    var certExpDate = $("#jhcertExpDate").val().replace(/^\s+|\s+$/g, "");
    if (!jhvalidateIndentityCard()) {
        return;
    }
    if (certExpDate == "长期") {
        certExpDate = "00000000";
    }
    
    if (!jhcheck_password() || !jhcheck_same_password()) {
        return;
    }
    
    var data = {
        "certificate_num": $jhzjh,
        "phone": $jhsjh,
        "password": $("#jhdlpwd").val(),
        "code": $("#jh_phone_code").val(),
        "certEffDate": certEffDate,
        "certExpDate": certExpDate,
        "activeUserName": $("#activeUserName").val(),
		"activeUserCertNo": $("#activeUserCertNo").val()
    };
    $.ajax({
        headers: {
            'Accept': 'application/json',
            'Content-Type': 'application/json'
        },
        url: window.location.origin + "/aip/v1/gov/govuseractive",
        type: "POST",
        data: JSON.stringify(data),
        dataType: "json",
        async: false,
        success: function (msg) {
            debugger;
            if (msg.code == "90000") {
                $("#jhform").css("display", "none");
                $("#jhcgtip").css("display", "block");
                setTimeout(function () {
                    window.location.href = "http://zwfw-new.hunan.gov.cn";
                }, 3000);
            } else {
                window.top.alert(msg.errtip, 3);
                // $("#jhform").css("display", "none");
                // $("#xtfmtip").css("display", "block");
                // setTimeout(function(){
                // 	window.location.href="http://zwfw-new.hunan.gov.cn";
                // }, 3000);
            }
        },
        error: function (error) {
            $("#jhform").css("display", "none");
            $("#xtfmtip").css("display", "block");
            setTimeout(function () {
                window.location.href = "http://zwfw-new.hunan.gov.cn";
            }, 3000);
            debugger;
        }
    });
}


function checkActiveName(){
	// 对中文姓名进行校验		非法姓名，包含空格\英文
	var nameCheck = /^[\u4E00-\u9FA5]+(·[\u4E00-\u9FA5]+)*$/;
	//用户输入姓名
	if ($("#activeUserName").val().length < 1) {
		document.getElementById("qrpwdtip-au").innerHTML = '<span class="cin1">请输入中文姓名</span>';
		return false;
	}else if ($("#activeUserName").val().length < 2){
		document.getElementById("qrpwdtip-au").innerHTML = '<span class="cin1">请输入两位(含)姓名</span>';
		return false;
	}else if (!nameCheck.test($("#activeUserName").val())){
		document.getElementById("qrpwdtip-au").innerHTML = '<span class="cin1">请输入合法中文姓名</span>';
		return false;
	}else{
		document.getElementById("qrpwdtip-au").innerHTML = "";
		return true;
	}
}

function checkActiveCertNo(){
	// 对身份证号码进行校验  18位
	//var cardCheck = /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
	
	/* var checkCode = function (val) {
				        var p = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
				        var factor = [ 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2 ];
				        var parity = [ 1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2 ];
				        var code = val.substring(17);
				        if(p.test(val)) {
				            var sum = 0;
				            for(var i=0;i<17;i++) {
				                sum += val[i]*factor[i];
				            }
				            if(parity[sum % 11] == code.toUpperCase()) {
				                return true;
				            }
				        }
				        return false;
				    } */
	
	//用户输入身份证
	if ($("#activeUserCertNo").val().length < 1) {
		document.getElementById("qrpwdtip-an").innerHTML = '<span class="cin1">请输入身份证</span>';
		return false;
	}else if(!validateIdCard($("#activeUserCertNo").val())){
		document.getElementById("qrpwdtip-an").innerHTML = '<span class="cin1">请输入合法身份证</span>';
		return false;
	}else{
		document.getElementById("qrpwdtip-an").innerHTML = "";
		return true;
	}
}

function jhcheck_password() {
    //用户密码设置
    if ($("#jhdlpwd").val().length < 1) {
        document.getElementById("jhdlpwdtip").innerHTML = '<span class="cin1">请输入您的登录密码。</span>';
        return false;
    }
    else if ($("#jhdlpwd").val().length > 0 && $("#jhdlpwd").val().length < 6) {
        document.getElementById("jhdlpwdtip").innerHTML = '<span class="cin1">请至少输入6-16个字符。</span>';
        return false;
    }
    //验证密码，只能输入数字，字母，下划线。
    var validatePassword = /^[a-zA-Z0-9_]{6,16}$/;
    if (!validatePassword.test($("#jhdlpwd").val())) {
        document.getElementById("jhdlpwdtip").innerHTML = '<span class="cin1">密码只能包含数字,大小写英文字母和英文下划线。</span>';
        return false;
    } else {
        document.getElementById("jhdlpwdtip").innerHTML = '<span class="rin1">您输入的登录密码符合规范。</span>';
    }
    return true;
}
function jhcheck_same_password() {
    //用户密码比较
    if ($("#jhqrpwd").val().length < 1) {
        document.getElementById("jhqrpwdtip").innerHTML = '<span class="cin1">请输入确认登录密码。</span>';
        pwd_success = false;
        return false;
    }
    else if ($("#jhqrpwd").val() != $("#jhdlpwd").val()) {
        document.getElementById("jhqrpwdtip").innerHTML = '<span class="cin1">您两次输入的密码不一致，请重新输入。</span>';
        pwd_success = false;
        return false;
    }
    else {
        document.getElementById("jhqrpwdtip").innerHTML = '<span class="rin1">您输入的登录密码符合规范。</span>';
        pwd_success = true;
    }
    return true;
}

/**
 * 选择年限后根据开始日期计算结束日期
 * 
 */
function jhsfzqxkz(year) {
    //开始日期
    var ksrq = $("#jhcertEffDate").val().replace(/^\s+|\s+$/g, "");
    var reg = /^([\d]{4}(((0[13578]|1[02])((0[1-9])|([12][0-9])|(3[01])))|(((0[469])|11)((0[1-9])|([12][0-9])|30))|(02((0[1-9])|(1[0-9])|(2[0-8])))))|((((([02468][048])|([13579][26]))00)|([0-9]{2}(([02468][048])|([13579][26]))))(((0[13578]|1[02])((0[1-9])|([12][0-9])|(3[01])))|(((0[469])|11)((0[1-9])|([12][0-9])|30))|(02((0[1-9])|(1[0-9])|(2[0-9])))))$/;

    if (ksrq.length != 8) {
        document.getElementById("sfzqxtip").innerHTML = '<span class="cin1">日期填写错误。</span>';
    } else if (!reg.test(ksrq)) {
        document.getElementById("sfzqxtip").innerHTML = '<span class="cin1">日期填写错误。</span>';
    } else {
        document.getElementById("sfzqxtip").innerHTML = '<span class="rin1">日期填写正确。</span>';
    }
    var nf = parseInt(ksrq.substring(0, 4));
    var rq = ksrq.substring(4);
    if (year == "5") {
        $("#jhcertExpDate").val(nf + 5 + rq);
    } else if (year == "10") {
        $("#jhcertExpDate").val(nf + 10 + rq);
    } else if (year == "20") {
        $("#jhcertExpDate").val(nf + 20 + rq);
    } else if (year == "长期") {
        $("#jhcertExpDate").val("长期");
    }
}

/**
 * 检测身份证有效期是否为空
 */
function jhvalidateIndentityCard() {
    var result = true;
    var certEffDate = $("#jhcertEffDate").val().replace(/^\s+|\s+$/g, "");
    var certExpDate = $("#jhcertExpDate").val().replace(/^\s+|\s+$/g, "");
    if (certEffDate == "") {
        document.getElementById("jhsfzqxtip").innerHTML = '<span class="cin1">日期填写错误。</span>';
        result = false;
    }
    if (certExpDate == "") {
        document.getElementById("jhsfzqxtip").innerHTML = '<span class="cin1">日期填写错误。</span>';
        result = false;
    }
    if (!jhsfzjsrqyz()) {
        result = false;
    }
    if (!jhsfzksrqyz()) {
        result = false;
    }
    return result;
}

/**
 * 开始日期校验
 * 
 */
function jhsfzksrqyz() {
	//开始日期
	var ksrq = $("#jhcertEffDate").val().replace(/^\s+|\s+$/g, "");
	var reg = /^([\d]{4}(((0[13578]|1[02])((0[1-9])|([12][0-9])|(3[01])))|(((0[469])|11)((0[1-9])|([12][0-9])|30))|(02((0[1-9])|(1[0-9])|(2[0-8])))))|((((([02468][048])|([13579][26]))00)|([0-9]{2}(([02468][048])|([13579][26]))))(((0[13578]|1[02])((0[1-9])|([12][0-9])|(3[01])))|(((0[469])|11)((0[1-9])|([12][0-9])|30))|(02((0[1-9])|(1[0-9])|(2[0-9])))))$/;
	var currentDate= getNowFormatDate();
	if (ksrq.length != 8) {
		document.getElementById("jhsfzqxtip").innerHTML = '<span class="cin1">日期填写错误。</span>';
		sfzqsqx_success = false;
		timeErrorMap.set("start", "false");
		return false;
	} else if (1900 > ksrq || ksrq > currentDate) {
		document.getElementById("jhsfzqxtip").innerHTML = '<span class="cin1">日期填写错误。</span>';
		sfzqsqx_success = false;
		timeErrorMap.set("start", "false");
		return false;
	} else if (!reg.test(ksrq)) {
		document.getElementById("jhsfzqxtip").innerHTML = '<span class="cin1">日期填写错误。</span>';
		sfzqsqx_success = false;
		timeErrorMap.set("start", "false");
		return false;
	} else {
		sfzqsqx_success = true;
		timeErrorMap.delete("start");
		if (timeErrorMap.size == 0) {
			document.getElementById("jhsfzqxtip").innerHTML = '<span class="rin1">日期格式正确。</span>';
		}
	}
	//结束日期
	var jsrq = $("#jhcertExpDate").val().replace(/^\s+|\s+$/g, "");
	if (jsrq != "长期" && jsrq != "") {
		jsrq = parseInt(jsrq);
		ksrq = parseInt(ksrq);
		if (ksrq >= jsrq) {
			sfzqsqx_success = false;
            document.getElementById("jhsfzqxtip").innerHTML = '<span class="cin1">日期填写错误。</span>';
            return false;
		}
    }
    return true;
}

/**
 * 结束日期校验
 * 
 */
function jhsfzjsrqyz() {
	//结束日期
	var jsrq = $("#jhcertExpDate").val().replace(/^\s+|\s+$/g, "");
	var reg = /^([\d]{4}(((0[13578]|1[02])((0[1-9])|([12][0-9])|(3[01])))|(((0[469])|11)((0[1-9])|([12][0-9])|30))|(02((0[1-9])|(1[0-9])|(2[0-8])))))|((((([02468][048])|([13579][26]))00)|([0-9]{2}(([02468][048])|([13579][26]))))(((0[13578]|1[02])((0[1-9])|([12][0-9])|(3[01])))|(((0[469])|11)((0[1-9])|([12][0-9])|30))|(02((0[1-9])|(1[0-9])|(2[0-9])))))$/;

	 if (jsrq=="长期") {
		sfzjsqx_success=true;
		timeErrorMap.delete("end");
		if(timeErrorMap.size == 0){
			document.getElementById("jhsfzqxtip").innerHTML = '<span class="rin1">日期格式正确。</span>';
		}
	}else if (jsrq.length != 8) {
		document.getElementById("jhsfzqxtip").innerHTML = '<span class="cin1">日期填写错误。</span>';
		sfzjsqx_success=false;
		timeErrorMap.set("end","false");
		return false;
	} else if (!reg.test(jsrq)) {
		document.getElementById("jhsfzqxtip").innerHTML = '<span class="cin1">日期填写错误。</span>';
		sfzjsqx_success=false;
		timeErrorMap.set("end","false");
		return false;
	}else{
		sfzjsqx_success=true;
		timeErrorMap.delete("end");
		if(timeErrorMap.size == 0){
			document.getElementById("jhsfzqxtip").innerHTML = '<span class="rin1">日期格式正确。</span>';
		}
	}
	//开始日期
	var ksrq = $("#jhcertEffDate").val().replace(/^\s+|\s+$/g, "");
	if (jsrq != "长期"&&ksrq!="") {
		jsrq = parseInt(jsrq);
		ksrq = parseInt(ksrq);
		if (ksrq >= jsrq) {
			sfzjsqx_success=false;
            document.getElementById("jhsfzqxtip").innerHTML = '<span class="cin1">日期填写错误。</span>';
            return false;
		}
    }
    return true;
}

function qxjh() {
    //关闭激活面板
    $("#jhform").hide();
}
