230320a303 1 year ago
parent
commit
febce8a603

+ 564 - 0
gjj/index.html

@@ -0,0 +1,564 @@
+
+
+<!DOCTYPE html>
+<html lang="zh-cmn-Hans">
+<head>
+    
+
+
+
+
+<script type="text/javascript">
+    
+
+     var global = {
+        // "newsevent": "http://m.xxx/",
+        // "im": "https://weixin.ncgjj.com.cn:7900/wtzx/probconsult/problemChatAction.do",
+        // "city": "南昌住房公积金管理中心",
+        // "imcustmsg": "",
+        // "workguid": "http://www.xxxxx.gov.cn/portal/affairs-public-depart-matters?region=440800&orgId=45625026X",
+        // "newssurvey": "https://www.xxxxx.com/info/iList.jsp?cat_id=10021",
+        // "phone2": "12329",
+        // "newslodge": "https://www.xxxxx.com/info/iList.jsp?tm_id=13",
+        // "newspolicy": "http://www.xxxxx.gov.cn/fileserver/NewsHtml/bd42aecb-b38d-4de3-b5fe-ddf515e556d9.html",
+        // "newshot": "http://m.xxxxx.gov.cn/Modules/Wap/NewsList.aspx?cid=5dc8ad6b-a1f6-4911-83ac-4dbc1d52abee",
+        // "web": "http://ncgjj.nc.gov.cn/nczfgjj/",
+        // "phone": "12329",
+        // "WEIXIN_URL": "http://wx.xxxxx/mobileApp",
+        // "sinaWeibo": "",
+        // "myzixun": "http://www.xxxxx.gov.cn/fileserver/NewsHtml/bd42aecb-b38d-4de3-b5fe-ddf515e556d9.html",
+        // "myadvisory": ""
+    }
+
+    var basePath=  ''; // "https://weixin.ncgjj.com.cn:443/mobileApp/";
+    // var pwd_reg="^(?=.*[A-Za-z])(?=.*\d)(?=.*[$@!%*#?&])[A-Za-z\d@$!%*#?&]{8,20}$";
+    // gobackurl="indexAbout.jsp";
+    // Base={gobackurl:"indexAbout.jsp"};//针对慧眼刷脸跳转页面(防止重复刷新)
+    
+
+</script>
+<link rel="stylesheet" href="./static/font-awesome.min.css?r=dsfsdf">
+<link rel="stylesheet" href="./static/base.css?r=dsfsdf">
+<link rel="stylesheet" href="./static/yinhai.css?rff=d3sfffs">
+<script src="./static/jquery-1.11.1.min.js?r=dsfsdf"></script>
+<script src="./static/layer.js?r=dsfsdf"></script>
+<script src="./static/yinhai.js?rd=0"></script>
+<script src="./static/netutil.js?r=1"></script>
+<script src="./static/core-min.js"></script>
+<script src="./static/weui.min.js"></script>
+<script src="./static/enc-base64.js"></script>
+<script src="./static/jsencrypt.js"></script>
+<script src="./static/security.js"></script>
+<script type="text/javascript" src="./static/jweixin-1.4.0.js"></script>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<meta charset="utf-8">
+<meta name="Keywords" content="">
+<meta name="robots" content="all">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<link rel="stylesheet" href="./static/weui.min.css?rff=dsfffsdf">
+<link rel="stylesheet" href="./static/fund-ui-form.css?r=dsfsd7f" />
+<link rel="stylesheet" href="./static/dark.css?r=dsfsd7f"/>
+
+    
+    <title></title>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <meta charset="UTF-8">
+</head>
+<style type="text/css">
+    .color_red{
+        color:red;
+    }
+</style>
+<body>
+
+ 
+<div class="mian">
+    <form class="jsq_mian">
+        <div style="margin-top:5px" class="weui-cells ">
+            <div class="weui-cell">
+                <div class="weui-cell__hd"><label class="weui-label" style="width: 120px"><span class="color_red">*</span>主借款人账户余额</label></div>
+                <div class="weui-cell__bd">
+                    <input class="weui-input" placeholder="请输入余额" style="text-align: right"
+                           oninput="handleInfo('zjkrzhye',this)"/>
+                </div>
+            </div>
+            <div class="weui-cell">
+                <div class="weui-cell__hd"><label class="weui-label" style="width: 90px"><span class="color_red">*</span>缴存基数</label></div>
+                <div class="weui-cell__bd">
+                    <input class="weui-input" placeholder="请输入缴存基数" style="text-align: right"
+                           oninput="handleInfo('zjkrgzjs',this)"/>
+                </div>
+            </div>
+            <div class="weui-cell ">
+                <div class="weui-cell__hd"><label class="weui-label"><span class="color_red">*</span>出生日期</label></div>
+                <div class="weui-cell__bd">
+                    <input onclick="openpick(this,'yyyy-mm-dd')" class="weui-input" style="text-align: right"
+                           id="csrq" placeholder="请选择出生日期"/>
+                </div>
+            </div>
+            <div class="weui-cell" style="height: 21px">
+                <div class="weui-cell__hd"><label class="weui-label">性别</label></div>
+                <div class="weui-cell__bd">
+                    <select id="xingbie" class="weui-select" valid="r" style="direction: rtl">
+                        <option value="0">男</option>
+                        <option value="1">女</option>
+                    </select>
+                </div>
+            </div>
+            <div class="weui-cell" style="height: 21px">
+                <div class="weui-cell__hd"><label class="weui-label">是否多子女家庭</label></div>
+                <div class="weui-cell__bd">
+                    <select id="sfdh" class="weui-select" valid="r" style="direction: rtl">
+                        <option value="0">否</option>
+                        <option value="1">是</option>
+                    </select>
+                </div>
+            </div>
+            <div class="weui-cell ">
+                <div class="weui-cell__hd"><label class="weui-label"><span class="color_red">*</span>累计缴存月份</label></div>
+                <div class="weui-cell__bd">
+                    <input oninput="handleInfo('ljhjyfs',this)" style="text-align: right" placeholder="请输入累计缴存月份"
+                           class="weui-input "/>
+                </div>
+            </div>
+            <div class="weui-cell" style="height: 21px">
+                <div class="weui-cell__hd"><label class="weui-label" style="width: 120px">是否连续缴存满5年</label></div>
+                <div class="weui-cell__bd">
+                    <select class="weui-select" id="sflxjc" style="direction: rtl">
+                        <option value="0">否</option>
+                        <option value="1">是</option>
+                    </select>
+                </div>
+            </div>
+            <div class="weui-cell" style="height: 25px">
+                <div class="weui-cell__hd"><label class="weui-label" style="width: 180px">共同借款人是否在同城住房公积金中心缴交公积金</label>
+                </div>
+                <div class="weui-cell__bd">
+                    <select class="weui-select" onchange="handleInfo('sfztczfgjj',this)" style="direction: rtl">
+                        <option value="0">否</option>
+                        <option value="1">是</option>
+                    </select>
+                </div>
+            </div>
+            <div id="jrx_box" style="display: none">
+                <div class="weui-cell">
+                    <div class="weui-cell__hd"><label class="weui-label" style="width: 140px"><span class="color_red">*</span>共同借款人账户余额</label></div>
+                    <div class="weui-cell__bd">
+                        <input class="weui-input" id="gtjkrzhye" placeholder="请输入账户余额" style="text-align: right"
+                               oninput="handleInfo('gtjkrzhye',this)"/>
+                    </div>
+                </div>
+                <div class="weui-cell">
+                    <div class="weui-cell__hd"><label class="weui-label" style="width: 140px"><span class="color_red">*</span>共同借款人缴存基数</label></div>
+                    <div class="weui-cell__bd">
+                        <input class="weui-input" id="gtjkrgzjs" placeholder="请输入缴存基数" style="text-align: right"
+                               oninput="handleInfo('gtjkrgzjs',this)"/>
+                    </div>
+                </div>
+            </div>
+            <div class="weui-cell" style="height: 21px">
+                <div class="weui-cell__hd"><label class="weui-label">购房所在地</label></div>
+                <div class="weui-cell__bd">
+                    <select class="weui-select" onchange="handleInfo('gfszd',this)" style="direction: rtl">
+                        <option value="0">市城区</option>
+                        <option value="1">南昌县</option>
+                        <option value="2">新建区(含原湾里区)</option>
+                        <option value="3">进贤县</option>
+                        <option value="4">安义县</option>
+                        
+                    </select>
+                </div>
+            </div>
+            <div class="weui-cell">
+                <div class="weui-cell__hd"><label class="weui-label" style="width: 90px"><span class="color_red">*</span>房屋总价</label></div>
+                <div class="weui-cell__bd">
+                    <input class="weui-input" placeholder="请输入房屋总价" style="text-align: right"
+                           oninput="handleInfo('fwzj',this)"/>
+                </div>
+            </div>
+            <div class="weui-cell" style="height: 21px">
+                <div class="weui-cell__hd"><label class="weui-label"><span class="color_red">*</span>房屋性质</label></div>
+                <div class="weui-cell__bd">
+                    <select class="weui-select" id="fwxz" style="direction: rtl" onchange="changeFwxz(this)">
+                        <option value="0">商品房</option>
+                        <option value="1">存量房</option>
+                        <option value="2">商转公</option>
+                    </select>
+                </div>
+            </div>
+            <div class="weui-cell" style="height: 21px">
+                <div class="weui-cell__hd"><label class="weui-label">房屋套数</label></div>
+                <div class="weui-cell__bd">
+                    <select class="weui-select" onchange="handleInfo('fwts',this)" style="direction: rtl">
+                        <option value="0">一套</option>
+                        <option value="1">二套</option>
+                    </select>
+                </div>
+            </div>
+            <div class="weui-cell" style="height: 21px">
+                <div class="weui-cell__hd"><label class="weui-label">还款方式</label></div>
+                <div class="weui-cell__bd">
+                    <select class="weui-select" onchange="handleInfo('hkfs',this)" style="direction: rtl">
+                        <option value="0">等额本金</option>
+                        <option value="1">等额本息</option>
+                    </select>
+                </div>
+            </div>
+            <div class="weui-cell szgedjs_box" style="display: none">
+                <div class="weui-cell__hd"><label class="weui-label" style="width: 90px"><span class="color_red">*</span>贷款余额</label></div>
+                <div class="weui-cell__bd">
+                    <input class="weui-input" id="dkye_" placeholder="请输入贷款余额" style="text-align: right"
+                           oninput="handleInfo('dkye_',this)"/>
+                </div>
+            </div>
+            <div class="weui-cell szgedjs_box"  style="display: none">
+                <div class="weui-cell__hd"><label class="weui-label" style="width: 100px"><span class="color_red">*</span>购房提取金额</label></div>
+                <div class="weui-cell__bd">
+                    <input class="weui-input" id="gftqje_" placeholder="请输入购房提取金额" style="text-align: right"
+                           oninput="handleInfo('gftqje_',this)"/>
+                </div>
+            </div>
+        </div>
+
+        <div style="display:none;">
+            <div class="jsqleftdiv"><label>家庭工资基数:</label><input type="text" id="jtgzjs"/></div>
+        </div>
+        <div class="box mar-all">
+            <div class="box-f1 mar-all">
+                <a onclick="reset()" class="fund_ui_btn fund_ui_btn_primary"
+                   style="background: #FFFFFF;color: #00A1EA;border: 1px solid #00A1EA">重置</a>
+            </div>
+            <div class="box-f1 mar-all">
+                <a onclick="calc()" class="fund_ui_btn fund_ui_btn_primary">开始计算</a>
+            </div>
+        </div>
+    </form>
+    <div style="font-size: 14px;color: #dda244;padding: 0px 10px 10px 10px">
+        <p class="red">温馨提示:</p>
+        <ul>
+            <li class="noPointLi">&emsp;“缴存基数”、“累计缴存月份”和“是否连续缴存满5年”等信息可通过以下渠道查询:</li>
+            <li class="noPointLi">&emsp;1.公积金中心官方网站—个人网上业务大厅—我要查询;</li>
+            <li class="noPointLi">&emsp;2.微信公众号—服务大厅—快速查—账户查询;</li>
+            <li class="noPointLi">&emsp;3.手机客户端—快速查—账户查询;</li>
+            <li class="noPointLi">&emsp;4.支付宝—赣服通—当前地址切换至南昌市—查看全部—本地服务—市公积金—账户查询;</li>
+            <li class="noPointLi">&emsp;试算结果仅供参考,具体贷款额度以公积金中心根据贷款材料审批结果为准。</li>
+        </ul>
+    </div>
+</div>
+<style>
+    .noPointLi{
+        list-style-top: none;
+        word-wrap:break-word;
+        word-break:normal;
+    }
+</style>
+<script type="text/javascript">
+    $(document).ready(function () {
+        if (window.onViewOpen) {
+            onViewOpen();
+        }
+        if (window.onViewCreate) {
+            onViewCreate();
+        }
+        if (!window.goback) {
+            $("#nav-left").bind("click", function () {
+                window.history.go(-1);
+            });
+            var nav = $("<div class='circle  box box-c tx-c'><div class='fa  fa-angle-left fa-2x' style='color:#00A1EA;display:relative;'></div></div>");
+            nav.bind("click", function () {
+                closeCurrWin();
+            });
+            $(document.body).append(nav);
+        }
+    })
+    var option = {
+        zjkrzhye: 0,
+        zjkrgzjs: 0,
+        ljhjyfs: 6,
+        sfztczfgjj: 0,
+        gtjkrzhye: 0,
+        gtjkrgzjs: 0,
+        gfszd: 0,
+        fwzj: 0,
+        fwts: 0,
+        hkfs: 0,
+        dknx: 0,
+        dkye_: 0,
+        gftqje_: 0,
+        fwxz: 0
+    };
+
+    function handleInfo(key, item) {
+        if("sfztczfgjj"==key){
+            if("1"==item.value){
+                $("#jrx_box").show();
+                $("#gtjkrzhye").val(option["gtjkrzhye"])
+                $("#gtjkrgzjs").val(option["gtjkrgzjs"])
+            }else{
+                option["gtjkrzhye"] = 0;
+                option["gtjkrgzjs"] = 0;
+                $("#jrx_box").hide();
+            }
+        }
+        option[key] = +item.value;
+        if (key === 'zjkrgzjs' || key === 'gtjkrgzjs') {
+            $('#jtgzjs').val(option['zjkrgzjs'] + option['gtjkrgzjs']);
+        }
+    }
+
+
+    function openpick(obj, format, fun) {
+        var date = new Date();
+        weui.datePicker({
+            start: date.getFullYear() - 70,
+            end: date.getFullYear(),
+            defaultValue: [new Date().getFullYear(), new Date().getMonth() + 1, new Date().getDate()],
+            onChange: function (result) {
+            },
+            onConfirm: function (result) {
+                console.log(result);
+                obj.value = result[0].value + "-" + result[1].value + "-" + result[2].value;
+            }
+        });
+    }
+
+    function calc() {
+        var dkye = $("#dkye_").val()
+        var gftqje = $("#gftqje_").val()
+        var fwxz = option['fwxz']
+        if (isEmpty(option['zjkrzhye'])) {
+            Base.alert("主借款人账户余额不能为空", "warn")
+            return
+        } else if (isEmpty(option['zjkrgzjs'])) {
+            Base.alert("缴存基数不能为空", "warn")
+            return
+        } else if (isEmpty(Base.getValue("csrq"))) {
+            Base.alert("出生日期不能为空", "warn")
+            return
+        } else if (isEmpty(option['ljhjyfs'])) {
+            Base.alert("累计汇缴月份数不能为空", "warn")
+            return
+        } else if (isEmpty(option['fwzj'])) {
+            Base.alert("房屋总价不能为空", "warn")
+            return
+        } else if (fwxz == '2' && dkye != '0' && isEmpty(dkye)) {
+            Base.alert("贷款余额不能为空", "warn")
+            return
+        } else if (fwxz == 2 && gftqje != '0' && isEmpty(gftqje)) {
+            Base.alert("购房提取金额不能为空", "warn")
+            return
+        }else if (option["sfztczfgjj"] == 1 && (option["gtjkrzhye"] == 0 || option["gtjkrgzjs"] == 0)){
+            Base.alert("共同借款人账户余额或缴存基数不能为空", "warn")
+            return
+        }
+        var dknx = 0;
+        var age = 0;
+        var xingbie = $("#xingbie option:selected").val();
+        var sflxjc = $("#sflxjc option:selected").val();
+        var sfdh = $("#sfdh option:selected").val();
+        var csrq = $("#csrq").val();
+        var csinfo = csrq.split("-");
+        var cs_year = parseInt(csinfo[0]);
+        var cs_month = parseInt(csinfo[1]);
+        var cs_day = parseInt(csinfo[2]);
+        var date = new Date();
+        var year = parseInt(date.getFullYear());
+        var month = parseInt(date.getMonth() + 1);
+        var day = parseInt(date.getDate());
+        if (month < cs_month) {
+            age = year - cs_year - 1;
+        } else {
+            age = year - cs_year
+        }
+        age = age + 1;
+        if ("0" == xingbie) {
+            dknx = 60 - age;
+        } else {
+            dknx = 55 - age;
+        }
+        if (dknx > 30) {
+            dknx = 30
+        }
+        if (!dknx) {
+            dknx = 0
+        }
+        if (age < 18) {
+            dknx = 0
+        }
+        if (1 == sflxjc) {
+            dknx += 5;
+        }
+        if(dknx>30){
+            dknx = 30;
+        }
+        // var fwxz = $("#fwxz").val();
+        if("1"==fwxz || fwxz == '2'){
+            if(dknx>20){
+                dknx=20;
+            }
+        }
+        var dkeda, dkedb, dkedc;
+        dkeda = (option['zjkrzhye'] + option['gtjkrzhye']) * 30 * monthToParam(option['ljhjyfs']);
+        dkedb = gfszdTodked(option['gfszd'], option['sfztczfgjj']);
+        //是否多子女家庭上浮20%
+        if ( sfdh == "1") {
+            dkedc = Math.min(dkeda, dkedb) * 1.2;
+        } else {
+            dkedc = Math.min(dkeda, dkedb);
+        }
+
+        if (option['fwts'] === 0) {
+            dkedc = Math.min(dkedc, option['fwzj'] * 0.8);
+        } else {
+            dkedc = Math.min(dkedc, option['fwzj'] * 0.7);
+        }
+
+        dkedc = option['hkfs'] === 0 ?
+            debjCalc(dkedc, dknx, option['zjkrgzjs'], option['gtjkrgzjs'],option['fwts']) :
+            debxCalc(dkedc, dknx, option['zjkrgzjs'], option['gtjkrgzjs'],option['fwts']);
+        showResult()
+        $('#kdnx').val(dknx);
+        if(fwxz != '2') {
+            $('#dked').val(parseInt(dkedc / 1000) * 1000);
+            return;
+        }else {
+            //仅商转公的房子才需要根据贷款余额和已提取金额去算
+            //2021-09-22 原公式计算金额与贷款余额取最小值-购房提取金额
+            var fin_dked = Math.min(dkedc, option['dkye_']) - option['gftqje_']
+            $('#dked').val(parseInt(fin_dked / 1000) * 1000);
+        }
+    }
+
+    /**
+     * 房屋性质为商转公则显示贷款余额
+     * @param value
+     */
+    function changeFwxz(item){
+        if (item.value == 2){
+            $(".szgedjs_box").show()
+        }else {
+            $(".szgedjs_box").hide()
+        }
+        option['fwxz'] = item.value
+    }
+
+    function isEmpty(arr){
+        return !arr || arr.length == 0
+    }
+
+    function monthToParam(val) {
+        val = parseInt(val);
+        var opt = {
+            0: 0.9,
+            1: 0.9,
+            2: 1,
+            3: 1.1,
+            4: 1.2,
+            5: 1.3
+        };
+        if (val < 6) {
+            return 0;
+        } else if (6 <= val && val <= 12) {
+            return opt[0];
+        } else if (12 < val && val <= 24) {
+            return opt[1];
+        } else if (24 < val && val <= 36) {
+            return opt[2];
+        } else if (36 < val && val <= 48) {
+            return opt[3];
+        } else if (48 < val && val <= 60) {
+            return opt[4];
+        } else {
+            return opt[5];
+        }
+    }
+
+    function gfszdTodked(pos, type) {
+        var opt = {
+            0: [700000, 800000],
+            1: [700000, 800000],
+            2: [700000, 800000],
+            3: [700000, 800000],
+            4: [700000, 800000],
+            5: [700000, 800000]
+        };
+        return opt[pos][type];
+    }
+
+    function debxCalc(dkedc, dknx, zjkrgzjs, gtjkrgzjs,fwts) {
+        var rate = 0;
+        if(dknx<=5){
+            if(fwts==0){
+                rate = 0.026;
+            }else{
+                rate = 0.03025;
+            }
+        }else{
+            if(fwts==0){
+                rate = 0.031;
+            }else{
+                rate = 0.03575;
+            }
+        }
+        var yhke = dkedc * ((rate / 12) * (Math.pow(1 + rate / 12, dknx * 12))) / (Math.pow(1 + rate / 12, dknx * 12) - 1);
+
+        if (yhke <= (zjkrgzjs + gtjkrgzjs) * 0.6) {
+            return dkedc;
+        } else {
+            return ((zjkrgzjs + gtjkrgzjs) * 0.6) * (Math.pow(1 + rate / 12, dknx * 12) - 1) / ((rate / 12) * (Math.pow(1 + rate / 12, dknx * 12)));
+        }
+    }
+
+    function debjCalc(dkedc, dknx, zjkrgzjs, gtjkrgzjs,fwts) {
+        var rate = 0;
+        if(dknx<=5){
+            if(fwts==0){
+                rate = 0.026;
+            }else{
+                rate = 0.03025;
+            }
+        }else{
+            if(fwts==0){
+                rate = 0.031;
+            }else{
+                rate = 0.03575;
+            }
+        }
+        var yhke = dkedc * rate / 12 + dkedc / (dknx * 12);
+
+        if (yhke <= (zjkrgzjs + gtjkrgzjs) * 0.6) {
+            return dkedc;
+        } else {
+            return (zjkrgzjs + gtjkrgzjs) * 0.6 / (rate / 12 + 1 / (dknx * 12));
+        }
+    }
+
+    function reset() {
+        $('.jsq_mian')[0].reset();
+    }
+
+    function closeCurrWin() {
+        window.history.go(-1);
+    }
+
+    function showResult() {
+
+        var html = "<div style='padding:.3rem;'><div  style='margin-top:0px'  class='weui-cells weui-cells_form'>"
+            + "<div class='weui-cell' >"
+            + "<div class='weui-cell__hd'><label  style='width:5rem' class='weui-label'>可贷年限:</label></div>"
+            + "<div class='weui-cell__bd'> <input style='font-size: .875rem' class='weui-input' readonly id='kdnx' placeholder='' type='text' value=''></div>"
+            + "</div>"
+            + "<div class='weui-cell' >"
+            + "<div class='weui-cell__hd'><label style='width:5rem' class='weui-label'>可贷金额:</label></div>"
+            + "<div class='weui-cell__bd'> <input style='font-size: .875rem'  class='weui-input' readonly id='dked' placeholder='' type='text' value=''></div>"
+            + "</div>"
+            + "</div></div>"
+        $.dialog({ok: "确定", title: "计算结果", content: html, mode: 1}, function (index) {
+
+            return;
+        });
+    }
+
+</script>
+</body>
+</html>

+ 87 - 0
gjj/static/base.css

@@ -0,0 +1,87 @@
+*{margin: 0px;padding: 0px}
+.fa-1x{font-size:1.8em}
+html,body{
+    color:#3A3634;
+    -webkit-text-size-adjust: none;
+    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+    -webkit-user-select: none;
+     background-color:#fbf9fe;
+    }
+    
+.baseFont{font-size:15px;}    
+.text {
+    margin: 0;
+    padding: 0;
+    overflow-x: hidden;
+    -webkit-text-size-adjust: none;
+    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+    -webkit-user-select: none
+}
+
+.tx-c{text-align: center;}
+.tx-r{text-align: right;}
+.tx-l{text-align: left;}
+.ut-s {
+    text-overflow: ellipsis;
+    overflow: hidden;
+    white-space: nowrap !important;
+    outline: 0 !important
+}
+.font-s5-size{font-size:.75em}
+.font-5-size{font-size:0.857em}
+.box
+{
+    display: -webkit-box !important;
+    display: box !important;
+    position:relative;
+}
+.box-ver
+{
+    -webkit-box-orient:vertical;
+    box-orient:vertical;
+}
+.box-pack-c{
+    box-pack:center;
+    -webkit-box-pack: center;
+}
+.box-align-c{
+    -webkit-box-align:center;
+    box-align:center;
+}
+.box-c{
+    box-pack:center;
+    -webkit-box-pack: center;
+    -webkit-box-align:center;
+    box-align:center;
+}
+.mdui-input-row{
+ display: -webkit-box !important;
+ display: box !important;
+ position:relative; 
+ padding:0em 1em;
+    -webkit-box-align:center;
+    box-align:center;
+}
+.box-f1
+{
+     position:relative;
+    -webkit-box-flex:1;
+    box-flex:1;
+    flex:1;
+}
+.bd.spacing{padding:0px 0.9375rem}
+.mar-all{margin:.4em}
+.mar-row-top{ margin-top: 1.17647059em;}
+.mar-0-top{ margin-top:.5em;}
+.mar-1-top{ margin-top:1em;}
+.mar-0-right{margin-right :.4em}
+.padd-r{padding-right: .4em}
+.padd-a{padding:0.635em;}
+.padding-a{padding:0.635em;}
+/**ÒýÈëfontawesome ×ÖÌå**/
+@font-face {
+    font-family: Mduiicons;/**Õâ¸öÖµ±ØÐëÊÇMduiicons**/
+    font-weight: normal;
+    font-style: normal;
+    src: url('fonts/fontawesome-webfont.ttf') format('truetype');
+}

+ 13 - 0
gjj/static/core-min.js

@@ -0,0 +1,13 @@
+/*
+CryptoJS v3.1.2
+code.google.com/p/crypto-js
+(c) 2009-2013 by Jeff Mott. All rights reserved.
+code.google.com/p/crypto-js/wiki/License
+*/
+var CryptoJS=CryptoJS||function(h,r){var k={},l=k.lib={},n=function(){},f=l.Base={extend:function(a){n.prototype=this;var b=new n;a&&b.mixIn(a);b.hasOwnProperty("init")||(b.init=function(){b.$super.init.apply(this,arguments)});b.init.prototype=b;b.$super=this;return b},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}},
+j=l.WordArray=f.extend({init:function(a,b){a=this.words=a||[];this.sigBytes=b!=r?b:4*a.length},toString:function(a){return(a||s).stringify(this)},concat:function(a){var b=this.words,d=a.words,c=this.sigBytes;a=a.sigBytes;this.clamp();if(c%4)for(var e=0;e<a;e++)b[c+e>>>2]|=(d[e>>>2]>>>24-8*(e%4)&255)<<24-8*((c+e)%4);else if(65535<d.length)for(e=0;e<a;e+=4)b[c+e>>>2]=d[e>>>2];else b.push.apply(b,d);this.sigBytes+=a;return this},clamp:function(){var a=this.words,b=this.sigBytes;a[b>>>2]&=4294967295<<
+32-8*(b%4);a.length=h.ceil(b/4)},clone:function(){var a=f.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var b=[],d=0;d<a;d+=4)b.push(4294967296*h.random()|0);return new j.init(b,a)}}),m=k.enc={},s=m.Hex={stringify:function(a){var b=a.words;a=a.sigBytes;for(var d=[],c=0;c<a;c++){var e=b[c>>>2]>>>24-8*(c%4)&255;d.push((e>>>4).toString(16));d.push((e&15).toString(16))}return d.join("")},parse:function(a){for(var b=a.length,d=[],c=0;c<b;c+=2)d[c>>>3]|=parseInt(a.substr(c,
+2),16)<<24-4*(c%8);return new j.init(d,b/2)}},p=m.Latin1={stringify:function(a){var b=a.words;a=a.sigBytes;for(var d=[],c=0;c<a;c++)d.push(String.fromCharCode(b[c>>>2]>>>24-8*(c%4)&255));return d.join("")},parse:function(a){for(var b=a.length,d=[],c=0;c<b;c++)d[c>>>2]|=(a.charCodeAt(c)&255)<<24-8*(c%4);return new j.init(d,b)}},t=m.Utf8={stringify:function(a){try{return decodeURIComponent(escape(p.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return p.parse(unescape(encodeURIComponent(a)))}},
+q=l.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new j.init;this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=t.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,d=b.words,c=b.sigBytes,e=this.blockSize,f=c/(4*e),f=a?h.ceil(f):h.max((f|0)-this._minBufferSize,0);a=f*e;c=h.min(4*a,c);if(a){for(var g=0;g<a;g+=e)this._doProcessBlock(d,g);g=d.splice(0,a);b.sigBytes-=c}return new j.init(g,c)},clone:function(){var a=f.clone.call(this);
+a._data=this._data.clone();return a},_minBufferSize:0});l.Hasher=q.extend({cfg:f.extend(),init:function(a){this.cfg=this.cfg.extend(a);this.reset()},reset:function(){q.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&&this._append(a);return this._doFinalize()},blockSize:16,_createHelper:function(a){return function(b,d){return(new a.init(d)).finalize(b)}},_createHmacHelper:function(a){return function(b,d){return(new u.HMAC.init(a,
+d)).finalize(b)}}});var u=k.algo={};return k}(Math);

+ 98 - 0
gjj/static/dark.css

@@ -0,0 +1,98 @@
+@media screen and (prefers-color-scheme: dark) {
+    ::-webkit-input-placeholder { /* WebKit browsers */
+        color: #B2B2B2 !important;
+    }
+
+    ::-moz-placeholder { /* Mozilla Firefox 19+ */
+        color: #B2B2B2 !important;
+    }
+
+    :-moz-placeholder {
+        color: #B2B2B2 !important;
+    }
+
+    :-ms-input-placeholder { /* Internet Explorer 10+ */
+        color: #B2B2B2 !important;
+    }
+
+    .weui-half-screen-dialog {
+        background-color: #fff;
+    }
+
+    .weui-btn_disabled {
+        background-color: #f2f2f2;
+        color: rgba(0, 0, 0, 0.2);
+    }
+
+    .weui-icon-close-thin {
+        -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.25%2010.693L6.057%204.5%205%205.557l6.193%206.193L5%2017.943%206.057%2019l6.193-6.193L18.443%2019l1.057-1.057-6.193-6.193L19.5%205.557%2018.443%204.5z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+        mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.25%2010.693L6.057%204.5%205%205.557l6.193%206.193L5%2017.943%206.057%2019l6.193-6.193L18.443%2019l1.057-1.057-6.193-6.193L19.5%205.557%2018.443%204.5z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+        color: #000000;
+    }
+
+    .weui-icon-btn_close {
+        -webkit-mask: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.25%2010.693L6.057%204.5%205%205.557l6.193%206.193L5%2017.943%206.057%2019l6.193-6.193L18.443%2019l1.057-1.057-6.193-6.193L19.5%205.557%2018.443%204.5z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E) no-repeat 50% 50%;
+        color: #000000;
+    }
+
+    .weui-cell__hd .weui-label {
+        color: #000000;
+    }
+
+    .layermcont {
+        color: #fff;
+    }
+
+    .weui-cell__ft {
+        color: #7f7f7f;
+    }
+
+    .weui-cell:before {
+        border-top: 1px solid rgba(0, 0, 0, 0.1);
+        border-top: 1px solid var(--weui-FG-3)
+    }
+
+    .weui-cell_access .weui-cell__ft:after {
+        -webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+        mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);
+        color: #b2b2b2;
+    }
+
+    .weui-half-screen-dialog__title,.weui-label{
+        color: #000000;
+    }
+
+    .weui-select,.weui-form-preview__label,.weui-cell__bd,.weui-form__tips{
+        color: #666666;
+    }
+    input{
+        color: #000000 !important;
+    }
+    .weui-cells,.weui-form-preview,.weui-form{
+        background-color: #ffffff;
+        color: #fff;
+    }
+    textarea{
+        color:#000000 !important;
+    }
+    body{
+        background-color: #fbf9fe;
+    }
+    .weui-cell:before,.weui-cells:after{
+        content: " ";
+        position: absolute;
+        left: 0;
+        top: 0;
+        right: 0;
+        height: 47px;
+        /* border-top: 1px solid rgba(0,0,0,0.1); */
+        border-top: 1px solid #cccccc;
+        -webkit-transform-origin: 0 0;
+        transform-origin: 0 0;
+        -webkit-transform: scaleY(0.5);
+        transform: scaleY(0.5);
+        left: 16px;
+        z-index: 2;
+    }
+
+}

+ 109 - 0
gjj/static/enc-base64.js

@@ -0,0 +1,109 @@
+/*
+CryptoJS v3.1.2
+code.google.com/p/crypto-js
+(c) 2009-2013 by Jeff Mott. All rights reserved.
+code.google.com/p/crypto-js/wiki/License
+*/
+(function () {
+    // Shortcuts
+    var C = CryptoJS;
+    var C_lib = C.lib;
+    var WordArray = C_lib.WordArray;
+    var C_enc = C.enc;
+
+    /**
+     * Base64 encoding strategy.
+     */
+    var Base64 = C_enc.Base64 = {
+        /**
+         * Converts a word array to a Base64 string.
+         *
+         * @param {WordArray} wordArray The word array.
+         *
+         * @return {string} The Base64 string.
+         *
+         * @static
+         *
+         * @example
+         *
+         *     var base64String = CryptoJS.enc.Base64.stringify(wordArray);
+         */
+        stringify: function (wordArray) {
+            // Shortcuts
+            var words = wordArray.words;
+            var sigBytes = wordArray.sigBytes;
+            var map = this._map;
+
+            // Clamp excess bits
+            wordArray.clamp();
+
+            // Convert
+            var base64Chars = [];
+            for (var i = 0; i < sigBytes; i += 3) {
+                var byte1 = (words[i >>> 2]       >>> (24 - (i % 4) * 8))       & 0xff;
+                var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;
+                var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;
+
+                var triplet = (byte1 << 16) | (byte2 << 8) | byte3;
+
+                for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {
+                    base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));
+                }
+            }
+
+            // Add padding
+            var paddingChar = map.charAt(64);
+            if (paddingChar) {
+                while (base64Chars.length % 4) {
+                    base64Chars.push(paddingChar);
+                }
+            }
+
+            return base64Chars.join('');
+        },
+
+        /**
+         * Converts a Base64 string to a word array.
+         *
+         * @param {string} base64Str The Base64 string.
+         *
+         * @return {WordArray} The word array.
+         *
+         * @static
+         *
+         * @example
+         *
+         *     var wordArray = CryptoJS.enc.Base64.parse(base64String);
+         */
+        parse: function (base64Str) {
+            // Shortcuts
+            var base64StrLength = base64Str.length;
+            var map = this._map;
+
+            // Ignore padding
+            var paddingChar = map.charAt(64);
+            if (paddingChar) {
+                var paddingIndex = base64Str.indexOf(paddingChar);
+                if (paddingIndex != -1) {
+                    base64StrLength = paddingIndex;
+                }
+            }
+
+            // Convert
+            var words = [];
+            var nBytes = 0;
+            for (var i = 0; i < base64StrLength; i++) {
+                if (i % 4) {
+                    var bits1 = map.indexOf(base64Str.charAt(i - 1)) << ((i % 4) * 2);
+                    var bits2 = map.indexOf(base64Str.charAt(i)) >>> (6 - (i % 4) * 2);
+                    words[nBytes >>> 2] |= (bits1 | bits2) << (24 - (nBytes % 4) * 8);
+                    nBytes++;
+                }
+            }
+
+            return WordArray.create(words, nBytes);
+        },
+
+        _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
+    };
+}());

File diff suppressed because it is too large
+ 17 - 0
gjj/static/font-awesome.min.css


BIN
gjj/static/fontawesome-webfont.ttf


+ 460 - 0
gjj/static/fund-ui-form.css

@@ -0,0 +1,460 @@
+ button ,.button{
+    outline:none;
+    border:0px;
+    border-radius: .6em;
+    -webkit-border-radius: .6em;
+    color: #fff;
+    padding:0em 1em;
+    font-size:0.875em;
+    height:2.2em;
+    background: #00A1EA;
+  
+}
+.btncor{
+    outline:none;
+    border:0px;
+    border-radius: 1.5em;
+    -webkit-border-radius: 1.5em;
+    color: #fff;
+    padding:0em 1em;
+    font-size:1.1rem ;
+    height:2.2em;
+    background: #00A1EA;
+  
+}
+.purple{
+  background: #BA2BCA;
+}
+button.fund_ui_btn,
+input.fund_ui_btn {
+  width: 100%;
+  border-width: 0;
+  outline: 0;
+  -webkit-appearance: none;
+}
+button.fund_ui_btn:focus,
+input.fund_ui_btn:focus {
+  outline: 0;
+}
+.fund_ui_btn {
+  position: relative;
+  display: block;
+  margin-left: auto;
+  margin-right: auto;
+  padding-left: 14px;
+  padding-right: 14px;
+  box-sizing: border-box;
+  font-size: 1.15rem;
+  text-align: center;
+  text-decoration: none;
+  color: #FFFFFF;
+  line-height: 2.33333333;
+  border-radius: 0.3125em;
+  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+  overflow: hidden;
+}
+.fund_ui_btn:after {
+  content: " ";
+  width: 200%;
+  height: 200%;
+  position: absolute;
+  top: 0;
+  left: 0;
+  border: 1px solid rgba(0, 0, 0, 0.2);
+  -webkit-transform: scale(0.5);
+          transform: scale(0.5);
+  -webkit-transform-origin: 0 0;
+          transform-origin: 0 0;
+  box-sizing: border-box;
+  border-radius: 10px;
+}
+.fund_ui_btn_primary {
+  background-color: #00A1EA;
+}
+.fund_ui_btn_primary:not(.fund_ui_btn_disabled):visited {
+  color: #FFFFFF;
+}
+.fund_ui_btn_primary:not(.fund_ui_btn_disabled):active {
+  color: rgba(255, 255, 255, 0.4);
+  background-color: #007DB8;
+}
+/*********************/
+.fund_ui_btn.fund_ui_btn_mini {
+  line-height: 1.9;
+  font-size: 0.875em;
+  padding: 0 .75em;
+  display: inline-block;
+}
+.fund_ui_btn_plain_primary {
+  color: #00A1EA;
+  border: 1px solid #00A1EA;
+}
+
+button.fund_ui_btn_plain_primary,
+input.fund_ui_btn_plain_primary {
+  border-width: 1px;
+  background-color: transparent;
+}
+.fund_ui_btn_plain_primary:active {
+  border-color: #039702;
+}
+.fund_ui_btn_plain_primary:after {
+  border-width: 0;
+}
+
+.fund_ui_btn_plain_primary:not(.fund_ui_btn_disabled):visited {
+  color: #FFFFFF;
+}
+.fund_ui_btn_plain_primary:not(.fund_ui_btn_disabled):active {
+  color: rgba(255, 255, 255, 0.4);
+  background-color: #007DB8;
+}
+
+ .fund_switch_label{padding-top:0.325em }       
+ .fund_switch {
+  -webkit-appearance: none;
+          appearance: none;
+  position: relative;
+  width: 3.25em;
+  height: 2em;
+  border: 0.0625em solid #DFDFDF;
+  outline: 0;
+  border-radius: 1em; border-radius: 0.9375em;
+  box-sizing: border-box;
+  background: #DFDFDF;
+  background-color: #DFDFDF;
+  -webkit-transition: background-color 0.1s, border 0.1s;
+  transition: background-color 0.1s, border 0.1s;
+}
+.fund_switch:before { border-radius: 0.9375em;
+  content: " ";
+  position: absolute;
+  top: 0;
+  left: 0; 
+  width: 3.125em;
+  height: 1.875em;
+  border-radius: 0.9375em;
+  background-color: #FDFDFD;
+  -webkit-transition: -webkit-transform .3s;
+  transition: -webkit-transform .3s;
+  transition: transform .3s;
+  transition: transform .3s, -webkit-transform .3s;
+  -webkit-transition: -webkit-transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
+  transition: -webkit-transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
+  transition: transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
+  transition: transform 0.35s cubic-bezier(0.45, 1, 0.4, 1), -webkit-transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
+}
+
+.fund_switch:after {
+  content: " ";
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 1.875em;
+  height: 1.875em;
+  border-radius: 0.9375em;
+  background-color: #FFFFFF;
+  -webkit-transition: -webkit-transform .3s;
+  transition: -webkit-transform .3s;
+  transition: transform .3s;
+  transition: transform .3s, -webkit-transform .3s;
+  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
+  -webkit-transition: -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
+  transition: -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
+  transition: transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
+  transition: transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35), -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
+}
+.fund_switch:checked {
+  border-color: #04BE02;
+  background-color: #04BE02; border-radius: 0.9375em;
+}
+.fund_switch:checked:before { border-radius: 0.9375em;
+  -webkit-transform: scale(0);
+          transform: scale(0);
+}
+.fund_switch:checked:after { border-radius: 0.9375em;
+  -webkit-transform: translateX(1.25em);
+          transform: translateX(1.25em);
+}    
+          
+
+/**************************/
+.fund_cell_select {
+  padding: 0;
+}
+.fund_cell_select .weui_select {
+  padding-right: 1.875em;
+}
+.fund_cell_select .weui_cell_bd:after {
+  content: " ";
+  display: inline-block;
+  -webkit-transform: rotate(45deg);
+          transform: rotate(45deg);
+  height: 6px;
+  width: 6px;
+  border-width: 2px 2px 0 0;
+  border-color: #C8C8CD;
+  border-style: solid;
+  position: relative;
+  top: -2px;
+  position: absolute;
+  top: 50%;
+  right: 15px;
+  margin-top: -3px;
+}
+.fund_select {
+  -webkit-appearance: none;
+  border: 0;
+  outline: 0;
+  background-color: transparent;
+  width: 100%;
+  font-size: inherit;
+  height: 2.75em;
+  line-height: 2.75em;
+  position: relative;
+  z-index: 1;
+  padding-left: 0.9375em;
+}
+.fund_select_before {
+  padding-right: 0.9375em;
+}
+.fund_select_before .weui_select {
+  width: 6.5625em;
+  box-sizing: border-box;
+}
+/*列表*/
+.fund_row {
+  position: relative;
+}
+.fund_row:before {
+  content: " ";
+  position: absolute;
+  left: 0;
+  top: 0;
+  width: 100%;
+  height: 1px;
+  border-top: 1px solid #D9D9D9;
+  color: #D9D9D9;
+  -webkit-transform-origin: 0 0;
+          transform-origin: 0 0;
+  -webkit-transform: scaleY(1);
+          transform: scaleY(1);
+  left: 0.9375em;
+}
+.fund_rows .row-left-line:before {left: 0;}
+.fund_row:first-child:before {
+  display: none;
+}
+.fund_rows {
+  background-color: #FFFFFF;
+  line-height: 1.41176471;
+  font-size: 0.9375em;
+  overflow: hidden;
+  position: relative;
+}
+.fund_rows:before {
+  content: " ";
+  position: absolute;
+  left: 0;
+  top: 0;
+  width: 100%;
+  height: 1px;
+  border-top: 1px solid #D9D9D9;
+  color: #D9D9D9;
+  -webkit-transform-origin: 0 0;
+          transform-origin: 0 0;
+  -webkit-transform: scaleY(0.7);
+          transform: scaleY(0.7);
+}
+.fund_rows:after {
+  content: " ";
+  position: absolute;
+  left: 0;
+  bottom: 0;
+  width: 100%;
+  height: 1px;
+  border-bottom: 1px solid #D9D9D9;
+  color: #D9D9D9;
+  -webkit-transform-origin: 0 100%;
+          transform-origin: 0 100%;
+  -webkit-transform: scaleY(0.7);
+          transform: scaleY(0.7);
+}
+.fund_row {
+  padding: 0.625rem 0.9375rem;
+  position: relative;  
+  display: -webkit-box;
+  display: -webkit-flex;
+  display: flex;
+  -webkit-box-align: center;
+  -webkit-align-items: center;
+          align-items: center;
+}
+.fund_row .label{width:6.5625em; } 
+.fundRow_tip_bg .fund_row:not(.no_access) {
+     -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+ }
+.fundRow_tip_bg .fund_row:not(.no_access):active {
+     background-color: #ECECEC;
+}
+/*对话框*/
+.fund_dialog {
+  position: fixed;
+  z-index: 5000;
+  width: 85%;
+  top: 50%;
+  left: 50%;
+  -webkit-transform: translate(-50%, -50%);
+          transform: translate(-50%, -50%);
+  background-color: #FAFAFC;
+  text-align: center;
+  border-radius: 0.1875em;
+  overflow: hidden;
+}
+.fund_dialog_confirm .fund_dialog .fund_dialog_hd {
+  padding: 1.2em 1.25em .5em;
+}
+.fund_dialog_confirm .fund_dialog .fund_dialog_bd {
+  text-align: left;
+}
+.fund_dialog_hd {
+  padding: 1.2em 0 .5em;
+}
+.fund_dialog_title {
+  font-weight: 400;
+  font-size: 1em;
+}
+.fund_dialog_bd {
+  padding: 0 1.25em;
+  font-size: 0.9375em;
+  color: #888;
+  word-wrap: break-word;
+  word-break: break-all;
+}
+.fund_dialog_ft {
+  position: relative;
+  line-height: 2.625em;
+  margin-top: 1.25em;
+  font-size: 1.0625em;
+  display: -webkit-box;
+  display: -webkit-flex;
+  display: flex;
+}
+.fund_dialog_ft a {
+  display: block;
+  -webkit-box-flex: 1;
+  -webkit-flex: 1;
+          flex: 1;
+  color: #3CC51F;
+  text-decoration: none;
+  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+}
+.fund_dialog_ft a:active {
+  background-color: #EEEEEE;
+}
+.fund_dialog_ft:after {
+  content: " ";
+  position: absolute;
+  left: 0;
+  top: 0;
+  width: 100%;
+  height: 1px;
+  border-top: 1px solid #D5D5D6;
+  color: #D5D5D6;
+  -webkit-transform-origin: 0 0;
+          transform-origin: 0 0;
+  -webkit-transform: scaleY(0.5);
+          transform: scaleY(0.5);
+}
+.fund_dialog_confirm .fund_dialog_ft a {
+  position: relative;
+}
+.fund_dialog_confirm .fund_dialog_ft a:after {
+  content: " ";
+  position: absolute;
+  left: 0;
+  top: 0;
+  width: 1px;
+  height: 100%;
+  border-left: 1px solid #D5D5D6;
+  color: #D5D5D6;
+  -webkit-transform-origin: 0 0;
+          transform-origin: 0 0;
+  -webkit-transform: scaleX(0.5);
+          transform: scaleX(0.5);
+}
+.fund_dialog_confirm .fund_dialog_ft a:first-child:after {
+  display: none;
+}
+.fund_btn_dialog.default {
+  color: #353535;
+}
+.fund_btn_dialog.primary {
+  color: #00A1EA; /*0BB20C*/
+} 
+.fund_mask {
+  position: fixed;
+  z-index: 1000;
+  width: 100%;
+  height: 100%;
+  top:0;
+  left: 0;
+  background: rgba(0, 0, 0, 0.6);
+}
+.fund_row .fund_input {
+    width: 100%;
+    border: 0;
+    padding:0em;
+    outline: 0;
+    -webkit-appearance: none;
+    background-color: transparent;
+    font-size: inherit;
+    color: inherit;
+    margin:0px;
+    height: 1.41176471em;
+    line-height: 1.41176471;
+}
+.fund_input {
+    width: 100%;
+    border: 0;
+    padding:0em;
+    outline: 0;
+    -webkit-appearance: none;
+    background-color: transparent;
+    font-size: inherit;
+    color: inherit;
+    margin:0px;
+    height: 1.41176471em;
+    line-height: 1.41176471;
+    text-indent: .4em;
+}
+.fund_row .select {
+    width: 100%;
+    border: 0;
+    outline: 0;
+    padding:0px;
+    padding-left:1em;
+    -webkit-appearance: none;
+    background-color: transparent;
+    font-size: inherit;
+    color: inherit;
+    margin:0px;
+    height: 1.41176471em;
+    line-height: 1.41176471;
+}
+ .weui-cells {
+     margin-top: 1.17647059em;
+     background-color: #fff;
+     line-height: 1.47058824;
+     font-size: 14px;
+     overflow: hidden;
+     position: relative;
+ }
+ .weui-switch:checked, .weui-switch-cp__input:checked ~ .weui-switch-cp__box {
+     border-color: #49A5E1;
+     background-color: #49A5E1;
+ }
+ .weui-vcode-btn {
+     color: #49A5E1;
+     font-size:.9rem;
+ }

File diff suppressed because it is too large
+ 1 - 0
gjj/static/jquery-1.11.1.min.js


+ 4351 - 0
gjj/static/jsencrypt.js

@@ -0,0 +1,4351 @@
+/*! JSEncrypt v2.3.1 | https://npmcdn.com/jsencrypt@2.3.1/LICENSE.txt */
+(function (root, factory) {
+  if (typeof define === 'function' && define.amd) {
+    // AMD
+    define(['exports'], factory);
+  } else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
+    // Node, CommonJS-like
+    factory(module.exports);
+  } else {
+    factory(root);
+  }
+})(this, function (exports) {
+  // Copyright (c) 2005  Tom Wu
+// All Rights Reserved.
+// See "LICENSE" for details.
+
+// Basic JavaScript BN library - subset useful for RSA encryption.
+
+// Bits per digit
+var dbits;
+
+// JavaScript engine analysis
+var canary = 0xdeadbeefcafe;
+var j_lm = ((canary&0xffffff)==0xefcafe);
+
+// (public) Constructor
+function BigInteger(a,b,c) {
+  if(a != null)
+    if("number" == typeof a) this.fromNumber(a,b,c);
+    else if(b == null && "string" != typeof a) this.fromString(a,256);
+    else this.fromString(a,b);
+}
+
+// return new, unset BigInteger
+function nbi() { return new BigInteger(null); }
+
+// am: Compute w_j += (x*this_i), propagate carries,
+// c is initial carry, returns final carry.
+// c < 3*dvalue, x < 2*dvalue, this_i < dvalue
+// We need to select the fastest one that works in this environment.
+
+// am1: use a single mult and divide to get the high bits,
+// max digit bits should be 26 because
+// max internal value = 2*dvalue^2-2*dvalue (< 2^53)
+function am1(i,x,w,j,c,n) {
+  while(--n >= 0) {
+    var v = x*this[i++]+w[j]+c;
+    c = Math.floor(v/0x4000000);
+    w[j++] = v&0x3ffffff;
+  }
+  return c;
+}
+// am2 avoids a big mult-and-extract completely.
+// Max digit bits should be <= 30 because we do bitwise ops
+// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)
+function am2(i,x,w,j,c,n) {
+  var xl = x&0x7fff, xh = x>>15;
+  while(--n >= 0) {
+    var l = this[i]&0x7fff;
+    var h = this[i++]>>15;
+    var m = xh*l+h*xl;
+    l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);
+    c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);
+    w[j++] = l&0x3fffffff;
+  }
+  return c;
+}
+// Alternately, set max digit bits to 28 since some
+// browsers slow down when dealing with 32-bit numbers.
+function am3(i,x,w,j,c,n) {
+  var xl = x&0x3fff, xh = x>>14;
+  while(--n >= 0) {
+    var l = this[i]&0x3fff;
+    var h = this[i++]>>14;
+    var m = xh*l+h*xl;
+    l = xl*l+((m&0x3fff)<<14)+w[j]+c;
+    c = (l>>28)+(m>>14)+xh*h;
+    w[j++] = l&0xfffffff;
+  }
+  return c;
+}
+if(j_lm && (navigator.appName == "Microsoft Internet Explorer")) {
+  BigInteger.prototype.am = am2;
+  dbits = 30;
+}
+else if(j_lm && (navigator.appName != "Netscape")) {
+  BigInteger.prototype.am = am1;
+  dbits = 26;
+}
+else { // Mozilla/Netscape seems to prefer am3
+  BigInteger.prototype.am = am3;
+  dbits = 28;
+}
+
+BigInteger.prototype.DB = dbits;
+BigInteger.prototype.DM = ((1<<dbits)-1);
+BigInteger.prototype.DV = (1<<dbits);
+
+var BI_FP = 52;
+BigInteger.prototype.FV = Math.pow(2,BI_FP);
+BigInteger.prototype.F1 = BI_FP-dbits;
+BigInteger.prototype.F2 = 2*dbits-BI_FP;
+
+// Digit conversions
+var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz";
+var BI_RC = new Array();
+var rr,vv;
+rr = "0".charCodeAt(0);
+for(vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;
+rr = "a".charCodeAt(0);
+for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
+rr = "A".charCodeAt(0);
+for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
+
+function int2char(n) { return BI_RM.charAt(n); }
+function intAt(s,i) {
+  var c = BI_RC[s.charCodeAt(i)];
+  return (c==null)?-1:c;
+}
+
+// (protected) copy this to r
+function bnpCopyTo(r) {
+  for(var i = this.t-1; i >= 0; --i) r[i] = this[i];
+  r.t = this.t;
+  r.s = this.s;
+}
+
+// (protected) set from integer value x, -DV <= x < DV
+function bnpFromInt(x) {
+  this.t = 1;
+  this.s = (x<0)?-1:0;
+  if(x > 0) this[0] = x;
+  else if(x < -1) this[0] = x+this.DV;
+  else this.t = 0;
+}
+
+// return bigint initialized to value
+function nbv(i) { var r = nbi(); r.fromInt(i); return r; }
+
+// (protected) set from string and radix
+function bnpFromString(s,b) {
+  var k;
+  if(b == 16) k = 4;
+  else if(b == 8) k = 3;
+  else if(b == 256) k = 8; // byte array
+  else if(b == 2) k = 1;
+  else if(b == 32) k = 5;
+  else if(b == 4) k = 2;
+  else { this.fromRadix(s,b); return; }
+  this.t = 0;
+  this.s = 0;
+  var i = s.length, mi = false, sh = 0;
+  while(--i >= 0) {
+    var x = (k==8)?s[i]&0xff:intAt(s,i);
+    if(x < 0) {
+      if(s.charAt(i) == "-") mi = true;
+      continue;
+    }
+    mi = false;
+    if(sh == 0)
+      this[this.t++] = x;
+    else if(sh+k > this.DB) {
+      this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<<sh;
+      this[this.t++] = (x>>(this.DB-sh));
+    }
+    else
+      this[this.t-1] |= x<<sh;
+    sh += k;
+    if(sh >= this.DB) sh -= this.DB;
+  }
+  if(k == 8 && (s[0]&0x80) != 0) {
+    this.s = -1;
+    if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)<<sh;
+  }
+  this.clamp();
+  if(mi) BigInteger.ZERO.subTo(this,this);
+}
+
+// (protected) clamp off excess high words
+function bnpClamp() {
+  var c = this.s&this.DM;
+  while(this.t > 0 && this[this.t-1] == c) --this.t;
+}
+
+// (public) return string representation in given radix
+function bnToString(b) {
+  if(this.s < 0) return "-"+this.negate().toString(b);
+  var k;
+  if(b == 16) k = 4;
+  else if(b == 8) k = 3;
+  else if(b == 2) k = 1;
+  else if(b == 32) k = 5;
+  else if(b == 4) k = 2;
+  else return this.toRadix(b);
+  var km = (1<<k)-1, d, m = false, r = "", i = this.t;
+  var p = this.DB-(i*this.DB)%k;
+  if(i-- > 0) {
+    if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }
+    while(i >= 0) {
+      if(p < k) {
+        d = (this[i]&((1<<p)-1))<<(k-p);
+        d |= this[--i]>>(p+=this.DB-k);
+      }
+      else {
+        d = (this[i]>>(p-=k))&km;
+        if(p <= 0) { p += this.DB; --i; }
+      }
+      if(d > 0) m = true;
+      if(m) r += int2char(d);
+    }
+  }
+  return m?r:"0";
+}
+
+// (public) -this
+function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }
+
+// (public) |this|
+function bnAbs() { return (this.s<0)?this.negate():this; }
+
+// (public) return + if this > a, - if this < a, 0 if equal
+function bnCompareTo(a) {
+  var r = this.s-a.s;
+  if(r != 0) return r;
+  var i = this.t;
+  r = i-a.t;
+  if(r != 0) return (this.s<0)?-r:r;
+  while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;
+  return 0;
+}
+
+// returns bit length of the integer x
+function nbits(x) {
+  var r = 1, t;
+  if((t=x>>>16) != 0) { x = t; r += 16; }
+  if((t=x>>8) != 0) { x = t; r += 8; }
+  if((t=x>>4) != 0) { x = t; r += 4; }
+  if((t=x>>2) != 0) { x = t; r += 2; }
+  if((t=x>>1) != 0) { x = t; r += 1; }
+  return r;
+}
+
+// (public) return the number of bits in "this"
+function bnBitLength() {
+  if(this.t <= 0) return 0;
+  return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));
+}
+
+// (protected) r = this << n*DB
+function bnpDLShiftTo(n,r) {
+  var i;
+  for(i = this.t-1; i >= 0; --i) r[i+n] = this[i];
+  for(i = n-1; i >= 0; --i) r[i] = 0;
+  r.t = this.t+n;
+  r.s = this.s;
+}
+
+// (protected) r = this >> n*DB
+function bnpDRShiftTo(n,r) {
+  for(var i = n; i < this.t; ++i) r[i-n] = this[i];
+  r.t = Math.max(this.t-n,0);
+  r.s = this.s;
+}
+
+// (protected) r = this << n
+function bnpLShiftTo(n,r) {
+  var bs = n%this.DB;
+  var cbs = this.DB-bs;
+  var bm = (1<<cbs)-1;
+  var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;
+  for(i = this.t-1; i >= 0; --i) {
+    r[i+ds+1] = (this[i]>>cbs)|c;
+    c = (this[i]&bm)<<bs;
+  }
+  for(i = ds-1; i >= 0; --i) r[i] = 0;
+  r[ds] = c;
+  r.t = this.t+ds+1;
+  r.s = this.s;
+  r.clamp();
+}
+
+// (protected) r = this >> n
+function bnpRShiftTo(n,r) {
+  r.s = this.s;
+  var ds = Math.floor(n/this.DB);
+  if(ds >= this.t) { r.t = 0; return; }
+  var bs = n%this.DB;
+  var cbs = this.DB-bs;
+  var bm = (1<<bs)-1;
+  r[0] = this[ds]>>bs;
+  for(var i = ds+1; i < this.t; ++i) {
+    r[i-ds-1] |= (this[i]&bm)<<cbs;
+    r[i-ds] = this[i]>>bs;
+  }
+  if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;
+  r.t = this.t-ds;
+  r.clamp();
+}
+
+// (protected) r = this - a
+function bnpSubTo(a,r) {
+  var i = 0, c = 0, m = Math.min(a.t,this.t);
+  while(i < m) {
+    c += this[i]-a[i];
+    r[i++] = c&this.DM;
+    c >>= this.DB;
+  }
+  if(a.t < this.t) {
+    c -= a.s;
+    while(i < this.t) {
+      c += this[i];
+      r[i++] = c&this.DM;
+      c >>= this.DB;
+    }
+    c += this.s;
+  }
+  else {
+    c += this.s;
+    while(i < a.t) {
+      c -= a[i];
+      r[i++] = c&this.DM;
+      c >>= this.DB;
+    }
+    c -= a.s;
+  }
+  r.s = (c<0)?-1:0;
+  if(c < -1) r[i++] = this.DV+c;
+  else if(c > 0) r[i++] = c;
+  r.t = i;
+  r.clamp();
+}
+
+// (protected) r = this * a, r != this,a (HAC 14.12)
+// "this" should be the larger one if appropriate.
+function bnpMultiplyTo(a,r) {
+  var x = this.abs(), y = a.abs();
+  var i = x.t;
+  r.t = i+y.t;
+  while(--i >= 0) r[i] = 0;
+  for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t);
+  r.s = 0;
+  r.clamp();
+  if(this.s != a.s) BigInteger.ZERO.subTo(r,r);
+}
+
+// (protected) r = this^2, r != this (HAC 14.16)
+function bnpSquareTo(r) {
+  var x = this.abs();
+  var i = r.t = 2*x.t;
+  while(--i >= 0) r[i] = 0;
+  for(i = 0; i < x.t-1; ++i) {
+    var c = x.am(i,x[i],r,2*i,0,1);
+    if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {
+      r[i+x.t] -= x.DV;
+      r[i+x.t+1] = 1;
+    }
+  }
+  if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1);
+  r.s = 0;
+  r.clamp();
+}
+
+// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)
+// r != q, this != m.  q or r may be null.
+function bnpDivRemTo(m,q,r) {
+  var pm = m.abs();
+  if(pm.t <= 0) return;
+  var pt = this.abs();
+  if(pt.t < pm.t) {
+    if(q != null) q.fromInt(0);
+    if(r != null) this.copyTo(r);
+    return;
+  }
+  if(r == null) r = nbi();
+  var y = nbi(), ts = this.s, ms = m.s;
+  var nsh = this.DB-nbits(pm[pm.t-1]);	// normalize modulus
+  if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }
+  else { pm.copyTo(y); pt.copyTo(r); }
+  var ys = y.t;
+  var y0 = y[ys-1];
+  if(y0 == 0) return;
+  var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);
+  var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;
+  var i = r.t, j = i-ys, t = (q==null)?nbi():q;
+  y.dlShiftTo(j,t);
+  if(r.compareTo(t) >= 0) {
+    r[r.t++] = 1;
+    r.subTo(t,r);
+  }
+  BigInteger.ONE.dlShiftTo(ys,t);
+  t.subTo(y,y);	// "negative" y so we can replace sub with am later
+  while(y.t < ys) y[y.t++] = 0;
+  while(--j >= 0) {
+    // Estimate quotient digit
+    var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);
+    if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) {	// Try it out
+      y.dlShiftTo(j,t);
+      r.subTo(t,r);
+      while(r[i] < --qd) r.subTo(t,r);
+    }
+  }
+  if(q != null) {
+    r.drShiftTo(ys,q);
+    if(ts != ms) BigInteger.ZERO.subTo(q,q);
+  }
+  r.t = ys;
+  r.clamp();
+  if(nsh > 0) r.rShiftTo(nsh,r);	// Denormalize remainder
+  if(ts < 0) BigInteger.ZERO.subTo(r,r);
+}
+
+// (public) this mod a
+function bnMod(a) {
+  var r = nbi();
+  this.abs().divRemTo(a,null,r);
+  if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);
+  return r;
+}
+
+// Modular reduction using "classic" algorithm
+function Classic(m) { this.m = m; }
+function cConvert(x) {
+  if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);
+  else return x;
+}
+function cRevert(x) { return x; }
+function cReduce(x) { x.divRemTo(this.m,null,x); }
+function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
+function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
+
+Classic.prototype.convert = cConvert;
+Classic.prototype.revert = cRevert;
+Classic.prototype.reduce = cReduce;
+Classic.prototype.mulTo = cMulTo;
+Classic.prototype.sqrTo = cSqrTo;
+
+// (protected) return "-1/this % 2^DB"; useful for Mont. reduction
+// justification:
+//         xy == 1 (mod m)
+//         xy =  1+km
+//   xy(2-xy) = (1+km)(1-km)
+// x[y(2-xy)] = 1-k^2m^2
+// x[y(2-xy)] == 1 (mod m^2)
+// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
+// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.
+// JS multiply "overflows" differently from C/C++, so care is needed here.
+function bnpInvDigit() {
+  if(this.t < 1) return 0;
+  var x = this[0];
+  if((x&1) == 0) return 0;
+  var y = x&3;		// y == 1/x mod 2^2
+  y = (y*(2-(x&0xf)*y))&0xf;	// y == 1/x mod 2^4
+  y = (y*(2-(x&0xff)*y))&0xff;	// y == 1/x mod 2^8
+  y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff;	// y == 1/x mod 2^16
+  // last step - calculate inverse mod DV directly;
+  // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints
+  y = (y*(2-x*y%this.DV))%this.DV;		// y == 1/x mod 2^dbits
+  // we really want the negative inverse, and -DV < y < DV
+  return (y>0)?this.DV-y:-y;
+}
+
+// Montgomery reduction
+function Montgomery(m) {
+  this.m = m;
+  this.mp = m.invDigit();
+  this.mpl = this.mp&0x7fff;
+  this.mph = this.mp>>15;
+  this.um = (1<<(m.DB-15))-1;
+  this.mt2 = 2*m.t;
+}
+
+// xR mod m
+function montConvert(x) {
+  var r = nbi();
+  x.abs().dlShiftTo(this.m.t,r);
+  r.divRemTo(this.m,null,r);
+  if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);
+  return r;
+}
+
+// x/R mod m
+function montRevert(x) {
+  var r = nbi();
+  x.copyTo(r);
+  this.reduce(r);
+  return r;
+}
+
+// x = x/R mod m (HAC 14.32)
+function montReduce(x) {
+  while(x.t <= this.mt2)	// pad x so am has enough room later
+    x[x.t++] = 0;
+  for(var i = 0; i < this.m.t; ++i) {
+    // faster way of calculating u0 = x[i]*mp mod DV
+    var j = x[i]&0x7fff;
+    var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;
+    // use am to combine the multiply-shift-add into one call
+    j = i+this.m.t;
+    x[j] += this.m.am(0,u0,x,i,0,this.m.t);
+    // propagate carry
+    while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }
+  }
+  x.clamp();
+  x.drShiftTo(this.m.t,x);
+  if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
+}
+
+// r = "x^2/R mod m"; x != r
+function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
+
+// r = "xy/R mod m"; x,y != r
+function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
+
+Montgomery.prototype.convert = montConvert;
+Montgomery.prototype.revert = montRevert;
+Montgomery.prototype.reduce = montReduce;
+Montgomery.prototype.mulTo = montMulTo;
+Montgomery.prototype.sqrTo = montSqrTo;
+
+// (protected) true iff this is even
+function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }
+
+// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)
+function bnpExp(e,z) {
+  if(e > 0xffffffff || e < 1) return BigInteger.ONE;
+  var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;
+  g.copyTo(r);
+  while(--i >= 0) {
+    z.sqrTo(r,r2);
+    if((e&(1<<i)) > 0) z.mulTo(r2,g,r);
+    else { var t = r; r = r2; r2 = t; }
+  }
+  return z.revert(r);
+}
+
+// (public) this^e % m, 0 <= e < 2^32
+function bnModPowInt(e,m) {
+  var z;
+  if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);
+  return this.exp(e,z);
+}
+
+// protected
+BigInteger.prototype.copyTo = bnpCopyTo;
+BigInteger.prototype.fromInt = bnpFromInt;
+BigInteger.prototype.fromString = bnpFromString;
+BigInteger.prototype.clamp = bnpClamp;
+BigInteger.prototype.dlShiftTo = bnpDLShiftTo;
+BigInteger.prototype.drShiftTo = bnpDRShiftTo;
+BigInteger.prototype.lShiftTo = bnpLShiftTo;
+BigInteger.prototype.rShiftTo = bnpRShiftTo;
+BigInteger.prototype.subTo = bnpSubTo;
+BigInteger.prototype.multiplyTo = bnpMultiplyTo;
+BigInteger.prototype.squareTo = bnpSquareTo;
+BigInteger.prototype.divRemTo = bnpDivRemTo;
+BigInteger.prototype.invDigit = bnpInvDigit;
+BigInteger.prototype.isEven = bnpIsEven;
+BigInteger.prototype.exp = bnpExp;
+
+// public
+BigInteger.prototype.toString = bnToString;
+BigInteger.prototype.negate = bnNegate;
+BigInteger.prototype.abs = bnAbs;
+BigInteger.prototype.compareTo = bnCompareTo;
+BigInteger.prototype.bitLength = bnBitLength;
+BigInteger.prototype.mod = bnMod;
+BigInteger.prototype.modPowInt = bnModPowInt;
+
+// "constants"
+BigInteger.ZERO = nbv(0);
+BigInteger.ONE = nbv(1);
+
+// Copyright (c) 2005-2009  Tom Wu
+// All Rights Reserved.
+// See "LICENSE" for details.
+
+// Extended JavaScript BN functions, required for RSA private ops.
+
+// Version 1.1: new BigInteger("0", 10) returns "proper" zero
+// Version 1.2: square() API, isProbablePrime fix
+
+// (public)
+function bnClone() { var r = nbi(); this.copyTo(r); return r; }
+
+// (public) return value as integer
+function bnIntValue() {
+  if(this.s < 0) {
+    if(this.t == 1) return this[0]-this.DV;
+    else if(this.t == 0) return -1;
+  }
+  else if(this.t == 1) return this[0];
+  else if(this.t == 0) return 0;
+  // assumes 16 < DB < 32
+  return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];
+}
+
+// (public) return value as byte
+function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }
+
+// (public) return value as short (assumes DB>=16)
+function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }
+
+// (protected) return x s.t. r^x < DV
+function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }
+
+// (public) 0 if this == 0, 1 if this > 0
+function bnSigNum() {
+  if(this.s < 0) return -1;
+  else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;
+  else return 1;
+}
+
+// (protected) convert to radix string
+function bnpToRadix(b) {
+  if(b == null) b = 10;
+  if(this.signum() == 0 || b < 2 || b > 36) return "0";
+  var cs = this.chunkSize(b);
+  var a = Math.pow(b,cs);
+  var d = nbv(a), y = nbi(), z = nbi(), r = "";
+  this.divRemTo(d,y,z);
+  while(y.signum() > 0) {
+    r = (a+z.intValue()).toString(b).substr(1) + r;
+    y.divRemTo(d,y,z);
+  }
+  return z.intValue().toString(b) + r;
+}
+
+// (protected) convert from radix string
+function bnpFromRadix(s,b) {
+  this.fromInt(0);
+  if(b == null) b = 10;
+  var cs = this.chunkSize(b);
+  var d = Math.pow(b,cs), mi = false, j = 0, w = 0;
+  for(var i = 0; i < s.length; ++i) {
+    var x = intAt(s,i);
+    if(x < 0) {
+      if(s.charAt(i) == "-" && this.signum() == 0) mi = true;
+      continue;
+    }
+    w = b*w+x;
+    if(++j >= cs) {
+      this.dMultiply(d);
+      this.dAddOffset(w,0);
+      j = 0;
+      w = 0;
+    }
+  }
+  if(j > 0) {
+    this.dMultiply(Math.pow(b,j));
+    this.dAddOffset(w,0);
+  }
+  if(mi) BigInteger.ZERO.subTo(this,this);
+}
+
+// (protected) alternate constructor
+function bnpFromNumber(a,b,c) {
+  if("number" == typeof b) {
+    // new BigInteger(int,int,RNG)
+    if(a < 2) this.fromInt(1);
+    else {
+      this.fromNumber(a,c);
+      if(!this.testBit(a-1))	// force MSB set
+        this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);
+      if(this.isEven()) this.dAddOffset(1,0); // force odd
+      while(!this.isProbablePrime(b)) {
+        this.dAddOffset(2,0);
+        if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this);
+      }
+    }
+  }
+  else {
+    // new BigInteger(int,RNG)
+    var x = new Array(), t = a&7;
+    x.length = (a>>3)+1;
+    b.nextBytes(x);
+    if(t > 0) x[0] &= ((1<<t)-1); else x[0] = 0;
+    this.fromString(x,256);
+  }
+}
+
+// (public) convert to bigendian byte array
+function bnToByteArray() {
+  var i = this.t, r = new Array();
+  r[0] = this.s;
+  var p = this.DB-(i*this.DB)%8, d, k = 0;
+  if(i-- > 0) {
+    if(p < this.DB && (d = this[i]>>p) != (this.s&this.DM)>>p)
+      r[k++] = d|(this.s<<(this.DB-p));
+    while(i >= 0) {
+      if(p < 8) {
+        d = (this[i]&((1<<p)-1))<<(8-p);
+        d |= this[--i]>>(p+=this.DB-8);
+      }
+      else {
+        d = (this[i]>>(p-=8))&0xff;
+        if(p <= 0) { p += this.DB; --i; }
+      }
+      if((d&0x80) != 0) d |= -256;
+      if(k == 0 && (this.s&0x80) != (d&0x80)) ++k;
+      if(k > 0 || d != this.s) r[k++] = d;
+    }
+  }
+  return r;
+}
+
+function bnEquals(a) { return(this.compareTo(a)==0); }
+function bnMin(a) { return(this.compareTo(a)<0)?this:a; }
+function bnMax(a) { return(this.compareTo(a)>0)?this:a; }
+
+// (protected) r = this op a (bitwise)
+function bnpBitwiseTo(a,op,r) {
+  var i, f, m = Math.min(a.t,this.t);
+  for(i = 0; i < m; ++i) r[i] = op(this[i],a[i]);
+  if(a.t < this.t) {
+    f = a.s&this.DM;
+    for(i = m; i < this.t; ++i) r[i] = op(this[i],f);
+    r.t = this.t;
+  }
+  else {
+    f = this.s&this.DM;
+    for(i = m; i < a.t; ++i) r[i] = op(f,a[i]);
+    r.t = a.t;
+  }
+  r.s = op(this.s,a.s);
+  r.clamp();
+}
+
+// (public) this & a
+function op_and(x,y) { return x&y; }
+function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; }
+
+// (public) this | a
+function op_or(x,y) { return x|y; }
+function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; }
+
+// (public) this ^ a
+function op_xor(x,y) { return x^y; }
+function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; }
+
+// (public) this & ~a
+function op_andnot(x,y) { return x&~y; }
+function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; }
+
+// (public) ~this
+function bnNot() {
+  var r = nbi();
+  for(var i = 0; i < this.t; ++i) r[i] = this.DM&~this[i];
+  r.t = this.t;
+  r.s = ~this.s;
+  return r;
+}
+
+// (public) this << n
+function bnShiftLeft(n) {
+  var r = nbi();
+  if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);
+  return r;
+}
+
+// (public) this >> n
+function bnShiftRight(n) {
+  var r = nbi();
+  if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);
+  return r;
+}
+
+// return index of lowest 1-bit in x, x < 2^31
+function lbit(x) {
+  if(x == 0) return -1;
+  var r = 0;
+  if((x&0xffff) == 0) { x >>= 16; r += 16; }
+  if((x&0xff) == 0) { x >>= 8; r += 8; }
+  if((x&0xf) == 0) { x >>= 4; r += 4; }
+  if((x&3) == 0) { x >>= 2; r += 2; }
+  if((x&1) == 0) ++r;
+  return r;
+}
+
+// (public) returns index of lowest 1-bit (or -1 if none)
+function bnGetLowestSetBit() {
+  for(var i = 0; i < this.t; ++i)
+    if(this[i] != 0) return i*this.DB+lbit(this[i]);
+  if(this.s < 0) return this.t*this.DB;
+  return -1;
+}
+
+// return number of 1 bits in x
+function cbit(x) {
+  var r = 0;
+  while(x != 0) { x &= x-1; ++r; }
+  return r;
+}
+
+// (public) return number of set bits
+function bnBitCount() {
+  var r = 0, x = this.s&this.DM;
+  for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);
+  return r;
+}
+
+// (public) true iff nth bit is set
+function bnTestBit(n) {
+  var j = Math.floor(n/this.DB);
+  if(j >= this.t) return(this.s!=0);
+  return((this[j]&(1<<(n%this.DB)))!=0);
+}
+
+// (protected) this op (1<<n)
+function bnpChangeBit(n,op) {
+  var r = BigInteger.ONE.shiftLeft(n);
+  this.bitwiseTo(r,op,r);
+  return r;
+}
+
+// (public) this | (1<<n)
+function bnSetBit(n) { return this.changeBit(n,op_or); }
+
+// (public) this & ~(1<<n)
+function bnClearBit(n) { return this.changeBit(n,op_andnot); }
+
+// (public) this ^ (1<<n)
+function bnFlipBit(n) { return this.changeBit(n,op_xor); }
+
+// (protected) r = this + a
+function bnpAddTo(a,r) {
+  var i = 0, c = 0, m = Math.min(a.t,this.t);
+  while(i < m) {
+    c += this[i]+a[i];
+    r[i++] = c&this.DM;
+    c >>= this.DB;
+  }
+  if(a.t < this.t) {
+    c += a.s;
+    while(i < this.t) {
+      c += this[i];
+      r[i++] = c&this.DM;
+      c >>= this.DB;
+    }
+    c += this.s;
+  }
+  else {
+    c += this.s;
+    while(i < a.t) {
+      c += a[i];
+      r[i++] = c&this.DM;
+      c >>= this.DB;
+    }
+    c += a.s;
+  }
+  r.s = (c<0)?-1:0;
+  if(c > 0) r[i++] = c;
+  else if(c < -1) r[i++] = this.DV+c;
+  r.t = i;
+  r.clamp();
+}
+
+// (public) this + a
+function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }
+
+// (public) this - a
+function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; }
+
+// (public) this * a
+function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; }
+
+// (public) this^2
+function bnSquare() { var r = nbi(); this.squareTo(r); return r; }
+
+// (public) this / a
+function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }
+
+// (public) this % a
+function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; }
+
+// (public) [this/a,this%a]
+function bnDivideAndRemainder(a) {
+  var q = nbi(), r = nbi();
+  this.divRemTo(a,q,r);
+  return new Array(q,r);
+}
+
+// (protected) this *= n, this >= 0, 1 < n < DV
+function bnpDMultiply(n) {
+  this[this.t] = this.am(0,n-1,this,0,0,this.t);
+  ++this.t;
+  this.clamp();
+}
+
+// (protected) this += n << w words, this >= 0
+function bnpDAddOffset(n,w) {
+  if(n == 0) return;
+  while(this.t <= w) this[this.t++] = 0;
+  this[w] += n;
+  while(this[w] >= this.DV) {
+    this[w] -= this.DV;
+    if(++w >= this.t) this[this.t++] = 0;
+    ++this[w];
+  }
+}
+
+// A "null" reducer
+function NullExp() {}
+function nNop(x) { return x; }
+function nMulTo(x,y,r) { x.multiplyTo(y,r); }
+function nSqrTo(x,r) { x.squareTo(r); }
+
+NullExp.prototype.convert = nNop;
+NullExp.prototype.revert = nNop;
+NullExp.prototype.mulTo = nMulTo;
+NullExp.prototype.sqrTo = nSqrTo;
+
+// (public) this^e
+function bnPow(e) { return this.exp(e,new NullExp()); }
+
+// (protected) r = lower n words of "this * a", a.t <= n
+// "this" should be the larger one if appropriate.
+function bnpMultiplyLowerTo(a,n,r) {
+  var i = Math.min(this.t+a.t,n);
+  r.s = 0; // assumes a,this >= 0
+  r.t = i;
+  while(i > 0) r[--i] = 0;
+  var j;
+  for(j = r.t-this.t; i < j; ++i) r[i+this.t] = this.am(0,a[i],r,i,0,this.t);
+  for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a[i],r,i,0,n-i);
+  r.clamp();
+}
+
+// (protected) r = "this * a" without lower n words, n > 0
+// "this" should be the larger one if appropriate.
+function bnpMultiplyUpperTo(a,n,r) {
+  --n;
+  var i = r.t = this.t+a.t-n;
+  r.s = 0; // assumes a,this >= 0
+  while(--i >= 0) r[i] = 0;
+  for(i = Math.max(n-this.t,0); i < a.t; ++i)
+    r[this.t+i-n] = this.am(n-i,a[i],r,0,0,this.t+i-n);
+  r.clamp();
+  r.drShiftTo(1,r);
+}
+
+// Barrett modular reduction
+function Barrett(m) {
+  // setup Barrett
+  this.r2 = nbi();
+  this.q3 = nbi();
+  BigInteger.ONE.dlShiftTo(2*m.t,this.r2);
+  this.mu = this.r2.divide(m);
+  this.m = m;
+}
+
+function barrettConvert(x) {
+  if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m);
+  else if(x.compareTo(this.m) < 0) return x;
+  else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; }
+}
+
+function barrettRevert(x) { return x; }
+
+// x = x mod m (HAC 14.42)
+function barrettReduce(x) {
+  x.drShiftTo(this.m.t-1,this.r2);
+  if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); }
+  this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);
+  this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);
+  while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1);
+  x.subTo(this.r2,x);
+  while(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
+}
+
+// r = x^2 mod m; x != r
+function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
+
+// r = x*y mod m; x,y != r
+function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
+
+Barrett.prototype.convert = barrettConvert;
+Barrett.prototype.revert = barrettRevert;
+Barrett.prototype.reduce = barrettReduce;
+Barrett.prototype.mulTo = barrettMulTo;
+Barrett.prototype.sqrTo = barrettSqrTo;
+
+// (public) this^e % m (HAC 14.85)
+function bnModPow(e,m) {
+  var i = e.bitLength(), k, r = nbv(1), z;
+  if(i <= 0) return r;
+  else if(i < 18) k = 1;
+  else if(i < 48) k = 3;
+  else if(i < 144) k = 4;
+  else if(i < 768) k = 5;
+  else k = 6;
+  if(i < 8)
+    z = new Classic(m);
+  else if(m.isEven())
+    z = new Barrett(m);
+  else
+    z = new Montgomery(m);
+
+  // precomputation
+  var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;
+  g[1] = z.convert(this);
+  if(k > 1) {
+    var g2 = nbi();
+    z.sqrTo(g[1],g2);
+    while(n <= km) {
+      g[n] = nbi();
+      z.mulTo(g2,g[n-2],g[n]);
+      n += 2;
+    }
+  }
+
+  var j = e.t-1, w, is1 = true, r2 = nbi(), t;
+  i = nbits(e[j])-1;
+  while(j >= 0) {
+    if(i >= k1) w = (e[j]>>(i-k1))&km;
+    else {
+      w = (e[j]&((1<<(i+1))-1))<<(k1-i);
+      if(j > 0) w |= e[j-1]>>(this.DB+i-k1);
+    }
+
+    n = k;
+    while((w&1) == 0) { w >>= 1; --n; }
+    if((i -= n) < 0) { i += this.DB; --j; }
+    if(is1) {	// ret == 1, don't bother squaring or multiplying it
+      g[w].copyTo(r);
+      is1 = false;
+    }
+    else {
+      while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }
+      if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }
+      z.mulTo(r2,g[w],r);
+    }
+
+    while(j >= 0 && (e[j]&(1<<i)) == 0) {
+      z.sqrTo(r,r2); t = r; r = r2; r2 = t;
+      if(--i < 0) { i = this.DB-1; --j; }
+    }
+  }
+  return z.revert(r);
+}
+
+// (public) gcd(this,a) (HAC 14.54)
+function bnGCD(a) {
+  var x = (this.s<0)?this.negate():this.clone();
+  var y = (a.s<0)?a.negate():a.clone();
+  if(x.compareTo(y) < 0) { var t = x; x = y; y = t; }
+  var i = x.getLowestSetBit(), g = y.getLowestSetBit();
+  if(g < 0) return x;
+  if(i < g) g = i;
+  if(g > 0) {
+    x.rShiftTo(g,x);
+    y.rShiftTo(g,y);
+  }
+  while(x.signum() > 0) {
+    if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);
+    if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);
+    if(x.compareTo(y) >= 0) {
+      x.subTo(y,x);
+      x.rShiftTo(1,x);
+    }
+    else {
+      y.subTo(x,y);
+      y.rShiftTo(1,y);
+    }
+  }
+  if(g > 0) y.lShiftTo(g,y);
+  return y;
+}
+
+// (protected) this % n, n < 2^26
+function bnpModInt(n) {
+  if(n <= 0) return 0;
+  var d = this.DV%n, r = (this.s<0)?n-1:0;
+  if(this.t > 0)
+    if(d == 0) r = this[0]%n;
+    else for(var i = this.t-1; i >= 0; --i) r = (d*r+this[i])%n;
+  return r;
+}
+
+// (public) 1/this % m (HAC 14.61)
+function bnModInverse(m) {
+  var ac = m.isEven();
+  if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;
+  var u = m.clone(), v = this.clone();
+  var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);
+  while(u.signum() != 0) {
+    while(u.isEven()) {
+      u.rShiftTo(1,u);
+      if(ac) {
+        if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); }
+        a.rShiftTo(1,a);
+      }
+      else if(!b.isEven()) b.subTo(m,b);
+      b.rShiftTo(1,b);
+    }
+    while(v.isEven()) {
+      v.rShiftTo(1,v);
+      if(ac) {
+        if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); }
+        c.rShiftTo(1,c);
+      }
+      else if(!d.isEven()) d.subTo(m,d);
+      d.rShiftTo(1,d);
+    }
+    if(u.compareTo(v) >= 0) {
+      u.subTo(v,u);
+      if(ac) a.subTo(c,a);
+      b.subTo(d,b);
+    }
+    else {
+      v.subTo(u,v);
+      if(ac) c.subTo(a,c);
+      d.subTo(b,d);
+    }
+  }
+  if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;
+  if(d.compareTo(m) >= 0) return d.subtract(m);
+  if(d.signum() < 0) d.addTo(m,d); else return d;
+  if(d.signum() < 0) return d.add(m); else return d;
+}
+
+var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];
+var lplim = (1<<26)/lowprimes[lowprimes.length-1];
+
+// (public) test primality with certainty >= 1-.5^t
+function bnIsProbablePrime(t) {
+  var i, x = this.abs();
+  if(x.t == 1 && x[0] <= lowprimes[lowprimes.length-1]) {
+    for(i = 0; i < lowprimes.length; ++i)
+      if(x[0] == lowprimes[i]) return true;
+    return false;
+  }
+  if(x.isEven()) return false;
+  i = 1;
+  while(i < lowprimes.length) {
+    var m = lowprimes[i], j = i+1;
+    while(j < lowprimes.length && m < lplim) m *= lowprimes[j++];
+    m = x.modInt(m);
+    while(i < j) if(m%lowprimes[i++] == 0) return false;
+  }
+  return x.millerRabin(t);
+}
+
+// (protected) true if probably prime (HAC 4.24, Miller-Rabin)
+function bnpMillerRabin(t) {
+  var n1 = this.subtract(BigInteger.ONE);
+  var k = n1.getLowestSetBit();
+  if(k <= 0) return false;
+  var r = n1.shiftRight(k);
+  t = (t+1)>>1;
+  if(t > lowprimes.length) t = lowprimes.length;
+  var a = nbi();
+  for(var i = 0; i < t; ++i) {
+    //Pick bases at random, instead of starting at 2
+    a.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);
+    var y = a.modPow(r,this);
+    if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {
+      var j = 1;
+      while(j++ < k && y.compareTo(n1) != 0) {
+        y = y.modPowInt(2,this);
+        if(y.compareTo(BigInteger.ONE) == 0) return false;
+      }
+      if(y.compareTo(n1) != 0) return false;
+    }
+  }
+  return true;
+}
+
+// protected
+BigInteger.prototype.chunkSize = bnpChunkSize;
+BigInteger.prototype.toRadix = bnpToRadix;
+BigInteger.prototype.fromRadix = bnpFromRadix;
+BigInteger.prototype.fromNumber = bnpFromNumber;
+BigInteger.prototype.bitwiseTo = bnpBitwiseTo;
+BigInteger.prototype.changeBit = bnpChangeBit;
+BigInteger.prototype.addTo = bnpAddTo;
+BigInteger.prototype.dMultiply = bnpDMultiply;
+BigInteger.prototype.dAddOffset = bnpDAddOffset;
+BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo;
+BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo;
+BigInteger.prototype.modInt = bnpModInt;
+BigInteger.prototype.millerRabin = bnpMillerRabin;
+
+// public
+BigInteger.prototype.clone = bnClone;
+BigInteger.prototype.intValue = bnIntValue;
+BigInteger.prototype.byteValue = bnByteValue;
+BigInteger.prototype.shortValue = bnShortValue;
+BigInteger.prototype.signum = bnSigNum;
+BigInteger.prototype.toByteArray = bnToByteArray;
+BigInteger.prototype.equals = bnEquals;
+BigInteger.prototype.min = bnMin;
+BigInteger.prototype.max = bnMax;
+BigInteger.prototype.and = bnAnd;
+BigInteger.prototype.or = bnOr;
+BigInteger.prototype.xor = bnXor;
+BigInteger.prototype.andNot = bnAndNot;
+BigInteger.prototype.not = bnNot;
+BigInteger.prototype.shiftLeft = bnShiftLeft;
+BigInteger.prototype.shiftRight = bnShiftRight;
+BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit;
+BigInteger.prototype.bitCount = bnBitCount;
+BigInteger.prototype.testBit = bnTestBit;
+BigInteger.prototype.setBit = bnSetBit;
+BigInteger.prototype.clearBit = bnClearBit;
+BigInteger.prototype.flipBit = bnFlipBit;
+BigInteger.prototype.add = bnAdd;
+BigInteger.prototype.subtract = bnSubtract;
+BigInteger.prototype.multiply = bnMultiply;
+BigInteger.prototype.divide = bnDivide;
+BigInteger.prototype.remainder = bnRemainder;
+BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder;
+BigInteger.prototype.modPow = bnModPow;
+BigInteger.prototype.modInverse = bnModInverse;
+BigInteger.prototype.pow = bnPow;
+BigInteger.prototype.gcd = bnGCD;
+BigInteger.prototype.isProbablePrime = bnIsProbablePrime;
+
+// JSBN-specific extension
+BigInteger.prototype.square = bnSquare;
+
+// BigInteger interfaces not implemented in jsbn:
+
+// BigInteger(int signum, byte[] magnitude)
+// double doubleValue()
+// float floatValue()
+// int hashCode()
+// long longValue()
+// static BigInteger valueOf(long val)
+
+// prng4.js - uses Arcfour as a PRNG
+
+function Arcfour() {
+  this.i = 0;
+  this.j = 0;
+  this.S = new Array();
+}
+
+// Initialize arcfour context from key, an array of ints, each from [0..255]
+function ARC4init(key) {
+  var i, j, t;
+  for(i = 0; i < 256; ++i)
+    this.S[i] = i;
+  j = 0;
+  for(i = 0; i < 256; ++i) {
+    j = (j + this.S[i] + key[i % key.length]) & 255;
+    t = this.S[i];
+    this.S[i] = this.S[j];
+    this.S[j] = t;
+  }
+  this.i = 0;
+  this.j = 0;
+}
+
+function ARC4next() {
+  var t;
+  this.i = (this.i + 1) & 255;
+  this.j = (this.j + this.S[this.i]) & 255;
+  t = this.S[this.i];
+  this.S[this.i] = this.S[this.j];
+  this.S[this.j] = t;
+  return this.S[(t + this.S[this.i]) & 255];
+}
+
+Arcfour.prototype.init = ARC4init;
+Arcfour.prototype.next = ARC4next;
+
+// Plug in your RNG constructor here
+function prng_newstate() {
+  return new Arcfour();
+}
+
+// Pool size must be a multiple of 4 and greater than 32.
+// An array of bytes the size of the pool will be passed to init()
+var rng_psize = 256;
+
+// Random number generator - requires a PRNG backend, e.g. prng4.js
+var rng_state;
+var rng_pool;
+var rng_pptr;
+
+// Initialize the pool with junk if needed.
+if(rng_pool == null) {
+  rng_pool = new Array();
+  rng_pptr = 0;
+  var t;
+  if(window.crypto && window.crypto.getRandomValues) {
+    // Extract entropy (2048 bits) from RNG if available
+    var z = new Uint32Array(256);
+    window.crypto.getRandomValues(z);
+    for (t = 0; t < z.length; ++t)
+      rng_pool[rng_pptr++] = z[t] & 255;
+  }
+
+  // Use mouse events for entropy, if we do not have enough entropy by the time
+  // we need it, entropy will be generated by Math.random.
+  var onMouseMoveListener = function(ev) {
+    this.count = this.count || 0;
+    if (this.count >= 256 || rng_pptr >= rng_psize) {
+      if (window.removeEventListener)
+        window.removeEventListener("mousemove", onMouseMoveListener, false);
+      else if (window.detachEvent)
+        window.detachEvent("onmousemove", onMouseMoveListener);
+      return;
+    }
+    try {
+      var mouseCoordinates = ev.x + ev.y;
+      rng_pool[rng_pptr++] = mouseCoordinates & 255;
+      this.count += 1;
+    } catch (e) {
+      // Sometimes Firefox will deny permission to access event properties for some reason. Ignore.
+    }
+  };
+  if (window.addEventListener)
+    window.addEventListener("mousemove", onMouseMoveListener, false);
+  else if (window.attachEvent)
+    window.attachEvent("onmousemove", onMouseMoveListener);
+
+}
+
+function rng_get_byte() {
+  if(rng_state == null) {
+    rng_state = prng_newstate();
+    // At this point, we may not have collected enough entropy.  If not, fall back to Math.random
+    while (rng_pptr < rng_psize) {
+      var random = Math.floor(65536 * Math.random());
+      rng_pool[rng_pptr++] = random & 255;
+    }
+    rng_state.init(rng_pool);
+    for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)
+      rng_pool[rng_pptr] = 0;
+    rng_pptr = 0;
+  }
+  // TODO: allow reseeding after first request
+  return rng_state.next();
+}
+
+function rng_get_bytes(ba) {
+  var i;
+  for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte();
+}
+
+function SecureRandom() {}
+
+SecureRandom.prototype.nextBytes = rng_get_bytes;
+
+// Depends on jsbn.js and rng.js
+
+// Version 1.1: support utf-8 encoding in pkcs1pad2
+
+// convert a (hex) string to a bignum object
+function parseBigInt(str,r) {
+  return new BigInteger(str,r);
+}
+
+function linebrk(s,n) {
+  var ret = "";
+  var i = 0;
+  while(i + n < s.length) {
+    ret += s.substring(i,i+n) + "\n";
+    i += n;
+  }
+  return ret + s.substring(i,s.length);
+}
+
+function byte2Hex(b) {
+  if(b < 0x10)
+    return "0" + b.toString(16);
+  else
+    return b.toString(16);
+}
+
+// PKCS#1 (type 2, random) pad input string s to n bytes, and return a bigint
+function pkcs1pad2(s,n) {
+  if(n < s.length + 11) { // TODO: fix for utf-8
+    console.error("Message too long for RSA");
+    return null;
+  }
+  var ba = new Array();
+  var i = s.length - 1;
+  while(i >= 0 && n > 0) {
+    var c = s.charCodeAt(i--);
+    if(c < 128) { // encode using utf-8
+      ba[--n] = c;
+    }
+    else if((c > 127) && (c < 2048)) {
+      ba[--n] = (c & 63) | 128;
+      ba[--n] = (c >> 6) | 192;
+    }
+    else {
+      ba[--n] = (c & 63) | 128;
+      ba[--n] = ((c >> 6) & 63) | 128;
+      ba[--n] = (c >> 12) | 224;
+    }
+  }
+  ba[--n] = 0;
+  var rng = new SecureRandom();
+  var x = new Array();
+  while(n > 2) { // random non-zero pad
+    x[0] = 0;
+    while(x[0] == 0) rng.nextBytes(x);
+    ba[--n] = x[0];
+  }
+  ba[--n] = 2;
+  ba[--n] = 0;
+  return new BigInteger(ba);
+}
+
+// "empty" RSA key constructor
+function RSAKey() {
+  this.n = null;
+  this.e = 0;
+  this.d = null;
+  this.p = null;
+  this.q = null;
+  this.dmp1 = null;
+  this.dmq1 = null;
+  this.coeff = null;
+}
+
+// Set the public key fields N and e from hex strings
+function RSASetPublic(N,E) {
+  if(N != null && E != null && N.length > 0 && E.length > 0) {
+    this.n = parseBigInt(N,16);
+    this.e = parseInt(E,16);
+  }
+  else
+    console.error("Invalid RSA public key");
+}
+
+// Perform raw public operation on "x": return x^e (mod n)
+function RSADoPublic(x) {
+  return x.modPowInt(this.e, this.n);
+}
+
+// Return the PKCS#1 RSA encryption of "text" as an even-length hex string
+function RSAEncrypt(text) {
+  var m = pkcs1pad2(text,(this.n.bitLength()+7)>>3);
+  if(m == null) return null;
+  var c = this.doPublic(m);
+  if(c == null) return null;
+  var h = c.toString(16);
+  if((h.length & 1) == 0) return h; else return "0" + h;
+}
+
+// Return the PKCS#1 RSA encryption of "text" as a Base64-encoded string
+//function RSAEncryptB64(text) {
+//  var h = this.encrypt(text);
+//  if(h) return hex2b64(h); else return null;
+//}
+
+// protected
+RSAKey.prototype.doPublic = RSADoPublic;
+
+// public
+RSAKey.prototype.setPublic = RSASetPublic;
+RSAKey.prototype.encrypt = RSAEncrypt;
+//RSAKey.prototype.encrypt_b64 = RSAEncryptB64;
+
+// Depends on rsa.js and jsbn2.js
+
+// Version 1.1: support utf-8 decoding in pkcs1unpad2
+
+// Undo PKCS#1 (type 2, random) padding and, if valid, return the plaintext
+function pkcs1unpad2(d,n) {
+  var b = d.toByteArray();
+  var i = 0;
+  while(i < b.length && b[i] == 0) ++i;
+  if(b.length-i != n-1 || b[i] != 2)
+    return null;
+  ++i;
+  while(b[i] != 0)
+    if(++i >= b.length) return null;
+  var ret = "";
+  while(++i < b.length) {
+    var c = b[i] & 255;
+    if(c < 128) { // utf-8 decode
+      ret += String.fromCharCode(c);
+    }
+    else if((c > 191) && (c < 224)) {
+      ret += String.fromCharCode(((c & 31) << 6) | (b[i+1] & 63));
+      ++i;
+    }
+    else {
+      ret += String.fromCharCode(((c & 15) << 12) | ((b[i+1] & 63) << 6) | (b[i+2] & 63));
+      i += 2;
+    }
+  }
+  return ret;
+}
+
+// Set the private key fields N, e, and d from hex strings
+function RSASetPrivate(N,E,D) {
+  if(N != null && E != null && N.length > 0 && E.length > 0) {
+    this.n = parseBigInt(N,16);
+    this.e = parseInt(E,16);
+    this.d = parseBigInt(D,16);
+  }
+  else
+    console.error("Invalid RSA private key");
+}
+
+// Set the private key fields N, e, d and CRT params from hex strings
+function RSASetPrivateEx(N,E,D,P,Q,DP,DQ,C) {
+  if(N != null && E != null && N.length > 0 && E.length > 0) {
+    this.n = parseBigInt(N,16);
+    this.e = parseInt(E,16);
+    this.d = parseBigInt(D,16);
+    this.p = parseBigInt(P,16);
+    this.q = parseBigInt(Q,16);
+    this.dmp1 = parseBigInt(DP,16);
+    this.dmq1 = parseBigInt(DQ,16);
+    this.coeff = parseBigInt(C,16);
+  }
+  else
+    console.error("Invalid RSA private key");
+}
+
+// Generate a new random private key B bits long, using public expt E
+function RSAGenerate(B,E) {
+  var rng = new SecureRandom();
+  var qs = B>>1;
+  this.e = parseInt(E,16);
+  var ee = new BigInteger(E,16);
+  for(;;) {
+    for(;;) {
+      this.p = new BigInteger(B-qs,1,rng);
+      if(this.p.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) == 0 && this.p.isProbablePrime(10)) break;
+    }
+    for(;;) {
+      this.q = new BigInteger(qs,1,rng);
+      if(this.q.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) == 0 && this.q.isProbablePrime(10)) break;
+    }
+    if(this.p.compareTo(this.q) <= 0) {
+      var t = this.p;
+      this.p = this.q;
+      this.q = t;
+    }
+    var p1 = this.p.subtract(BigInteger.ONE);
+    var q1 = this.q.subtract(BigInteger.ONE);
+    var phi = p1.multiply(q1);
+    if(phi.gcd(ee).compareTo(BigInteger.ONE) == 0) {
+      this.n = this.p.multiply(this.q);
+      this.d = ee.modInverse(phi);
+      this.dmp1 = this.d.mod(p1);
+      this.dmq1 = this.d.mod(q1);
+      this.coeff = this.q.modInverse(this.p);
+      break;
+    }
+  }
+}
+
+// Perform raw private operation on "x": return x^d (mod n)
+function RSADoPrivate(x) {
+  if(this.p == null || this.q == null)
+    return x.modPow(this.d, this.n);
+
+  // TODO: re-calculate any missing CRT params
+  var xp = x.mod(this.p).modPow(this.dmp1, this.p);
+  var xq = x.mod(this.q).modPow(this.dmq1, this.q);
+
+  while(xp.compareTo(xq) < 0)
+    xp = xp.add(this.p);
+  return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);
+}
+
+// Return the PKCS#1 RSA decryption of "ctext".
+// "ctext" is an even-length hex string and the output is a plain string.
+function RSADecrypt(ctext) {
+  var c = parseBigInt(ctext, 16);
+  var m = this.doPrivate(c);
+  if(m == null) return null;
+  return pkcs1unpad2(m, (this.n.bitLength()+7)>>3);
+}
+
+// Return the PKCS#1 RSA decryption of "ctext".
+// "ctext" is a Base64-encoded string and the output is a plain string.
+//function RSAB64Decrypt(ctext) {
+//  var h = b64tohex(ctext);
+//  if(h) return this.decrypt(h); else return null;
+//}
+
+// protected
+RSAKey.prototype.doPrivate = RSADoPrivate;
+
+// public
+RSAKey.prototype.setPrivate = RSASetPrivate;
+RSAKey.prototype.setPrivateEx = RSASetPrivateEx;
+RSAKey.prototype.generate = RSAGenerate;
+RSAKey.prototype.decrypt = RSADecrypt;
+//RSAKey.prototype.b64_decrypt = RSAB64Decrypt;
+
+// Copyright (c) 2011  Kevin M Burns Jr.
+// All Rights Reserved.
+// See "LICENSE" for details.
+//
+// Extension to jsbn which adds facilities for asynchronous RSA key generation
+// Primarily created to avoid execution timeout on mobile devices
+//
+// http://www-cs-students.stanford.edu/~tjw/jsbn/
+//
+// ---
+
+(function(){
+
+// Generate a new random private key B bits long, using public expt E
+var RSAGenerateAsync = function (B, E, callback) {
+    //var rng = new SeededRandom();
+    var rng = new SecureRandom();
+    var qs = B >> 1;
+    this.e = parseInt(E, 16);
+    var ee = new BigInteger(E, 16);
+    var rsa = this;
+    // These functions have non-descript names because they were originally for(;;) loops.
+    // I don't know about cryptography to give them better names than loop1-4.
+    var loop1 = function() {
+        var loop4 = function() {
+            if (rsa.p.compareTo(rsa.q) <= 0) {
+                var t = rsa.p;
+                rsa.p = rsa.q;
+                rsa.q = t;
+            }
+            var p1 = rsa.p.subtract(BigInteger.ONE);
+            var q1 = rsa.q.subtract(BigInteger.ONE);
+            var phi = p1.multiply(q1);
+            if (phi.gcd(ee).compareTo(BigInteger.ONE) == 0) {
+                rsa.n = rsa.p.multiply(rsa.q);
+                rsa.d = ee.modInverse(phi);
+                rsa.dmp1 = rsa.d.mod(p1);
+                rsa.dmq1 = rsa.d.mod(q1);
+                rsa.coeff = rsa.q.modInverse(rsa.p);
+                setTimeout(function(){callback()},0); // escape
+            } else {
+                setTimeout(loop1,0);
+            }
+        };
+        var loop3 = function() {
+            rsa.q = nbi();
+            rsa.q.fromNumberAsync(qs, 1, rng, function(){
+                rsa.q.subtract(BigInteger.ONE).gcda(ee, function(r){
+                    if (r.compareTo(BigInteger.ONE) == 0 && rsa.q.isProbablePrime(10)) {
+                        setTimeout(loop4,0);
+                    } else {
+                        setTimeout(loop3,0);
+                    }
+                });
+            });
+        };
+        var loop2 = function() {
+            rsa.p = nbi();
+            rsa.p.fromNumberAsync(B - qs, 1, rng, function(){
+                rsa.p.subtract(BigInteger.ONE).gcda(ee, function(r){
+                    if (r.compareTo(BigInteger.ONE) == 0 && rsa.p.isProbablePrime(10)) {
+                        setTimeout(loop3,0);
+                    } else {
+                        setTimeout(loop2,0);
+                    }
+                });
+            });
+        };
+        setTimeout(loop2,0);
+    };
+    setTimeout(loop1,0);
+};
+RSAKey.prototype.generateAsync = RSAGenerateAsync;
+
+// Public API method
+var bnGCDAsync = function (a, callback) {
+    var x = (this.s < 0) ? this.negate() : this.clone();
+    var y = (a.s < 0) ? a.negate() : a.clone();
+    if (x.compareTo(y) < 0) {
+        var t = x;
+        x = y;
+        y = t;
+    }
+    var i = x.getLowestSetBit(),
+        g = y.getLowestSetBit();
+    if (g < 0) {
+        callback(x);
+        return;
+    }
+    if (i < g) g = i;
+    if (g > 0) {
+        x.rShiftTo(g, x);
+        y.rShiftTo(g, y);
+    }
+    // Workhorse of the algorithm, gets called 200 - 800 times per 512 bit keygen.
+    var gcda1 = function() {
+        if ((i = x.getLowestSetBit()) > 0){ x.rShiftTo(i, x); }
+        if ((i = y.getLowestSetBit()) > 0){ y.rShiftTo(i, y); }
+        if (x.compareTo(y) >= 0) {
+            x.subTo(y, x);
+            x.rShiftTo(1, x);
+        } else {
+            y.subTo(x, y);
+            y.rShiftTo(1, y);
+        }
+        if(!(x.signum() > 0)) {
+            if (g > 0) y.lShiftTo(g, y);
+            setTimeout(function(){callback(y)},0); // escape
+        } else {
+            setTimeout(gcda1,0);
+        }
+    };
+    setTimeout(gcda1,10);
+};
+BigInteger.prototype.gcda = bnGCDAsync;
+
+// (protected) alternate constructor
+var bnpFromNumberAsync = function (a,b,c,callback) {
+  if("number" == typeof b) {
+    if(a < 2) {
+        this.fromInt(1);
+    } else {
+      this.fromNumber(a,c);
+      if(!this.testBit(a-1)){
+        this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);
+      }
+      if(this.isEven()) {
+        this.dAddOffset(1,0);
+      }
+      var bnp = this;
+      var bnpfn1 = function(){
+        bnp.dAddOffset(2,0);
+        if(bnp.bitLength() > a) bnp.subTo(BigInteger.ONE.shiftLeft(a-1),bnp);
+        if(bnp.isProbablePrime(b)) {
+            setTimeout(function(){callback()},0); // escape
+        } else {
+            setTimeout(bnpfn1,0);
+        }
+      };
+      setTimeout(bnpfn1,0);
+    }
+  } else {
+    var x = new Array(), t = a&7;
+    x.length = (a>>3)+1;
+    b.nextBytes(x);
+    if(t > 0) x[0] &= ((1<<t)-1); else x[0] = 0;
+    this.fromString(x,256);
+  }
+};
+BigInteger.prototype.fromNumberAsync = bnpFromNumberAsync;
+
+})();
+var b64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+var b64pad="=";
+
+function hex2b64(h) {
+  var i;
+  var c;
+  var ret = "";
+  for(i = 0; i+3 <= h.length; i+=3) {
+    c = parseInt(h.substring(i,i+3),16);
+    ret += b64map.charAt(c >> 6) + b64map.charAt(c & 63);
+  }
+  if(i+1 == h.length) {
+    c = parseInt(h.substring(i,i+1),16);
+    ret += b64map.charAt(c << 2);
+  }
+  else if(i+2 == h.length) {
+    c = parseInt(h.substring(i,i+2),16);
+    ret += b64map.charAt(c >> 2) + b64map.charAt((c & 3) << 4);
+  }
+  while((ret.length & 3) > 0) ret += b64pad;
+  return ret;
+}
+
+// convert a base64 string to hex
+function b64tohex(s) {
+  var ret = ""
+  var i;
+  var k = 0; // b64 state, 0-3
+  var slop;
+  for(i = 0; i < s.length; ++i) {
+    if(s.charAt(i) == b64pad) break;
+    v = b64map.indexOf(s.charAt(i));
+    if(v < 0) continue;
+    if(k == 0) {
+      ret += int2char(v >> 2);
+      slop = v & 3;
+      k = 1;
+    }
+    else if(k == 1) {
+      ret += int2char((slop << 2) | (v >> 4));
+      slop = v & 0xf;
+      k = 2;
+    }
+    else if(k == 2) {
+      ret += int2char(slop);
+      ret += int2char(v >> 2);
+      slop = v & 3;
+      k = 3;
+    }
+    else {
+      ret += int2char((slop << 2) | (v >> 4));
+      ret += int2char(v & 0xf);
+      k = 0;
+    }
+  }
+  if(k == 1)
+    ret += int2char(slop << 2);
+  return ret;
+}
+
+// convert a base64 string to a byte/number array
+function b64toBA(s) {
+  //piggyback on b64tohex for now, optimize later
+  var h = b64tohex(s);
+  var i;
+  var a = new Array();
+  for(i = 0; 2*i < h.length; ++i) {
+    a[i] = parseInt(h.substring(2*i,2*i+2),16);
+  }
+  return a;
+}
+
+/*! asn1-1.0.2.js (c) 2013 Kenji Urushima | kjur.github.com/jsrsasign/license
+ */
+
+var JSX = JSX || {};
+JSX.env = JSX.env || {};
+
+var L = JSX, OP = Object.prototype, FUNCTION_TOSTRING = '[object Function]',ADD = ["toString", "valueOf"];
+
+JSX.env.parseUA = function(agent) {
+
+    var numberify = function(s) {
+        var c = 0;
+        return parseFloat(s.replace(/\./g, function() {
+            return (c++ == 1) ? '' : '.';
+        }));
+    },
+
+    nav = navigator,
+    o = {
+        ie: 0,
+        opera: 0,
+        gecko: 0,
+        webkit: 0,
+        chrome: 0,
+        mobile: null,
+        air: 0,
+        ipad: 0,
+        iphone: 0,
+        ipod: 0,
+        ios: null,
+        android: 0,
+        webos: 0,
+        caja: nav && nav.cajaVersion,
+        secure: false,
+        os: null
+
+    },
+
+    ua = agent || (navigator && navigator.userAgent),
+    loc = window && window.location,
+    href = loc && loc.href,
+    m;
+
+    o.secure = href && (href.toLowerCase().indexOf("https") === 0);
+
+    if (ua) {
+
+        if ((/windows|win32/i).test(ua)) {
+            o.os = 'windows';
+        } else if ((/macintosh/i).test(ua)) {
+            o.os = 'macintosh';
+        } else if ((/rhino/i).test(ua)) {
+            o.os = 'rhino';
+        }
+        if ((/KHTML/).test(ua)) {
+            o.webkit = 1;
+        }
+        m = ua.match(/AppleWebKit\/([^\s]*)/);
+        if (m && m[1]) {
+            o.webkit = numberify(m[1]);
+            if (/ Mobile\//.test(ua)) {
+                o.mobile = 'Apple'; // iPhone or iPod Touch
+                m = ua.match(/OS ([^\s]*)/);
+                if (m && m[1]) {
+                    m = numberify(m[1].replace('_', '.'));
+                }
+                o.ios = m;
+                o.ipad = o.ipod = o.iphone = 0;
+                m = ua.match(/iPad|iPod|iPhone/);
+                if (m && m[0]) {
+                    o[m[0].toLowerCase()] = o.ios;
+                }
+            } else {
+                m = ua.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/);
+                if (m) {
+                    o.mobile = m[0];
+                }
+                if (/webOS/.test(ua)) {
+                    o.mobile = 'WebOS';
+                    m = ua.match(/webOS\/([^\s]*);/);
+                    if (m && m[1]) {
+                        o.webos = numberify(m[1]);
+                    }
+                }
+                if (/ Android/.test(ua)) {
+                    o.mobile = 'Android';
+                    m = ua.match(/Android ([^\s]*);/);
+                    if (m && m[1]) {
+                        o.android = numberify(m[1]);
+                    }
+                }
+            }
+            m = ua.match(/Chrome\/([^\s]*)/);
+            if (m && m[1]) {
+                o.chrome = numberify(m[1]); // Chrome
+            } else {
+                m = ua.match(/AdobeAIR\/([^\s]*)/);
+                if (m) {
+                    o.air = m[0]; // Adobe AIR 1.0 or better
+                }
+            }
+        }
+        if (!o.webkit) {
+            m = ua.match(/Opera[\s\/]([^\s]*)/);
+            if (m && m[1]) {
+                o.opera = numberify(m[1]);
+                m = ua.match(/Version\/([^\s]*)/);
+                if (m && m[1]) {
+                    o.opera = numberify(m[1]); // opera 10+
+                }
+                m = ua.match(/Opera Mini[^;]*/);
+                if (m) {
+                    o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316
+                }
+            } else { // not opera or webkit
+                m = ua.match(/MSIE\s([^;]*)/);
+                if (m && m[1]) {
+                    o.ie = numberify(m[1]);
+                } else { // not opera, webkit, or ie
+                    m = ua.match(/Gecko\/([^\s]*)/);
+                    if (m) {
+                        o.gecko = 1; // Gecko detected, look for revision
+                        m = ua.match(/rv:([^\s\)]*)/);
+                        if (m && m[1]) {
+                            o.gecko = numberify(m[1]);
+                        }
+                    }
+                }
+            }
+        }
+    }
+    return o;
+};
+
+JSX.env.ua = JSX.env.parseUA();
+
+JSX.isFunction = function(o) {
+    return (typeof o === 'function') || OP.toString.apply(o) === FUNCTION_TOSTRING;
+};
+
+JSX._IEEnumFix = (JSX.env.ua.ie) ? function(r, s) {
+    var i, fname, f;
+    for (i=0;i<ADD.length;i=i+1) {
+
+        fname = ADD[i];
+        f = s[fname];
+
+        if (L.isFunction(f) && f!=OP[fname]) {
+            r[fname]=f;
+        }
+    }
+} : function(){};
+
+JSX.extend = function(subc, superc, overrides) {
+    if (!superc||!subc) {
+        throw new Error("extend failed, please check that " +
+                        "all dependencies are included.");
+    }
+    var F = function() {}, i;
+    F.prototype=superc.prototype;
+    subc.prototype=new F();
+    subc.prototype.constructor=subc;
+    subc.superclass=superc.prototype;
+    if (superc.prototype.constructor == OP.constructor) {
+        superc.prototype.constructor=superc;
+    }
+
+    if (overrides) {
+        for (i in overrides) {
+            if (L.hasOwnProperty(overrides, i)) {
+                subc.prototype[i]=overrides[i];
+            }
+        }
+
+        L._IEEnumFix(subc.prototype, overrides);
+    }
+};
+
+/*
+ * asn1.js - ASN.1 DER encoder classes
+ *
+ * Copyright (c) 2013 Kenji Urushima (kenji.urushima@gmail.com)
+ *
+ * This software is licensed under the terms of the MIT License.
+ * http://kjur.github.com/jsrsasign/license
+ *
+ * The above copyright and license notice shall be 
+ * included in all copies or substantial portions of the Software.
+ */
+
+/**
+ * @fileOverview
+ * @name asn1-1.0.js
+ * @author Kenji Urushima kenji.urushima@gmail.com
+ * @version 1.0.2 (2013-May-30)
+ * @since 2.1
+ * @license <a href="http://kjur.github.io/jsrsasign/license/">MIT License</a>
+ */
+
+/** 
+ * kjur's class library name space
+ * <p>
+ * This name space provides following name spaces:
+ * <ul>
+ * <li>{@link KJUR.asn1} - ASN.1 primitive hexadecimal encoder</li>
+ * <li>{@link KJUR.asn1.x509} - ASN.1 structure for X.509 certificate and CRL</li>
+ * <li>{@link KJUR.crypto} - Java Cryptographic Extension(JCE) style MessageDigest/Signature 
+ * class and utilities</li>
+ * </ul>
+ * </p> 
+ * NOTE: Please ignore method summary and document of this namespace. This caused by a bug of jsdoc2.
+  * @name KJUR
+ * @namespace kjur's class library name space
+ */
+if (typeof KJUR == "undefined" || !KJUR) KJUR = {};
+
+/**
+ * kjur's ASN.1 class library name space
+ * <p>
+ * This is ITU-T X.690 ASN.1 DER encoder class library and
+ * class structure and methods is very similar to 
+ * org.bouncycastle.asn1 package of 
+ * well known BouncyCaslte Cryptography Library.
+ *
+ * <h4>PROVIDING ASN.1 PRIMITIVES</h4>
+ * Here are ASN.1 DER primitive classes.
+ * <ul>
+ * <li>{@link KJUR.asn1.DERBoolean}</li>
+ * <li>{@link KJUR.asn1.DERInteger}</li>
+ * <li>{@link KJUR.asn1.DERBitString}</li>
+ * <li>{@link KJUR.asn1.DEROctetString}</li>
+ * <li>{@link KJUR.asn1.DERNull}</li>
+ * <li>{@link KJUR.asn1.DERObjectIdentifier}</li>
+ * <li>{@link KJUR.asn1.DERUTF8String}</li>
+ * <li>{@link KJUR.asn1.DERNumericString}</li>
+ * <li>{@link KJUR.asn1.DERPrintableString}</li>
+ * <li>{@link KJUR.asn1.DERTeletexString}</li>
+ * <li>{@link KJUR.asn1.DERIA5String}</li>
+ * <li>{@link KJUR.asn1.DERUTCTime}</li>
+ * <li>{@link KJUR.asn1.DERGeneralizedTime}</li>
+ * <li>{@link KJUR.asn1.DERSequence}</li>
+ * <li>{@link KJUR.asn1.DERSet}</li>
+ * </ul>
+ *
+ * <h4>OTHER ASN.1 CLASSES</h4>
+ * <ul>
+ * <li>{@link KJUR.asn1.ASN1Object}</li>
+ * <li>{@link KJUR.asn1.DERAbstractString}</li>
+ * <li>{@link KJUR.asn1.DERAbstractTime}</li>
+ * <li>{@link KJUR.asn1.DERAbstractStructured}</li>
+ * <li>{@link KJUR.asn1.DERTaggedObject}</li>
+ * </ul>
+ * </p>
+ * NOTE: Please ignore method summary and document of this namespace. This caused by a bug of jsdoc2.
+ * @name KJUR.asn1
+ * @namespace
+ */
+if (typeof KJUR.asn1 == "undefined" || !KJUR.asn1) KJUR.asn1 = {};
+
+/**
+ * ASN1 utilities class
+ * @name KJUR.asn1.ASN1Util
+ * @classs ASN1 utilities class
+ * @since asn1 1.0.2
+ */
+KJUR.asn1.ASN1Util = new function() {
+    this.integerToByteHex = function(i) {
+	var h = i.toString(16);
+	if ((h.length % 2) == 1) h = '0' + h;
+	return h;
+    };
+    this.bigIntToMinTwosComplementsHex = function(bigIntegerValue) {
+	var h = bigIntegerValue.toString(16);
+	if (h.substr(0, 1) != '-') {
+	    if (h.length % 2 == 1) {
+		h = '0' + h;
+	    } else {
+		if (! h.match(/^[0-7]/)) {
+		    h = '00' + h;
+		}
+	    }
+	} else {
+	    var hPos = h.substr(1);
+	    var xorLen = hPos.length;
+	    if (xorLen % 2 == 1) {
+		xorLen += 1;
+	    } else {
+		if (! h.match(/^[0-7]/)) {
+		    xorLen += 2;
+		}
+	    }
+	    var hMask = '';
+	    for (var i = 0; i < xorLen; i++) {
+		hMask += 'f';
+	    }
+	    var biMask = new BigInteger(hMask, 16);
+	    var biNeg = biMask.xor(bigIntegerValue).add(BigInteger.ONE);
+	    h = biNeg.toString(16).replace(/^-/, '');
+	}
+	return h;
+    };
+    /**
+     * get PEM string from hexadecimal data and header string
+     * @name getPEMStringFromHex
+     * @memberOf KJUR.asn1.ASN1Util
+     * @function
+     * @param {String} dataHex hexadecimal string of PEM body
+     * @param {String} pemHeader PEM header string (ex. 'RSA PRIVATE KEY')
+     * @return {String} PEM formatted string of input data
+     * @description
+     * @example
+     * var pem  = KJUR.asn1.ASN1Util.getPEMStringFromHex('616161', 'RSA PRIVATE KEY');
+     * // value of pem will be:
+     * -----BEGIN PRIVATE KEY-----
+     * YWFh
+     * -----END PRIVATE KEY-----
+     */
+    this.getPEMStringFromHex = function(dataHex, pemHeader) {
+	var dataWA = CryptoJS.enc.Hex.parse(dataHex);
+	var dataB64 = CryptoJS.enc.Base64.stringify(dataWA);
+	var pemBody = dataB64.replace(/(.{64})/g, "$1\r\n");
+        pemBody = pemBody.replace(/\r\n$/, '');
+	return "-----BEGIN " + pemHeader + "-----\r\n" + 
+               pemBody + 
+               "\r\n-----END " + pemHeader + "-----\r\n";
+    };
+};
+
+// ********************************************************************
+//  Abstract ASN.1 Classes
+// ********************************************************************
+
+// ********************************************************************
+
+/**
+ * base class for ASN.1 DER encoder object
+ * @name KJUR.asn1.ASN1Object
+ * @class base class for ASN.1 DER encoder object
+ * @property {Boolean} isModified flag whether internal data was changed
+ * @property {String} hTLV hexadecimal string of ASN.1 TLV
+ * @property {String} hT hexadecimal string of ASN.1 TLV tag(T)
+ * @property {String} hL hexadecimal string of ASN.1 TLV length(L)
+ * @property {String} hV hexadecimal string of ASN.1 TLV value(V)
+ * @description
+ */
+KJUR.asn1.ASN1Object = function() {
+    var isModified = true;
+    var hTLV = null;
+    var hT = '00'
+    var hL = '00';
+    var hV = '';
+
+    /**
+     * get hexadecimal ASN.1 TLV length(L) bytes from TLV value(V)
+     * @name getLengthHexFromValue
+     * @memberOf KJUR.asn1.ASN1Object
+     * @function
+     * @return {String} hexadecimal string of ASN.1 TLV length(L)
+     */
+    this.getLengthHexFromValue = function() {
+	if (typeof this.hV == "undefined" || this.hV == null) {
+	    throw "this.hV is null or undefined.";
+	}
+	if (this.hV.length % 2 == 1) {
+	    throw "value hex must be even length: n=" + hV.length + ",v=" + this.hV;
+	}
+	var n = this.hV.length / 2;
+	var hN = n.toString(16);
+	if (hN.length % 2 == 1) {
+	    hN = "0" + hN;
+	}
+	if (n < 128) {
+	    return hN;
+	} else {
+	    var hNlen = hN.length / 2;
+	    if (hNlen > 15) {
+		throw "ASN.1 length too long to represent by 8x: n = " + n.toString(16);
+	    }
+	    var head = 128 + hNlen;
+	    return head.toString(16) + hN;
+	}
+    };
+
+    /**
+     * get hexadecimal string of ASN.1 TLV bytes
+     * @name getEncodedHex
+     * @memberOf KJUR.asn1.ASN1Object
+     * @function
+     * @return {String} hexadecimal string of ASN.1 TLV
+     */
+    this.getEncodedHex = function() {
+	if (this.hTLV == null || this.isModified) {
+	    this.hV = this.getFreshValueHex();
+	    this.hL = this.getLengthHexFromValue();
+	    this.hTLV = this.hT + this.hL + this.hV;
+	    this.isModified = false;
+	    //console.error("first time: " + this.hTLV);
+	}
+	return this.hTLV;
+    };
+
+    /**
+     * get hexadecimal string of ASN.1 TLV value(V) bytes
+     * @name getValueHex
+     * @memberOf KJUR.asn1.ASN1Object
+     * @function
+     * @return {String} hexadecimal string of ASN.1 TLV value(V) bytes
+     */
+    this.getValueHex = function() {
+	this.getEncodedHex();
+	return this.hV;
+    }
+
+    this.getFreshValueHex = function() {
+	return '';
+    };
+};
+
+// == BEGIN DERAbstractString ================================================
+/**
+ * base class for ASN.1 DER string classes
+ * @name KJUR.asn1.DERAbstractString
+ * @class base class for ASN.1 DER string classes
+ * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
+ * @property {String} s internal string of value
+ * @extends KJUR.asn1.ASN1Object
+ * @description
+ * <br/>
+ * As for argument 'params' for constructor, you can specify one of
+ * following properties:
+ * <ul>
+ * <li>str - specify initial ASN.1 value(V) by a string</li>
+ * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
+ * </ul>
+ * NOTE: 'params' can be omitted.
+ */
+KJUR.asn1.DERAbstractString = function(params) {
+    KJUR.asn1.DERAbstractString.superclass.constructor.call(this);
+    var s = null;
+    var hV = null;
+
+    /**
+     * get string value of this string object
+     * @name getString
+     * @memberOf KJUR.asn1.DERAbstractString
+     * @function
+     * @return {String} string value of this string object
+     */
+    this.getString = function() {
+	return this.s;
+    };
+
+    /**
+     * set value by a string
+     * @name setString
+     * @memberOf KJUR.asn1.DERAbstractString
+     * @function
+     * @param {String} newS value by a string to set
+     */
+    this.setString = function(newS) {
+	this.hTLV = null;
+	this.isModified = true;
+	this.s = newS;
+	this.hV = stohex(this.s);
+    };
+
+    /**
+     * set value by a hexadecimal string
+     * @name setStringHex
+     * @memberOf KJUR.asn1.DERAbstractString
+     * @function
+     * @param {String} newHexString value by a hexadecimal string to set
+     */
+    this.setStringHex = function(newHexString) {
+	this.hTLV = null;
+	this.isModified = true;
+	this.s = null;
+	this.hV = newHexString;
+    };
+
+    this.getFreshValueHex = function() {
+	return this.hV;
+    };
+
+    if (typeof params != "undefined") {
+	if (typeof params['str'] != "undefined") {
+	    this.setString(params['str']);
+	} else if (typeof params['hex'] != "undefined") {
+	    this.setStringHex(params['hex']);
+	}
+    }
+};
+JSX.extend(KJUR.asn1.DERAbstractString, KJUR.asn1.ASN1Object);
+// == END   DERAbstractString ================================================
+
+// == BEGIN DERAbstractTime ==================================================
+/**
+ * base class for ASN.1 DER Generalized/UTCTime class
+ * @name KJUR.asn1.DERAbstractTime
+ * @class base class for ASN.1 DER Generalized/UTCTime class
+ * @param {Array} params associative array of parameters (ex. {'str': '130430235959Z'})
+ * @extends KJUR.asn1.ASN1Object
+ * @description
+ * @see KJUR.asn1.ASN1Object - superclass
+ */
+KJUR.asn1.DERAbstractTime = function(params) {
+    KJUR.asn1.DERAbstractTime.superclass.constructor.call(this);
+    var s = null;
+    var date = null;
+
+    // --- PRIVATE METHODS --------------------
+    this.localDateToUTC = function(d) {
+	utc = d.getTime() + (d.getTimezoneOffset() * 60000);
+	var utcDate = new Date(utc);
+	return utcDate;
+    };
+
+    this.formatDate = function(dateObject, type) {
+	var pad = this.zeroPadding;
+	var d = this.localDateToUTC(dateObject);
+	var year = String(d.getFullYear());
+	if (type == 'utc') year = year.substr(2, 2);
+	var month = pad(String(d.getMonth() + 1), 2);
+	var day = pad(String(d.getDate()), 2);
+	var hour = pad(String(d.getHours()), 2);
+	var min = pad(String(d.getMinutes()), 2);
+	var sec = pad(String(d.getSeconds()), 2);
+	return year + month + day + hour + min + sec + 'Z';
+    };
+
+    this.zeroPadding = function(s, len) {
+	if (s.length >= len) return s;
+	return new Array(len - s.length + 1).join('0') + s;
+    };
+
+    // --- PUBLIC METHODS --------------------
+    /**
+     * get string value of this string object
+     * @name getString
+     * @memberOf KJUR.asn1.DERAbstractTime
+     * @function
+     * @return {String} string value of this time object
+     */
+    this.getString = function() {
+	return this.s;
+    };
+
+    /**
+     * set value by a string
+     * @name setString
+     * @memberOf KJUR.asn1.DERAbstractTime
+     * @function
+     * @param {String} newS value by a string to set such like "130430235959Z"
+     */
+    this.setString = function(newS) {
+	this.hTLV = null;
+	this.isModified = true;
+	this.s = newS;
+	this.hV = stohex(this.s);
+    };
+
+    /**
+     * set value by a Date object
+     * @name setByDateValue
+     * @memberOf KJUR.asn1.DERAbstractTime
+     * @function
+     * @param {Integer} year year of date (ex. 2013)
+     * @param {Integer} month month of date between 1 and 12 (ex. 12)
+     * @param {Integer} day day of month
+     * @param {Integer} hour hours of date
+     * @param {Integer} min minutes of date
+     * @param {Integer} sec seconds of date
+     */
+    this.setByDateValue = function(year, month, day, hour, min, sec) {
+	var dateObject = new Date(Date.UTC(year, month - 1, day, hour, min, sec, 0));
+	this.setByDate(dateObject);
+    };
+
+    this.getFreshValueHex = function() {
+	return this.hV;
+    };
+};
+JSX.extend(KJUR.asn1.DERAbstractTime, KJUR.asn1.ASN1Object);
+// == END   DERAbstractTime ==================================================
+
+// == BEGIN DERAbstractStructured ============================================
+/**
+ * base class for ASN.1 DER structured class
+ * @name KJUR.asn1.DERAbstractStructured
+ * @class base class for ASN.1 DER structured class
+ * @property {Array} asn1Array internal array of ASN1Object
+ * @extends KJUR.asn1.ASN1Object
+ * @description
+ * @see KJUR.asn1.ASN1Object - superclass
+ */
+KJUR.asn1.DERAbstractStructured = function(params) {
+    KJUR.asn1.DERAbstractString.superclass.constructor.call(this);
+    var asn1Array = null;
+
+    /**
+     * set value by array of ASN1Object
+     * @name setByASN1ObjectArray
+     * @memberOf KJUR.asn1.DERAbstractStructured
+     * @function
+     * @param {array} asn1ObjectArray array of ASN1Object to set
+     */
+    this.setByASN1ObjectArray = function(asn1ObjectArray) {
+	this.hTLV = null;
+	this.isModified = true;
+	this.asn1Array = asn1ObjectArray;
+    };
+
+    /**
+     * append an ASN1Object to internal array
+     * @name appendASN1Object
+     * @memberOf KJUR.asn1.DERAbstractStructured
+     * @function
+     * @param {ASN1Object} asn1Object to add
+     */
+    this.appendASN1Object = function(asn1Object) {
+	this.hTLV = null;
+	this.isModified = true;
+	this.asn1Array.push(asn1Object);
+    };
+
+    this.asn1Array = new Array();
+    if (typeof params != "undefined") {
+	if (typeof params['array'] != "undefined") {
+	    this.asn1Array = params['array'];
+	}
+    }
+};
+JSX.extend(KJUR.asn1.DERAbstractStructured, KJUR.asn1.ASN1Object);
+
+
+// ********************************************************************
+//  ASN.1 Object Classes
+// ********************************************************************
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER Boolean
+ * @name KJUR.asn1.DERBoolean
+ * @class class for ASN.1 DER Boolean
+ * @extends KJUR.asn1.ASN1Object
+ * @description
+ * @see KJUR.asn1.ASN1Object - superclass
+ */
+KJUR.asn1.DERBoolean = function() {
+    KJUR.asn1.DERBoolean.superclass.constructor.call(this);
+    this.hT = "01";
+    this.hTLV = "0101ff";
+};
+JSX.extend(KJUR.asn1.DERBoolean, KJUR.asn1.ASN1Object);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER Integer
+ * @name KJUR.asn1.DERInteger
+ * @class class for ASN.1 DER Integer
+ * @extends KJUR.asn1.ASN1Object
+ * @description
+ * <br/>
+ * As for argument 'params' for constructor, you can specify one of
+ * following properties:
+ * <ul>
+ * <li>int - specify initial ASN.1 value(V) by integer value</li>
+ * <li>bigint - specify initial ASN.1 value(V) by BigInteger object</li>
+ * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
+ * </ul>
+ * NOTE: 'params' can be omitted.
+ */
+KJUR.asn1.DERInteger = function(params) {
+    KJUR.asn1.DERInteger.superclass.constructor.call(this);
+    this.hT = "02";
+
+    /**
+     * set value by Tom Wu's BigInteger object
+     * @name setByBigInteger
+     * @memberOf KJUR.asn1.DERInteger
+     * @function
+     * @param {BigInteger} bigIntegerValue to set
+     */
+    this.setByBigInteger = function(bigIntegerValue) {
+	this.hTLV = null;
+	this.isModified = true;
+	this.hV = KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(bigIntegerValue);
+    };
+
+    /**
+     * set value by integer value
+     * @name setByInteger
+     * @memberOf KJUR.asn1.DERInteger
+     * @function
+     * @param {Integer} integer value to set
+     */
+    this.setByInteger = function(intValue) {
+	var bi = new BigInteger(String(intValue), 10);
+	this.setByBigInteger(bi);
+    };
+
+    /**
+     * set value by integer value
+     * @name setValueHex
+     * @memberOf KJUR.asn1.DERInteger
+     * @function
+     * @param {String} hexadecimal string of integer value
+     * @description
+     * <br/>
+     * NOTE: Value shall be represented by minimum octet length of
+     * two's complement representation.
+     */
+    this.setValueHex = function(newHexString) {
+	this.hV = newHexString;
+    };
+
+    this.getFreshValueHex = function() {
+	return this.hV;
+    };
+
+    if (typeof params != "undefined") {
+	if (typeof params['bigint'] != "undefined") {
+	    this.setByBigInteger(params['bigint']);
+	} else if (typeof params['int'] != "undefined") {
+	    this.setByInteger(params['int']);
+	} else if (typeof params['hex'] != "undefined") {
+	    this.setValueHex(params['hex']);
+	}
+    }
+};
+JSX.extend(KJUR.asn1.DERInteger, KJUR.asn1.ASN1Object);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER encoded BitString primitive
+ * @name KJUR.asn1.DERBitString
+ * @class class for ASN.1 DER encoded BitString primitive
+ * @extends KJUR.asn1.ASN1Object
+ * @description 
+ * <br/>
+ * As for argument 'params' for constructor, you can specify one of
+ * following properties:
+ * <ul>
+ * <li>bin - specify binary string (ex. '10111')</li>
+ * <li>array - specify array of boolean (ex. [true,false,true,true])</li>
+ * <li>hex - specify hexadecimal string of ASN.1 value(V) including unused bits</li>
+ * </ul>
+ * NOTE: 'params' can be omitted.
+ */
+KJUR.asn1.DERBitString = function(params) {
+    KJUR.asn1.DERBitString.superclass.constructor.call(this);
+    this.hT = "03";
+
+    /**
+     * set ASN.1 value(V) by a hexadecimal string including unused bits
+     * @name setHexValueIncludingUnusedBits
+     * @memberOf KJUR.asn1.DERBitString
+     * @function
+     * @param {String} newHexStringIncludingUnusedBits
+     */
+    this.setHexValueIncludingUnusedBits = function(newHexStringIncludingUnusedBits) {
+	this.hTLV = null;
+	this.isModified = true;
+	this.hV = newHexStringIncludingUnusedBits;
+    };
+
+    /**
+     * set ASN.1 value(V) by unused bit and hexadecimal string of value
+     * @name setUnusedBitsAndHexValue
+     * @memberOf KJUR.asn1.DERBitString
+     * @function
+     * @param {Integer} unusedBits
+     * @param {String} hValue
+     */
+    this.setUnusedBitsAndHexValue = function(unusedBits, hValue) {
+	if (unusedBits < 0 || 7 < unusedBits) {
+	    throw "unused bits shall be from 0 to 7: u = " + unusedBits;
+	}
+	var hUnusedBits = "0" + unusedBits;
+	this.hTLV = null;
+	this.isModified = true;
+	this.hV = hUnusedBits + hValue;
+    };
+
+    /**
+     * set ASN.1 DER BitString by binary string
+     * @name setByBinaryString
+     * @memberOf KJUR.asn1.DERBitString
+     * @function
+     * @param {String} binaryString binary value string (i.e. '10111')
+     * @description
+     * Its unused bits will be calculated automatically by length of 
+     * 'binaryValue'. <br/>
+     * NOTE: Trailing zeros '0' will be ignored.
+     */
+    this.setByBinaryString = function(binaryString) {
+	binaryString = binaryString.replace(/0+$/, '');
+	var unusedBits = 8 - binaryString.length % 8;
+	if (unusedBits == 8) unusedBits = 0;
+	for (var i = 0; i <= unusedBits; i++) {
+	    binaryString += '0';
+	}
+	var h = '';
+	for (var i = 0; i < binaryString.length - 1; i += 8) {
+	    var b = binaryString.substr(i, 8);
+	    var x = parseInt(b, 2).toString(16);
+	    if (x.length == 1) x = '0' + x;
+	    h += x;  
+	}
+	this.hTLV = null;
+	this.isModified = true;
+	this.hV = '0' + unusedBits + h;
+    };
+
+    /**
+     * set ASN.1 TLV value(V) by an array of boolean
+     * @name setByBooleanArray
+     * @memberOf KJUR.asn1.DERBitString
+     * @function
+     * @param {array} booleanArray array of boolean (ex. [true, false, true])
+     * @description
+     * NOTE: Trailing falses will be ignored.
+     */
+    this.setByBooleanArray = function(booleanArray) {
+	var s = '';
+	for (var i = 0; i < booleanArray.length; i++) {
+	    if (booleanArray[i] == true) {
+		s += '1';
+	    } else {
+		s += '0';
+	    }
+	}
+	this.setByBinaryString(s);
+    };
+
+    /**
+     * generate an array of false with specified length
+     * @name newFalseArray
+     * @memberOf KJUR.asn1.DERBitString
+     * @function
+     * @param {Integer} nLength length of array to generate
+     * @return {array} array of boolean faluse
+     * @description
+     * This static method may be useful to initialize boolean array.
+     */
+    this.newFalseArray = function(nLength) {
+	var a = new Array(nLength);
+	for (var i = 0; i < nLength; i++) {
+	    a[i] = false;
+	}
+	return a;
+    };
+
+    this.getFreshValueHex = function() {
+	return this.hV;
+    };
+
+    if (typeof params != "undefined") {
+	if (typeof params['hex'] != "undefined") {
+	    this.setHexValueIncludingUnusedBits(params['hex']);
+	} else if (typeof params['bin'] != "undefined") {
+	    this.setByBinaryString(params['bin']);
+	} else if (typeof params['array'] != "undefined") {
+	    this.setByBooleanArray(params['array']);
+	}
+    }
+};
+JSX.extend(KJUR.asn1.DERBitString, KJUR.asn1.ASN1Object);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER OctetString
+ * @name KJUR.asn1.DEROctetString
+ * @class class for ASN.1 DER OctetString
+ * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
+ * @extends KJUR.asn1.DERAbstractString
+ * @description
+ * @see KJUR.asn1.DERAbstractString - superclass
+ */
+KJUR.asn1.DEROctetString = function(params) {
+    KJUR.asn1.DEROctetString.superclass.constructor.call(this, params);
+    this.hT = "04";
+};
+JSX.extend(KJUR.asn1.DEROctetString, KJUR.asn1.DERAbstractString);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER Null
+ * @name KJUR.asn1.DERNull
+ * @class class for ASN.1 DER Null
+ * @extends KJUR.asn1.ASN1Object
+ * @description
+ * @see KJUR.asn1.ASN1Object - superclass
+ */
+KJUR.asn1.DERNull = function() {
+    KJUR.asn1.DERNull.superclass.constructor.call(this);
+    this.hT = "05";
+    this.hTLV = "0500";
+};
+JSX.extend(KJUR.asn1.DERNull, KJUR.asn1.ASN1Object);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER ObjectIdentifier
+ * @name KJUR.asn1.DERObjectIdentifier
+ * @class class for ASN.1 DER ObjectIdentifier
+ * @param {Array} params associative array of parameters (ex. {'oid': '2.5.4.5'})
+ * @extends KJUR.asn1.ASN1Object
+ * @description
+ * <br/>
+ * As for argument 'params' for constructor, you can specify one of
+ * following properties:
+ * <ul>
+ * <li>oid - specify initial ASN.1 value(V) by a oid string (ex. 2.5.4.13)</li>
+ * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
+ * </ul>
+ * NOTE: 'params' can be omitted.
+ */
+KJUR.asn1.DERObjectIdentifier = function(params) {
+    var itox = function(i) {
+	var h = i.toString(16);
+	if (h.length == 1) h = '0' + h;
+	return h;
+    };
+    var roidtox = function(roid) {
+	var h = '';
+	var bi = new BigInteger(roid, 10);
+	var b = bi.toString(2);
+	var padLen = 7 - b.length % 7;
+	if (padLen == 7) padLen = 0;
+	var bPad = '';
+	for (var i = 0; i < padLen; i++) bPad += '0';
+	b = bPad + b;
+	for (var i = 0; i < b.length - 1; i += 7) {
+	    var b8 = b.substr(i, 7);
+	    if (i != b.length - 7) b8 = '1' + b8;
+	    h += itox(parseInt(b8, 2));
+	}
+	return h;
+    }
+
+    KJUR.asn1.DERObjectIdentifier.superclass.constructor.call(this);
+    this.hT = "06";
+
+    /**
+     * set value by a hexadecimal string
+     * @name setValueHex
+     * @memberOf KJUR.asn1.DERObjectIdentifier
+     * @function
+     * @param {String} newHexString hexadecimal value of OID bytes
+     */
+    this.setValueHex = function(newHexString) {
+	this.hTLV = null;
+	this.isModified = true;
+	this.s = null;
+	this.hV = newHexString;
+    };
+
+    /**
+     * set value by a OID string
+     * @name setValueOidString
+     * @memberOf KJUR.asn1.DERObjectIdentifier
+     * @function
+     * @param {String} oidString OID string (ex. 2.5.4.13)
+     */
+    this.setValueOidString = function(oidString) {
+	if (! oidString.match(/^[0-9.]+$/)) {
+	    throw "malformed oid string: " + oidString;
+	}
+	var h = '';
+	var a = oidString.split('.');
+	var i0 = parseInt(a[0]) * 40 + parseInt(a[1]);
+	h += itox(i0);
+	a.splice(0, 2);
+	for (var i = 0; i < a.length; i++) {
+	    h += roidtox(a[i]);
+	}
+	this.hTLV = null;
+	this.isModified = true;
+	this.s = null;
+	this.hV = h;
+    };
+
+    /**
+     * set value by a OID name
+     * @name setValueName
+     * @memberOf KJUR.asn1.DERObjectIdentifier
+     * @function
+     * @param {String} oidName OID name (ex. 'serverAuth')
+     * @since 1.0.1
+     * @description
+     * OID name shall be defined in 'KJUR.asn1.x509.OID.name2oidList'.
+     * Otherwise raise error.
+     */
+    this.setValueName = function(oidName) {
+	if (typeof KJUR.asn1.x509.OID.name2oidList[oidName] != "undefined") {
+	    var oid = KJUR.asn1.x509.OID.name2oidList[oidName];
+	    this.setValueOidString(oid);
+	} else {
+	    throw "DERObjectIdentifier oidName undefined: " + oidName;
+	}
+    };
+
+    this.getFreshValueHex = function() {
+	return this.hV;
+    };
+
+    if (typeof params != "undefined") {
+	if (typeof params['oid'] != "undefined") {
+	    this.setValueOidString(params['oid']);
+	} else if (typeof params['hex'] != "undefined") {
+	    this.setValueHex(params['hex']);
+	} else if (typeof params['name'] != "undefined") {
+	    this.setValueName(params['name']);
+	}
+    }
+};
+JSX.extend(KJUR.asn1.DERObjectIdentifier, KJUR.asn1.ASN1Object);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER UTF8String
+ * @name KJUR.asn1.DERUTF8String
+ * @class class for ASN.1 DER UTF8String
+ * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
+ * @extends KJUR.asn1.DERAbstractString
+ * @description
+ * @see KJUR.asn1.DERAbstractString - superclass
+ */
+KJUR.asn1.DERUTF8String = function(params) {
+    KJUR.asn1.DERUTF8String.superclass.constructor.call(this, params);
+    this.hT = "0c";
+};
+JSX.extend(KJUR.asn1.DERUTF8String, KJUR.asn1.DERAbstractString);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER NumericString
+ * @name KJUR.asn1.DERNumericString
+ * @class class for ASN.1 DER NumericString
+ * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
+ * @extends KJUR.asn1.DERAbstractString
+ * @description
+ * @see KJUR.asn1.DERAbstractString - superclass
+ */
+KJUR.asn1.DERNumericString = function(params) {
+    KJUR.asn1.DERNumericString.superclass.constructor.call(this, params);
+    this.hT = "12";
+};
+JSX.extend(KJUR.asn1.DERNumericString, KJUR.asn1.DERAbstractString);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER PrintableString
+ * @name KJUR.asn1.DERPrintableString
+ * @class class for ASN.1 DER PrintableString
+ * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
+ * @extends KJUR.asn1.DERAbstractString
+ * @description
+ * @see KJUR.asn1.DERAbstractString - superclass
+ */
+KJUR.asn1.DERPrintableString = function(params) {
+    KJUR.asn1.DERPrintableString.superclass.constructor.call(this, params);
+    this.hT = "13";
+};
+JSX.extend(KJUR.asn1.DERPrintableString, KJUR.asn1.DERAbstractString);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER TeletexString
+ * @name KJUR.asn1.DERTeletexString
+ * @class class for ASN.1 DER TeletexString
+ * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
+ * @extends KJUR.asn1.DERAbstractString
+ * @description
+ * @see KJUR.asn1.DERAbstractString - superclass
+ */
+KJUR.asn1.DERTeletexString = function(params) {
+    KJUR.asn1.DERTeletexString.superclass.constructor.call(this, params);
+    this.hT = "14";
+};
+JSX.extend(KJUR.asn1.DERTeletexString, KJUR.asn1.DERAbstractString);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER IA5String
+ * @name KJUR.asn1.DERIA5String
+ * @class class for ASN.1 DER IA5String
+ * @param {Array} params associative array of parameters (ex. {'str': 'aaa'})
+ * @extends KJUR.asn1.DERAbstractString
+ * @description
+ * @see KJUR.asn1.DERAbstractString - superclass
+ */
+KJUR.asn1.DERIA5String = function(params) {
+    KJUR.asn1.DERIA5String.superclass.constructor.call(this, params);
+    this.hT = "16";
+};
+JSX.extend(KJUR.asn1.DERIA5String, KJUR.asn1.DERAbstractString);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER UTCTime
+ * @name KJUR.asn1.DERUTCTime
+ * @class class for ASN.1 DER UTCTime
+ * @param {Array} params associative array of parameters (ex. {'str': '130430235959Z'})
+ * @extends KJUR.asn1.DERAbstractTime
+ * @description
+ * <br/>
+ * As for argument 'params' for constructor, you can specify one of
+ * following properties:
+ * <ul>
+ * <li>str - specify initial ASN.1 value(V) by a string (ex.'130430235959Z')</li>
+ * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
+ * <li>date - specify Date object.</li>
+ * </ul>
+ * NOTE: 'params' can be omitted.
+ * <h4>EXAMPLES</h4>
+ * @example
+ * var d1 = new KJUR.asn1.DERUTCTime();
+ * d1.setString('130430125959Z');
+ *
+ * var d2 = new KJUR.asn1.DERUTCTime({'str': '130430125959Z'});
+ *
+ * var d3 = new KJUR.asn1.DERUTCTime({'date': new Date(Date.UTC(2015, 0, 31, 0, 0, 0, 0))});
+ */
+KJUR.asn1.DERUTCTime = function(params) {
+    KJUR.asn1.DERUTCTime.superclass.constructor.call(this, params);
+    this.hT = "17";
+
+    /**
+     * set value by a Date object
+     * @name setByDate
+     * @memberOf KJUR.asn1.DERUTCTime
+     * @function
+     * @param {Date} dateObject Date object to set ASN.1 value(V)
+     */
+    this.setByDate = function(dateObject) {
+	this.hTLV = null;
+	this.isModified = true;
+	this.date = dateObject;
+	this.s = this.formatDate(this.date, 'utc');
+	this.hV = stohex(this.s);
+    };
+
+    if (typeof params != "undefined") {
+	if (typeof params['str'] != "undefined") {
+	    this.setString(params['str']);
+	} else if (typeof params['hex'] != "undefined") {
+	    this.setStringHex(params['hex']);
+	} else if (typeof params['date'] != "undefined") {
+	    this.setByDate(params['date']);
+	}
+    }
+};
+JSX.extend(KJUR.asn1.DERUTCTime, KJUR.asn1.DERAbstractTime);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER GeneralizedTime
+ * @name KJUR.asn1.DERGeneralizedTime
+ * @class class for ASN.1 DER GeneralizedTime
+ * @param {Array} params associative array of parameters (ex. {'str': '20130430235959Z'})
+ * @extends KJUR.asn1.DERAbstractTime
+ * @description
+ * <br/>
+ * As for argument 'params' for constructor, you can specify one of
+ * following properties:
+ * <ul>
+ * <li>str - specify initial ASN.1 value(V) by a string (ex.'20130430235959Z')</li>
+ * <li>hex - specify initial ASN.1 value(V) by a hexadecimal string</li>
+ * <li>date - specify Date object.</li>
+ * </ul>
+ * NOTE: 'params' can be omitted.
+ */
+KJUR.asn1.DERGeneralizedTime = function(params) {
+    KJUR.asn1.DERGeneralizedTime.superclass.constructor.call(this, params);
+    this.hT = "18";
+
+    /**
+     * set value by a Date object
+     * @name setByDate
+     * @memberOf KJUR.asn1.DERGeneralizedTime
+     * @function
+     * @param {Date} dateObject Date object to set ASN.1 value(V)
+     * @example
+     * When you specify UTC time, use 'Date.UTC' method like this:<br/>
+     * var o = new DERUTCTime();
+     * var date = new Date(Date.UTC(2015, 0, 31, 23, 59, 59, 0)); #2015JAN31 23:59:59
+     * o.setByDate(date);
+     */
+    this.setByDate = function(dateObject) {
+	this.hTLV = null;
+	this.isModified = true;
+	this.date = dateObject;
+	this.s = this.formatDate(this.date, 'gen');
+	this.hV = stohex(this.s);
+    };
+
+    if (typeof params != "undefined") {
+	if (typeof params['str'] != "undefined") {
+	    this.setString(params['str']);
+	} else if (typeof params['hex'] != "undefined") {
+	    this.setStringHex(params['hex']);
+	} else if (typeof params['date'] != "undefined") {
+	    this.setByDate(params['date']);
+	}
+    }
+};
+JSX.extend(KJUR.asn1.DERGeneralizedTime, KJUR.asn1.DERAbstractTime);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER Sequence
+ * @name KJUR.asn1.DERSequence
+ * @class class for ASN.1 DER Sequence
+ * @extends KJUR.asn1.DERAbstractStructured
+ * @description
+ * <br/>
+ * As for argument 'params' for constructor, you can specify one of
+ * following properties:
+ * <ul>
+ * <li>array - specify array of ASN1Object to set elements of content</li>
+ * </ul>
+ * NOTE: 'params' can be omitted.
+ */
+KJUR.asn1.DERSequence = function(params) {
+    KJUR.asn1.DERSequence.superclass.constructor.call(this, params);
+    this.hT = "30";
+    this.getFreshValueHex = function() {
+	var h = '';
+	for (var i = 0; i < this.asn1Array.length; i++) {
+	    var asn1Obj = this.asn1Array[i];
+	    h += asn1Obj.getEncodedHex();
+	}
+	this.hV = h;
+	return this.hV;
+    };
+};
+JSX.extend(KJUR.asn1.DERSequence, KJUR.asn1.DERAbstractStructured);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER Set
+ * @name KJUR.asn1.DERSet
+ * @class class for ASN.1 DER Set
+ * @extends KJUR.asn1.DERAbstractStructured
+ * @description
+ * <br/>
+ * As for argument 'params' for constructor, you can specify one of
+ * following properties:
+ * <ul>
+ * <li>array - specify array of ASN1Object to set elements of content</li>
+ * </ul>
+ * NOTE: 'params' can be omitted.
+ */
+KJUR.asn1.DERSet = function(params) {
+    KJUR.asn1.DERSet.superclass.constructor.call(this, params);
+    this.hT = "31";
+    this.getFreshValueHex = function() {
+	var a = new Array();
+	for (var i = 0; i < this.asn1Array.length; i++) {
+	    var asn1Obj = this.asn1Array[i];
+	    a.push(asn1Obj.getEncodedHex());
+	}
+	a.sort();
+	this.hV = a.join('');
+	return this.hV;
+    };
+};
+JSX.extend(KJUR.asn1.DERSet, KJUR.asn1.DERAbstractStructured);
+
+// ********************************************************************
+/**
+ * class for ASN.1 DER TaggedObject
+ * @name KJUR.asn1.DERTaggedObject
+ * @class class for ASN.1 DER TaggedObject
+ * @extends KJUR.asn1.ASN1Object
+ * @description
+ * <br/>
+ * Parameter 'tagNoNex' is ASN.1 tag(T) value for this object.
+ * For example, if you find '[1]' tag in a ASN.1 dump, 
+ * 'tagNoHex' will be 'a1'.
+ * <br/>
+ * As for optional argument 'params' for constructor, you can specify *ANY* of
+ * following properties:
+ * <ul>
+ * <li>explicit - specify true if this is explicit tag otherwise false 
+ *     (default is 'true').</li>
+ * <li>tag - specify tag (default is 'a0' which means [0])</li>
+ * <li>obj - specify ASN1Object which is tagged</li>
+ * </ul>
+ * @example
+ * d1 = new KJUR.asn1.DERUTF8String({'str':'a'});
+ * d2 = new KJUR.asn1.DERTaggedObject({'obj': d1});
+ * hex = d2.getEncodedHex();
+ */
+KJUR.asn1.DERTaggedObject = function(params) {
+    KJUR.asn1.DERTaggedObject.superclass.constructor.call(this);
+    this.hT = "a0";
+    this.hV = '';
+    this.isExplicit = true;
+    this.asn1Object = null;
+
+    /**
+     * set value by an ASN1Object
+     * @name setString
+     * @memberOf KJUR.asn1.DERTaggedObject
+     * @function
+     * @param {Boolean} isExplicitFlag flag for explicit/implicit tag
+     * @param {Integer} tagNoHex hexadecimal string of ASN.1 tag
+     * @param {ASN1Object} asn1Object ASN.1 to encapsulate
+     */
+    this.setASN1Object = function(isExplicitFlag, tagNoHex, asn1Object) {
+	this.hT = tagNoHex;
+	this.isExplicit = isExplicitFlag;
+	this.asn1Object = asn1Object;
+	if (this.isExplicit) {
+	    this.hV = this.asn1Object.getEncodedHex();
+	    this.hTLV = null;
+	    this.isModified = true;
+	} else {
+	    this.hV = null;
+	    this.hTLV = asn1Object.getEncodedHex();
+	    this.hTLV = this.hTLV.replace(/^../, tagNoHex);
+	    this.isModified = false;
+	}
+    };
+
+    this.getFreshValueHex = function() {
+	return this.hV;
+    };
+
+    if (typeof params != "undefined") {
+	if (typeof params['tag'] != "undefined") {
+	    this.hT = params['tag'];
+	}
+	if (typeof params['explicit'] != "undefined") {
+	    this.isExplicit = params['explicit'];
+	}
+	if (typeof params['obj'] != "undefined") {
+	    this.asn1Object = params['obj'];
+	    this.setASN1Object(this.isExplicit, this.hT, this.asn1Object);
+	}
+    }
+};
+JSX.extend(KJUR.asn1.DERTaggedObject, KJUR.asn1.ASN1Object);
+// Hex JavaScript decoder
+// Copyright (c) 2008-2013 Lapo Luchini <lapo@lapo.it>
+
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+/*jshint browser: true, strict: true, immed: true, latedef: true, undef: true, regexdash: false */
+(function (undefined) {
+"use strict";
+
+var Hex = {},
+    decoder;
+
+Hex.decode = function(a) {
+    var i;
+    if (decoder === undefined) {
+        var hex = "0123456789ABCDEF",
+            ignore = " \f\n\r\t\u00A0\u2028\u2029";
+        decoder = [];
+        for (i = 0; i < 16; ++i)
+            decoder[hex.charAt(i)] = i;
+        hex = hex.toLowerCase();
+        for (i = 10; i < 16; ++i)
+            decoder[hex.charAt(i)] = i;
+        for (i = 0; i < ignore.length; ++i)
+            decoder[ignore.charAt(i)] = -1;
+    }
+    var out = [],
+        bits = 0,
+        char_count = 0;
+    for (i = 0; i < a.length; ++i) {
+        var c = a.charAt(i);
+        if (c == '=')
+            break;
+        c = decoder[c];
+        if (c == -1)
+            continue;
+        if (c === undefined)
+            throw 'Illegal character at offset ' + i;
+        bits |= c;
+        if (++char_count >= 2) {
+            out[out.length] = bits;
+            bits = 0;
+            char_count = 0;
+        } else {
+            bits <<= 4;
+        }
+    }
+    if (char_count)
+        throw "Hex encoding incomplete: 4 bits missing";
+    return out;
+};
+
+// export globals
+window.Hex = Hex;
+})();
+// Base64 JavaScript decoder
+// Copyright (c) 2008-2013 Lapo Luchini <lapo@lapo.it>
+
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+/*jshint browser: true, strict: true, immed: true, latedef: true, undef: true, regexdash: false */
+(function (undefined) {
+"use strict";
+
+var Base64 = {},
+    decoder;
+
+Base64.decode = function (a) {
+    var i;
+    if (decoder === undefined) {
+        var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
+            ignore = "= \f\n\r\t\u00A0\u2028\u2029";
+        decoder = [];
+        for (i = 0; i < 64; ++i)
+            decoder[b64.charAt(i)] = i;
+        for (i = 0; i < ignore.length; ++i)
+            decoder[ignore.charAt(i)] = -1;
+    }
+    var out = [];
+    var bits = 0, char_count = 0;
+    for (i = 0; i < a.length; ++i) {
+        var c = a.charAt(i);
+        if (c == '=')
+            break;
+        c = decoder[c];
+        if (c == -1)
+            continue;
+        if (c === undefined)
+            throw 'Illegal character at offset ' + i;
+        bits |= c;
+        if (++char_count >= 4) {
+            out[out.length] = (bits >> 16);
+            out[out.length] = (bits >> 8) & 0xFF;
+            out[out.length] = bits & 0xFF;
+            bits = 0;
+            char_count = 0;
+        } else {
+            bits <<= 6;
+        }
+    }
+    switch (char_count) {
+      case 1:
+        throw "Base64 encoding incomplete: at least 2 bits missing";
+      case 2:
+        out[out.length] = (bits >> 10);
+        break;
+      case 3:
+        out[out.length] = (bits >> 16);
+        out[out.length] = (bits >> 8) & 0xFF;
+        break;
+    }
+    return out;
+};
+
+Base64.re = /-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/;
+Base64.unarmor = function (a) {
+    var m = Base64.re.exec(a);
+    if (m) {
+        if (m[1])
+            a = m[1];
+        else if (m[2])
+            a = m[2];
+        else
+            throw "RegExp out of sync";
+    }
+    return Base64.decode(a);
+};
+
+// export globals
+window.Base64 = Base64;
+})();
+// ASN.1 JavaScript decoder
+// Copyright (c) 2008-2013 Lapo Luchini <lapo@lapo.it>
+
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+/*jshint browser: true, strict: true, immed: true, latedef: true, undef: true, regexdash: false */
+/*global oids */
+(function (undefined) {
+"use strict";
+
+var hardLimit = 100,
+    ellipsis = "\u2026",
+    DOM = {
+        tag: function (tagName, className) {
+            var t = document.createElement(tagName);
+            t.className = className;
+            return t;
+        },
+        text: function (str) {
+            return document.createTextNode(str);
+        }
+    };
+
+function Stream(enc, pos) {
+    if (enc instanceof Stream) {
+        this.enc = enc.enc;
+        this.pos = enc.pos;
+    } else {
+        this.enc = enc;
+        this.pos = pos;
+    }
+}
+Stream.prototype.get = function (pos) {
+    if (pos === undefined)
+        pos = this.pos++;
+    if (pos >= this.enc.length)
+        throw 'Requesting byte offset ' + pos + ' on a stream of length ' + this.enc.length;
+    return this.enc[pos];
+};
+Stream.prototype.hexDigits = "0123456789ABCDEF";
+Stream.prototype.hexByte = function (b) {
+    return this.hexDigits.charAt((b >> 4) & 0xF) + this.hexDigits.charAt(b & 0xF);
+};
+Stream.prototype.hexDump = function (start, end, raw) {
+    var s = "";
+    for (var i = start; i < end; ++i) {
+        s += this.hexByte(this.get(i));
+        if (raw !== true)
+            switch (i & 0xF) {
+            case 0x7: s += "  "; break;
+            case 0xF: s += "\n"; break;
+            default:  s += " ";
+            }
+    }
+    return s;
+};
+Stream.prototype.parseStringISO = function (start, end) {
+    var s = "";
+    for (var i = start; i < end; ++i)
+        s += String.fromCharCode(this.get(i));
+    return s;
+};
+Stream.prototype.parseStringUTF = function (start, end) {
+    var s = "";
+    for (var i = start; i < end; ) {
+        var c = this.get(i++);
+        if (c < 128)
+            s += String.fromCharCode(c);
+        else if ((c > 191) && (c < 224))
+            s += String.fromCharCode(((c & 0x1F) << 6) | (this.get(i++) & 0x3F));
+        else
+            s += String.fromCharCode(((c & 0x0F) << 12) | ((this.get(i++) & 0x3F) << 6) | (this.get(i++) & 0x3F));
+    }
+    return s;
+};
+Stream.prototype.parseStringBMP = function (start, end) {
+    var str = ""
+    for (var i = start; i < end; i += 2) {
+        var high_byte = this.get(i);
+        var low_byte = this.get(i + 1);
+        str += String.fromCharCode( (high_byte << 8) + low_byte );
+    }
+
+    return str;
+};
+Stream.prototype.reTime = /^((?:1[89]|2\d)?\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;
+Stream.prototype.parseTime = function (start, end) {
+    var s = this.parseStringISO(start, end),
+        m = this.reTime.exec(s);
+    if (!m)
+        return "Unrecognized time: " + s;
+    s = m[1] + "-" + m[2] + "-" + m[3] + " " + m[4];
+    if (m[5]) {
+        s += ":" + m[5];
+        if (m[6]) {
+            s += ":" + m[6];
+            if (m[7])
+                s += "." + m[7];
+        }
+    }
+    if (m[8]) {
+        s += " UTC";
+        if (m[8] != 'Z') {
+            s += m[8];
+            if (m[9])
+                s += ":" + m[9];
+        }
+    }
+    return s;
+};
+Stream.prototype.parseInteger = function (start, end) {
+    //TODO support negative numbers
+    var len = end - start;
+    if (len > 4) {
+        len <<= 3;
+        var s = this.get(start);
+        if (s === 0)
+            len -= 8;
+        else
+            while (s < 128) {
+                s <<= 1;
+                --len;
+            }
+        return "(" + len + " bit)";
+    }
+    var n = 0;
+    for (var i = start; i < end; ++i)
+        n = (n << 8) | this.get(i);
+    return n;
+};
+Stream.prototype.parseBitString = function (start, end) {
+    var unusedBit = this.get(start),
+        lenBit = ((end - start - 1) << 3) - unusedBit,
+        s = "(" + lenBit + " bit)";
+    if (lenBit <= 20) {
+        var skip = unusedBit;
+        s += " ";
+        for (var i = end - 1; i > start; --i) {
+            var b = this.get(i);
+            for (var j = skip; j < 8; ++j)
+                s += (b >> j) & 1 ? "1" : "0";
+            skip = 0;
+        }
+    }
+    return s;
+};
+Stream.prototype.parseOctetString = function (start, end) {
+    var len = end - start,
+        s = "(" + len + " byte) ";
+    if (len > hardLimit)
+        end = start + hardLimit;
+    for (var i = start; i < end; ++i)
+        s += this.hexByte(this.get(i)); //TODO: also try Latin1?
+    if (len > hardLimit)
+        s += ellipsis;
+    return s;
+};
+Stream.prototype.parseOID = function (start, end) {
+    var s = '',
+        n = 0,
+        bits = 0;
+    for (var i = start; i < end; ++i) {
+        var v = this.get(i);
+        n = (n << 7) | (v & 0x7F);
+        bits += 7;
+        if (!(v & 0x80)) { // finished
+            if (s === '') {
+                var m = n < 80 ? n < 40 ? 0 : 1 : 2;
+                s = m + "." + (n - m * 40);
+            } else
+                s += "." + ((bits >= 31) ? "bigint" : n);
+            n = bits = 0;
+        }
+    }
+    return s;
+};
+
+function ASN1(stream, header, length, tag, sub) {
+    this.stream = stream;
+    this.header = header;
+    this.length = length;
+    this.tag = tag;
+    this.sub = sub;
+}
+ASN1.prototype.typeName = function () {
+    if (this.tag === undefined)
+        return "unknown";
+    var tagClass = this.tag >> 6,
+        tagConstructed = (this.tag >> 5) & 1,
+        tagNumber = this.tag & 0x1F;
+    switch (tagClass) {
+    case 0: // universal
+        switch (tagNumber) {
+        case 0x00: return "EOC";
+        case 0x01: return "BOOLEAN";
+        case 0x02: return "INTEGER";
+        case 0x03: return "BIT_STRING";
+        case 0x04: return "OCTET_STRING";
+        case 0x05: return "NULL";
+        case 0x06: return "OBJECT_IDENTIFIER";
+        case 0x07: return "ObjectDescriptor";
+        case 0x08: return "EXTERNAL";
+        case 0x09: return "REAL";
+        case 0x0A: return "ENUMERATED";
+        case 0x0B: return "EMBEDDED_PDV";
+        case 0x0C: return "UTF8String";
+        case 0x10: return "SEQUENCE";
+        case 0x11: return "SET";
+        case 0x12: return "NumericString";
+        case 0x13: return "PrintableString"; // ASCII subset
+        case 0x14: return "TeletexString"; // aka T61String
+        case 0x15: return "VideotexString";
+        case 0x16: return "IA5String"; // ASCII
+        case 0x17: return "UTCTime";
+        case 0x18: return "GeneralizedTime";
+        case 0x19: return "GraphicString";
+        case 0x1A: return "VisibleString"; // ASCII subset
+        case 0x1B: return "GeneralString";
+        case 0x1C: return "UniversalString";
+        case 0x1E: return "BMPString";
+        default:   return "Universal_" + tagNumber.toString(16);
+        }
+    case 1: return "Application_" + tagNumber.toString(16);
+    case 2: return "[" + tagNumber + "]"; // Context
+    case 3: return "Private_" + tagNumber.toString(16);
+    }
+};
+ASN1.prototype.reSeemsASCII = /^[ -~]+$/;
+ASN1.prototype.content = function () {
+    if (this.tag === undefined)
+        return null;
+    var tagClass = this.tag >> 6,
+        tagNumber = this.tag & 0x1F,
+        content = this.posContent(),
+        len = Math.abs(this.length);
+    if (tagClass !== 0) { // universal
+        if (this.sub !== null)
+            return "(" + this.sub.length + " elem)";
+        //TODO: TRY TO PARSE ASCII STRING
+        var s = this.stream.parseStringISO(content, content + Math.min(len, hardLimit));
+        if (this.reSeemsASCII.test(s))
+            return s.substring(0, 2 * hardLimit) + ((s.length > 2 * hardLimit) ? ellipsis : "");
+        else
+            return this.stream.parseOctetString(content, content + len);
+    }
+    switch (tagNumber) {
+    case 0x01: // BOOLEAN
+        return (this.stream.get(content) === 0) ? "false" : "true";
+    case 0x02: // INTEGER
+        return this.stream.parseInteger(content, content + len);
+    case 0x03: // BIT_STRING
+        return this.sub ? "(" + this.sub.length + " elem)" :
+            this.stream.parseBitString(content, content + len);
+    case 0x04: // OCTET_STRING
+        return this.sub ? "(" + this.sub.length + " elem)" :
+            this.stream.parseOctetString(content, content + len);
+    //case 0x05: // NULL
+    case 0x06: // OBJECT_IDENTIFIER
+        return this.stream.parseOID(content, content + len);
+    //case 0x07: // ObjectDescriptor
+    //case 0x08: // EXTERNAL
+    //case 0x09: // REAL
+    //case 0x0A: // ENUMERATED
+    //case 0x0B: // EMBEDDED_PDV
+    case 0x10: // SEQUENCE
+    case 0x11: // SET
+        return "(" + this.sub.length + " elem)";
+    case 0x0C: // UTF8String
+        return this.stream.parseStringUTF(content, content + len);
+    case 0x12: // NumericString
+    case 0x13: // PrintableString
+    case 0x14: // TeletexString
+    case 0x15: // VideotexString
+    case 0x16: // IA5String
+    //case 0x19: // GraphicString
+    case 0x1A: // VisibleString
+    //case 0x1B: // GeneralString
+    //case 0x1C: // UniversalString
+        return this.stream.parseStringISO(content, content + len);
+    case 0x1E: // BMPString
+        return this.stream.parseStringBMP(content, content + len);
+    case 0x17: // UTCTime
+    case 0x18: // GeneralizedTime
+        return this.stream.parseTime(content, content + len);
+    }
+    return null;
+};
+ASN1.prototype.toString = function () {
+    return this.typeName() + "@" + this.stream.pos + "[header:" + this.header + ",length:" + this.length + ",sub:" + ((this.sub === null) ? 'null' : this.sub.length) + "]";
+};
+ASN1.prototype.print = function (indent) {
+    if (indent === undefined) indent = '';
+    document.writeln(indent + this);
+    if (this.sub !== null) {
+        indent += '  ';
+        for (var i = 0, max = this.sub.length; i < max; ++i)
+            this.sub[i].print(indent);
+    }
+};
+ASN1.prototype.toPrettyString = function (indent) {
+    if (indent === undefined) indent = '';
+    var s = indent + this.typeName() + " @" + this.stream.pos;
+    if (this.length >= 0)
+        s += "+";
+    s += this.length;
+    if (this.tag & 0x20)
+        s += " (constructed)";
+    else if (((this.tag == 0x03) || (this.tag == 0x04)) && (this.sub !== null))
+        s += " (encapsulates)";
+    s += "\n";
+    if (this.sub !== null) {
+        indent += '  ';
+        for (var i = 0, max = this.sub.length; i < max; ++i)
+            s += this.sub[i].toPrettyString(indent);
+    }
+    return s;
+};
+ASN1.prototype.toDOM = function () {
+    var node = DOM.tag("div", "node");
+    node.asn1 = this;
+    var head = DOM.tag("div", "head");
+    var s = this.typeName().replace(/_/g, " ");
+    head.innerHTML = s;
+    var content = this.content();
+    if (content !== null) {
+        content = String(content).replace(/</g, "&lt;");
+        var preview = DOM.tag("span", "preview");
+        preview.appendChild(DOM.text(content));
+        head.appendChild(preview);
+    }
+    node.appendChild(head);
+    this.node = node;
+    this.head = head;
+    var value = DOM.tag("div", "value");
+    s = "Offset: " + this.stream.pos + "<br/>";
+    s += "Length: " + this.header + "+";
+    if (this.length >= 0)
+        s += this.length;
+    else
+        s += (-this.length) + " (undefined)";
+    if (this.tag & 0x20)
+        s += "<br/>(constructed)";
+    else if (((this.tag == 0x03) || (this.tag == 0x04)) && (this.sub !== null))
+        s += "<br/>(encapsulates)";
+    //TODO if (this.tag == 0x03) s += "Unused bits: "
+    if (content !== null) {
+        s += "<br/>Value:<br/><b>" + content + "</b>";
+        if ((typeof oids === 'object') && (this.tag == 0x06)) {
+            var oid = oids[content];
+            if (oid) {
+                if (oid.d) s += "<br/>" + oid.d;
+                if (oid.c) s += "<br/>" + oid.c;
+                if (oid.w) s += "<br/>(warning!)";
+            }
+        }
+    }
+    value.innerHTML = s;
+    node.appendChild(value);
+    var sub = DOM.tag("div", "sub");
+    if (this.sub !== null) {
+        for (var i = 0, max = this.sub.length; i < max; ++i)
+            sub.appendChild(this.sub[i].toDOM());
+    }
+    node.appendChild(sub);
+    head.onclick = function () {
+        node.className = (node.className == "node collapsed") ? "node" : "node collapsed";
+    };
+    return node;
+};
+ASN1.prototype.posStart = function () {
+    return this.stream.pos;
+};
+ASN1.prototype.posContent = function () {
+    return this.stream.pos + this.header;
+};
+ASN1.prototype.posEnd = function () {
+    return this.stream.pos + this.header + Math.abs(this.length);
+};
+ASN1.prototype.fakeHover = function (current) {
+    this.node.className += " hover";
+    if (current)
+        this.head.className += " hover";
+};
+ASN1.prototype.fakeOut = function (current) {
+    var re = / ?hover/;
+    this.node.className = this.node.className.replace(re, "");
+    if (current)
+        this.head.className = this.head.className.replace(re, "");
+};
+ASN1.prototype.toHexDOM_sub = function (node, className, stream, start, end) {
+    if (start >= end)
+        return;
+    var sub = DOM.tag("span", className);
+    sub.appendChild(DOM.text(
+        stream.hexDump(start, end)));
+    node.appendChild(sub);
+};
+ASN1.prototype.toHexDOM = function (root) {
+    var node = DOM.tag("span", "hex");
+    if (root === undefined) root = node;
+    this.head.hexNode = node;
+    this.head.onmouseover = function () { this.hexNode.className = "hexCurrent"; };
+    this.head.onmouseout  = function () { this.hexNode.className = "hex"; };
+    node.asn1 = this;
+    node.onmouseover = function () {
+        var current = !root.selected;
+        if (current) {
+            root.selected = this.asn1;
+            this.className = "hexCurrent";
+        }
+        this.asn1.fakeHover(current);
+    };
+    node.onmouseout  = function () {
+        var current = (root.selected == this.asn1);
+        this.asn1.fakeOut(current);
+        if (current) {
+            root.selected = null;
+            this.className = "hex";
+        }
+    };
+    this.toHexDOM_sub(node, "tag", this.stream, this.posStart(), this.posStart() + 1);
+    this.toHexDOM_sub(node, (this.length >= 0) ? "dlen" : "ulen", this.stream, this.posStart() + 1, this.posContent());
+    if (this.sub === null)
+        node.appendChild(DOM.text(
+            this.stream.hexDump(this.posContent(), this.posEnd())));
+    else if (this.sub.length > 0) {
+        var first = this.sub[0];
+        var last = this.sub[this.sub.length - 1];
+        this.toHexDOM_sub(node, "intro", this.stream, this.posContent(), first.posStart());
+        for (var i = 0, max = this.sub.length; i < max; ++i)
+            node.appendChild(this.sub[i].toHexDOM(root));
+        this.toHexDOM_sub(node, "outro", this.stream, last.posEnd(), this.posEnd());
+    }
+    return node;
+};
+ASN1.prototype.toHexString = function (root) {
+    return this.stream.hexDump(this.posStart(), this.posEnd(), true);
+};
+ASN1.decodeLength = function (stream) {
+    var buf = stream.get(),
+        len = buf & 0x7F;
+    if (len == buf)
+        return len;
+    if (len > 3)
+        throw "Length over 24 bits not supported at position " + (stream.pos - 1);
+    if (len === 0)
+        return -1; // undefined
+    buf = 0;
+    for (var i = 0; i < len; ++i)
+        buf = (buf << 8) | stream.get();
+    return buf;
+};
+ASN1.hasContent = function (tag, len, stream) {
+    if (tag & 0x20) // constructed
+        return true;
+    if ((tag < 0x03) || (tag > 0x04))
+        return false;
+    var p = new Stream(stream);
+    if (tag == 0x03) p.get(); // BitString unused bits, must be in [0, 7]
+    var subTag = p.get();
+    if ((subTag >> 6) & 0x01) // not (universal or context)
+        return false;
+    try {
+        var subLength = ASN1.decodeLength(p);
+        return ((p.pos - stream.pos) + subLength == len);
+    } catch (exception) {
+        return false;
+    }
+};
+ASN1.decode = function (stream) {
+    if (!(stream instanceof Stream))
+        stream = new Stream(stream, 0);
+    var streamStart = new Stream(stream),
+        tag = stream.get(),
+        len = ASN1.decodeLength(stream),
+        header = stream.pos - streamStart.pos,
+        sub = null;
+    if (ASN1.hasContent(tag, len, stream)) {
+        // it has content, so we decode it
+        var start = stream.pos;
+        if (tag == 0x03) stream.get(); // skip BitString unused bits, must be in [0, 7]
+        sub = [];
+        if (len >= 0) {
+            // definite length
+            var end = start + len;
+            while (stream.pos < end)
+                sub[sub.length] = ASN1.decode(stream);
+            if (stream.pos != end)
+                throw "Content size is not correct for container starting at offset " + start;
+        } else {
+            // undefined length
+            try {
+                for (;;) {
+                    var s = ASN1.decode(stream);
+                    if (s.tag === 0)
+                        break;
+                    sub[sub.length] = s;
+                }
+                len = start - stream.pos;
+            } catch (e) {
+                throw "Exception while decoding undefined length content: " + e;
+            }
+        }
+    } else
+        stream.pos += len; // skip content
+    return new ASN1(streamStart, header, len, tag, sub);
+};
+ASN1.test = function () {
+    var test = [
+        { value: [0x27],                   expected: 0x27     },
+        { value: [0x81, 0xC9],             expected: 0xC9     },
+        { value: [0x83, 0xFE, 0xDC, 0xBA], expected: 0xFEDCBA }
+    ];
+    for (var i = 0, max = test.length; i < max; ++i) {
+        var pos = 0,
+            stream = new Stream(test[i].value, 0),
+            res = ASN1.decodeLength(stream);
+        if (res != test[i].expected)
+            document.write("In test[" + i + "] expected " + test[i].expected + " got " + res + "\n");
+    }
+};
+
+// export globals
+window.ASN1 = ASN1;
+})();
+/**
+ * Retrieve the hexadecimal value (as a string) of the current ASN.1 element
+ * @returns {string}
+ * @public
+ */
+ASN1.prototype.getHexStringValue = function () {
+  var hexString = this.toHexString();
+  var offset = this.header * 2;
+  var length = this.length * 2;
+  return hexString.substr(offset, length);
+};
+
+/**
+ * Method to parse a pem encoded string containing both a public or private key.
+ * The method will translate the pem encoded string in a der encoded string and
+ * will parse private key and public key parameters. This method accepts public key
+ * in the rsaencryption pkcs #1 format (oid: 1.2.840.113549.1.1.1).
+ *
+ * @todo Check how many rsa formats use the same format of pkcs #1.
+ *
+ * The format is defined as:
+ * PublicKeyInfo ::= SEQUENCE {
+ *   algorithm       AlgorithmIdentifier,
+ *   PublicKey       BIT STRING
+ * }
+ * Where AlgorithmIdentifier is:
+ * AlgorithmIdentifier ::= SEQUENCE {
+ *   algorithm       OBJECT IDENTIFIER,     the OID of the enc algorithm
+ *   parameters      ANY DEFINED BY algorithm OPTIONAL (NULL for PKCS #1)
+ * }
+ * and PublicKey is a SEQUENCE encapsulated in a BIT STRING
+ * RSAPublicKey ::= SEQUENCE {
+ *   modulus           INTEGER,  -- n
+ *   publicExponent    INTEGER   -- e
+ * }
+ * it's possible to examine the structure of the keys obtained from openssl using
+ * an asn.1 dumper as the one used here to parse the components: http://lapo.it/asn1js/
+ * @argument {string} pem the pem encoded string, can include the BEGIN/END header/footer
+ * @private
+ */
+RSAKey.prototype.parseKey = function (pem) {
+  try {
+    var modulus = 0;
+    var public_exponent = 0;
+    var reHex = /^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/;
+    var der = reHex.test(pem) ? Hex.decode(pem) : Base64.unarmor(pem);
+    var asn1 = ASN1.decode(der);
+
+    //Fixes a bug with OpenSSL 1.0+ private keys
+    if(asn1.sub.length === 3){
+        asn1 = asn1.sub[2].sub[0];
+    }
+    if (asn1.sub.length === 9) {
+
+      // Parse the private key.
+      modulus = asn1.sub[1].getHexStringValue(); //bigint
+      this.n = parseBigInt(modulus, 16);
+
+      public_exponent = asn1.sub[2].getHexStringValue(); //int
+      this.e = parseInt(public_exponent, 16);
+
+      var private_exponent = asn1.sub[3].getHexStringValue(); //bigint
+      this.d = parseBigInt(private_exponent, 16);
+
+      var prime1 = asn1.sub[4].getHexStringValue(); //bigint
+      this.p = parseBigInt(prime1, 16);
+
+      var prime2 = asn1.sub[5].getHexStringValue(); //bigint
+      this.q = parseBigInt(prime2, 16);
+
+      var exponent1 = asn1.sub[6].getHexStringValue(); //bigint
+      this.dmp1 = parseBigInt(exponent1, 16);
+
+      var exponent2 = asn1.sub[7].getHexStringValue(); //bigint
+      this.dmq1 = parseBigInt(exponent2, 16);
+
+      var coefficient = asn1.sub[8].getHexStringValue(); //bigint
+      this.coeff = parseBigInt(coefficient, 16);
+
+    }
+    else if (asn1.sub.length === 2) {
+
+      // Parse the public key.
+      var bit_string = asn1.sub[1];
+      var sequence = bit_string.sub[0];
+
+      modulus = sequence.sub[0].getHexStringValue();
+      this.n = parseBigInt(modulus, 16);
+      public_exponent = sequence.sub[1].getHexStringValue();
+      this.e = parseInt(public_exponent, 16);
+
+    }
+    else {
+      return false;
+    }
+    return true;
+  }
+  catch (ex) {
+    return false;
+  }
+};
+
+/**
+ * Translate rsa parameters in a hex encoded string representing the rsa key.
+ *
+ * The translation follow the ASN.1 notation :
+ * RSAPrivateKey ::= SEQUENCE {
+ *   version           Version,
+ *   modulus           INTEGER,  -- n
+ *   publicExponent    INTEGER,  -- e
+ *   privateExponent   INTEGER,  -- d
+ *   prime1            INTEGER,  -- p
+ *   prime2            INTEGER,  -- q
+ *   exponent1         INTEGER,  -- d mod (p1)
+ *   exponent2         INTEGER,  -- d mod (q-1)
+ *   coefficient       INTEGER,  -- (inverse of q) mod p
+ * }
+ * @returns {string}  DER Encoded String representing the rsa private key
+ * @private
+ */
+RSAKey.prototype.getPrivateBaseKey = function () {
+  var options = {
+    'array': [
+      new KJUR.asn1.DERInteger({'int': 0}),
+      new KJUR.asn1.DERInteger({'bigint': this.n}),
+      new KJUR.asn1.DERInteger({'int': this.e}),
+      new KJUR.asn1.DERInteger({'bigint': this.d}),
+      new KJUR.asn1.DERInteger({'bigint': this.p}),
+      new KJUR.asn1.DERInteger({'bigint': this.q}),
+      new KJUR.asn1.DERInteger({'bigint': this.dmp1}),
+      new KJUR.asn1.DERInteger({'bigint': this.dmq1}),
+      new KJUR.asn1.DERInteger({'bigint': this.coeff})
+    ]
+  };
+  var seq = new KJUR.asn1.DERSequence(options);
+  return seq.getEncodedHex();
+};
+
+/**
+ * base64 (pem) encoded version of the DER encoded representation
+ * @returns {string} pem encoded representation without header and footer
+ * @public
+ */
+RSAKey.prototype.getPrivateBaseKeyB64 = function () {
+  return hex2b64(this.getPrivateBaseKey());
+};
+
+/**
+ * Translate rsa parameters in a hex encoded string representing the rsa public key.
+ * The representation follow the ASN.1 notation :
+ * PublicKeyInfo ::= SEQUENCE {
+ *   algorithm       AlgorithmIdentifier,
+ *   PublicKey       BIT STRING
+ * }
+ * Where AlgorithmIdentifier is:
+ * AlgorithmIdentifier ::= SEQUENCE {
+ *   algorithm       OBJECT IDENTIFIER,     the OID of the enc algorithm
+ *   parameters      ANY DEFINED BY algorithm OPTIONAL (NULL for PKCS #1)
+ * }
+ * and PublicKey is a SEQUENCE encapsulated in a BIT STRING
+ * RSAPublicKey ::= SEQUENCE {
+ *   modulus           INTEGER,  -- n
+ *   publicExponent    INTEGER   -- e
+ * }
+ * @returns {string} DER Encoded String representing the rsa public key
+ * @private
+ */
+RSAKey.prototype.getPublicBaseKey = function () {
+  var options = {
+    'array': [
+      new KJUR.asn1.DERObjectIdentifier({'oid': '1.2.840.113549.1.1.1'}), //RSA Encryption pkcs #1 oid
+      new KJUR.asn1.DERNull()
+    ]
+  };
+  var first_sequence = new KJUR.asn1.DERSequence(options);
+
+  options = {
+    'array': [
+      new KJUR.asn1.DERInteger({'bigint': this.n}),
+      new KJUR.asn1.DERInteger({'int': this.e})
+    ]
+  };
+  var second_sequence = new KJUR.asn1.DERSequence(options);
+
+  options = {
+    'hex': '00' + second_sequence.getEncodedHex()
+  };
+  var bit_string = new KJUR.asn1.DERBitString(options);
+
+  options = {
+    'array': [
+      first_sequence,
+      bit_string
+    ]
+  };
+  var seq = new KJUR.asn1.DERSequence(options);
+  return seq.getEncodedHex();
+};
+
+/**
+ * base64 (pem) encoded version of the DER encoded representation
+ * @returns {string} pem encoded representation without header and footer
+ * @public
+ */
+RSAKey.prototype.getPublicBaseKeyB64 = function () {
+  return hex2b64(this.getPublicBaseKey());
+};
+
+/**
+ * wrap the string in block of width chars. The default value for rsa keys is 64
+ * characters.
+ * @param {string} str the pem encoded string without header and footer
+ * @param {Number} [width=64] - the length the string has to be wrapped at
+ * @returns {string}
+ * @private
+ */
+RSAKey.prototype.wordwrap = function (str, width) {
+  width = width || 64;
+  if (!str) {
+    return str;
+  }
+  var regex = '(.{1,' + width + '})( +|$\n?)|(.{1,' + width + '})';
+  return str.match(RegExp(regex, 'g')).join('\n');
+};
+
+/**
+ * Retrieve the pem encoded private key
+ * @returns {string} the pem encoded private key with header/footer
+ * @public
+ */
+RSAKey.prototype.getPrivateKey = function () {
+  var key = "-----BEGIN RSA PRIVATE KEY-----\n";
+  key += this.wordwrap(this.getPrivateBaseKeyB64()) + "\n";
+  key += "-----END RSA PRIVATE KEY-----";
+  return key;
+};
+
+/**
+ * Retrieve the pem encoded public key
+ * @returns {string} the pem encoded public key with header/footer
+ * @public
+ */
+RSAKey.prototype.getPublicKey = function () {
+  var key = "-----BEGIN PUBLIC KEY-----\n";
+  key += this.wordwrap(this.getPublicBaseKeyB64()) + "\n";
+  key += "-----END PUBLIC KEY-----";
+  return key;
+};
+
+/**
+ * Check if the object contains the necessary parameters to populate the rsa modulus
+ * and public exponent parameters.
+ * @param {Object} [obj={}] - An object that may contain the two public key
+ * parameters
+ * @returns {boolean} true if the object contains both the modulus and the public exponent
+ * properties (n and e)
+ * @todo check for types of n and e. N should be a parseable bigInt object, E should
+ * be a parseable integer number
+ * @private
+ */
+RSAKey.prototype.hasPublicKeyProperty = function (obj) {
+  obj = obj || {};
+  return (
+    obj.hasOwnProperty('n') &&
+    obj.hasOwnProperty('e')
+  );
+};
+
+/**
+ * Check if the object contains ALL the parameters of an RSA key.
+ * @param {Object} [obj={}] - An object that may contain nine rsa key
+ * parameters
+ * @returns {boolean} true if the object contains all the parameters needed
+ * @todo check for types of the parameters all the parameters but the public exponent
+ * should be parseable bigint objects, the public exponent should be a parseable integer number
+ * @private
+ */
+RSAKey.prototype.hasPrivateKeyProperty = function (obj) {
+  obj = obj || {};
+  return (
+    obj.hasOwnProperty('n') &&
+    obj.hasOwnProperty('e') &&
+    obj.hasOwnProperty('d') &&
+    obj.hasOwnProperty('p') &&
+    obj.hasOwnProperty('q') &&
+    obj.hasOwnProperty('dmp1') &&
+    obj.hasOwnProperty('dmq1') &&
+    obj.hasOwnProperty('coeff')
+  );
+};
+
+/**
+ * Parse the properties of obj in the current rsa object. Obj should AT LEAST
+ * include the modulus and public exponent (n, e) parameters.
+ * @param {Object} obj - the object containing rsa parameters
+ * @private
+ */
+RSAKey.prototype.parsePropertiesFrom = function (obj) {
+  this.n = obj.n;
+  this.e = obj.e;
+
+  if (obj.hasOwnProperty('d')) {
+    this.d = obj.d;
+    this.p = obj.p;
+    this.q = obj.q;
+    this.dmp1 = obj.dmp1;
+    this.dmq1 = obj.dmq1;
+    this.coeff = obj.coeff;
+  }
+};
+
+/**
+ * Create a new JSEncryptRSAKey that extends Tom Wu's RSA key object.
+ * This object is just a decorator for parsing the key parameter
+ * @param {string|Object} key - The key in string format, or an object containing
+ * the parameters needed to build a RSAKey object.
+ * @constructor
+ */
+var JSEncryptRSAKey = function (key) {
+  // Call the super constructor.
+  RSAKey.call(this);
+  // If a key key was provided.
+  if (key) {
+    // If this is a string...
+    if (typeof key === 'string') {
+      this.parseKey(key);
+    }
+    else if (
+      this.hasPrivateKeyProperty(key) ||
+      this.hasPublicKeyProperty(key)
+    ) {
+      // Set the values for the key.
+      this.parsePropertiesFrom(key);
+    }
+  }
+};
+
+// Derive from RSAKey.
+JSEncryptRSAKey.prototype = new RSAKey();
+
+// Reset the contructor.
+JSEncryptRSAKey.prototype.constructor = JSEncryptRSAKey;
+
+
+/**
+ *
+ * @param {Object} [options = {}] - An object to customize JSEncrypt behaviour
+ * possible parameters are:
+ * - default_key_size        {number}  default: 1024 the key size in bit
+ * - default_public_exponent {string}  default: '010001' the hexadecimal representation of the public exponent
+ * - log                     {boolean} default: false whether log warn/error or not
+ * @constructor
+ */
+var JSEncrypt = function (options) {
+  options = options || {};
+  this.default_key_size = parseInt(options.default_key_size) || 1024;
+  this.default_public_exponent = options.default_public_exponent || '010001'; //65537 default openssl public exponent for rsa key type
+  this.log = options.log || false;
+  // The private and public key.
+  this.key = null;
+};
+
+/**
+ * Method to set the rsa key parameter (one method is enough to set both the public
+ * and the private key, since the private key contains the public key paramenters)
+ * Log a warning if logs are enabled
+ * @param {Object|string} key the pem encoded string or an object (with or without header/footer)
+ * @public
+ */
+JSEncrypt.prototype.setKey = function (key) {
+  if (this.log && this.key) {
+    console.warn('A key was already set, overriding existing.');
+  }
+  this.key = new JSEncryptRSAKey(key);
+};
+
+/**
+ * Proxy method for setKey, for api compatibility
+ * @see setKey
+ * @public
+ */
+JSEncrypt.prototype.setPrivateKey = function (privkey) {
+  // Create the key.
+  this.setKey(privkey);
+};
+
+/**
+ * Proxy method for setKey, for api compatibility
+ * @see setKey
+ * @public
+ */
+JSEncrypt.prototype.setPublicKey = function (pubkey) {
+  // Sets the public key.
+  this.setKey(pubkey);
+};
+
+/**
+ * Proxy method for RSAKey object's decrypt, decrypt the string using the private
+ * components of the rsa key object. Note that if the object was not set will be created
+ * on the fly (by the getKey method) using the parameters passed in the JSEncrypt constructor
+ * @param {string} string base64 encoded crypted string to decrypt
+ * @return {string} the decrypted string
+ * @public
+ */
+JSEncrypt.prototype.decrypt = function (string) {
+  // Return the decrypted string.
+  try {
+    return this.getKey().decrypt(b64tohex(string));
+  }
+  catch (ex) {
+    return false;
+  }
+};
+
+/**
+ * Proxy method for RSAKey object's encrypt, encrypt the string using the public
+ * components of the rsa key object. Note that if the object was not set will be created
+ * on the fly (by the getKey method) using the parameters passed in the JSEncrypt constructor
+ * @param {string} string the string to encrypt
+ * @return {string} the encrypted string encoded in base64
+ * @public
+ */
+JSEncrypt.prototype.encrypt = function (string) {
+  // Return the encrypted string.
+  try {
+    return hex2b64(this.getKey().encrypt(string));
+  }
+  catch (ex) {
+    return false;
+  }
+};
+
+/**
+ * Getter for the current JSEncryptRSAKey object. If it doesn't exists a new object
+ * will be created and returned
+ * @param {callback} [cb] the callback to be called if we want the key to be generated
+ * in an async fashion
+ * @returns {JSEncryptRSAKey} the JSEncryptRSAKey object
+ * @public
+ */
+JSEncrypt.prototype.getKey = function (cb) {
+  // Only create new if it does not exist.
+  if (!this.key) {
+    // Get a new private key.
+    this.key = new JSEncryptRSAKey();
+    if (cb && {}.toString.call(cb) === '[object Function]') {
+      this.key.generateAsync(this.default_key_size, this.default_public_exponent, cb);
+      return;
+    }
+    // Generate the key.
+    this.key.generate(this.default_key_size, this.default_public_exponent);
+  }
+  return this.key;
+};
+
+/**
+ * Returns the pem encoded representation of the private key
+ * If the key doesn't exists a new key will be created
+ * @returns {string} pem encoded representation of the private key WITH header and footer
+ * @public
+ */
+JSEncrypt.prototype.getPrivateKey = function () {
+  // Return the private representation of this key.
+  return this.getKey().getPrivateKey();
+};
+
+/**
+ * Returns the pem encoded representation of the private key
+ * If the key doesn't exists a new key will be created
+ * @returns {string} pem encoded representation of the private key WITHOUT header and footer
+ * @public
+ */
+JSEncrypt.prototype.getPrivateKeyB64 = function () {
+  // Return the private representation of this key.
+  return this.getKey().getPrivateBaseKeyB64();
+};
+
+
+/**
+ * Returns the pem encoded representation of the public key
+ * If the key doesn't exists a new key will be created
+ * @returns {string} pem encoded representation of the public key WITH header and footer
+ * @public
+ */
+JSEncrypt.prototype.getPublicKey = function () {
+  // Return the private representation of this key.
+  return this.getKey().getPublicKey();
+};
+
+/**
+ * Returns the pem encoded representation of the public key
+ * If the key doesn't exists a new key will be created
+ * @returns {string} pem encoded representation of the public key WITHOUT header and footer
+ * @public
+ */
+JSEncrypt.prototype.getPublicKeyB64 = function () {
+  // Return the private representation of this key.
+  return this.getKey().getPublicBaseKeyB64();
+};
+
+
+  JSEncrypt.version = '2.3.1';
+  exports.JSEncrypt = JSEncrypt;
+});

File diff suppressed because it is too large
+ 0 - 0
gjj/static/jweixin-1.4.0.js


File diff suppressed because it is too large
+ 0 - 0
gjj/static/layer.css


+ 31 - 0
gjj/static/layer.js

@@ -0,0 +1,31 @@
+function getlaymloadtwo(content){
+//var html='<i></i><i class="laymloadtwo"></i><i></i>';
+ 
+ if(!content){
+     content="数据加载中";
+ }
+var html='';
+    html+='<div style="text-align: center;margin-top:1em;margin-bottom:.4em;height:5em;"> ';
+    html+='  <div class="weui_loading">';
+    html+='   <div class="weui_loading_leaf weui_loading_leaf_0"></div>';
+    html+='   <div class="weui_loading_leaf weui_loading_leaf_1"></div>';
+    html+='   <div class="weui_loading_leaf weui_loading_leaf_2"></div>';
+    html+='   <div class="weui_loading_leaf weui_loading_leaf_3"></div>';
+    html+='   <div class="weui_loading_leaf weui_loading_leaf_4"></div>';
+    html+='   <div class="weui_loading_leaf weui_loading_leaf_5"></div>';
+    html+='   <div class="weui_loading_leaf weui_loading_leaf_6"></div>';
+    html+='   <div class="weui_loading_leaf weui_loading_leaf_7"></div>';
+    html+='   <div class="weui_loading_leaf weui_loading_leaf_8"></div>';
+    html+='   <div class="weui_loading_leaf weui_loading_leaf_9"></div>';
+    html+='   <div class="weui_loading_leaf weui_loading_leaf_10"></div>';
+    html+='   <div class="weui_loading_leaf weui_loading_leaf_11"></div>';
+    html+='  </div> ';
+    html+='</div> '; 
+    html+=content; 
+ return html;
+}
+
+;!function(a){"use strict";var b=document,c="querySelectorAll",d="getElementsByClassName",e=function(a){return b[c](a)},f={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:!0},g={extend:function(a){var b=JSON.parse(JSON.stringify(f));for(var c in a)b[c]=a[c];return b},timer:{},end:{}};g.touch=function(a,b){var c;return/Android|iPhone|SymbianOS|Windows Phone|iPad|iPod/.test(navigator.userAgent)?(a.addEventListener("touchmove",function(){c=!0},!1),void a.addEventListener("touchend",function(a){a.preventDefault(),c||b.call(this,a),c=!1},!1)):a.addEventListener("click",function(a){b.call(this,a)},!1)};var h=0,i=["layermbox"],j=function(a){var b=this;b.config=g.extend(a),b.view()};j.prototype.view=function(){var a=this,c=a.config,f=b.createElement("div");a.id=f.id=i[0]+h,f.setAttribute("class",i[0]+" "+i[0]+(c.type||0)),f.setAttribute("index",h);var g=function(){var a="object"==typeof c.title;return c.title?'<h3 style="'+(a?c.title[1]:"")+'">'+(a?c.title[0]:c.title)+'</h3><button class="layermend"></button>':""}(),j=function(){var a,b=(c.btn||[]).length;return 0!==b&&c.btn?(a='<span type="1">'+c.btn[0]+"</span>",2===b&&(a='<span type="0">'+c.btn[1]+"</span>"+a),'<div class="layermbtn">'+a+"</div>"):""}();if(c.fixed||(c.top=c.hasOwnProperty("top")?c.top:100,c.style=c.style||"",c.style+=" ;top:"+(b.body.scrollTop+c.top)+"px"),2===c.type&&(c.content=getlaymloadtwo(c.content)),f.innerHTML=(c.shade?"<div "+("string"==typeof c.shade?'style="'+c.shade+'"':"")+' class="laymshade"></div>':"")+'<div class="layermmain" '+(c.fixed?"":'style="position:static;"')+'><div class="section">'+
+'<div class="layermchild '+(c.className?c.className:"")+" "+(c.type||c.shade?"":"layermborder ")+(c.anim?"layermanim":"")+'" '+(c.type==2?'style="height:7em;min-width:8em;background-color:rgba(0,0,0,.6); color:#fff; border:none;"':(c.style?'style="'+c.style+'"':'style="background-color:rgba(0,0,0,.6); color:#fff; border:none;"'))+">"+g+'<div class="layermcont">'+c.content+"</div>"+j+"</div></div></div>",!c.type||2===c.type)
+{var k=b[d](i[0]+c.type),l=k.length;l>=1&&layer.close(k[0].getAttribute("index"))}document.body.appendChild(f);var m=a.elem=e("#"+a.id)[0];c.success&&c.success(m),a.index=h++,a.action(c,m)},j.prototype.action=function(a,b){var c=this;if(a.time&&(g.timer[c.index]=setTimeout(function(){layer.close(c.index)},1e3*a.time)),a.title){var e=b[d]("layermend")[0],f=function(){a.cancel&&a.cancel(),layer.close(c.index)};g.touch(e,f)}var h=function(){var b=this.getAttribute("type");0==b?(a.no&&a.no(),layer.close(c.index)):a.yes?a.yes(c.index):layer.close(c.index)};if(a.btn)for(var i=b[d]("layermbtn")[0].children,j=i.length,k=0;j>k;k++)g.touch(i[k],h);if(a.shade&&a.shadeClose){var l=b[d]("laymshade")[0];g.touch(l,function(){layer.close(c.index,a.end)})}a.end&&(g.end[c.index]=a.end)},a.layer={v:"1.7",index:h,open:function(a){var b=new j(a||{});return b.index},close:function(a){var c=e("#"+i[0]+a)[0];c&&(c.innerHTML="",b.body.removeChild(c),clearTimeout(g.timer[a]),delete g.timer[a],"function"==typeof g.end[a]&&g.end[a](),delete g.end[a])},closeAll:function(){for(var a=b[d](i[0]),c=0,e=a.length;e>c;c++)layer.close(0|a[0].getAttribute("index"))}},"function"==typeof define?define(function(){return layer}):function(){var a=document.scripts,c=a[a.length-1],d=c.src,e=d.substring(0,d.lastIndexOf("/")+1);c.getAttribute("merge")||document.head.appendChild(function(){var a=b.createElement("link");return a.href=e+"/layer.css",a.type="text/css",a.rel="styleSheet",a.id="layermcss",a}())}()}(window);
+layer.dialog=$.dialog;

+ 651 - 0
gjj/static/netutil.js

@@ -0,0 +1,651 @@
+/**
+ *定义的网络模块
+ */
+(function($){
+	/*   sha1函数实现
+     *   A   JavaScript   implementation   of   the   Secure   Hash   Algorithm,   SHA-1,   as   defined
+     *   in   FIPS   PUB   180-1
+     *   Version   2.1-BETA   Copyright   Paul   Johnston   2000   -   2002.
+     *   Other   contributors:   Greg   Holt,   Andrew   Kepert,   Ydnar,   Lostinet
+     *   Distributed   under   the   BSD   License
+     *   See   http://pajhome.org.uk/crypt/md5   for   details.
+     */
+    /*
+     *   Configurable   variables.   You   may   need   to   tweak   these   to   be   compatible   with
+     *   the   server-side,   but   the   defaults   work   in   most   cases.
+     */
+    var hexcase = 0;
+    /*   hex   output   format.   0   -   lowercase;   1   -   uppercase                 */
+    var b64pad = "";
+    /*   base-64   pad   character.   "="   for   strict   RFC   compliance       */
+    var chrsz = 8;
+    /*   bits   per   input   character.   8   -   ASCII;   16   -   Unicode             */
+    /*
+     *   These   are   the   functions   you'll   usually   want   to   call
+     *   They   take   string   arguments   and   return   either   hex   or   base-64   encoded   strings
+     */
+    function hex_sha1(s) {
+        return binb2hex(core_sha1(str2binb(s), s.length * chrsz));
+    }
+
+    function b64_sha1(s) {
+        return binb2b64(core_sha1(str2binb(s), s.length * chrsz));
+    }
+
+    function str_sha1(s) {
+        return binb2str(core_sha1(str2binb(s), s.length * chrsz));
+    }
+
+    function hex_hmac_sha1(key, data) {
+        return binb2hex(core_hmac_sha1(key, data));
+    }
+
+    function b64_hmac_sha1(key, data) {
+        return binb2b64(core_hmac_sha1(key, data));
+    }
+    
+    function str_hmac_sha1(key, data) {
+        return binb2str(core_hmac_sha1(key, data));
+    }
+    /*
+     *   Perform   a   simple   self-test   to   see   if   the   VM   is   working
+     */
+    function sha1_vm_test() {
+        return hex_sha1("abc") == "a9993e364706816aba3e25717850c26c9cd0d89d";
+    }
+
+    /*
+     *   Calculate   the   SHA-1   of   an   array   of   big-endian   words,   and   a   bit   length
+     */
+    function core_sha1(x, len) {
+        /*   append   padding   */
+        x[len >> 5] |= 0x80 << (24 - len % 32);
+        x[((len + 64 >> 9) << 4) + 15] = len;
+
+        var w = Array(80);
+        var a = 1732584193;
+        var b = -271733879;
+        var c = -1732584194;
+        var d = 271733878;
+        var e = -1009589776;
+
+        for (var i = 0; i < x.length; i += 16) {
+            var olda = a;
+            var oldb = b;
+            var oldc = c;
+            var oldd = d;
+            var olde = e;
+
+            for (var j = 0; j < 80; j++) {
+                if (j < 16)
+                    w[j] = x[i + j];
+                else
+                    w[j] = rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);
+                var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)), safe_add(safe_add(e, w[j]), sha1_kt(j)));
+                e = d;
+                d = c;
+                c = rol(b, 30);
+                b = a;
+                a = t;
+            }
+
+            a = safe_add(a, olda);
+            b = safe_add(b, oldb);
+            c = safe_add(c, oldc);
+            d = safe_add(d, oldd);
+            e = safe_add(e, olde);
+        }
+        return Array(a, b, c, d, e);
+
+    }
+
+    /*
+     *   Perform   the   appropriate   triplet   combination   function   for   the   current
+     *   iteration
+     */
+    function sha1_ft(t, b, c, d) {
+        if (t < 20)
+            return (b & c) | ((~b) & d);
+        if (t < 40)
+            return b ^ c ^ d;
+        if (t < 60)
+            return (b & c) | (b & d) | (c & d);
+        return b ^ c ^ d;
+    }
+
+    /*
+     *   Determine   the   appropriate   additive   constant   for   the   current   iteration
+     */
+    function sha1_kt(t) {
+        return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 : (t < 60) ? -1894007588 : -899497514;
+    }
+
+    /*
+     *   Calculate   the   HMAC-SHA1   of   a   key   and   some   data
+     */
+    function core_hmac_sha1(key, data) {
+        var bkey = str2binb(key);
+        if (bkey.length > 16)
+            bkey = core_sha1(bkey, key.length * chrsz);
+
+        var ipad = Array(16),
+            opad = Array(16);
+        for (var i = 0; i < 16; i++) {
+            ipad[i] = bkey[i] ^ 0x36363636;
+            opad[i] = bkey[i] ^ 0x5C5C5C5C;
+        }
+
+        var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);
+        return core_sha1(opad.concat(hash), 512 + 160);
+    }
+
+    /*
+     *   Add   integers,   wrapping   at   2^32.   This   uses   16-bit   operations   internally
+     *   to   work   around   bugs   in   some   JS   interpreters.
+     */
+    function safe_add(x, y) {
+        var lsw = (x & 0xFFFF) + (y & 0xFFFF);
+        var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
+        return (msw << 16) | (lsw & 0xFFFF);
+    }
+
+    /*
+     *   Bitwise   rotate   a   32-bit   number   to   the   left.
+     */
+    function rol(num, cnt) {
+        return (num << cnt) | (num >>> (32 - cnt));
+    }
+
+    /*
+     *   Convert   an   8-bit   or   16-bit   string   to   an   array   of   big-endian   words
+     *   In   8-bit   function,   characters   >255   have   their   hi-byte   silently   ignored.
+     */
+    function str2binb(str) {
+        var bin = Array();
+        var mask = (1 << chrsz) - 1;
+        for (var i = 0; i < str.length * chrsz; i += chrsz)
+            bin[i >> 5] |= (str.charCodeAt(i / chrsz) & mask) << (24 - i % 32);
+        return bin;
+    }
+
+    /*
+     *   Convert   an   array   of   big-endian   words   to   a   string
+     */
+    function binb2str(bin) {
+        var str = "";
+        var mask = (1 << chrsz) - 1;
+        for (var i = 0; i < bin.length * 32; i += chrsz)
+            str += String.fromCharCode((bin[i >> 5] >>> (24 - i % 32)) & mask);
+        return str;
+    }
+
+    /*
+     *   Convert   an   array   of   big-endian   words   to   a   hex   string.
+     */
+    function binb2hex(binarray) {
+        var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
+        var str = "";
+        for (var i = 0; i < binarray.length * 4; i++) {
+            str += hex_tab.charAt((binarray[i >> 2] >> ((3 - i % 4) * 8 + 4)) & 0xF) + hex_tab.charAt((binarray[i >> 2] >> ((3 - i % 4) * 8)) & 0xF);
+        }
+        return str;
+    }
+
+    /*
+     *   Convert   an   array   of   big-endian   words   to   a   base-64   string
+     */
+    function binb2b64(binarray) {
+        var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+        var str = "";
+        for (var i = 0; i < binarray.length * 4; i += 3) {
+            var triplet = (((binarray[i >> 2] >> 8 * (3 - i % 4)) & 0xFF) << 16) | (((binarray[i + 1 >> 2] >> 8 * (3 - (i + 1) % 4)) & 0xFF) << 8) | ((binarray[i + 2 >> 2] >> 8 * (3 - (i + 2) % 4)) & 0xFF);
+            for (var j = 0; j < 4; j++) {
+                if (i * 8 + j * 6 > binarray.length * 32)
+                    str += b64pad;
+                else
+                    str += tab.charAt((triplet >> 6 * (3 - j)) & 0x3F);
+            }
+        }
+        return str;
+    }
+    
+    //网络实现
+    //获取签名串
+    function getSign(data, secret){
+        data || (data = {});
+        var keys = [];
+        for(var k in data){
+            keys.push(k);
+        }
+        keys.sort(function(a, b){
+            return a > b ? 1: -1;
+        });
+        var signStr = secret;
+        var val;
+        for(var k in keys){
+            val = data[keys[k]];
+            if(/[\u4e00-\u9fa5]+/.test(val)){
+                val = val.replace(/\s/g,"");
+                signStr += keys[k] + encodeURIComponent(val);
+            }else if(val != undefined && val !== ""){
+                signStr += keys[k] + val;
+            }
+            
+        }
+        signStr += secret;
+        if(/[\(]/.test(signStr)){
+            signStr = signStr.replace(/[\(]/g,"%28");
+        }
+        if(/[\)]/.test(signStr)){
+            signStr = signStr.replace(/[\)]/g,"%29");
+        }
+        return hex_sha1(signStr);
+    }
+    
+    function toast(msg,time,type){
+    	if(type!=2){
+	    	layer.open({
+	    	    content: msg,
+	    	    style: 'background-color:#000; color:#ccc; border:none;opacity:0.1;',
+	    	    time: (time==null?2:time)
+	    	});
+        }else{
+        	layer.open({
+                type: 2,
+                content: msg,
+                shadeClose: false
+            });
+        }
+    }
+    
+    var reqUrl = basePath + "api/getway.do",
+        appKey = "f8fer24f8797646b9a26",
+        appSecret = "98edf7472d99a3f75297",
+        vRegx = {
+            "r": {
+                "reg": [/.+/],
+                "tip": "请输入{label}"
+            },
+            "d": {
+                "reg": [/^\d{4}(\-|\/|\.)(0)?[1-12]{1}\1(0)?[1-31]{1}$/],
+                "tip": "{label}不是有效的日期"
+            },
+            "e": {
+                "reg": [/^\S+@\S+$/],
+                "tip": "{label}不是有效Email地址"
+            },
+            "n": {
+                "reg":[/\d+/],
+                "tip":"{label}不是有效的数字"
+            },
+            "h": {
+                "reg": [/(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&amp;:/~\+#]*[\w\-\@?^=%&amp;/~\+#])?/],
+                "tip": "{label}格式无效"
+            },
+            "p": {
+                "reg": [/^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$/],
+                "tip": "{label}格式无效"
+            },
+            "m":{
+            	"reg":[/^(1[3,5,6,8][0-9]{9})$/],
+            	"tip": "{label}格式无效"      
+            },
+            "fa":{
+                "tip":"{label}只允许(英文字母、数字、下划线、英文句点)组合",
+                "handler": function(id, val){
+                    val = val.replace(/[A-Za-z]*[0-9]*_*@*.*\s*/g, "");
+                    if(val) return false;
+                    return true;
+                }
+            },
+            "fa_en":{
+                "tip":"{label}只允许(英文字母、数字)组合",
+                "handler": function(id, val){
+                    val = val.replace(/[A-Za-z0-9]/g, "");
+                    if(val) return false;
+                    return true;
+                }
+            },
+            "zc\[[0-9]+\]":{
+                "tip":"",
+                "handler": function(id, val, valid){
+                    var reg = /zc\[([0-9]+)\]/,max;
+                    if(reg.test(valid)){
+                        max = RegExp.$1;
+                        if(val.length > max){
+                            this.tip = "{label}不能超过" + max + "个字符";
+                            return false;
+                        }
+                    }
+                    return true;
+                }
+            },
+            "zd\[[0-9]+\]":{
+                "tip":"",
+                "handler": function(id, val, valid){
+                    var reg = /zd\[([0-9]+)\]/,min;
+                    if(reg.test(valid)){
+                        min = RegExp.$1;
+                        if(val.length < min){
+                            this.tip = "{label}长度不足" + min + "个字符";
+                            return false;
+                        }
+                    }
+                    return true;
+                }
+            }
+        };
+    
+    function indexOf(ar, item){
+        if(!ar || !item) return -1;
+        var index = -1, reg;
+        try{reg = new RegExp("^" + item + "$");}catch(e){};
+        for(var i = 0, len = ar.length; i < len; i++){
+            if(ar[i] === item){
+                return i;
+            }else if(reg && reg.test(ar[i])){
+                return i;
+            }
+        }
+        return -1;
+    }
+    /**
+     * 验证的id容器
+     *  验证某个表单元素,被验证的表单元素要求具备属性valid和msgid,
+     *  valid指定验证内容,r-必输,d-日期,n-数字,e-邮件,h-网址,p-身份证,fa-用户名格式验证(只能是英文、数字、_、@等),
+     *  zc[n]最长不能超过N个字符,zd[n]最短不能少于N个字符
+     * @param {Object} id
+     */
+    function doValid(id,isyzm){
+        if (!id) return true;
+        var ids, c ,
+            t, valid = true;
+        if (id.indexOf(",") > -1) {
+            ids = id.split(",");
+        } 
+        ids || (ids = [id]);
+        // 验证text textarea
+        for (var i = 0, len = ids.length; i < len; i++) {
+            c = $("#" + ids[i]);
+            if(c.length == 0) continue;
+            if(indexOf(['INPUT', 'TEXTAREA','SELECT'], c[0].nodeName) == -1){
+                c = c.find("input,textarea,select");
+            }
+            c.each(function(index) {
+            	if(index==c.length-1&&isyzm){
+                    valid=true;
+                    return valid;
+                }
+                var v = $(this).attr("valid"), type = $(this).attr("type"),
+                    val = $(this).val(), label = $(this).attr("label") || $(this).attr("placeholder");
+                label || (label = "");
+                if(type){
+                    type = type.toLowerCase();
+                    if(indexOf(['button', 'submit','image','reset'], type) > -1) return; //此类不做处理
+                }
+                if (v) {
+                    v = v.split(",");
+                    for (var p in vRegx) {
+                        var arIndex = indexOf(v, p);
+                        if (arIndex > -1) {
+                            t = vRegx[p].reg;
+                            if (t) {
+                                for (var j = 0, l = t.length; j < l; j++) {
+                                    if (!t[j].test(val)) {
+                                        valid = false;
+                                        break;
+                                    }
+                                }
+                            } else {
+                                t = vRegx[p].handler;
+                                if (t && !t.call(vRegx[p], $(this).attr("id"), val, v[arIndex])) {
+                                    valid = false;
+                                }
+                            }
+                            if (!valid) {
+                                var msgTip = "";
+                                if(type=="file"){
+                                    msgTip = vRegx[p].tip.replace("{label}", label);
+                                    msgTip= msgTip.replace("输入","选择");
+                                }else{
+                                   msgTip = vRegx[p].tip.replace("{label}", label);
+                                  
+                                }
+                                
+                                toast(msgTip);
+                                break;
+                            }
+                        }
+                    }
+                    if (!valid) {
+                        return false;
+                    }
+                }
+            });
+            if(!valid) return false;
+        }
+        return true;
+    }
+    /**
+     * 获取参数值
+     * @param {Object} ids
+     */
+    function getParams(ids){
+        if (!ids) return {};
+        if (ids.indexOf(",") > -1) {
+            ids = ids.split(",");
+        } else {
+            ids = [ids];
+        }
+        var data = {},c;
+        for (var i = 0, len = ids.length; i < len; i++) {
+            c = $("#" + ids[i]);
+            if(c.length == 0) continue;
+            if(indexOf(['INPUT', 'TEXTAREA'], c[0].nodeName) == -1){
+                c = c.find("input,textarea,select");
+            }
+            c.each(function() {
+                var type = $(this).attr("type");
+                if(type){
+                    type = type.toLowerCase();
+                    if(indexOf(['button', 'submit','image','reset'], type) > -1) return; //此类不做处理
+                }
+                var id = $(this).attr("id");
+                if(!id) id = $(this).attr("name");
+                if (!id) {
+                    throw new Error("元素的Id不能为空");
+                }
+                var val;
+                if($("input[type='radio'][name='" + id + "']").length > 0){
+                    val=  $("input[type='radio'][name='" + id + "']:checked").val()
+                }else{
+                    val = $(this).val();
+                }
+                data[id] = val;
+            });
+        }
+        return data;
+    }
+    /**
+     * 网络请求
+     * @param {Object} pids
+     *          请求的参数容器id
+     * @param {Object} succ
+     *          成功回调函数
+     * @param {Object} fail
+     *          失败回调函数
+     * @param {Object} reqData
+     *          请求的参数
+     */
+    function submit(pids, reqData, succ, fail,netfail,isTip){
+        reqData || (reqData = {});
+        if(!reqData.method){
+        	toast("未传入请求方法");
+            return;
+        }
+        reqData.v || (reqData.v = '1.0');
+        var data;
+        var isprocessData=true;
+        var iscontentType="application/x-www-form-urlencoded";
+        if (doValid(pids)) {
+            var myform = $("#"+pids);
+            var encType=myform.attr("enctype");
+            if(encType!=null&&encType.toLowerCase()=="multipart/form-data"){
+                data = new FormData(myform[0]);
+                data.append("appkey",appKey);
+                data.append("timestamp",Date.now());
+                data.append("sign",getSign(data, appSecret));
+                for(var key in reqData){
+                    data.append(key,reqData[key]);
+                }
+                isprocessData=false;
+                iscontentType=false;
+            }else{
+                data = getParams(pids);
+                //解析url上的参数,转化为post提交
+                $.extend(data, reqData);
+                data["appkey"] = appKey;
+                data["timestamp"] = Date.now();
+                data["sign"] = getSign(data, appSecret);
+            }
+
+            if(reqData.toast!=0){
+	            layer.open({
+	                type: 2,
+	                content: '数据获取中....',
+	                shadeClose: false
+	            });
+            }
+            $.ajax({
+                url: reqUrl,
+                type: "POST",
+                dataType: "json",
+                data: data,
+                processData: isprocessData,
+                contentType:iscontentType,
+                error: function(xhr, status) {
+                	//layer.closeAll();
+                    //toast("网络不给力,请稍后尝试");
+                    if(netfail)netfail();
+                },
+                success: function(data) {
+                	layer.closeAll();
+                    if(data.rescode == '1'){
+                        if(succ){
+                           var mylist=[];
+                           //如果data.list不为空且不是数组,则转换为数组
+                           if(data.list&&!(data.list instanceof Array)){
+                             mylist[0]=data.list;
+                             data.list=mylist;  
+                           } 
+                           succ(data);
+                         };
+                    }else if(data.rescode == '3'){
+                    	top.location.href = basePath + "weixin/login.jsp";
+                    }else if(data.rescode == '4'){
+                        dialog({title:"",content:data.resmsg,mode:1},function(index){
+                            $.doSubmit("",{"method": "user.loginout", "v": "1.0"}, function(data){
+                                if("undefined"!=typeof WeixinJSBridge){
+                                    WeixinJSBridge.invoke('closeWindow',{},function(res){});
+                                }else{
+                                    $.openWin("login.jsp");
+                                }
+                            });
+                        });
+                    }else if(data.rescode == '5'){
+                        dialog({title:"",content:data.resmsg,mode:1},function(index){
+                            $.doSubmit("",{"method": "user.loginout", "v": "1.0"}, function(data){
+                                if("undefined"!=typeof WeixinJSBridge){
+                                    WeixinJSBridge.invoke('closeWindow',{},function(res){});
+                                }else{
+                                    $.openWin("login.jsp");
+                                }
+                            });
+                        });
+                    }else{
+                        if(fail)fail(data);
+                        else toast(data.resmsg);
+                    }
+                }
+            });
+        }
+    }
+    /**
+     * 模版渲染函数
+     * @param str
+     * @param o
+     * @returns
+     */
+    function tmpl2Str(str, o) {
+        for (var k in o) {
+            var re = new RegExp("{" + k + "}", "g");
+            if(o[k] == undefined || o[k] == "null") o[k] = "";
+            try{str = str.replace(re, o[k]);}catch(e){}
+        }
+        str = str.replace(/{.*}/, "");
+        return str;
+    }
+    /**
+     * 上传银行卡照片进行OCR识别,识别成功返回银行卡号
+     * @param obj
+     * @param type
+     * @param kjid
+     * @returns
+     */
+    function uploadOcrFile(obj, type, kjid ) {
+        submit(obj,{method: "user.ocrSbYhkh","kjid":kjid,"tjkj":obj},function(data){
+
+        },function (data) {
+
+        });
+    }
+    
+    $.extend({
+    	 doSubmit: submit,
+         doValid: doValid,
+        tmpl2Str: tmpl2Str,
+        uploadOcrFile: uploadOcrFile,
+         toast: toast
+    });
+    function dialog(params,callBack) {
+        var win="<div class='fund_dialog_confirm'  id='dialog1' style='display: ;'>";
+        win+=" <div class='dialogMask' style='position: fixed;z-index: 1000;width: 100%;height: 100%;top:0;left: 0; background: rgba(0, 0, 0, 0.6);'></div>";
+        win+=" <div class='fund_dialog'  "+(params.mode<=-1?"style='padding-bottom:.4em'":"")+" >";
+        if(params.title!=null){
+            win+=" <div class='fund_dialog_hd'><strong class='fund_dialog_title'>"+(params.title==null?"":params.title)+"</strong></div>";
+        }
+        win+="   <div class='fund_dialog_bd'>"+(params.content==null?"":params.content)+"</div>";
+        if(params.mode!=-1){
+            win+="   <div class='fund_dialog_ft'>";
+            if(params.mode==0||params.mode==null){
+                win+="      <a id='dialog_cancel' class='fund_btn_dialog default'>"+(params.canncel==null?"取消":params.canncel)+"</a>";
+            }
+            win+="       <a id='dialog_ok' class='fund_btn_dialog primary'>"+(params.ok==null?"确定":params.ok)+"</a>";
+            win+="   </div>";
+        }
+        win+="</div></div>";
+        var mydialog= $(win);
+        mydialog.find("a").each(function(index){
+            $(this).bind('click',function(){
+                var sign=0;
+                if(callBack){
+                    sign=callBack(index);
+                    if(sign==undefined){
+                        sign=0;
+                    }
+                }else{
+                    sign=0;
+                }
+                if(sign==0||$(this).attr("id")=="dialog_cancel"){
+                    $(mydialog).remove();
+                }
+
+            });
+        });
+        $(document.body).append(mydialog);
+        if(params.duration){
+            setTimeout(function(){$(mydialog).remove();},params.duration);
+        }
+
+    }
+})(jQuery);

+ 6 - 0
gjj/static/security.js

@@ -0,0 +1,6 @@
+(function(){
+	var publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCJcTBCPyX3OpLPNmDYLUitf8sZG4Wa1Q/9MNX/t12keSOjT/44OWnGHSo69eEpqxxx1KXkGJyLqvkUBhd8E5PUuADoy6AEyIRR093ceoYY2gNPVgsY61edp7MvB5iz9ej8Aw/ZwIacYZIib7VhFIBas+yG8yRvDU7kZYdmGrAH5QIDAQAB";
+	var cryptModule = new JSEncrypt();
+	cryptModule.setPublicKey(publicKey);
+	window.cryptModule = cryptModule;
+})();

File diff suppressed because it is too large
+ 4124 - 0
gjj/static/weui.min.css


+ 1239 - 0
gjj/static/weui.min.js

@@ -0,0 +1,1239 @@
+/*!
+ * weui.js v1.2.1 (https://weui.io)
+ * Copyright 2019, wechat ui team
+ * MIT license
+ */
+!function (e, t) {
+    "object" == typeof exports && "object" == typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? exports.weui = t() : e.weui = t()
+}(this, function () {
+    return function (e) {
+        function t(i) {
+            if (n[i]) return n[i].exports;
+            var a = n[i] = {exports: {}, id: i, loaded: !1};
+            return e[i].call(a.exports, a, a.exports, t), a.loaded = !0, a.exports
+        }
+
+        var n = {};
+        return t.m = e, t.c = n, t.p = "", t(0)
+    }([function (e, t, n) {
+        "use strict";
+
+        function i(e) {
+            return e && e.__esModule ? e : {default: e}
+        }
+
+        Object.defineProperty(t, "__esModule", {value: !0});
+        var a = n(1), o = i(a), r = n(7), u = i(r), l = n(8), s = i(l), d = n(9), f = i(d), c = n(11), p = i(c),
+            h = n(13), v = i(h), m = n(15), _ = i(m), g = n(17), w = i(g), y = n(18), b = i(y), k = n(19), x = i(k),
+            C = n(20), M = i(C), E = n(24), j = n(30), S = i(j), O = n(32), P = i(O);
+        t.default = {
+            dialog: o.default,
+            alert: u.default,
+            confirm: s.default,
+            toast: f.default,
+            loading: p.default,
+            actionSheet: v.default,
+            topTips: _.default,
+            searchBar: w.default,
+            tab: b.default,
+            form: x.default,
+            uploader: M.default,
+            picker: E.picker,
+            datePicker: E.datePicker,
+            gallery: S.default,
+            slider: P.default
+        }, e.exports = t.default
+    }, function (e, t, n) {
+        "use strict";
+
+        function i(e) {
+            return e && e.__esModule ? e : {default: e}
+        }
+
+        function a() {
+            function e(t) {
+                e = r.default.noop, u.addClass("weui-animate-fade-out"), o.addClass("weui-animate-fade-out").on("animationend webkitAnimationEnd", function () {
+                    a.remove(), s = !1, t && t()
+                })
+            }
+
+            function t(t) {
+                e(t)
+            }
+
+            var n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
+            if (s) return s;
+            var i = r.default.os.android;
+            n = r.default.extend({
+                title: null,
+                content: "",
+                className: "",
+                buttons: [{label: "确定", type: "primary", onClick: r.default.noop}],
+                isAndroid: i
+            }, n);
+            var a = (0, r.default)(r.default.render(l.default, n)), o = a.find(".weui-dialog"),
+                u = a.find(".weui-mask");
+            return (0, r.default)("body").append(a), u.addClass("weui-animate-fade-in"), o.addClass("weui-animate-fade-in"), a.on("click", ".weui-dialog__btn", function (e) {
+                var i = (0, r.default)(this).index();
+                n.buttons[i].onClick ? n.buttons[i].onClick.call(this, e) !== !1 && t() : t()
+            }).on("touchmove", function (e) {
+                e.stopPropagation(), e.preventDefault()
+            }), s = a[0], s.hide = t, s
+        }
+
+        Object.defineProperty(t, "__esModule", {value: !0});
+        var o = n(2), r = i(o), u = n(6), l = i(u), s = void 0;
+        t.default = a, e.exports = t.default
+    }, function (e, t, n) {
+        "use strict";
+
+        function i(e) {
+            return e && e.__esModule ? e : {default: e}
+        }
+
+        function a(e) {
+            var t = this.os = {}, n = e.match(/(Android);?[\s\/]+([\d.]+)?/);
+            n && (t.android = !0, t.version = n[2])
+        }
+
+        Object.defineProperty(t, "__esModule", {value: !0});
+        var o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
+            return typeof e
+        } : function (e) {
+            return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
+        };
+        n(3);
+        var r = n(4), u = i(r), l = n(5), s = i(l);
+        a.call(s.default, navigator.userAgent), (0, u.default)(s.default.fn, {
+            append: function (e) {
+                return e instanceof HTMLElement || (e = e[0]), this.forEach(function (t) {
+                    t.appendChild(e)
+                }), this
+            }, remove: function () {
+                return this.forEach(function (e) {
+                    e.parentNode.removeChild(e)
+                }), this
+            }, find: function (e) {
+                return (0, s.default)(e, this)
+            }, addClass: function (e) {
+                return this.forEach(function (t) {
+                    t.classList.add(e)
+                }), this
+            }, removeClass: function (e) {
+                return this.forEach(function (t) {
+                    t.classList.remove(e)
+                }), this
+            }, eq: function (e) {
+                return (0, s.default)(this[e])
+            }, show: function () {
+                return this.forEach(function (e) {
+                    e.style.display = "block"
+                }), this
+            }, hide: function () {
+                return this.forEach(function (e) {
+                    e.style.display = "none"
+                }), this
+            }, html: function (e) {
+                return this.forEach(function (t) {
+                    t.innerHTML = e
+                }), this
+            }, css: function (e) {
+                var t = this;
+                return Object.keys(e).forEach(function (n) {
+                    t.forEach(function (t) {
+                        t.style[n] = e[n]
+                    })
+                }), this
+            }, on: function (e, t, n) {
+                var i = "string" == typeof t && "function" == typeof n;
+                return i || (n = t), this.forEach(function (a) {
+                    e.split(" ").forEach(function (e) {
+                        a.addEventListener(e, function (e) {
+                            i ? this.contains(e.target.closest(t)) && n.call(e.target, e) : n.call(this, e)
+                        })
+                    })
+                }), this
+            }, off: function (e, t, n) {
+                return "function" == typeof t && (n = t, t = null), this.forEach(function (i) {
+                    e.split(" ").forEach(function (e) {
+                        "string" == typeof t ? i.querySelectorAll(t).forEach(function (t) {
+                            t.removeEventListener(e, n)
+                        }) : i.removeEventListener(e, n)
+                    })
+                }), this
+            }, index: function () {
+                var e = this[0], t = e.parentNode;
+                return Array.prototype.indexOf.call(t.children, e)
+            }, offAll: function () {
+                var e = this;
+                return this.forEach(function (t, n) {
+                    var i = t.cloneNode(!0);
+                    t.parentNode.replaceChild(i, t), e[n] = i
+                }), this
+            }, val: function () {
+                var e = arguments;
+                return arguments.length ? (this.forEach(function (t) {
+                    t.value = e[0]
+                }), this) : this[0].value
+            }, attr: function () {
+                var e = arguments;
+                if ("object" == o(arguments[0])) {
+                    var t = arguments[0], n = this;
+                    return Object.keys(t).forEach(function (e) {
+                        n.forEach(function (n) {
+                            n.setAttribute(e, t[e])
+                        })
+                    }), this
+                }
+                return "string" == typeof arguments[0] && arguments.length < 2 ? this[0].getAttribute(arguments[0]) : (this.forEach(function (t) {
+                    t.setAttribute(e[0], e[1])
+                }), this)
+            }
+        }), (0, u.default)(s.default, {
+            extend: u.default, noop: function () {
+            }, render: function (e, t) {
+                var n = "var p=[];with(this){p.push('" + e.replace(/[\r\t\n]/g, " ").split("<%").join("\t").replace(/((^|%>)[^\t]*)'/g, "$1\r").replace(/\t=(.*?)%>/g, "',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'") + "');}return p.join('');";
+                return new Function(n).apply(t)
+            }, getStyle: function (e, t) {
+                var n, i = (e.ownerDocument || document).defaultView;
+                return i && i.getComputedStyle ? (t = t.replace(/([A-Z])/g, "-$1").toLowerCase(), i.getComputedStyle(e, null).getPropertyValue(t)) : e.currentStyle ? (t = t.replace(/\-(\w)/g, function (e, t) {
+                    return t.toUpperCase()
+                }), n = e.currentStyle[t], /^\d+(em|pt|%|ex)?$/i.test(n) ? function (t) {
+                    var n = e.style.left, i = e.runtimeStyle.left;
+                    return e.runtimeStyle.left = e.currentStyle.left, e.style.left = t || 0, t = e.style.pixelLeft + "px", e.style.left = n, e.runtimeStyle.left = i, t
+                }(n) : n) : void 0
+            }
+        }), t.default = s.default, e.exports = t.default
+    }, function (e, t) {
+        !function (e) {
+            "function" != typeof e.matches && (e.matches = e.msMatchesSelector || e.mozMatchesSelector || e.webkitMatchesSelector || function (e) {
+                for (var t = this, n = (t.document || t.ownerDocument).querySelectorAll(e), i = 0; n[i] && n[i] !== t;) ++i;
+                return Boolean(n[i])
+            }), "function" != typeof e.closest && (e.closest = function (e) {
+                for (var t = this; t && 1 === t.nodeType;) {
+                    if (t.matches(e)) return t;
+                    t = t.parentNode
+                }
+                return null
+            })
+        }(window.Element.prototype)
+    }, function (e, t) {/*
+	object-assign
+	(c) Sindre Sorhus
+	@license MIT
+	*/
+        "use strict";
+
+        function n(e) {
+            if (null === e || void 0 === e) throw new TypeError("Object.assign cannot be called with null or undefined");
+            return Object(e)
+        }
+
+        function i() {
+            try {
+                if (!Object.assign) return !1;
+                var e = new String("abc");
+                if (e[5] = "de", "5" === Object.getOwnPropertyNames(e)[0]) return !1;
+                for (var t = {}, n = 0; n < 10; n++) t["_" + String.fromCharCode(n)] = n;
+                var i = Object.getOwnPropertyNames(t).map(function (e) {
+                    return t[e]
+                });
+                if ("0123456789" !== i.join("")) return !1;
+                var a = {};
+                return "abcdefghijklmnopqrst".split("").forEach(function (e) {
+                    a[e] = e
+                }), "abcdefghijklmnopqrst" === Object.keys(Object.assign({}, a)).join("")
+            } catch (e) {
+                return !1
+            }
+        }
+
+        var a = Object.getOwnPropertySymbols, o = Object.prototype.hasOwnProperty,
+            r = Object.prototype.propertyIsEnumerable;
+        e.exports = i() ? Object.assign : function (e, t) {
+            for (var i, u, l = n(e), s = 1; s < arguments.length; s++) {
+                i = Object(arguments[s]);
+                for (var d in i) o.call(i, d) && (l[d] = i[d]);
+                if (a) {
+                    u = a(i);
+                    for (var f = 0; f < u.length; f++) r.call(i, u[f]) && (l[u[f]] = i[u[f]])
+                }
+            }
+            return l
+        }
+    }, function (e, t, n) {
+        var i, a;
+        !function (n, o) {
+            o = function (e, t, n) {
+                function i(a, o, r) {
+                    return r = Object.create(i.fn), a && r.push.apply(r, a[t] ? [a] : "" + a === a ? /</.test(a) ? ((o = e.createElement(o || t)).innerHTML = a, o.children) : o ? (o = i(o)[0]) ? o[n](a) : r : e[n](a) : "function" == typeof a ? e.readyState[7] ? a() : e[t]("DOMContentLoaded", a) : a), r
+                }
+
+                return i.fn = [], i.one = function (e, t) {
+                    return i(e, t)[0] || null
+                }, i
+            }(document, "addEventListener", "querySelectorAll"), i = [], a = function () {
+                return o
+            }.apply(t, i), !(void 0 !== a && (e.exports = a))
+        }(this)
+    }, function (e, t) {
+        e.exports = '<div class="<%=className%>"> <div class=weui-mask></div> <div class="weui-dialog <% if(isAndroid){ %> weui-skin_android <% } %>"> <% if(title){ %> <div class=weui-dialog__hd><strong class=weui-dialog__title><%=title%></strong></div> <% } %> <div class=weui-dialog__bd><%=content%></div> <div class=weui-dialog__ft> <% for(var i = 0; i < buttons.length; i++){ %> <a href=javascript:; class="weui-dialog__btn weui-dialog__btn_<%=buttons[i][\'type\']%>"><%=buttons[i][\'label\']%></a> <% } %> </div> </div> </div> '
+    }, function (e, t, n) {
+        "use strict";
+
+        function i(e) {
+            return e && e.__esModule ? e : {default: e}
+        }
+
+        function a() {
+            var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "",
+                t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : u.default.noop, n = arguments[2];
+            return "object" === ("undefined" == typeof t ? "undefined" : o(t)) && (n = t, t = u.default.noop), n = u.default.extend({
+                content: e,
+                buttons: [{label: "确定", type: "primary", onClick: t}]
+            }, n), (0, s.default)(n)
+        }
+
+        Object.defineProperty(t, "__esModule", {value: !0});
+        var o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
+            return typeof e
+        } : function (e) {
+            return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
+        }, r = n(2), u = i(r), l = n(1), s = i(l);
+        t.default = a, e.exports = t.default
+    }, function (e, t, n) {
+        "use strict";
+
+        function i(e) {
+            return e && e.__esModule ? e : {default: e}
+        }
+
+        function a() {
+            var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "",
+                t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : u.default.noop,
+                n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : u.default.noop, i = arguments[3];
+            return "object" === ("undefined" == typeof t ? "undefined" : o(t)) ? (i = t, t = u.default.noop) : "object" === ("undefined" == typeof n ? "undefined" : o(n)) && (i = n, n = u.default.noop), i = u.default.extend({
+                content: e,
+                buttons: [{label: "鍙栨秷", type: "default", onClick: n}, {label: "确定", type: "primary", onClick: t}]
+            }, i), (0, s.default)(i)
+        }
+
+        Object.defineProperty(t, "__esModule", {value: !0});
+        var o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
+            return typeof e
+        } : function (e) {
+            return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
+        }, r = n(2), u = i(r), l = n(1), s = i(l);
+        t.default = a, e.exports = t.default
+    }, function (e, t, n) {
+        "use strict";
+
+        function i(e) {
+            return e && e.__esModule ? e : {default: e}
+        }
+
+        function a() {
+            var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "",
+                t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
+            if (s) return s;
+            "number" == typeof t && (t = {duration: t}), "function" == typeof t && (t = {callback: t}), t = r.default.extend({
+                content: e,
+                duration: 3e3,
+                callback: r.default.noop,
+                className: ""
+            }, t);
+            var n = (0, r.default)(r.default.render(l.default, t)), i = n.find(".weui-toast"), a = n.find(".weui-mask");
+            return (0, r.default)("body").append(n), i.addClass("weui-animate-fade-in"), a.addClass("weui-animate-fade-in"), setTimeout(function () {
+                a.addClass("weui-animate-fade-out"), i.addClass("weui-animate-fade-out").on("animationend webkitAnimationEnd", function () {
+                    n.remove(), s = !1, t.callback()
+                })
+            }, t.duration), s = n[0], n[0]
+        }
+
+        Object.defineProperty(t, "__esModule", {value: !0});
+        var o = n(2), r = i(o), u = n(10), l = i(u), s = void 0;
+        t.default = a, e.exports = t.default
+    }, function (e, t) {
+        e.exports = '<div class="<%= className %>"> <div class=weui-mask_transparent></div> <div class=weui-toast> <i class="weui-icon_toast weui-icon-success-no-circle"></i> <p class=weui-toast__content><%=content%></p> </div> </div> '
+    }, function (e, t, n) {
+        "use strict";
+
+        function i(e) {
+            return e && e.__esModule ? e : {default: e}
+        }
+
+        function a() {
+            function e(t) {
+                e = r.default.noop, u.addClass("weui-animate-fade-out"), o.addClass("weui-animate-fade-out").on("animationend webkitAnimationEnd", function () {
+                    a.remove(), s = !1, t && t()
+                })
+            }
+
+            function t(t) {
+                e(t)
+            }
+
+            var n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "",
+                i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
+            if (s) return s;
+            i = r.default.extend({content: n, className: ""}, i);
+            var a = (0, r.default)(r.default.render(l.default, i)), o = a.find(".weui-toast"), u = a.find(".weui-mask");
+            return (0, r.default)("body").append(a), o.addClass("weui-animate-fade-in"), u.addClass("weui-animate-fade-in"), s = a[0], s.hide = t, s
+        }
+
+        Object.defineProperty(t, "__esModule", {value: !0});
+        var o = n(2), r = i(o), u = n(12), l = i(u), s = void 0;
+        t.default = a, e.exports = t.default
+    }, function (e, t) {
+        e.exports = '<div class="weui-loading_toast <%= className %>"> <div class=weui-mask_transparent></div> <div class=weui-toast> <i class="weui-loading weui-icon_toast"></i> <p class=weui-toast__content><%=content%></p> </div> </div> '
+    }, function (e, t, n) {
+        "use strict";
+
+        function i(e) {
+            return e && e.__esModule ? e : {default: e}
+        }
+
+        function a() {
+            function e(t) {
+                e = r.default.noop, d.addClass(a.isAndroid ? "weui-animate-fade-out" : "weui-animate-slide-down"), f.addClass("weui-animate-fade-out").on("animationend webkitAnimationEnd", function () {
+                    u.remove(), s = !1, a.onClose(), t && t()
+                })
+            }
+
+            function t(t) {
+                e(t)
+            }
+
+            var n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [],
+                i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [],
+                a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
+            if (s) return s;
+            var o = r.default.os.android;
+            a = r.default.extend({
+                menus: n,
+                actions: i,
+                title: "",
+                className: "",
+                isAndroid: o,
+                onClose: r.default.noop
+            }, a);
+            var u = (0, r.default)(r.default.render(l.default, a)), d = u.find(".weui-actionsheet"),
+                f = u.find(".weui-mask");
+            return (0, r.default)("body").append(u), r.default.getStyle(d[0], "transform"), d.addClass(a.isAndroid ? "weui-animate-fade-in" : "weui-animate-slide-up"), f.addClass("weui-animate-fade-in").on("click", function () {
+                t()
+            }), u.find(".weui-actionsheet__menu").on("click", ".weui-actionsheet__cell", function (e) {
+                var i = (0, r.default)(this).index();
+                n[i].onClick.call(this, e), t()
+            }), u.find(".weui-actionsheet__action").on("click", ".weui-actionsheet__cell", function (e) {
+                var n = (0, r.default)(this).index();
+                i[n].onClick.call(this, e), t()
+            }), s = u[0], s.hide = t, s
+        }
+
+        Object.defineProperty(t, "__esModule", {value: !0});
+        var o = n(2), r = i(o), u = n(14), l = i(u), s = void 0;
+        t.default = a, e.exports = t.default
+    }, function (e, t) {
+        e.exports = '<div class="<% if(isAndroid){ %>weui-skin_android <% } %><%= className %>"> <div class=weui-mask></div> <div class=weui-actionsheet> <% if(!isAndroid && title){ %> <div class=weui-actionsheet__title> <p class=weui-actionsheet__title-text><%= title %></p> </div> <% } %> <div class=weui-actionsheet__menu> <% for(var i = 0; i < menus.length; i++){ %> <div class=weui-actionsheet__cell><%= menus[i].label %></div> <% } %> </div> <div class=weui-actionsheet__action> <% for(var j = 0; j < actions.length; j++){ %> <div class=weui-actionsheet__cell><%= actions[j].label %></div> <% } %> </div> </div> </div> '
+    }, function (e, t, n) {
+        "use strict";
+
+        function i(e) {
+            return e && e.__esModule ? e : {default: e}
+        }
+
+        function a(e) {
+            function t(e) {
+                t = r.default.noop, a.remove(), e && e(), i.callback(), s = null
+            }
+
+            function n(e) {
+                t(e)
+            }
+
+            var i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
+            "number" == typeof i && (i = {duration: i}), "function" == typeof i && (i = {callback: i}), i = r.default.extend({
+                content: e,
+                duration: 3e3,
+                callback: r.default.noop,
+                className: ""
+            }, i);
+            var a = (0, r.default)(r.default.render(l.default, i));
+            return (0, r.default)("body").append(a), s && (clearTimeout(s.timeout), s.hide()), s = {hide: n}, s.timeout = setTimeout(n, i.duration), a[0].hide = n, a[0]
+        }
+
+        Object.defineProperty(t, "__esModule", {value: !0});
+        var o = n(2), r = i(o), u = n(16), l = i(u), s = null;
+        t.default = a, e.exports = t.default
+    }, function (e, t) {
+        e.exports = '<div class="weui-toptips weui-toptips_warn <%= className %>" style=display:block><%= content %></div> '
+    }, function (e, t, n) {
+        "use strict";
+
+        function i(e) {
+            return e && e.__esModule ? e : {default: e}
+        }
+
+        function a(e) {
+            var t = (0, r.default)(e);
+            return t.forEach(function (e) {
+                function t() {
+                    a.val(""), n.removeClass("weui-search-bar_focusing")
+                }
+
+                var n = (0, r.default)(e), i = n.find(".weui-search-bar__label"), a = n.find(".weui-search-bar__input"),
+                    o = n.find(".weui-icon-clear"), u = n.find(".weui-search-bar__cancel-btn");
+                i.on("click", function () {
+                    n.addClass("weui-search-bar_focusing"), a[0].focus()
+                }), a.on("blur", function () {
+                    this.value.length || t()
+                }), o.on("click", function () {
+                    a.val(""), a[0].focus()
+                }), u.on("click", function () {
+                    t(), a[0].blur()
+                })
+            }), t
+        }
+
+        Object.defineProperty(t, "__esModule", {value: !0});
+        var o = n(2), r = i(o);
+        t.default = a, e.exports = t.default
+    }, function (e, t, n) {
+        "use strict";
+
+        function i(e) {
+            return e && e.__esModule ? e : {default: e}
+        }
+
+        function a(e) {
+            var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n = (0, r.default)(e);
+            return t = r.default.extend({defaultIndex: 0, onChange: r.default.noop}, t), n.forEach(function (e) {
+                var n = (0, r.default)(e), i = n.find(".weui-navbar__item, .weui-tabbar__item"),
+                    a = n.find(".weui-tab__content");
+                i.eq(t.defaultIndex).addClass("weui-bar__item_on"), a.eq(t.defaultIndex).show(), i.on("click", function () {
+                    var e = (0, r.default)(this), n = e.index();
+                    i.removeClass("weui-bar__item_on"), e.addClass("weui-bar__item_on"), a.hide(), a.eq(n).show(), t.onChange.call(this, n)
+                })
+            }), this
+        }
+
+        Object.defineProperty(t, "__esModule", {value: !0});
+        var o = n(2), r = i(o);
+        t.default = a, e.exports = t.default
+    }, function (e, t, n) {
+        "use strict";
+
+        function i(e) {
+            return e && e.__esModule ? e : {default: e}
+        }
+
+        function a(e) {
+            return e && e.classList ? e.classList.contains("weui-cell") ? e : a(e.parentNode) : null
+        }
+
+        function o(e, t, n) {
+            var i = e[0], a = e.val();
+            if ("INPUT" == i.tagName || "TEXTAREA" == i.tagName) {
+                var o = i.getAttribute("pattern") || "";
+                if ("radio" == i.type) {
+                    for (var r = t.find('input[type="radio"][name="' + i.name + '"]'), u = 0, l = r.length; u < l; ++u) if (r[u].checked) return null;
+                    return "empty"
+                }
+                if ("checkbox" == i.type) {
+                    if (o) {
+                        var s = t.find('input[type="checkbox"][name="' + i.name + '"]'),
+                            d = o.replace(/[{\s}]/g, "").split(","), f = 0;
+                        if (2 != d.length) throw i.outerHTML + " regexp is wrong.";
+                        return s.forEach(function (e) {
+                            e.checked && ++f
+                        }), "" === d[1] ? f >= parseInt(d[0]) ? null : 0 == f ? "empty" : "notMatch" : parseInt(d[0]) <= f && f <= parseInt(d[1]) ? null : 0 == f ? "empty" : "notMatch"
+                    }
+                    return i.checked ? null : "empty"
+                }
+                if (o) {
+                    if (/^REG_/.test(o)) {
+                        if (!n) throw"RegExp " + o + " is empty.";
+                        if (o = o.replace(/^REG_/, ""), !n[o]) throw"RegExp " + o + " has not found.";
+                        o = n[o]
+                    }
+                    return new RegExp(o).test(a) ? null : e.val().length ? "notMatch" : "empty"
+                }
+                return e.val().length ? null : "empty"
+            }
+            return a.length ? null : "empty"
+        }
+
+        function r(e) {
+            var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : f.default.noop,
+                n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, i = (0, f.default)(e);
+            return i.forEach(function (e) {
+                var i = (0, f.default)(e), a = i.find("[required]");
+                "function" != typeof t && (t = l);
+                for (var r = 0, u = a.length; r < u; ++r) {
+                    var s = a.eq(r), d = o(s, i, n.regexp), c = {ele: s[0], msg: d};
+                    if (d) return void (t(c) || l(c))
+                }
+                t(null)
+            }), this
+        }
+
+        function u(e) {
+            var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n = (0, f.default)(e);
+            return n.forEach(function (e) {
+                var n = (0, f.default)(e);
+                n.find("[required]").on("blur", function () {
+                    if ("checkbox" != this.type && "radio" != this.type) {
+                        var e = (0, f.default)(this);
+                        if (!(e.val().length < 1)) {
+                            var i = o(e, n, t.regexp);
+                            i && l({ele: e[0], msg: i})
+                        }
+                    }
+                }).on("focus", function () {
+                    s(this)
+                })
+            }), this
+        }
+
+        function l(e) {
+            if (e) {
+                var t = (0, f.default)(e.ele), n = e.msg,
+                    i = t.attr(n + "Tips") || t.attr("tips") || t.attr("placeholder");
+                if (i && (0, p.default)(i), "checkbox" == e.ele.type || "radio" == e.ele.type) return;
+                var o = a(e.ele);
+                o && o.classList.add("weui-cell_warn")
+            }
+        }
+
+        function s(e) {
+            var t = a(e);
+            t && t.classList.remove("weui-cell_warn")
+        }
+
+        Object.defineProperty(t, "__esModule", {value: !0});
+        var d = n(2), f = i(d), c = n(15), p = i(c);
+        t.default = {showErrorTips: l, hideErrorTips: s, validate: r, checkIfBlur: u}, e.exports = t.default
+    }, function (e, t, n) {
+        "use strict";
+
+        function i(e) {
+            return e && e.__esModule ? e : {default: e}
+        }
+
+        function a(e, t) {
+            function n(e, t) {
+                var n = e.find('[data-id="' + t + '"]'), i = n.find(".weui-uploader__file-content");
+                return i.length || (i = (0, r.default)('<div class="weui-uploader__file-content"></div>'), n.append(i)), n.addClass("weui-uploader__file_status"), i
+            }
+
+            function i(e, t) {
+                var n = e.find('[data-id="' + t + '"]').removeClass("weui-uploader__file_status");
+                n.find(".weui-uploader__file-content").remove()
+            }
+
+            function a(e) {
+                e.url = u.createObjectURL(e), e.status = "ready", e.upload = function () {
+                    (0, f.default)(r.default.extend({$uploader: o, file: e}, t))
+                }, e.stop = function () {
+                    this.xhr.abort()
+                }, t.onQueued(e), t.auto && e.upload()
+            }
+
+            var o = (0, r.default)(e), u = window.URL || window.webkitURL || window.mozURL;
+            if (t = r.default.extend({
+                url: "",
+                auto: !0,
+                type: "file",
+                fileVal: "file",
+                xhrFields: {},
+                onBeforeQueued: r.default.noop,
+                onQueued: r.default.noop,
+                onBeforeSend: r.default.noop,
+                onSuccess: r.default.noop,
+                onProgress: r.default.noop,
+                onError: r.default.noop
+            }, t), t.compress !== !1 && (t.compress = r.default.extend({
+                width: 1600,
+                height: 1600,
+                quality: .8
+            }, t.compress)), t.onBeforeQueued) {
+                var d = t.onBeforeQueued;
+                t.onBeforeQueued = function (e, t) {
+                    var n = d.call(e, t);
+                    if (n === !1) return !1;
+                    if (n !== !0) {
+                        var i = (0, r.default)(r.default.render(l.default, {id: e.id}));
+                        o.find(".weui-uploader__files").append(i)
+                    }
+                }
+            }
+            if (t.onQueued) {
+                var p = t.onQueued;
+                t.onQueued = function (e) {
+                    if (!p.call(e)) {
+                        var n = o.find('[data-id="' + e.id + '"]');
+                        n.css({backgroundImage: 'url("' + (e.base64 || e.url) + '")'}), t.auto || i(o, e.id)
+                    }
+                }
+            }
+            if (t.onBeforeSend) {
+                var h = t.onBeforeSend;
+                t.onBeforeSend = function (e, t, n) {
+                    var i = h.call(e, t, n);
+                    if (i === !1) return !1
+                }
+            }
+            if (t.onSuccess) {
+                var v = t.onSuccess;
+                t.onSuccess = function (e, t) {
+                    e.status = "success", v.call(e, t) || i(o, e.id)
+                }
+            }
+            if (t.onProgress) {
+                var m = t.onProgress;
+                t.onProgress = function (e, t) {
+                    m.call(e, t) || n(o, e.id).html(t + "%")
+                }
+            }
+            if (t.onError) {
+                var _ = t.onError;
+                t.onError = function (e, t) {
+                    e.status = "fail", _.call(e, t) || n(o, e.id).html('<i class="weui-icon-warn"></i>')
+                }
+            }
+            o.find('input[type="file"]').on("change", function (e) {
+                var n = e.target.files;
+                0 !== n.length && (t.compress === !1 && "file" == t.type ? Array.prototype.forEach.call(n, function (e) {
+                    e.id = ++c, t.onBeforeQueued(e, n) !== !1 && a(e)
+                }) : Array.prototype.forEach.call(n, function (e) {
+                    e.id = ++c, t.onBeforeQueued(e, n) !== !1 && (0, s.compress)(e, t, function (e) {
+                        e && a(e)
+                    })
+                }), this.value = "")
+            })
+        }
+
+        Object.defineProperty(t, "__esModule", {value: !0});
+        var o = n(2), r = i(o), u = n(21), l = i(u), s = n(22), d = n(23), f = i(d), c = 0;
+        t.default = a, e.exports = t.default
+    }, function (e, t) {
+        e.exports = '<li class="weui-uploader__file weui-uploader__file_status" data-id="<%= id %>"> <div class=weui-uploader__file-content> <i class=weui-loading style=width:30px;height:30px></i> </div> </li> '
+    }, function (e, t) {
+        "use strict";
+
+        function n(e) {
+            var t, n = e.naturalHeight, i = document.createElement("canvas");
+            i.width = 1, i.height = n;
+            var a = i.getContext("2d");
+            a.drawImage(e, 0, 0);
+            try {
+                t = a.getImageData(0, 0, 1, n).data
+            } catch (e) {
+                return 1
+            }
+            for (var o = 0, r = n, u = n; u > o;) {
+                var l = t[4 * (u - 1) + 3];
+                0 === l ? r = u : o = u, u = r + o >> 1
+            }
+            var s = u / n;
+            return 0 === s ? 1 : s
+        }
+
+        function i(e) {
+            for (var t = atob(e.split(",")[1]), n = new ArrayBuffer(t.length), i = new Uint8Array(n), a = 0; a < t.length; a++) i[a] = t.charCodeAt(a);
+            return n
+        }
+
+        function a(e) {
+            var t = e.split(",")[0].split(":")[1].split(";")[0], n = i(e);
+            return new Blob([n], {type: t})
+        }
+
+        function o(e) {
+            var t = new DataView(e);
+            if (65496 != t.getUint16(0, !1)) return -2;
+            for (var n = t.byteLength, i = 2; i < n;) {
+                var a = t.getUint16(i, !1);
+                if (i += 2, 65505 == a) {
+                    if (1165519206 != t.getUint32(i += 2, !1)) return -1;
+                    var o = 18761 == t.getUint16(i += 6, !1);
+                    i += t.getUint32(i + 4, o);
+                    var r = t.getUint16(i, o);
+                    i += 2;
+                    for (var u = 0; u < r; u++) if (274 == t.getUint16(i + 12 * u, o)) return t.getUint16(i + 12 * u + 8, o)
+                } else {
+                    if (65280 != (65280 & a)) break;
+                    i += t.getUint16(i, !1)
+                }
+            }
+            return -1
+        }
+
+        function r(e, t, n) {
+            var i = e.width, a = e.height;
+            switch (n > 4 && (e.width = a, e.height = i), n) {
+                case 2:
+                    t.translate(i, 0), t.scale(-1, 1);
+                    break;
+                case 3:
+                    t.translate(i, a), t.rotate(Math.PI);
+                    break;
+                case 4:
+                    t.translate(0, a), t.scale(1, -1);
+                    break;
+                case 5:
+                    t.rotate(.5 * Math.PI), t.scale(1, -1);
+                    break;
+                case 6:
+                    t.rotate(.5 * Math.PI), t.translate(0, -a);
+                    break;
+                case 7:
+                    t.rotate(.5 * Math.PI), t.translate(i, -a), t.scale(-1, 1);
+                    break;
+                case 8:
+                    t.rotate(-.5 * Math.PI), t.translate(-i, 0)
+            }
+        }
+
+        function u(e, t, u) {
+            var l = new FileReader;
+            l.onload = function (l) {
+                if (t.compress === !1) return e.base64 = l.target.result, void u(e);
+                var s = new Image;
+                s.onload = function () {
+                    var l = n(s), d = o(i(s.src)), f = document.createElement("canvas"), c = f.getContext("2d"),
+                        p = t.compress.width, h = t.compress.height, v = s.width, m = s.height, _ = void 0;
+                    if (v < m && m > h ? (v = parseInt(h * s.width / s.height), m = h) : v >= m && v > p && (m = parseInt(p * s.height / s.width), v = p), f.width = v, f.height = m, d > 0 && r(f, c, d), c.drawImage(s, 0, 0, v, m / l), _ = /image\/jpeg/.test(e.type) || /image\/jpg/.test(e.type) ? f.toDataURL("image/jpeg", t.compress.quality) : f.toDataURL(e.type), "file" == t.type) if (/;base64,null/.test(_) || /;base64,$/.test(_)) u(e); else {
+                        var g = a(_);
+                        g.id = e.id, g.name = e.name, g.lastModified = e.lastModified, g.lastModifiedDate = e.lastModifiedDate, u(g)
+                    } else /;base64,null/.test(_) || /;base64,$/.test(_) ? (t.onError(e, new Error("Compress fail, dataURL is " + _ + ".")), u()) : (e.base64 = _, u(e))
+                }, s.src = l.target.result
+            }, l.readAsDataURL(e)
+        }
+
+        Object.defineProperty(t, "__esModule", {value: !0}), t.default = {compress: u}, e.exports = t.default
+    }, function (e, t) {
+        "use strict";
+
+        function n(e) {
+            var t = e.url, n = e.file, i = e.fileVal, a = e.onBeforeSend, o = e.onProgress, r = e.onError,
+                u = e.onSuccess, l = e.xhrFields, s = n.name, d = n.type, f = n.lastModifiedDate,
+                c = {name: s, type: d, size: "file" == e.type ? n.size : n.base64.length, lastModifiedDate: f}, p = {};
+            if (a(n, c, p) !== !1) {
+                n.status = "progress", o(n, 0);
+                var h = new FormData, v = new XMLHttpRequest;
+                n.xhr = v, Object.keys(c).forEach(function (e) {
+                    h.append(e, c[e])
+                }), "file" == e.type ? h.append(i, n, s) : h.append(i, n.base64), v.onreadystatechange = function () {
+                    if (4 == v.readyState) if (200 == v.status) try {
+                        var e = JSON.parse(v.responseText);
+                        u(n, e)
+                    } catch (e) {
+                        r(n, e)
+                    } else r(n, new Error("XMLHttpRequest response status is " + v.status))
+                }, v.upload.addEventListener("progress", function (e) {
+                    if (0 != e.total) {
+                        var t = 100 * Math.ceil(e.loaded / e.total);
+                        o(n, t)
+                    }
+                }, !1), v.open("POST", t), Object.keys(l).forEach(function (e) {
+                    v[e] = l[e]
+                }), Object.keys(p).forEach(function (e) {
+                    v.setRequestHeader(e, p[e])
+                }), v.send(h)
+            }
+        }
+
+        Object.defineProperty(t, "__esModule", {value: !0}), t.default = n, e.exports = t.default
+    }, function (e, t, n) {
+        "use strict";
+
+        function i(e) {
+            if (e && e.__esModule) return e;
+            var t = {};
+            if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]);
+            return t.default = e, t
+        }
+
+        function a(e) {
+            return e && e.__esModule ? e : {default: e}
+        }
+
+        function o(e) {
+            "object" != ("undefined" == typeof e ? "undefined" : l(e)) && (e = {
+                label: e,
+                value: e
+            }), d.default.extend(this, e)
+        }
+
+        function r() {
+            function e() {
+                (0, d.default)(r.container).append(v), d.default.getStyle(v[0], "transform"), v.find(".weui-half-screen-dialog__title").html(r.title), v.find(".weui-mask").addClass("weui-animate-fade-in"), v.find(".weui-picker").addClass("weui-animate-slide-up")
+            }
+
+            function t(e) {
+                t = d.default.noop, v.find(".weui-mask").addClass("weui-animate-fade-out"), v.find(".weui-picker").addClass("weui-animate-slide-down").on("animationend webkitAnimationEnd", function () {
+                    v.remove(), w = !1, r.onClose(), e && e()
+                })
+            }
+
+            function n(e) {
+                t(e)
+            }
+
+            function i(e, t) {
+                if (void 0 === p[t] && r.defaultValue && void 0 !== r.defaultValue[t]) {
+                    var n = r.defaultValue[t], a = 0, u = e.length;
+                    if ("object" == l(e[a])) for (; a < u && n != e[a].value; ++a) ; else for (; a < u && n != e[a]; ++a) ;
+                    a < u && (p[t] = a)
+                }
+                v.find(".weui-picker__group").eq(t).scroll({
+                    items: e, temp: p[t], onChange: function (e, n) {
+                        if (e ? c[t] = new o(e) : c[t] = null, p[t] = n, s) c.length == _ && r.onChange(c); else if (e.children && e.children.length > 0) v.find(".weui-picker__group").eq(t + 1).show(), !s && i(e.children, t + 1); else {
+                            var a = v.find(".weui-picker__group");
+                            a.forEach(function (e, n) {
+                                n > t && (0, d.default)(e).hide()
+                            }), c.splice(t + 1), r.onChange(c)
+                        }
+                    }, onConfirm: r.onConfirm
+                })
+            }
+
+            if (w) return w;
+            var a = arguments[arguments.length - 1], r = d.default.extend({
+                id: "default",
+                className: "",
+                container: "body",
+                title: "",
+                onChange: d.default.noop,
+                onConfirm: d.default.noop,
+                onClose: d.default.noop
+            }, a), u = void 0, s = !1;
+            if (arguments.length > 2) {
+                var f = 0;
+                for (u = []; f < arguments.length - 1;) u.push(arguments[f++]);
+                s = !0
+            } else u = arguments[0];
+            y[r.id] = y[r.id] || [];
+            for (var c = [], p = y[r.id], v = (0, d.default)(d.default.render(m.default, r)), _ = a.depth || (s ? u.length : h.depthOf(u[0])), b = "", k = _; k--;) b += g.default;
+            return v.find(".weui-picker__bd").html(b), e(), s ? u.forEach(function (e, t) {
+                i(e, t)
+            }) : i(u, 0), v.on("click", ".weui-mask", function () {
+                n()
+            }).on("click", ".weui-picker__btn", function () {
+                n()
+            }).on("click", "#weui-picker-confirm", function () {
+                r.onConfirm(c)
+            }), w = v[0], w.hide = n, w
+        }
+
+        function u(e) {
+            var t = new Date, n = d.default.extend({
+                id: "datePicker",
+                onChange: d.default.noop,
+                onConfirm: d.default.noop,
+                start: t.getFullYear() - 20,
+                end: t.getFullYear() + 20,
+                defaultValue: [t.getFullYear(), t.getMonth() + 1, t.getDate()],
+                cron: "* * *"
+            }, e);
+            "number" == typeof n.start ? n.start = new Date(n.start + "/01/01") : "string" == typeof n.start && (n.start = new Date(n.start.replace(/-/g, "/"))), "number" == typeof n.end ? n.end = new Date(n.end + "/12/31") : "string" == typeof n.end && (n.end = new Date(n.end.replace(/-/g, "/")));
+            var i = function (e, t, n) {
+                for (var i = 0, a = e.length; i < a; i++) {
+                    var o = e[i];
+                    if (o[t] == n) return o
+                }
+            }, a = [], o = c.default.parse(n.cron, n.start, n.end), u = void 0;
+            do {
+                u = o.next();
+                var l = u.value.getFullYear(), s = u.value.getMonth() + 1, f = u.value.getDate(), p = i(a, "value", l);
+                p || (p = {label: l + "年", value: l, children: []}, a.push(p));
+                var h = i(p.children, "value", s);
+                h || (h = {
+                    label: s + "月",
+                    value: s,
+                    children: []
+                }, p.children.push(h)), h.children.push({label: f + "日", value: f})
+            } while (!u.done);
+            return r(a, n)
+        }
+
+        Object.defineProperty(t, "__esModule", {value: !0});
+        var l = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
+            return typeof e
+        } : function (e) {
+            return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
+        }, s = n(2), d = a(s), f = n(25), c = a(f);
+        n(26);
+        var p = n(27), h = i(p), v = n(28), m = a(v), _ = n(29), g = a(_);
+        o.prototype.toString = function () {
+            return this.value
+        }, o.prototype.valueOf = function () {
+            return this.value
+        };
+        var w = void 0, y = {};
+        t.default = {picker: r, datePicker: u}, e.exports = t.default
+    }, function (e, t) {
+        "use strict";
+
+        function n(e, t) {
+            if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
+        }
+
+        function i(e, t) {
+            var n = t[0], i = t[1], a = [], o = void 0;
+            e = e.replace(/\*/g, n + "-" + i);
+            for (var u = e.split(","), l = 0, s = u.length; l < s; l++) {
+                var d = u[l];
+                d.match(r) && d.replace(r, function (e, t, r, u) {
+                    u = parseInt(u) || 1, t = Math.min(Math.max(n, ~~Math.abs(t)), i), r = r ? Math.min(i, ~~Math.abs(r)) : t, o = t;
+                    do a.push(o), o += u; while (o <= r)
+                })
+            }
+            return a
+        }
+
+        function a(e, t, n) {
+            var a = e.replace(/^\s\s*|\s\s*$/g, "").split(/\s+/), o = [];
+            return a.forEach(function (e, t) {
+                var n = u[t];
+                o.push(i(e, n))
+            }), new l(o, t, n)
+        }
+
+        Object.defineProperty(t, "__esModule", {value: !0});
+        var o = function () {
+            function e(e, t) {
+                for (var n = 0; n < t.length; n++) {
+                    var i = t[n];
+                    i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i)
+                }
+            }
+
+            return function (t, n, i) {
+                return n && e(t.prototype, n), i && e(t, i), t
+            }
+        }(), r = /^(\d+)(?:-(\d+))?(?:\/(\d+))?$/g, u = [[1, 31], [1, 12], [0, 6]], l = function () {
+            function e(t, i, a) {
+                n(this, e), this._dates = t[0], this._months = t[1], this._days = t[2], this._start = i, this._end = a, this._pointer = i
+            }
+
+            return o(e, [{
+                key: "_findNext", value: function () {
+                    for (var e = void 0; ;) {
+                        if (this._end.getTime() - this._pointer.getTime() < 0) throw new Error("out of range, end is " + this._end + ", current is " + this._pointer);
+                        var t = this._pointer.getMonth(), n = this._pointer.getDate(), i = this._pointer.getDay();
+                        if (this._months.indexOf(t + 1) !== -1) if (this._dates.indexOf(n) !== -1) {
+                            if (this._days.indexOf(i) !== -1) {
+                                e = new Date(this._pointer);
+                                break
+                            }
+                            this._pointer.setDate(n + 1)
+                        } else this._pointer.setDate(n + 1); else this._pointer.setMonth(t + 1), this._pointer.setDate(1)
+                    }
+                    return e
+                }
+            }, {
+                key: "next", value: function () {
+                    var e = this._findNext();
+                    return this._pointer.setDate(this._pointer.getDate() + 1), {value: e, done: !this.hasNext()}
+                }
+            }, {
+                key: "hasNext", value: function () {
+                    try {
+                        return this._findNext(), !0
+                    } catch (e) {
+                        return !1
+                    }
+                }
+            }]), e
+        }();
+        t.default = {parse: a}, e.exports = t.default
+    }, function (e, t, n) {
+        "use strict";
+
+        function i(e) {
+            return e && e.__esModule ? e : {default: e}
+        }
+
+        var a = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
+            return typeof e
+        } : function (e) {
+            return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
+        }, o = n(2), r = i(o), u = function (e, t) {
+            return e.css({"-webkit-transition": "all " + t + "s", transition: "all " + t + "s"})
+        }, l = function (e, t) {
+            return e.css({
+                "-webkit-transform": "translate3d(0, " + t + "px, 0)",
+                transform: "translate3d(0, " + t + "px, 0)"
+            })
+        }, s = function (e) {
+            for (var t = Math.floor(e.length / 2), n = 0; e[t] && e[t].disabled;) if (t = ++t % e.length, n++, n > e.length) throw new Error("No selectable item.");
+            return t
+        }, d = function (e, t, n) {
+            var i = s(n);
+            return (e - i) * t
+        }, f = function (e, t) {
+            return e * t
+        }, c = function (e, t, n) {
+            return -(t * (n - e - 1))
+        };
+        r.default.fn.scroll = function (e) {
+            function t(e) {
+                _ = e, w = +new Date
+            }
+
+            function n(e) {
+                g = e;
+                var t = g - _;
+                u(m, 0), l(m, y + t), w = +new Date, b.push({time: w, y: g}), b.length > 40 && b.shift()
+            }
+
+            function i(e) {
+                if (_) {
+                    var t = (new Date).getTime(), n = v[0].getBoundingClientRect().top + p.bodyHeight / 2;
+                    if (g = e, t - w > 100) C(Math.abs(g - _) > 10 ? g - _ : n - g); else if (Math.abs(g - _) > 10) {
+                        for (var i = b.length - 1, a = i, o = i; o > 0 && w - b[o].time < 100; o--) a = o;
+                        if (a !== i) {
+                            var r = b[i], u = b[a], l = r.time - u.time, s = r.y - u.y, d = s / l,
+                                f = 150 * d + (g - _);
+                            C(f)
+                        } else C(0)
+                    } else C(n - g);
+                    _ = null
+                }
+            }
+
+            var o = this, p = r.default.extend({
+                items: [],
+                scrollable: ".weui-picker__content",
+                offset: 2,
+                rowHeight: 48,
+                onChange: r.default.noop,
+                temp: null,
+                bodyHeight: 240
+            }, e), h = p.items.map(function (e) {
+                return '<div class="weui-picker__item' + (e.disabled ? " weui-picker__item_disabled" : "") + '">' + ("object" == ("undefined" == typeof e ? "undefined" : a(e)) ? e.label : e) + "</div>"
+            }).join(""), v = (0, r.default)(this);
+            v.find(".weui-picker__content").html(h);
+            var m = v.find(p.scrollable), _ = void 0, g = void 0, w = void 0, y = void 0, b = [];
+            if (null !== p.temp && p.temp < p.items.length) {
+                var k = p.temp;
+                p.onChange.call(this, p.items[k], k), y = (p.offset - k) * p.rowHeight
+            } else {
+                var x = s(p.items);
+                p.onChange.call(this, p.items[x], x), y = d(p.offset, p.rowHeight, p.items)
+            }
+            l(m, y);
+            var C = function (e) {
+                y += e, y = Math.round(y / p.rowHeight) * p.rowHeight;
+                var t = f(p.offset, p.rowHeight), n = c(p.offset, p.rowHeight, p.items.length);
+                y > t && (y = t), y < n && (y = n);
+                for (var i = p.offset - y / p.rowHeight; p.items[i] && p.items[i].disabled;) e > 0 ? ++i : --i;
+                y = (p.offset - i) * p.rowHeight, u(m, .3), l(m, y), p.onChange.call(o, p.items[i], i)
+            };
+            m = v.offAll().on("touchstart", function (e) {
+                t(e.changedTouches[0].pageY)
+            }).on("touchmove", function (e) {
+                n(e.changedTouches[0].pageY), e.preventDefault()
+            }).on("touchend", function (e) {
+                i(e.changedTouches[0].pageY)
+            }).find(p.scrollable);
+            var M = "ontouchstart" in window || window.DocumentTouch && document instanceof window.DocumentTouch;
+            M || v.on("mousedown", function (e) {
+                t(e.pageY), e.stopPropagation(), e.preventDefault()
+            }).on("mousemove", function (e) {
+                _ && (n(e.pageY), e.stopPropagation(), e.preventDefault())
+            }).on("mouseup mouseleave", function (e) {
+                i(e.pageY), e.stopPropagation(), e.preventDefault()
+            })
+        }
+    }, function (e, t) {
+        "use strict";
+        Object.defineProperty(t, "__esModule", {value: !0});
+        t.depthOf = function e(t) {
+            var n = 1;
+            return t.children && t.children[0] && (n = e(t.children[0]) + 1), n
+        }
+    }, function (e, t) {
+        e.exports = ' <div class="<%= className %>"> <div class=weui-mask></div> <div class="weui-half-screen-dialog weui-picker"> <div class=weui-half-screen-dialog__hd> <div class=weui-half-screen-dialog__hd__side> <button class="weui-icon-btn weui-icon-btn_close weui-picker__btn">鍏抽棴</button> </div> <div class=weui-half-screen-dialog__hd__main> <strong class=weui-half-screen-dialog__title>鏍囬</strong> </div> </div> <div class=weui-half-screen-dialog__bd> <div class=weui-picker__bd></div> </div> <div class=weui-half-screen-dialog__ft> <a href=javascript:; class="weui-btn weui-btn_primary weui-picker__btn" id=weui-picker-confirm data-action=select>确定</a> </div> </div> </div>'
+    }, function (e, t) {
+        e.exports = "<div class=weui-picker__group> <div class=weui-picker__mask></div> <div class=weui-picker__indicator></div> <div class=weui-picker__content></div> </div>"
+    }, function (e, t, n) {
+        "use strict";
+
+        function i(e) {
+            return e && e.__esModule ? e : {default: e}
+        }
+
+        function a(e) {
+            function t(e) {
+                t = r.default.noop, a.addClass("weui-animate-fade-out").on("animationend webkitAnimationEnd", function () {
+                    a.remove(), s = !1, e && e()
+                })
+            }
+
+            function n(e) {
+                t(e)
+            }
+
+            var i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
+            if (s) return s;
+            i = r.default.extend({className: "", onDelete: r.default.noop}, i);
+            var a = (0, r.default)(r.default.render(l.default, r.default.extend({url: e}, i)));
+            return (0, r.default)("body").append(a), a.find(".weui-gallery__img").on("click", function () {
+                n()
+            }), a.find(".weui-gallery__del").on("click", function () {
+                i.onDelete.call(this, e)
+            }), a.show().addClass("weui-animate-fade-in"), s = a[0], s.hide = n, s
+        }
+
+        Object.defineProperty(t, "__esModule", {value: !0});
+        var o = n(2), r = i(o), u = n(31), l = i(u), s = void 0;
+        t.default = a, e.exports = t.default
+    }, function (e, t) {
+        e.exports = '<div class="weui-gallery <%= className %>"> <span class=weui-gallery__img style="background-image:url(<%= url %>)"></span> <div class=weui-gallery__opr> <a href=javascript: class=weui-gallery__del> <i class="weui-icon-delete weui-icon_gallery-delete"></i> </a> </div> </div> '
+    }, function (e, t, n) {
+        "use strict";
+
+        function i(e) {
+            return e && e.__esModule ? e : {default: e}
+        }
+
+        function a(e) {
+            var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n = (0, r.default)(e);
+            if (t = r.default.extend({
+                step: void 0,
+                defaultValue: 0,
+                onChange: r.default.noop
+            }, t), void 0 !== t.step && (t.step = parseFloat(t.step), !t.step || t.step < 0)) throw new Error("Slider step must be a positive number.");
+            if (void 0 !== t.defaultValue && t.defaultValue < 0 || t.defaultValue > 100) throw new Error("Slider defaultValue must be >= 0 and <= 100.");
+            return n.forEach(function (e) {
+                function n() {
+                    var e = r.default.getStyle(l[0], "left");
+                    return e = /%/.test(e) ? s * parseFloat(e) / 100 : parseFloat(e)
+                }
+
+                function i(n) {
+                    var i = void 0, a = void 0;
+                    t.step && (n = Math.round(n / p) * p), i = f + n, i = i < 0 ? 0 : i > s ? s : i, a = 100 * i / s, u.css({width: a + "%"}), l.css({left: a + "%"}), t.onChange.call(e, a)
+                }
+
+                var a = (0, r.default)(e), o = a.find(".weui-slider__inner"), u = a.find(".weui-slider__track"),
+                    l = a.find(".weui-slider__handler"), s = parseInt(r.default.getStyle(o[0], "width")),
+                    d = o[0].offsetLeft, f = 0, c = 0, p = void 0;
+                t.step && (p = s * t.step / 100), t.defaultValue && i(s * t.defaultValue / 100), a.on("click", function (e) {
+                    e.preventDefault(), f = n(), i(e.pageX - d - f)
+                }), l.on("touchstart", function (e) {
+                    f = n(), c = e.changedTouches[0].clientX
+                }).on("touchmove", function (e) {
+                    e.preventDefault(), i(e.changedTouches[0].clientX - c)
+                })
+            }), this
+        }
+
+        Object.defineProperty(t, "__esModule", {value: !0});
+        var o = n(2), r = i(o);
+        t.default = a, e.exports = t.default
+    }])
+});

+ 312 - 0
gjj/static/yinhai.css

@@ -0,0 +1,312 @@
+html,body{
+ background-color:#fbf9fe;
+/*color:rgb(63, 72, 79);*/
+}
+
+
+
+
+/*头部*/
+.header{-webkit-box-align:center;box-align:center;
+  display: -webkit-box !important;
+  display: box !important;
+  position:relative;width: 100%;
+  background:#00A1EA;
+  color: white;
+  font-size: 1rem;
+  height:2.75em; 
+ }
+ .header-nav {
+    min-height: 1rem;
+    min-width: 2em;
+    display: -webkit-box !important;
+    display: box !important;
+    position: relative;
+    -webkit-box-pack: center;
+    box-pack: center;
+}
+.header-title{
+    margin: 0;
+    padding-left: 35px;
+    position:relative;
+    -webkit-box-flex: 1; 
+    box-flex: 1;
+    display: flex;
+} 
+/**mdui 样式控件进行覆盖*/
+   
+.box-fl ,input{width:100%;font-size: .9375em}
+.mdui-input-row .listCell{font-size:0.9375em}
+.mdui-input-row .label{width:6.5625em;font-size:.9375em}
+.select select{font-size:.875em}
+.mdui-input-row{font-size:.875em}
+.mdui-input-group input{padding:0px;}
+.mdui-input-group .row-left-line:after {left:0rem;}
+.fundRow_tip_bg .mdui-input-row:not(.no_access) {
+     -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+ }
+.mdui-input-row .img{width:1.45em;margin-right:0.4em;display:block}
+.fund_row  .img{width:1.65em;margin-right:0.4em;display:block}  
+.fundRow_tip_bg .mdui-input-row:not(.no_access):active {
+     background-color: #ECECEC;
+}
+/*
+.mdui-input-group .mdui-input-row:after
+{
+    position: absolute;
+    right: 0;
+    bottom: 0;
+    left: .9375rem;
+
+    height: .0625em;
+
+    content: '';
+    -webkit-transform: scaleY(.5);
+            transform: scaleY(.5);
+    background-color: #c8c7cc;
+}*/
+/*注册*/
+.loginlogo{width: 100%;height: 8.5em; background: url(./images/loginlogo.png) no-repeat;background-size: 100%;-webkit-background-size: 100%;}
+.icon-tool{width: 100%;height: 8.5em; background: url(./images/title.png) no-repeat;background-size: 100%;-webkit-background-size: 100%;}
+.login-nav-color{color:#00A1EA}
+.titleTip{margin:.4em;font-size: .875em;color:#8B8B8E}
+
+/**grid**/
+.grid-bg-color{background:#FFF}
+/*表格边框样式*/
+.fund_grids {
+  font-size: 0.875em;
+  position: relative;
+  overflow: hidden;
+}
+.fund_grids:before {
+  content: '';
+  position: absolute;
+  box-sizing: border-box;
+  width: 200%;
+  height: 200%;
+  left: 0;
+  top: 0;
+  border: 1px solid #D9D9D9;
+  -webkit-transform-origin: 0 0;
+          transform-origin: 0 0;
+  -webkit-transform: scale(0.5);
+          transform: scale(0.5);
+}
+
+.fund_grid_icon img {
+  display: block;
+  width: 100%;
+  height: 100%;
+}
+.grid-mny{color: #FF6817;}
+/*两列表格*/
+.fund_grid {
+  position: relative;
+  float: left;
+  padding: 1em 0.625em;
+  box-sizing: border-box;
+
+}
+.fund_grid_noborder {
+  position: relative;
+  float: left;
+  padding: 1em 0.625em;
+  box-sizing: border-box;
+
+}
+.fund_grid_app {
+   padding: .825em  0.425em .65em 0.425em;
+}
+.fund_grid_app p{
+    margin-top: .0em;
+    margin-bottom: .8em;
+    height:1.7em;
+}
+.fund_grid .labe_margin{margin-top:.4em;margin-bottom:.3em}
+.grid-app{
+    position: relative;
+  float: left;
+  padding: .4em 0.4em;
+  box-sizing: border-box;
+  font-size: .875em;
+}
+.grid-2c{
+    width: 50%;
+}
+
+.grid-3c{
+    width: 33.3333%;
+}
+.grid-3c1{
+    width: 36.2%;
+}
+.grid-3c2{
+    width: 31.4%;
+}
+.grid-3c3{
+    width: 31.4%;
+}
+.grid-3c4{
+    width: 44%;
+}
+
+.grid-4c{
+    width: 25%;
+}
+.fund_grid:before {
+  content: '';
+  position: absolute;
+  box-sizing: border-box;
+  width: 200%;
+  left: 0;
+  top: 0;
+  -webkit-transform-origin: 0 0;
+          transform-origin: 0 0;
+  -webkit-transform: scale(0.5);
+          transform: scale(0.5);
+}
+.fund_grid:active {
+      background-color: #E4E4E4;
+    }
+.fund_grid img{height: 2em;width: 2em;}
+/**单击行背景变换*/
+
+/*功能应用图标*/
+.grid_icon{
+  width: 1.75em;height: 1.75em;margin: 0 auto;
+}
+.grid_icon img {
+  display: block;width: 100%;height: 100%;
+}
+.grid_icon + .grid_label {
+  margin-top: 0.3125em;
+}
+.grid_label {
+  display: block;text-align: center;color: #676767;padding-top:0.3em;font-size:0.9375em;
+}
+/*List arrow*/
+.right-arrow .arrow:after {
+  content: " ";
+  display: block;
+  -webkit-transform: rotate(45deg);
+          transform: rotate(45deg);
+  height: 0.475em;
+  width: 0.475em;
+  border-width: 2px 2px 0 0;
+  border-color: #888;
+  border-style: solid;
+  position: relative;
+  margin-left: .3em;
+  font-size: 1em;
+}
+.select-arrow .arrow:after {
+  content: " ";
+  display: block;
+  -webkit-transform: rotate(135deg);
+          transform: rotate(135deg);
+  height: 0.375em;
+  width: 0.375em;
+  border-width: 2px 2px 0 0;
+  border-color: #888;
+  border-style: solid;
+  position: relative;
+  margin-left: .3em;
+  font-size: 1em;
+}
+.fund_grid_icon {
+  width: 3em;
+  height: 3em;
+  margin: 0 auto;
+}
+.fund_grid_icon2 {
+  width: 2.8em;
+  height: 2.8em;
+  margin: 0 auto;
+}
+.icon{display:inline-block;width:100%;height:100%;vertical-align:middle;background-size:100% 100%}
+
+/*提取图标*/
+.icon_txtq{ content:url(../css/images/icon_txtq.png) ;}
+.icon_payLoan{background-image:url(../css/images/icon_payLoan.png) ;}
+.icon_leave{background-image:url(../css/images/icon_leave.png) ;}
+.icon_lz{background-image:url(../css/images/icon_lz.png) ;}
+.icon_gmzf{background-image: url(../css/images/icon_gmzf.png);}
+.icon_dxzf{background-image: url(../css/images/icon_dxzf.png);}
+.icon_qcdj{background-image: url(../css/images/icon_qcdj.png);}
+.icon_zlzf{background-image: url(../css/images/icon_zlzf.png);}
+.icon_zdjb{background-image: url(../css/images/icon_zdjb.png);}
+.icon_shkn{background-image: url(../css/images/icon_shkn.png);}
+.icon_dt{background-image: url(../css/images/icon_dt.png);}
+.icon_sw{background-image: url(../css/images/icon_sw.png);}
+.icon_sdqy{background-image: url(../css/images/icon_sdqy.png);}
+.icon_gfqy{background-image: url(../css/images/icon_gfqy.png);}
+.icon_xybg{background-image: url(../css/images/icon_xybg.png);}
+.icon_xyjc{background-image: url(../css/images/icon_xyjc.png);}
+.icon_xyck{background-image: url(../css/images/icon_xyck.png);}
+/*提取图标*/
+.icon_self_sev{ content:url(img/self_sev.png)}
+.self_ei{ content:url(img/self_ei.png)}
+.self_ni{ content:url(img/self_ni.png)}
+.self_ten{ content:url(img/self_ten.png)}
+.self_rd{ content:url(img/self_rd.png)}
+.self_plan{ content:url(img/self_plan.png)}
+.printCertificateofDeposit{ content:url(img/printCertificateofDeposit.png)}
+
+
+.tiqu{ content:url(../css/images/tiqu.png)}
+.pic_160{ content:url(../css/images/pic_160.png)}
+.icon_search{ content:url(../css/images/icon_search.png)}
+.icon_s3{ content:url(../css/images/icon_s3.gif)}
+.con_f{ content:url(../css/img/con_f.png)}
+.pay{ content:url(../css/images/pay.png)}
+.con_se{ content:url(../css/img/con_se.png)}
+.con_tr{ content:url(../css/img/con_tr.png)}
+.con_fo{ content:url(../css/img/con_fo.png)}
+.con_ph{ content:url(../css/img/con_ph.png)}
+.con_fi{ content:url(../css/img/con_fi.png)}
+.con_ei{ content:url(../css/img/con_ei.png)}
+.con_ele{ content:url(../css/img/con_ele.png)}
+.con_si{ content:url(../css/img/con_si.png)}
+.basemny{ content:url(../css/images/basemny.png)}
+.icon_user{ content:url(../css/images/icon_user.png)}
+.signcard{ content:url(../css/images/signcard.png)}
+.i10{ content:url(../css/images/i10.png)}
+.yw_tqhk{ content:url(../css/images/yw_tqhk.png)}
+.yw_hkzhbg{ content:url(../css/images/yw_hkzhbg.png)}
+.yw_grxxbg{ content:url(../css/images/yw_grxxbg.png)}
+.yw_yhkgl{ content:url(../css/images/yw_yhkgl.png)}
+.yw_gjjwtkh{ content:url(../css/images/yw_gjjwtkh.png)}
+.yw_tqjd{ content:url(../css/images/yw_tqjd.png)}
+.yw_hkfsbg{ content:url(../css/images/yw_hkfsbg.png)}
+.sy_jc{ content:url(../css/images/sy_jcjbxx.png)}
+.self_yd{ content:url(../css/images/sy_ydzrcx.png)}
+.self_zy{ content:url(../css/images/sy_grzyjlcx.png)}
+.con_se{ content:url(img/con_se.png)}
+.con_seve{ content:url(img/con_seve.png)}
+.arrow_right{ content:url(../css/images/arrow_right.png)}
+.daikuan{ content:url(../css/images/daikuan.png)}
+.daikuan1{ content:url(../css/images/daikuan1.png)}
+.icon_fjdx{ content:url(../css/images/icon_fjdx.png)}
+.icon_loanProcess{ content:url(../css/images/icon_loanProcess.png)}
+.icon_pen{ content:url(../css/images/icon_pen.png)}
+.xyzh{ content:url(../css/images/xyzh.png)}
+.dttz{ content:url(../css/images/dttz.png)}
+.zcfg{ content:url(../css/images/zcfg.png)}
+.ywzn{ content:url(../css/images/ywzn.png)}
+.dhyw{ content:url(../css/images/dhyw.png)}
+.yddk{ content:url(../css/images/yddk.png)}
+.jzgb{ content:url(../css/images/jzgb.png)}
+/*提取资料上传列表*/
+.filebox{height:3.2em;}
+.fileboxC{height:100%;background-size:cover;background-repeat:no-repeat}
+.fileboxC img{width: 99%;height:99%;position: absolute;}
+.fileboxC button{width:10.2em}
+.fileboxC .cklabel{width:2em;padding-top:.2em}
+.filebox .checkbox{width:1em;height:1em}
+.scan{content:url(../css/images/scan.png)}
+/*end*/
+
+.seach-Box{width:33.3333%;float:left;}
+.seach-Box .box{font-size:.875em;background:#FFF;border: 1px solid #EEEEEE;padding:.4em;margin: .4em} 
+  .circle { z-index:5666000000; position:fixed; bottom:3em; right:1em;  width: 2.8em; height: 2.8em;background:rgba(0, 0, 0, 0.6); border:0px solid #f1f1f1; -moz-border-radius: 3.125em; -webkit-border-radius: 3.125em; border-radius: 3.125em; }

+ 2064 - 0
gjj/static/yinhai.js

@@ -0,0 +1,2064 @@
+if (!window.Base) {
+    Base = {};
+}
+Base.check_alive_type = "2";//0:读数刷脸 1:屏幕闪烁刷脸 2:先闪烁不行则读数
+Base.faceType = "1";//0 不刷脸1:微信城市生活服务 2:支付宝 3:微信慧眼
+pubKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCJcTBCPyX3OpLPNmDYLUitf8sZG4Wa1Q/9MNX/t12keSOjT/44OWnGHSo69eEpqxxx1KXkGJyLqvkUBhd8E5PUuADoy6AEyIRR093ceoYY2gNPVgsY61edp7MvB5iz9ej8Aw/ZwIacYZIib7VhFIBas+yG8yRvDU7kZYdmGrAH5QIDAQAB";
+Base.setValue = function (key, value) {
+    if (typeof key == 'string') {
+        $("#" + key).val(value);
+    } else if (typeof key == 'object') {
+        for (var k in key) {
+            var obj = $("#" + k);
+            var tag = obj[0] != null ? obj[0].tagName.toLowerCase() : "";
+            if (tag == 'select' && key[k] instanceof Array) {
+                $.setSelect(k, key[k]);
+            } else {
+                obj.val(key[k]);
+            }
+
+        }
+    }
+
+};
+
+Base.getValue = function (key) {
+    return $("#" + key).val();
+};
+Base.setReadOnly = function (ids) {
+    ids = "#" + ids.replace(/,/g, ",#");
+    $(ids).attr("readonly", "readonly");
+};
+Base.setRequired = function (ids, valid) {
+    ids = "#" + ids.replace(/,/g, ",#");
+    if (!valid) {
+        $(ids).attr("valid", "r");
+    } else {
+        $(ids).removeAttr("valid");
+    }
+}
+Base.submit = function (id, p, fun, fail) {
+    $.doSubmit(id, p, function (data) {
+        //for(var key in data){
+        //    $("#"+key).val(data[key]);
+        //}
+        Base.setValue(data);
+        if (fun) {
+            fun();
+        }
+    }, function (data) {
+        $.toast(data.resmsg);
+        if (fail) {
+            fail(data);
+        }
+    });
+};
+Base.showObj = function (ids) {
+    ids = "#" + ids.replace(/,/g, ",#");
+    $(ids).parent().parent().show();
+};
+Base.hideObj = function (ids) {
+    ids = "#" + ids.replace(/,/g, ",#");
+    $(ids).parent().parent().hide();
+};
+Base.setEnable = function (ids) {
+    ids = "#" + ids.replace(/,/g, ",#");
+    $(ids).removeAttr("readonly");
+};
+Base.alert = function (msg) {
+    $.toast(msg);
+};
+Base.focus = function (ids) {
+    ids = "#" + ids;
+    $(ids).focus();
+};
+Base.filterSelectInput = function (id, value) {
+    var options = document.getElementById(id).options;
+    for (var i = 0; i < options.length; i++) {
+        var o = options[i];
+        if (o.value != value) {
+            o.disabled = true;
+        }
+    }
+};
+(function ($) {
+    function list2Row(data, mode) {
+        var html = "<div class='weui-cells' style='margin-top:0px' >";
+        var content = [];
+        var length = data.length;
+        for (var i = 0; i < length; i++) {
+            if (!data[i].value) {
+                continue;
+            }
+            content[i] = "<div class='weui-cell ' style='font-size:0.9375em'><div class='weui-cell__bd'>" + (data[i].name != null ? data[i].name : "") + "</div><div class='weui-cell__ft'>" + (data[i].value != null ? data[i].value : "") + "</div></div>";
+        }
+        html += content.join("") + "</div>";
+        return html;
+    }
+
+    function closeToast() {
+        $(".fund_mask").remove();
+        //uexWindow.closeToast();
+        layer.closeAll();
+
+    }
+
+    function halfScreenDialog(params, callBack,cancel) {
+        var counters = 15;
+        if(params.counters==0){
+            counters = 0
+        }
+        if(params.counters){
+            counters = params.counters
+        }
+        var button_text = "我已阅读并同意";
+        if(params.btn){
+            button_text = params.btn;
+        }
+        var win = '<div id="dialogs">';
+        win +="     <div class='js_dialog' id='iosDialog2' style='display: none;'>"
+        win +="         <div class='weui-mask'></div>"
+        win +="         <div id='js_dialog_2' class='weui-half-screen-dialog'>"
+        win +="             <div class='weui-half-screen-dialog__hd'>"
+        win +="                 <div class='weui-half-screen-dialog__hd__side'>"
+        win +="                     <button class='weui-icon-btn' id='hideIOSDialog2'>关闭<i class='weui-icon-close-thin'></i></button>"
+        win +="                 </div>"
+        win +="                 <div class='weui-half-screen-dialog__hd__main'>"
+        if (params.title != null) {
+            win +="                 <strong class='weui-half-screen-dialog__title'>"+ (params.title == null ? "" : params.title) +"</strong>"
+        }
+        win +="                 </div>"
+        win +="             </div>"
+        win +="             <div class='weui-half-screen-dialog__bd' style='max-height: 300px;'>"
+        win +="                 <p class='weui-half-screen-dialog__tips'>"+ (params.content == null ? "" : params.content) + "</p>"
+        win +="             </div>"
+        win +="             <div class='weui-half-screen-dialog__ft'>"
+        win +="                 <a href='javascript:' class='weui-btn weui-btn_primary weui-btn_disabled' id='confirm_btn'>"+counters+"s</a>"
+        win +="             </div>"
+        win +="         </div>"
+        win +="     </div>"
+        win +="</div>";
+
+        var mydialog = $(win);
+        $(document.body).append(mydialog);
+        $("#confirm_btn").addClass('weui-btn_disabled')
+        if(counters==0){
+            $("#confirm_btn").removeClass('weui-btn_disabled')
+            $("#confirm_btn").text(button_text)
+        }else{
+            var j ;
+            var counter = counters-1;
+            clearInterval(j);
+            j = setInterval(function () {
+                $("#confirm_btn").text(counter+"s")
+                counter--;
+
+                if (counter == -1) {
+                    $("#confirm_btn").removeClass('weui-btn_disabled')
+                    $("#confirm_btn").text(button_text)
+                    clearInterval(j);
+                }
+            }, 1000);
+        }
+
+        var $dialog2 = $('#js_dialog_2'),
+            $iosDialog2 = $('#iosDialog2');
+
+        mydialog.find("a").each(function (index) {
+            $(this).bind('click', function () {
+                if($("#confirm_btn").hasClass('weui-btn_disabled')){
+                    return
+                }
+                if (callBack) {
+                    callBack(index);
+                    $(mydialog).remove();
+                    $iosDialog2.fadeOut(200);
+                    $dialog2.removeClass('weui-half-screen-dialog_show');
+                }
+            });
+        });
+
+        $('#dialogs').on('click', '.weui-mask', function(){
+            // $(mydialog).remove();
+            // $("#confirm_btn").addClass('weui-btn_disabled')
+            // $("#confirm_btn").text(counters+"s")
+            // clearInterval(j);
+            // $(this).parents('.js_dialog').fadeOut(200);
+            // $dialog2.removeClass('weui-half-screen-dialog_show');
+        });
+
+        $('#hideIOSDialog2').on('click', function(){
+            $(mydialog).remove();
+            $("#confirm_btn").addClass('weui-btn_disabled')
+            $("#confirm_btn").text(counters+"s")
+            clearInterval(j);
+            $iosDialog2.fadeOut(200);
+            $dialog2.removeClass('weui-half-screen-dialog_show');
+            if(cancel){
+                cancel();
+            }
+        });
+
+        $iosDialog2.fadeIn(200);
+        $dialog2.addClass('weui-half-screen-dialog_show');
+    }
+
+
+    function dialog(params, callBack) {
+        var win = "<div class='fund_dialog_confirm'  id='dialog99' style='display: ;max-height:100px'>";
+        win += " <div class='dialogMask' style='position: fixed;z-index: 1000;width: 100%;height: 100%;top:0;left: 0; background: rgba(0, 0, 0, 0.6);'></div>";
+        win += " <div class='fund_dialog'  " + (params.mode <= -1 ? "style='padding-bottom:.4em'" : "") + " >";
+        if (params.title != null) {
+            win += " <div class='fund_dialog_hd'><strong class='fund_dialog_title'>" + (params.title == null ? "" : params.title) + "</strong></div>";
+        }
+        win += "   <div class='fund_dialog_bd'>" + (params.content == null ? "" : params.content) + "</div>";
+        if (params.mode != -1) {
+            win += "   <div class='fund_dialog_ft'>";
+            if (params.mode == 0 || params.mode == null) {
+                win += "       <a id='dialog_cancel' class='fund_btn_dialog default'>取消</a>";
+            }
+            if (params.mode == 2) {
+                win += "       <a id='dialog_cancel' class='fund_btn_dialog default'>取消</a>";
+                win += "       <a id='dialog_ok' class='fund_btn_dialog primary'>" + params.btn + "</a>";
+            } else if (params.mode == 3) {
+                win += "       <a id='dialog_ok' class='fund_btn_dialog primary'>" + params.btn + "</a>";
+            } else {
+                win += "       <a id='dialog_ok' class='fund_btn_dialog primary'>确定</a>";
+            }
+
+            win += "   </div>";
+        }
+        win += "</div></div>";
+        var mydialog = $(win);
+        mydialog.find("a").each(function (index) {
+            $(this).bind('click', function () {
+                if (params.mode == 2 && !$("#s11").is(":checked") && index == 1) {
+                    $.toast("您好!请下滑浏览内容后勾选“我同意该声明”");
+                    return
+                }
+                if (callBack) {
+                    callBack(index);
+                }
+                $(mydialog).remove();
+            });
+        });
+        $(document.body).append(mydialog);
+        if (params.duration) {
+            setTimeout(function () {
+                $(mydialog).remove();
+            }, params.duration);
+        }
+
+    }
+
+    function val(key, value) {
+        if (key && value) {
+            if (typeof value == "object") {
+                value = JSON.stringify(value);
+            }
+            localStorage.setItem(key, value);
+        }
+        if (!value) {
+            return localStorage.getItem(key);
+        }
+    };
+
+    function val2(list, value) {
+        if (!list) {
+            return value;
+        }
+        var v = "";
+        for (var i = 0; i < list.length; i++) {
+            var item = list[i];
+            if (item.id == value) {
+                v = item.value;
+            }
+        }
+        if (v) {
+            return v;
+        } else {
+            return value;
+        }
+    };
+
+    function remove(key) {
+        localStorage.removeItem(key);
+    };
+
+    function openWin(url) {
+        if (url.indexOf("perfetchlist") != -1) {
+            window.location.href = url + "?type=1";
+        } else {
+            window.location.href = url;
+        }
+    }
+
+    function closeCurrWin() {
+        window.history.go(-1);
+    }
+
+    function closeWin(winName, duration) {
+        var winName = winName || "";
+        var fun = function () {
+            window.history.go(-1);
+        };
+        duration = duration || 2000;
+        setTimeout(fun, duration);
+    }
+
+    function dataFormat(value) {
+        if (value === "" || value == undefined || value == "null" || value == null) {
+            return "";
+        } else if (isNaN(value)) {
+            return value;
+        } else {
+            var moneyValue = String(Number(value).toFixed(2));
+            var t_moneyValue;
+            if (moneyValue.indexOf(".") > 0) {
+                t_moneyValue = moneyValue.substring(0, moneyValue.indexOf("."));
+                var t_p = moneyValue.substring(moneyValue.indexOf("."));
+                var re = /(-?\d+)(\d{3})/;
+                while (re.test(t_moneyValue)) {
+                    t_moneyValue = t_moneyValue.replace(re, "$1,$2");
+                }
+                moneyValue = t_moneyValue + t_p;
+            } else {
+                var re = /(-?\d+)(\d{3})/;
+                while (re.test(moneyValue)) {
+                    moneyValue = moneyValue.replace(re, "$1,$2");
+                }
+            }
+            return moneyValue;
+        }
+    }
+
+    function setLayOut(ids) {
+        var h = $(window).height() - $("#header").height();
+        if (ids) {
+            ids = ids.split(",");
+            for (var i = 0; i < ids.length; i++) {
+                h -= $("#" + ids[0]).height();
+            }
+        }
+        $("#content").height(h);
+        $("#content").css("overflow-y", "auto");
+        return h;
+    }
+
+    function activateUrl() {
+        $(".shortcut").each(function () {
+            $(this).bind("click", function () {
+                $.openWin($(this).attr("data-url"));
+            });
+        });
+    }
+
+    function setCookie(c_name, value, expiredays) {
+        var exdate = new Date()
+        exdate.setDate(exdate.getDate() + expiredays)
+        document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : "; expires=" + exdate.toGMTString());
+    }
+
+    function getCookie(name) {
+        var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
+        if (arr = document.cookie.match(reg))
+            return unescape(arr[2]);
+        else
+            return null;
+    }
+
+    function delCookie(name) {
+        var exp = new Date();
+        exp.setTime(exp.getTime() - 1);
+        var cval = getCookie(name);
+        if (cval != null)
+            document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString();
+    }
+
+    function setSelect(obj, list, id, value) {
+        var houseno = $("#" + obj);
+        var defaultValue = houseno.attr("defaultValue");
+        if (list && list.length < 1) {
+            return houseno;
+        }
+        if (!id) {
+            id = "id";
+        }
+        if (!value) {
+            value = "value";
+        }
+        houseno.empty();
+        for (var i = 0; i < list.length; i++) {
+            var item = list[i];
+            var name = item.name;
+            if (!name) {
+                name = item[value];
+            }
+            var slected = "";
+            if (defaultValue == item[id]) {
+                slected = "selected";
+            }
+            houseno.append("<option " + slected + " value='" + item[id] + "'>" + name + "</option>");
+        }
+        return houseno;
+    }
+
+    function quit() {
+        $.doSubmit("", {"method": "user.loginout", "v": "1.0"}, function (data) {
+            $.remove("sessionId");
+            $.remove("loginFlag");
+            $.openWin("login.jsp", "", false, true);
+            //location.reload();
+        });
+    }
+
+    function validFace(param, call, fail) {
+        var p = {"method": "local.user.validFace", "v": "1.0"}
+        if (param.token) {//城市生活服务刷脸,需要token
+            p.token = param.token;
+        }
+        if (param.qrtoken) {//网厅刷脸
+            p.qrtoken = param.qrtoken;
+        }
+        if (param.ywdjh) {//业务登记号
+            p.ywdjh = param.ywdjh;
+        }
+        $.doSubmit("", p, function (data) {
+            if (call && data.sign == "1") {
+                call(data);
+            } else if (data.sign == "-1") {//刷脸失败
+                $.toast("没有做刷脸");
+                if (fail) {
+                    fail(data);
+                }
+
+            } else if (data.sign == "0") {
+                if (fail) {
+                    fail(data);
+                }
+                //if(data.faceFaileCount>=1){//刷脸失败,超过三次切换短信验证
+                $.setSelect("vtype", [{"id": 1, "name": "短信验证"}, {"id": 3, "name": "刷脸验证"}]);
+                $("#vtype").change();
+                $.toast("刷脸认证失败!");
+                // }
+            }
+        }, function (data) {
+            if (fail) {
+                fail(data);
+            }
+        });
+    }
+
+    /** param:{appId:"",name:"",idcard:"",key:""},callback 回调函数
+     *  callback(param) param->{code:0,key:"=",msg:''}
+     *  code=0 表示刷脸成功
+     * */
+    err__msg = {
+        "10001": "参数错误",
+        "10002": "人脸特征检测失败",
+        "10003": "身份证号不匹配",
+        "10004": "公安比对人脸信息不匹配",
+        "10005": "正在检测中",
+        "10006": "appid 没有权限",
+        "10007": "后台获取图片失败",
+        "10008": "公安系统失败",
+        "10009": "公安未查到身份证照片比对源",
+        "10010": "照片质量不满足公安比对要求",
+        "10011": "身份证信息未开通公安比对权限",
+        "10012": "征信验证失败",
+        "10013": "征信系统错误",
+        "10014": "公安系统失败,征信系统成功",
+        "10015": "公安服务暂时不可用",
+        "10016": "存储用户图片失败",
+        "10017": "非法 identify_id",
+        "10018": "用户信息不存在",
+        "10020": "认证超时",
+        "10021": "重复的请求,返回上一次的结果",
+        "10022": "用户信息错误",
+        "10026": "用户身份证数据不在公安比对数据库中",
+        "10027": "语音识别失败",
+        "10028": "唇动检测失败",
+        "90100": "刷脸取消"
+    };
+
+    function doWxVerifyFace(param, callback) {
+        wx.invoke("checkIsSupportFaceDetect", {}, function (res) {
+
+            if (res.err_code != 0) {
+                $.toast("当前微信版本不支持刷脸:" + res.err_code);
+                return;
+            }
+            if (param == null) {
+                $.toast("缺少参数");
+                return;
+            }
+            var p = {appId: appid};
+            var pre_info = "{\"name\":\"" + param.pername + "\",\"id_card_number\":\"" + param.codeno + "\"";
+            if (param.key) {
+                pre_info += ",\"user_id_key\": \"" + param.key + "\"";
+            }
+            pre_info += "}";
+            p.request_verify_pre_info = pre_info;
+            p.check_alive_type = Base.check_alive_type;
+            wx.invoke("requestWxFacePictureVerify", p, function (res) {
+                if (callback) {
+                    var p = {};
+                    p.code = res.err_code;
+                    p.msg = err__msg[p.code];
+                    if (p.msg == null) {
+                        p.msg = "刷脸错误,错误码:" + p.code;
+                    }
+                    p.key = res.verify_result;
+                    if (p.code == 0) {
+                        validFace({token: p.key, qrtoken: param.qrtoken, ywdjh: param.ywdjh}, function () {
+                            callback(p);
+                        });
+                    } else {
+                        //callback(p);
+                        $.toast(p.msg);
+                    }
+
+                }
+            });
+        });
+    }
+
+    function wxCloundFace(p, call) {
+        var a = window.location.href;
+        if (a.indexOf("BizToken") != -1) {//刷脸认证返回
+            //params.type=type;
+            validFace({qrtoken: p.qrtoken}, call, function (data) {
+                $.dialog({title: "", content: data.resmsg, mode: 1}, function (index) {
+                    //$.openWin("login.jsp?ref=no");
+                    window.location.href = Base.gobackurl;
+                    //window.location.href = window.location.href.split("?")[0];
+                });
+            });
+            return;
+        }
+        if (p.url) {//跳转刷脸url
+            window.location.href = p.url;
+            return;
+        }
+    }
+
+    function doFace(p, callback) {
+        var params = {"method": "local.user.initface", "v": "1.0"};
+        if (p.pername) {
+            params.pername = p.pername;
+        }
+        if (p.codeno) {
+            params.codeno = p.codeno;
+        }
+        if (p.qrtoken) {
+            params.qrtoken = p.qrtoken;
+        }
+
+        if (p.returnurl) {
+            params.returnurl = p.returnurl;
+        } else {
+            params.returnurl = window.location.href.split("#")[0];
+        }
+        if (p.faceType) {
+            params.facetype = p.faceType;//
+        } else {
+            params.facetype = Base.faceType;
+        }
+
+        if (params.facetype == 3) {
+            var a = window.location.href;
+            if (a.indexOf("BizToken") != -1) {//刷脸认证返回
+                wxCloundFace(p, callback);
+                return;
+            }
+        }
+        $.doSubmit("", params, function (data) {
+            if (params.facetype == 1) {//城市生活服务
+                doWxVerifyFace(p, callback);
+            }
+            if (params.facetype == 3) {//慧眼
+                p.url = data.url;
+                wxCloundFace(p, callback);
+            }
+        }, function (data) {
+
+        });
+    }
+
+    function wxConfig(isDebug) {//获取微信内置api 调用权限
+        if (!isDebug) {
+            isDebug = false;
+        }
+        var p = {toast: 0, 'method': 'user.wxconfig', 'v': '1.0'};
+        p.wxurl = location.href.split('#')[0];
+        $.doSubmit('', p, function (data) {
+            appid = data.appid;
+            if (data.facebug == 0) {
+                facebug = true;
+            } else {
+                facebug = false;
+            }
+            wx.config({
+                beta: true,
+                debug: isDebug,
+                appId: data.appid,
+                timestamp: data.timestamp,
+                nonceStr: data.noncestr,
+                signature: data.signature,
+                jsApiList: ["chooseImage", "scanQRCode", "uploadImage", "startRecord", "previewImage", "requestWxFacePictureVerify", "checkIsSupportFaceDetect"]
+            });
+        }, function (data) {
+            $.toast(data.resmsg);
+        });
+    }
+
+    function wxscanQRCode(callback, code) {
+        if (!code) {
+            code = 1;
+        }
+        wx.scanQRCode({
+            needResult: code, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
+            scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是一维码,默认二者都有
+            success: function (res) {
+                var result = res.resultStr; // 当needResult 为 1 时,扫码返回的结果
+                if (callback) {
+                    callback(result);
+                }
+            }
+        });
+    }
+
+    function base64(value) {
+        var str = CryptoJS.enc.Utf8.parse(value);
+        return CryptoJS.enc.Base64.stringify(str);
+    }
+
+    function openPicker(callfun, showday) {//depth
+        weui.datePicker({
+            start: 2000,
+            end: 2070,
+            defaultValue: [new Date().getFullYear(), new Date().getMonth() + 1, new Date().getDate()],
+            onChange: function (result) {
+                if (showday) {
+                    $('.weui-picker .weui-picker__bd .weui-picker__group').eq(2).hide();
+                }
+            },
+            onConfirm: function (result) {
+                console.log(result);
+                var data = {year: result[0]}
+                data.month = result[1] < 10 ? ("0" + result[1]) : result[1];
+                data.day = result[2] < 10 ? ("0" + result[2]) : result[2];
+                if (callfun) {
+                    callfun(data);
+                }
+            }
+        });
+    }
+
+    function uploadImage(callFun) {
+        wx.chooseImage({
+            count: 1, // 默认9
+            sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
+            sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
+            success: function (res) {
+                var localId = res.localIds[0]; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
+                wx.uploadImage({
+                    localId: localId, // 需要上传的图片的本地ID,由chooseImage接口获得
+                    isShowProgressTips: 1, // 默认为1,显示进度提示
+                    success: function (res) {
+                        var serverId = res.serverId; // 返回图片的服务器端ID
+                        $.toast("图片已上传");
+                        if (callFun) {
+                            callFun(serverId);
+                        }
+                    }
+                });
+            },
+            fail: function (res) {
+                $.toast("图片上传失败");
+            }
+        });
+    }
+
+    /*  var global= {"newsevent":"http://www.scsjgjj.com/ShowChannel.aspx?id=27"
+        ,"im":"http://www.scsjgjj.com/know.aspx"
+        ,"city":"四川省省级"
+        ,"imcustmsg":"http://www.scsjgjj.com/know.aspx"
+        ,"workguid":"http://www.scsjgjj.com/ShowChannel.aspx?id=15"
+        ,"newssurvey":"http://www.scsjgjj.com/ShowLeaveChannel.aspx?id=22"
+        ,"phone2":"12329"
+        ,"newslodge":"http://www.scsjgjj.com/ShowLeaveColumn.aspx?id=76&channelId=22"
+        ,"newspolicy":"http://www.scsjgjj.com/wx/News/List16?listid=0&&page=10&&index=1&&navid=0",
+        "newshot":"http://www.scsjgjj.com/wx/News/List27?listid=45&&page=10&&index=1&&navid=2"
+        ,"web":"http://www.scsjgjj.com"
+        ,"phone":"12329"
+        ,"sinaWeibo":"https://weibo.com/u/6046993337"
+        ,"myzixun":""
+        ,"myadvisory":""}*/
+    $.extend({
+        dialog: dialog,
+        halfScreenDialog: halfScreenDialog,
+        list2Row: list2Row,
+        closeToast: closeToast,
+        val: val,
+        val2: val2,
+        remove: remove,
+        openWin: openWin,
+        closeCurrWin: closeCurrWin,
+        closeWin: closeWin,
+        dataFormat: dataFormat,
+        setLayOut: setLayOut,
+        activateUrl: activateUrl,
+        global: global,
+        wxVerifyFace: doWxVerifyFace, /** 微信内置刷脸 */
+        wxConfig: wxConfig, /** 微信内置api权限获取 */
+        setCookie: setCookie,
+        getCookie: getCookie,
+        delCookie: delCookie,
+        openPicker: openPicker,
+        uploadImage: uploadImage,
+        wxConfig: wxConfig,
+        base64: base64,
+        doFace: doFace,
+        quit: quit,
+        setSelect: setSelect,
+        wxscanQRCode: wxscanQRCode,
+        scanQRCode: wxscanQRCode
+    });
+})(jQuery);
+__seconds = 60;
+
+function getSMSCode(phone, busType, sign, em, form) {
+    if (__seconds < 60) {
+        return;
+    }
+    if (!form) {
+        form = "myform";
+    }
+    if (!$.doValid(form, 1)) {
+        return;
+    }
+    if (!em) {
+        em = "yzmbt";
+    }
+    var codetype = $("#codetype").val();
+    var params = {
+        "phone": phone,
+        "codetype": codetype,
+        "bustype": busType,
+        "method": "local.user.getCheckCodeNews",
+        "v": "1.0"
+    };
+    if (sign) {
+        params.unlogin = sign;
+    }
+    $.doSubmit("", params, function (data) {
+        if (busType == "SMS_WXDL") {
+            var showphone = data.currentPhone;
+            $("#phonetype").show();
+            $("#currentPhone").val(showphone);
+            $(".login_box").css("height", "18rem");
+        }
+        $.toast("验证码已发送到手机,请注意查收!");
+        var embt = document.getElementById(em);
+        $("#" + em).css("color", "#999999");
+        time = setInterval(function () {
+            __seconds = __seconds - 1;
+            var temp = __seconds <= 9 ? ("0" + __seconds) : __seconds;
+            $("#" + em).text("(" + temp + "S)后重新获取");
+            if (__seconds < 0) {
+                clearInterval(time);
+                $("#" + em).text("获取验证码");
+                $("#" + em).css("color", "#49A5E1");
+                __seconds = 60;
+                embt.disabled = false;
+            }
+        }, 1000);
+        embt.disabled = true;
+    }, function (data) {
+        $.toast(data.resmsg);
+    });
+
+}
+
+function initResource(relist) {
+    if (!relist) {
+        relist = $.val("relist")
+    }
+    if (!relist) {
+        return;
+    }
+    var relist = $.parseJSON(relist);//[{number:1,datatype:"1",name:"身份证"},{number:1,datatype:"1",name:"购房合同"}];
+    var fileList = relist;
+    if (relist.length <= 0) {
+        return;
+    }
+    $("#fileNum").val(relist.length);
+    $("#uprestip").show();
+    if (relist.length == 0) {
+        $("#uprestip").hide();
+    }
+    var c = 0, html = "";
+    var asst = "";
+    for (var i = 0; i < fileList.length; i++) {
+        var obj = fileList[i];
+        var dataname = obj.name;
+        var isrquired = obj.isrquired;
+        var sfymb = obj.sfymb;
+        if (dataname.indexOf("身份证") != -1) {
+            dataname = dataname;
+            if(sfymb == "1"){
+                html += "<div  style='padding:0px;'  class='fund_grids '  style='width:100%' onclick='showModel(" + obj.id + ")'>";
+                html += "   <button  type='button' style='color: red;background: #ffffff;font-size:1em'>【"+dataname+"】模板</button>";
+                html += "</div>";
+            }
+            html += "<div  style='padding:15px'   class='fund_grids '  style='width:100%'>" + dataname + asst + "</div>";
+            html += "<div     class='fund_grids '  style='width:100%'>";
+            html += "<div  style='height:7em;padding:0px'  class='fund_grid grid-2c'>";
+            html += "   <div class='box box-c' style='height:100%;background-size:cover;background-repeat:no-repeat'>";
+            html += "     <input type='file' accept='image/*' name='archive' onchange='onChangeFile(this)' style='display: none' id='f" + i + "' valid='r'  label='上传" + dataname + "正面'  mainName='" + dataname + "正面'/>";
+            html += "     <input type='hidden' name='dataId' value='" + obj.id + "'/>";
+            html += "     <input type='hidden' name='sfocrsb' value='" + obj.sfocrsb + "'/>";
+            html += "     <input type='hidden' name='ocrsbzd' value='" + obj.ocrsbzd + "'/>";
+            html += "     <input type='hidden' name='ocrsbtype' value='face'/>";
+            html += "     <button  type='button' style='width:9em;padding-left:.5em;color:rgba(84, 172, 234,0.8);background:rgba(84, 172, 234, .18)'>选择"+dataname+"正面</button>";
+            html += "   </div>";
+            html += "</div>";
+            html += "<div  style='height:7em;padding:0px'  class='fund_grid grid-2c'>";
+            html += "   <div class='box box-c' style='height:100%;background-size:cover;background-repeat:no-repeat'>";
+            html += "     <input type='file' accept='image/*' name='archive' onchange='onChangeFile(this)' style='display: none' id='f" + i + "' valid='r'  label='上传" + dataname + "反面'  mainName='" + dataname + "反面'/>";
+            html += "     <input type='hidden' name='dataId' value='" + obj.id + "'/>";
+            html += "     <input type='hidden' name='sfocrsb' value='" + obj.sfocrsb + "'/>";
+            html += "     <input type='hidden' name='ocrsbzd' value='" + obj.ocrsbzd + "'/>";
+            html += "     <input type='hidden' name='ocrsbtype' value='back'/>";
+            html += "     <button  type='button' style='width:9em;padding-left:.5em;color:rgba(84, 172, 234,0.8);background:rgba(84, 172, 234, .18)'>选择"+dataname+"反面</button>";
+            html += "   </div>";
+            html += "</div>";
+            html += "</div>";
+        } else {
+            if (isrquired == 1) {
+                if(sfymb == "1"){
+                    html += "<div  style='padding:0px;'  class='fund_grids '  style='width:100%' onclick='showModel(" + obj.id + ")'>";
+                    html += "   <button  type='button' style='color: red;background: #ffffff;font-size:1em'>【"+dataname+"】模板</button>";
+                    html += "</div>";
+                }
+                html += "<div  style='padding:15px'   class='fund_grids '  style='width:100%'>" + dataname + asst + "</div>";
+                html += "<div     class='fund_grids '  style='width:100%'>";
+                html += "<div  style='height:7em;padding:0px'  class='fund_grid grid-2c'>";
+                html += "   <div class='box box-c' style='height:100%;background-size:cover;background-repeat:no-repeat'>";
+                html += "     <input type='file' accept='image/*' class='" + obj.id + "' name='archive' onchange='onChangeFile(this)' style='display: none' id='f" + i + "' valid='r'  label='上传" + dataname + "'  mainName='" + dataname + "'/>";
+
+                html += "     <input type='hidden' name='dataId' value='" + obj.id + "'/>";
+                html += "     <input type='hidden' name='sfocrsb' value='" + obj.sfocrsb + "'/>";
+                html += "     <input type='hidden' name='ocrsbzd' value='" + obj.ocrsbzd + "'/>";
+                html += "     <input type='hidden' name='ocrsbtype' value=''/>";
+                html += "     <button  type='button' style='width:5.6em;padding-left:.5em;color:rgba(84, 172, 234,0.8);background:rgba(84, 172, 234, .18)'>选择图片</button>";
+                html += "   </div>";
+                html += "</div>";
+                html += "<div  style='height:7em;padding:0px;display:none;'  class='fund_grid grid-2c' id='" + obj.id + "'>";
+                html += "   <div class='box box-c' style='height:100%;background-size:cover;background-repeat:no-repeat'>";
+                html += "     <input type='file' accept='image/*' onchange='onChangeFile(this)' sign='1' style='display: none' id='f" + i + "'  label='上传" + dataname + "'  mainName='" + dataname + "'/>";
+                html += "     <input type='hidden'  value='" + obj.id + "'/>";
+                html += "     <input type='hidden'  value='" + obj.sfocrsb + "'/>";
+                html += "     <input type='hidden'  value='" + obj.ocrsbzd + "'/>";
+                html += "     <input type='hidden'  value=''/>";
+                html += "     <button  type='button' style='width:25px;height:25px;background:url(css/images/icon-add-act.png);'></button>";
+                html += "   </div>";
+                html += "</div>";
+                html += "</div>";
+            }else{
+                if(sfymb == "1"){
+                    html += "<div  style='padding:0px;'  class='fund_grids '  style='width:100%' onclick='showModel(" + obj.id + ")'>";
+                    html += "   <button  type='button' style='color: red;background: #ffffff;font-size:1em'>【"+dataname+"】模板</button>";
+                    html += "</div>";
+                }
+                html += "<div  style='padding:15px'   class='fund_grids '  style='width:100%'>" + dataname + asst + "</div>";
+                html += "<div     class='fund_grids '  style='width:100%'>";
+                html += "<div  style='height:7em;padding:0px'  class='fund_grid grid-2c'>";
+                html += "   <div class='box box-c' style='height:100%;background-size:cover;background-repeat:no-repeat'>";
+                html += "     <input type='file' accept='image/*' class='" + obj.id + "' name='archive' onchange='onChangeFile(this)' style='display: none' id='f" + i + "'   label='上传" + dataname + "'  mainName='" + dataname + "'/>";
+                html += "     <input type='hidden' name='dataId' value='" + obj.id + "'/>";
+                html += "     <input type='hidden' name='sfocrsb' value='" + obj.sfocrsb + "'/>";
+                html += "     <input type='hidden' name='ocrsbzd' value='" + obj.ocrsbzd + "'/>";
+                html += "     <input type='hidden' name='ocrsbtype' value=''/>";
+                html += "     <button  type='button' style='width:5.6em;padding-left:.5em;color:rgba(84, 172, 234,0.8);background:rgba(84, 172, 234, .18)'>选择图片</button>";
+                html += "   </div>";
+                html += "</div>";
+                html += "<div  style='height:7em;padding:0px;display:none;'  class='fund_grid grid-2c' id='" + obj.id + "'>";
+                html += "   <div class='box box-c' style='height:100%;background-size:cover;background-repeat:no-repeat'>";
+                html += "     <input type='file' accept='image/*' onchange='onChangeFile(this)' sign='1' style='display: none' id='f" + i + "'   label='上传" + dataname + "'  mainName='" + dataname + "'/>";
+                html += "     <input type='hidden'  value='" + obj.id + "'/>";
+                html += "     <input type='hidden'  value='" + obj.sfocrsb + "'/>";
+                html += "     <input type='hidden'  value='" + obj.ocrsbzd + "'/>";
+                html += "     <input type='hidden'  value=''/>";
+                html += "     <button  type='button' style='width:25px;height:25px;background:url(css/images/icon-add-act.png);'></button>";
+                html += "   </div>";
+                html += "</div>";
+                html += "</div>";
+            }
+        }
+    }
+    $("#file_grids").html(html);
+    $(".fund_grid").unbind("click");
+    $(".fund_grid").bind("click", function () {
+        $(this).find("input")[0].click();
+    });
+}
+
+function getArchive(obj, id) {
+    return obj;
+}
+
+function onChangeFile(that) {
+    var className = that.className;
+    $("#" + className).show();
+    var b = false;
+    if (!that.value) {
+        b = true;
+    }
+    var a = that.value.substr(that.value.lastIndexOf(".") + 1).toLowerCase();
+    if (a != "jpg" && a != "png" && a != "gif") {
+        $.toast("请选择图片格式类型的资料文件");
+        b = true;
+    }
+    var box = $(that).parent();
+    if (b) {
+        box.css({"background-image": ""});
+        that.value = "";
+        return;
+    }
+    var reader = new FileReader();
+    reader.onload = function (e) {
+        var imgFile = e.target.result;
+        var w = box.width();
+        var h = box.height();
+        var sign = $(that).attr("sign");
+        if (sign) {
+            var archbox = $(that).parent().parent();
+            var html = archbox.prop("outerHTML");
+            html = $(html).bind("click", function () {
+                $(this).find("input")[0].click();
+            })
+            archbox.after(html);
+            $(archbox.find("input")[0]).attr("name", "archive");
+            $(archbox.find("input")[1]).attr("name", "dataId");
+            $(archbox.find("input")[2]).attr("name", "sfocrsb");
+            $(archbox.find("input")[3]).attr("name", "ocrsbzd");
+            $(archbox.find("input")[4]).attr("name", "ocrsbtype");
+            archbox.find("button").css({
+                width: "5.6em",
+                "padding-left": ".5em",
+                "color": "rgba(84, 172, 234,0.8)",
+                "background": "rgba(84, 172, 234, 0.13)"
+            }).text("选择图片");//$(that).attr("label")
+            $(that).removeAttr("sign")
+        }
+        box.css({
+            "background-image": "url(" + imgFile + ")",
+            "background-size": "" + w + "px " + h + "px ",
+            "background-repeat": "no-repeat"
+        });
+
+    };
+    reader.readAsDataURL(that.files[0]);
+}
+
+var Pie = {
+    init: function (id, loanMny, payMny) {
+        this.canvas = document.getElementById(id);
+        this.ctx = this.canvas.getContext("2d");
+        this.width = this.canvas.width;
+        this.height = this.canvas.height;
+        this.pointX = this.width / 2;
+        this.pointY = this.height / 2;
+        this.i = 0;
+        this.deg = 0;
+        var w = parseInt($(document).width());
+        this.PI = Math.PI / 180;
+        if (w > 414 && w <= 720) {
+            this.lineWidth = 50;
+            this.R = this.width / 2 - 25;
+            this.textH = 20;
+            this.diff = 55;
+            this.textH2 = 35;
+        } else if (w <= 414) {//针对苹果
+            this.lineWidth = 30;
+            this.R = this.width / 2 - 25;
+            this.textH = 16;
+            this.diff = this.R / 2 - 10;
+            this.textH2 = 18;
+        } else {
+            this.lineWidth = 70;
+            this.diff = 70;
+            this.R = this.width / 2 - 35;
+            this.textH = 20;
+            this.textH2 = 50;
+        }
+
+
+        this.per = payMny / loanMny;
+        this.loanMny = $.dataFormat(loanMny);
+        this.payMny = $.dataFormat(payMny);
+        this.payMnyColor = "#53c495";
+        this.loanMnyColor = "#6eb9f3";
+    }, drawPie: function (id, loanMny, payMny) {
+        this.init(id, loanMny, payMny);
+        this.degCount();
+
+    }, doDrawPie: function () {
+        this.ctx.clearRect(0, 0, this.width, this.height);
+        this.ctx.lineWidth = this.lineWidth;
+        this.ctx.beginPath();
+        this.ctx.strokeStyle = this.loanMnyColor;
+        this.ctx.arc(this.pointX, this.pointY, this.R, 0, Math.PI * 2);
+        this.ctx.stroke();
+
+        this.ctx.beginPath();
+        this.ctx.strokeStyle = this.payMnyColor;
+        this.deg = this.i * this.PI;
+        this.ctx.arc(this.pointX, this.pointY, this.R, -90 * this.PI, this.deg - 90 * this.PI);
+        this.ctx.stroke();
+        this.ctx.fillStyle = this.loanMnyColor;
+        var text = "贷款金额(元)";
+        this.ctx.font = "0.875em abc";
+        var text_w = this.ctx.measureText(text).width;
+        var text_h = this.ctx.measureText(text).height;
+        this.ctx.fillText(text, this.width / 2 - text_w / 2, this.pointY - this.diff);
+        text = this.loanMny;
+        text_w = this.ctx.measureText(text).width;
+        this.ctx.fillText(text, this.width / 2 - text_w / 2, this.pointY - this.textH);
+        this.ctx.fillStyle = this.payMnyColor;
+        text = "偿还本金(元)";
+        text_w = this.ctx.measureText(text).width;
+        this.ctx.fillText(text, this.width / 2 - text_w / 2, this.pointY + this.diff);
+        var text = this.payMny;
+        text_w = this.ctx.measureText(text).width;
+        this.ctx.fillText(text, this.width / 2 - text_w / 2, this.pointY + this.diff + this.textH2);
+
+    }, degCount: function () {
+        Pie.doDrawPie();
+        if (((Pie.per * 360) * Pie.PI - Pie.deg) < 0.01) {
+            return;
+        }
+        if (window.webkitRequestAnimationFrame) {
+            window.webkitRequestAnimationFrame(Pie.degCount);
+        } else if (window.requestAnimationFrame) {
+            window.requestAnimationFrame(Pie.degCount);
+        } else if (window.oRequestAnimationFrame) {
+            window.oRequestAnimationFrame(Pie.degCount);
+        }
+
+        if (Pie.per < 0.3) {
+            Pie.i += 1;
+        } else {
+            Pie.i += 4;
+        }
+    }
+}
+
+function autoFullUP() {//自动填充用户名和密码
+    var _loginacc = $.val("_loginacc");
+    if (_loginacc) {
+        $("#loginacc").val(_loginacc);
+    }
+}
+
+function autoLogin() {//自动登录
+    var _loginacc = $.val("_loginacc");
+    var _loginpwd = $.val("_loginpwd");
+    if (!_loginacc) {
+        return;
+    }
+    if (!_loginpwd) {
+        return;
+    }
+    $.doSubmit("", {
+        "toast": 0,
+        "loginacc": _loginacc,
+        "loginpwd": _loginpwd,
+        "method": "user.login",
+        "v": "1.0"
+    }, function (data) {
+        $.val("_loginacc", $("#loginacc").val());
+        $.val("_loginpwd", $("#loginpwd").val());
+        $.val("signflag", data.signflag);
+    }, function (data) {
+        $.toast(data.resmsg);
+        $.openWin("login.jsp");
+    });
+}
+
+function removeUserInfo() {
+    var _loginacc = $.val("_loginacc");
+    var _loginpwd = $.val("_loginpwd");
+    if (_loginacc == null || _loginpwd == null) {
+        $.toast("您没有绑定用户信息");
+        return;
+    }
+    $.remove("_loginacc");
+    $.remove("_loginpwd");
+    $.toast("解绑成功");
+}
+
+function reportGenerator(parameters) {
+    var defaults = {"method": "user.generateReport", "v": "1.0"};
+    parameters = $.extend(defaults, parameters);
+    $.doSubmit("", parameters, function (data) {
+        $.openWin("download.jsp?token=" + data.token + "&type=" + parameters.type + "&r=" + Math.random());
+    }, function (data) {
+        $.toast(data.resmsg);
+    }, function () {
+        $.toast(data.resmsg);
+    });
+}
+
+function fetchMenu(list, type) {
+    if (list.length == 0) {
+        $("#" + type).hide();
+    } else {
+        $("#" + type).show();
+        var box = $("#" + type).find(".weui-flexs");
+        box.html("");
+        for (var i = 0; i < list.length; i++) {
+            var html = "";
+            if(list[i].funurl.indexOf("http")!=-1){
+                html += '<div class="weui-flex__item shortcut icons" data-url="' + list[i].funurl + '">'
+            }else{
+                html += '<div class="weui-flex__item shortcut icons" data-url="' + list[i].funurl + '.jsp">'
+            }
+            html += '<div class="icon_img">'
+            html += '<img class="' + list[i].iconskin + '"/>'
+            html += '</div>'
+            html += '<p class="icon_text">' + list[i].name + '</p>'
+            html += '</div>'
+            box.append(html)
+        }
+
+    }
+}
+
+function initData() {//提取
+    arealist = $.parseJSON($.val("arealist"));//缓存区域,提取页面初始化
+    dklxlist = $.parseJSON($.val("dklxlist"));//缓存身份类型提取页面初始化
+    idlist = $.parseJSON($.val("idlist"));//缓存贷款类型,提取页面初始化
+    $.setSelect("cdxzqydm", arealist);//项目区域
+    $.setSelect("spousezjlx", idlist);//配偶证件类型
+    $.setSelect("ownzjlx", idlist);//关联人证件类型
+    $.setSelect("dklx", dklxlist);//配偶证件类型
+}
+
+function clearNoNum(obj) {//提取
+    obj.value = obj.value.replace(/[^\d.]/g, "");  //清除“数字”和“.”以外的字符
+    obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的
+    obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
+    obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3');//只能输入两个小数
+    if (obj.value.indexOf(".") < 0 && obj.value != "") {//以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额
+        obj.value = parseFloat(obj.value);
+    }
+    var allstandmny = $("#allstandmny").val() - 0;
+    var factfetchmny = $("#factfetchmny").val() - 0;
+    if (factfetchmny > allstandmny) {
+        $.dialog({title: "", content: "提取金额不能大于可提取金额", mode: 1}, function (index) {
+
+        });
+        $("#factfetchmny").val("");
+    } else if (factfetchmny * 100 % 10000 != 0) {
+        $.dialog({title: "", content: "申请提取金额必须以百元为单位", mode: 1}, function (index) {
+
+        });
+        $("#factfetchmny").val("");
+    } else if (factfetchmny <= 0) {
+        $.dialog({title: "", content: "请输入正确的提取金额", mode: 1}, function (index) {
+
+        });
+        $("#factfetchmny").val("");
+    }
+}
+
+function clearNoNum1(obj) {//提取
+    obj.value = obj.value.replace(/[^\d.]/g, "");  //清除“数字”和“.”以外的字符
+    obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的
+    obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
+    obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3');//只能输入两个小数
+    if (obj.value.indexOf(".") < 0 && obj.value != "") {//以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额
+        obj.value = parseFloat(obj.value);
+    }
+}
+
+function openpick(obj, format, fun) {
+    $.openPicker(function (data) {
+        if (format == "yyyymm") {
+            obj.value = data.year + "" + data.month;
+        } else if (format == "mm") {
+            obj.value = data.month;
+        } else {
+            obj.value = data.year + "-" + data.month + "-" + data.day;
+        }
+        if (fun) {
+            fun();
+        }
+    });
+}
+
+$(document).ready(function () {
+    if (window.onViewOpen) {
+        onViewOpen();
+    }
+    if (window.onViewCreate) {
+        onViewCreate();
+    }
+    if (!window.goback) {
+        $("#nav-left").bind("click", function () {
+            window.history.go(-1);
+        });
+        var nav = $("<div class='circle  box box-c tx-c'><div class='fa  fa-angle-left fa-2x' style='color:#00A1EA;display:relative;'></div></div>");
+        nav.bind("click", function () {
+            $.closeCurrWin()
+        });
+        $(document.body).append(nav);
+    }
+})
+
+function fnSelSheng(that) {  // 710000  810000  820000 台湾  香港  澳门  的没有市县
+    $("#shi").find("option").remove();
+    $("#xian").find("option").remove();
+    $("#shi").html('<option value="">请选择市</option>');
+    $("#xian").html('<option value="">请选择区/县</option>');
+    var value = that.value;
+    if (value == "710000" || value == "810000" || value == "820000") {
+        $("#shi1").hide();
+        $("#xian1").hide();
+        $.val("shi", "");
+        $.val("xian", "");
+    } else {
+        $("#shi1").show();
+        $("#xian1").show();
+        fnSelectedProvince(value, "2");
+        $.val("xian", "");
+    }
+}
+
+function fnSelShi(that) {
+    $("#xian").find("option").remove();
+    $("#xian").html('<option value="">请选择区/县</option>');
+    var value = that.value;
+    fnSelectedProvince(value, "3");
+
+}
+
+function fnSelXian(that) {
+    var shi = $("#shi").val();
+    if (!shi) {
+        return;
+    }
+    if (shi != "360100") {
+        set_select_checked("fwssqy", "1");
+    } else {
+        set_select_checked("fwssqy", "0");
+    }
+}
+
+var desheng;
+var deshi;
+
+/**
+ * 获取省/市/县
+ */
+function fnSelectedProvince(pidcode, type, data) {
+    var params = {
+        "method": "user.getDefaultArea",
+        "v": "1.0"
+    };
+    $.doSubmit("", params, function (resData) {
+        desheng = resData.desheng;
+        deshi = resData.deshi;
+        if (desheng && deshi) {
+            var param = {"pidcode": pidcode, "type": type, "method": "user.getPcclink", "v": "1.0"};
+            if (type == 0) {   // 初始化
+                var v1 = {"sheng": "000000", "shi": desheng, "xian": deshi};
+                param = $.extend(v1, param);
+            } else if (type == 2) {  // 获取市后处理是否本市
+                if ($("#sheng").val() != desheng) {
+                    set_select_checked("fwssqy", "1");
+                }
+            } else if (type == 3) {  // 获取县后处理是否本市
+                if ($("#shi").val() != deshi) {
+                    set_select_checked("fwssqy", "1");
+                } else {
+                    set_select_checked("fwssqy", "0");
+                }
+            } else if (type == 4) {
+
+            } else if (type == 5) {
+                var v2 = {"sheng": data.sheng, "shi": data.shi, "xian": data.xian};
+                param = $.extend(v2, param);
+            }
+            $.doSubmit("", param, function (resData) {
+                var shengList = resData.shengList;
+                var shiList = resData.shiList;
+                var xianList = resData.xianList;
+                if (type == 0) {
+                    for (var i = 0; i < shengList.length; i++) {
+                        $("<option></option>").val(shengList[i].id.toString()).text(shengList[i].name.toString()).appendTo("#sheng");
+                    }
+                    for (var i = 0; i < shiList.length; i++) {
+                        $("<option></option>").val(shiList[i].id.toString()).text(shiList[i].name.toString()).appendTo("#shi");
+                    }
+                    for (var i = 0; i < xianList.length; i++) {
+                        $("<option></option>").val(xianList[i].id.toString()).text(xianList[i].name.toString()).appendTo("#xian");
+                    }
+                    set_select_checked("sheng", desheng);
+                    set_select_checked("shi", deshi);
+                } else if (type == 2) {
+                    for (var i = 0; i < shiList.length; i++) {
+                        $("<option></option>").val(shiList[i].id.toString()).text(shiList[i].name.toString()).appendTo("#shi");
+                    }
+                } else if (type == 3) {
+                    for (var i = 0; i < xianList.length; i++) {
+                        $("<option></option>").val(xianList[i].id.toString()).text(xianList[i].name.toString()).appendTo("#xian");
+                    }
+                } else if (type == 5) {
+                    for (var i = 0; i < shengList.length; i++) {
+                        $("<option></option>").val(shengList[i].id.toString()).text(shengList[i].name.toString()).appendTo("#sheng");
+                    }
+                    for (var i = 0; i < shiList.length; i++) {
+                        $("<option></option>").val(shiList[i].id.toString()).text(shiList[i].name.toString()).appendTo("#shi");
+                    }
+                    for (var i = 0; i < xianList.length; i++) {
+                        $("<option></option>").val(xianList[i].id.toString()).text(xianList[i].name.toString()).appendTo("#xian");
+                    }
+                    set_select_checked("sheng", data.sheng);
+                    set_select_checked("shi", data.shi);
+                    set_select_checked("xian", data.xian);
+
+                }
+            }, function (data) {
+                $.toast(data.resmsg, 2000);
+            });
+        }
+    }, function (data) {
+        $.toast(data.resmsg, 2000);
+    });
+}
+
+function fnYDDKSelectedProvince(pidcode, type, data) {
+    var params = {
+        "method": "user.getDefaultArea",
+        "v": "1.0"
+    };
+    $.doSubmit("", params, function (resData) {
+        desheng = resData.desheng;
+        deshi = resData.deshi;
+        if (desheng && deshi) {
+            var param = {"pidcode": pidcode, "type": type, "method": "user.getPcclink", "v": "1.0"};
+            if (type == 0) {   // 初始化
+                var v1 = {"sheng": "000000", "shi": desheng, "xian": deshi};
+                param = $.extend(v1, param);
+            } else if (type == 2) {  // 获取市后处理是否本市
+                if ($("#sheng").val() != desheng) {
+                    set_select_checked("fwssqy", "1");
+                }
+            } else if (type == 3) {  // 获取县后处理是否本市
+                if ($("#shi").val() != deshi) {
+                    set_select_checked("fwssqy", "1");
+                } else {
+                    set_select_checked("fwssqy", "0");
+                }
+            } else if (type == 4) {
+
+            } else if (type == 5) {
+                var v2 = {"sheng": data.dssheng, "shi": data.gsshi, "xian": data.gsxian};
+                param = $.extend(v2, param);
+            }
+            $.doSubmit("", param, function (resData) {
+                var shengList = resData.shengList;
+                var shiList = resData.shiList;
+                var xianList = resData.xianList;
+                if (type == 0) {
+                    $("<option></option>").val("").text("可选").appendTo("#sheng");
+                    $("<option></option>").val("").text("可选").appendTo("#shi");
+                    $("<option></option>").val("").text("可选").appendTo("#xian");
+                    for (var i = 0; i < shengList.length; i++) {
+                        $("<option></option>").val(shengList[i].id.toString()).text(shengList[i].name.toString()).appendTo("#sheng");
+                    }
+                    for (var i = 0; i < shiList.length; i++) {
+                        $("<option></option>").val(shiList[i].id.toString()).text(shiList[i].name.toString()).appendTo("#shi");
+                    }
+                    for (var i = 0; i < xianList.length; i++) {
+                        $("<option></option>").val(xianList[i].id.toString()).text(xianList[i].name.toString()).appendTo("#xian");
+                    }
+                    // set_select_checked("sheng", desheng);
+                    // set_select_checked("shi", deshi);
+                } else if (type == 2) {
+                    for (var i = 0; i < shiList.length; i++) {
+                        $("<option></option>").val(shiList[i].id.toString()).text(shiList[i].name.toString()).appendTo("#shi");
+                    }
+                } else if (type == 3) {
+                    for (var i = 0; i < xianList.length; i++) {
+                        $("<option></option>").val(xianList[i].id.toString()).text(xianList[i].name.toString()).appendTo("#xian");
+                    }
+                } else if (type == 5) {
+                    for (var i = 0; i < shengList.length; i++) {
+                        $("<option></option>").val(shengList[i].id.toString()).text(shengList[i].name.toString()).appendTo("#sheng");
+                    }
+                    for (var i = 0; i < shiList.length; i++) {
+                        $("<option></option>").val(shiList[i].id.toString()).text(shiList[i].name.toString()).appendTo("#shi");
+                    }
+                    for (var i = 0; i < xianList.length; i++) {
+                        $("<option></option>").val(xianList[i].id.toString()).text(xianList[i].name.toString()).appendTo("#xian");
+                    }
+                    set_select_checked("sheng", data.dssheng);
+                    set_select_checked("shi", data.gsshi);
+                    set_select_checked("xian", data.gsxian);
+                    myReadonly("sheng,shi,xian,outfundname");
+
+                }
+            }, function (data) {
+                $.toast(data.resmsg, 2000);
+            });
+        }
+    }, function (data) {
+        $.toast(data.resmsg, 2000);
+    });
+}
+
+
+
+function set_select_checked(selectId, checkValue) {
+    var select = document.getElementById(selectId);
+    for (var i = 0; i < select.options.length; i++) {
+        if (select.options[i].value == checkValue) {
+            select.options[i].selected = true;
+            break;
+        }
+    }
+}
+
+function fnTqfs() {
+    $("#fetchhander").hide();
+    var tqfs = $("#tqfs").val();
+    if (tqfs == "02") {
+        $('#bkcard').attr("readonly", false);
+        $('#bkcardcode').attr("readonly", false);
+        $('#skyhmc').attr("readonly", false);
+        $("#bkcard").val("");
+        $("#bkcardcode").find("option").remove();
+        $("#skyhmc").val("");
+        $("#lhhbh").val("");
+        tqfs02(tqfs);
+    } else if (tqfs == "03") {
+        $("#bkcardcode").find("option").remove();
+        $('#bkcard').attr("readonly", true);
+        $('#bkcardcode').attr("readonly", true);
+        $('#skyhmc').attr("readonly", true);
+        tqfs03(tqfs);
+    }
+}
+
+function tqfs02(key) {
+    $("#bkcardcode").html('<option value="">请选择银行名称</option>');
+    var params = {
+        "method": "user.getGjBank",
+        "v": "1.0"
+    };
+    $.doSubmit("", params, function (data) {
+        var yhhblist = data.yhhblist;
+        for (var i = 0; i < yhhblist.length; i++) {
+            $("<option></option>").val(yhhblist[i].id.toString()).text(yhhblist[i].name.toString()).appendTo("#bkcardcode");
+        }
+    });
+}
+
+function tqfs03(key) {
+    var params = {
+        "method": "user.getBdinfo",
+        "tqfs": key,
+        "v": "1.0"
+    };
+    $.doSubmit("", params, function (data) {
+        $("#fetchhander").show();
+        $('#bkcard').val(data.bkcard);
+        $("<option></option>").val(data.bkcardcode).text(data.bkcardcodedesc).appendTo("#bkcardcode");
+        $('#skyhmc').val(data.skyhmc);
+        $('#lhhbh').val(data.lhhbh);
+    }, function (data) {
+        $.toast(data.resmsg, 2000);
+        $("#tqfs").val("02");
+        fnTqfs();
+    });
+}
+
+function fnInitHisSelect(data) {
+    if(data) {
+        $("#histqlist").show();
+        var  html = "<option value=''>录入新卡</option>"
+        for (var i=0;i< data.length;i++) {
+            var yhk = data[i];
+            html += "<option value='" + yhk.lhhbh + "|" + yhk.yhhb + "|" + yhk.skzh + "|" + yhk.skyhmc + "'>" + yhk.skzh + "|" + yhk.skyhmc + "</option>"
+        }
+        $("#hisTqYhkList").html(html);
+    }else{
+        $("#histqlist").hide();
+    }
+}
+
+function fnSelectHisTqYhk() {
+    var hisTqYhkList = $("#hisTqYhkList").val();
+    if(hisTqYhkList){
+        myhide("bkcardcode1,bkcard_desc");
+        var hisTqYhk = hisTqYhkList.split('|');
+        $("#bkcard").val(hisTqYhk[2]);
+        $("#skyhmc").val(hisTqYhk[3])
+        $("#bkcardcode").val(hisTqYhk[1]);
+        $("#lhhbh").val(hisTqYhk[0]);
+        //tqfs02(tqfs);
+        $("#fetchhander").hide();
+        if(!$("#bkcardcode").val()){
+            $("#bkcardcode").focus();
+            return;
+        }
+        var params = {
+            "method": "user.checkBkcardType",
+            "v": "1.0",
+            "tqfs": $("#tqfs").val(),
+            "lhhbh": $("#lhhbh").val(),
+            "bkcardcode": $("#bkcardcode").val(),
+            "bkcard": $("#bkcard").val()
+        };
+        $.doSubmit("", params, function(data){
+            $("#fetchhander").show();
+        }, function (data) {
+            $("#bkcard").val("");
+            $.toast(data.resmsg, 2000);
+        });
+    }else{
+        $("#bkcard").val("");
+        $("#skyhmc").val("")
+        $("#bkcardcode").val("");
+        $("#lhhbh").val("");
+        myshow("bkcardcode1,bkcard_desc");
+    }
+}
+
+
+
+function selBank(that) {
+    if(!$("#bkcardcode").val()){
+        $("#bkcardcode").focus();
+        $("#fetchhander").hide();
+        return;
+    }
+    var params = {
+        "method": "user.getBankCodeByYhhb",
+        "v": "1.0",
+        "yhhb": that.value
+    };
+    $.doSubmit("", params, function (data) {
+        $('#skyhmc').val(data.skyhmc);
+        myReadonly("skyhmc");
+        $('#lhhbh').val(data.lhhbh);
+        if($("#bkcard").val()){
+            fnCheckBkcardType1();
+        }
+        //不清除银行卡号
+        //$("#bkcard").val("");
+    });
+}
+
+function fnCheckBkcardType1() {
+    $("#fetchhander").hide();
+    if(!$("#bkcardcode").val()){
+        $("#bkcardcode").focus();
+        return;
+    }
+    var params = {
+        "method": "user.checkBkcardType",
+        "v": "1.0",
+        "tqfs": $("#tqfs").val(),
+        "lhhbh": $("#lhhbh").val(),
+        "bkcardcode": $("#bkcardcode").val(),
+        "bkcard": $("#bkcard").val()
+    };
+    $.doSubmit("", params, function(data){
+        $("#fetchhander").show();
+    }, function (data) {
+        $("#bkcard").val("");
+        $.toast(data.resmsg, 2000);
+    });
+}
+
+function fnCheckBkcardType(that) {
+    $("#fetchhander").hide();
+    if(!$("#bkcardcode").val()){
+        $("#bkcardcode").focus();
+        return;
+    }
+    var params = {
+        "method": "user.checkBkcardType",
+        "v": "1.0",
+        "tqfs": $("#tqfs").val(),
+        "lhhbh": $("#lhhbh").val(),
+        "bkcardcode": $("#bkcardcode").val(),
+        "bkcard": that.value
+    };
+    $.doSubmit("", params, function(data){
+        $("#fetchhander").show();
+    }, function (data) {
+        $("#bkcard").val("");
+        $.toast(data.resmsg, 2000);
+    });
+}
+
+function checkSpouseInfo() {
+    $("#btnValid").hide();
+    myReadonly("gfhth,bdcqzh");
+    $("#bdcqzh").attr("disabled",true);
+    var hyzk = $("#hyzk").val();
+    var poxm = $("#spousename").val();
+    var pozjlx = $("#spousezjlx").val();
+    var pozjhm = $("#spousezjhm").val();
+    var bustype = $.val("bustype");
+    var buscode = $.val("buscode");
+    var tqyy = $.val("tqyy");
+    var tqlx = $("#tqlx").val();
+    var params = {
+        "method": "user.checkSpouseInfo",
+        "v": "1.0",
+        "hyzk": hyzk,
+        "poxm": poxm,
+        "pozjlx": pozjlx,
+        "pozjhm": pozjhm,
+        "bustype": bustype,
+        "buscode": buscode,
+        "tqyy": tqyy,
+        "tqlx": tqlx
+    };
+    if(tqyy == "07"){
+        var ownerList = packageGlr();
+        var sctq = $("#sctq").val();
+        var v1;
+        if(sctq == "0"){
+            v1 = {"ownerList": ownerList,"sctq": sctq};
+            params = $.extend(v1,params);
+        }else if(sctq == "1"){
+            v1 = {"sctq": sctq};
+            params = $.extend(v1,params);
+        }
+    }
+    if (hyzk == "10" || hyzk == "40") {
+        //未婚和离婚不判断配偶信息
+    } else {
+        if(!hyzk){
+            $("#hyzk").focus();
+            return;
+        }
+        if(!poxm){
+            $("#spousename").focus();
+            return;
+        }
+        if(!pozjlx){
+            $("#spousezjlx").focus();
+            return;
+        }
+        if(!pozjhm){
+            $("#spousezjhm").focus();
+            return;
+        }
+    }
+    $.doSubmit("", params, function (data) {
+        if(tqyy == "01" || tqyy == "02" || tqyy == "82"){
+            removeReadonly("gfhth,bdcqzh");
+            $("#bdcqzh").removeAttr("disabled");
+        }
+        if (tqyy == "01") {
+            if(data.flag == "1"){
+                $("#checkSpouse").val("1");
+            }
+            // initPage2();
+        }else{
+            $("#btnValid").show();
+        }
+        myReadonly("hyzk,spousename,spousezjlx,spousezjhm");
+        //已婚婚姻协查成功会马上协查配偶,不用重新调一次接口
+        /*var whjxbl = data.whjxbl;
+        if (whjxbl && whjxbl == "1") {
+            var param = {
+                "method": "user.checkSpouseHouseInfo",
+                "v": "1.0",
+                "hyzk": hyzk,
+                "poxm": poxm,
+                "pozjlx": pozjlx,
+                "pozjhm": pozjhm,
+                "bustype": bustype,
+                "buscode": buscode,
+                "tqyy": tqyy,
+                "tqlx": tqlx
+            };
+            $.doSubmit("", param, function (data) {
+
+            }, function (data) {
+                $("#hyzk").removeAttr("disabled");
+                $("#hyzk").removeAttr("readOnly");
+                $("#spousename").removeAttr("disabled");
+                $("#spousename").removeAttr("readOnly");
+                $("#spousezjhm").removeAttr("disabled");
+                $("#spousezjhm").removeAttr("readOnly");
+                var resmsg;
+                if (isJSON(data.resmsg)) {
+                    resmsg = $.parseJSON(data.resmsg).msg;
+                } else {
+                    resmsg = data.resmsg;
+                }
+                $("#hyzk").val("");
+                $("#spousename").val("");
+                $("#spousezjhm").val("");
+                $.dialog({title: "", content: resmsg, mode: 1}, function (index) {
+
+                });
+            });
+        }*/
+        /*if (hyzk == "10" || hyzk == "40") {//选择未婚和离婚接口调用完再显示后续页面
+            getHyzkInfo(hyzk);
+        }*/
+        if (tqyy == "01") {
+            if (hyzk == "40") {
+                $("#lhsj").val(data.lhsj);
+                $("#lhqd").val("民政");
+                myReadonly("lhsj");
+            }
+        }
+        if (tqyy == "07") {
+            var sctq = $("#sctq").val();
+            if(sctq == "1"){
+                $("#baje").val(data.rentMaxMoney);
+                $("#bcktqed").val(data.rentMaxMoney);
+            }
+            $("#isAddPo").val(data.isAddPo);
+            $("#hzzxzfytje").val(data.hzzxzfytje);
+            addZfGlr();
+        }
+        if(tqyy == "01" || tqyy == "02" || tqyy == "82"){
+            if($("#gfhth").val() || $("#bdcqzh").val()){
+                checkFetchHouseInfo();
+            }
+        }
+    }, function (data) {
+        if(tqyy == "01" || tqyy == "02" || tqyy == "82"){
+            myReadonly("gfhth,bdcqzh");
+            $("#bdcqzh").attr("disabled",true);
+        }
+        if (tqyy == "01") {
+            $("#spousezjhm").val("");
+            if (hyzk != "20") {
+                $("#hyzk").val("");
+            }
+        }
+        var resmsg;
+        if (isJSON(data.resmsg)) {
+            resmsg = $.parseJSON(data.resmsg).msg;
+        } else {
+            resmsg = data.resmsg;
+        }
+        $.dialog({title: "", content: resmsg, mode: 1}, function (index) {
+
+        });
+    });
+}
+
+function isJSON(str) {
+    if (typeof str == 'string') {
+        try {
+            var obj = JSON.parse(str);
+            if (typeof obj == 'object' && obj) {
+                return true;
+            } else {
+                return false;
+            }
+
+        } catch (e) {
+            console.log('error:' + str + '!!!' + e);
+            return false;
+        }
+    }
+}
+
+function jump() {
+    $.closeCurrWin();
+}
+
+//设置显示输入框
+function myshow(ids) {
+    var all = ids.split(",");
+    for (var i = 0; i < all.length; i++) {
+        $("#" + all[i]).show();
+    }
+}
+
+//设置隐藏输入框
+function myhide(ids) {
+    var all = ids.split(",");
+    for (var i = 0; i < all.length; i++) {
+        $("#" + all[i]).hide();
+    }
+}
+
+//设置必填
+function myaddValid(ids) {
+    var all = ids.split(",");
+    for (var i = 0; i < all.length; i++) {
+        var item = $("#" + all[i]);
+        $("#" + all[i]).attr("valid", "r");
+    }
+}
+
+//移除必填
+function removeValid(ids) {
+    var all = ids.split(",");
+    for (var i = 0; i < all.length; i++) {
+        var item = $("#" + all[i]);
+        $("#" + all[i]).attr("valid", "");
+    }
+}
+
+//设置只读
+function myReadonly(ids) {
+    var all = ids.split(",");
+    for (var i = 0; i < all.length; i++) {
+        var item = $("#" + all[i]);
+        if (item.is('select')) {
+            $("#" + all[i]).attr("readOnly", true);
+            $("#" + all[i]).attr("disabled", true);
+        } else {
+            $("#" + all[i]).attr("readOnly", true);
+        }
+    }
+}
+
+//取消只读
+function removeReadonly(ids) {
+    var all = ids.split(",");
+    for (var i = 0; i < all.length; i++) {
+        var item = $("#" + all[i]);
+        if (item.is('select')) {
+            $("#" + all[i]).attr("disabled", false);
+            $("#" + all[i]).attr("readOnly", false);
+        } else {
+            $("#" + all[i]).attr("readOnly", false);
+        }
+    }
+}
+
+/**
+ ** 减法函数,用来得到精确的减法结果
+ ** 说明:javascript的减法结果会有误差,在两个浮点数相减的时候会比较明显。这个函数返回较为精确的减法结果。
+ ** 调用:accSub(arg1,arg2)
+ ** 返回值:arg1加上arg2的精确结果
+ **/
+function accSub(arg1, arg2) {
+    var r1, r2, m, n;
+    try {
+        r1 = arg1.toString().split(".")[1].length;
+    } catch (e) {
+        r1 = 0;
+    }
+    try {
+        r2 = arg2.toString().split(".")[1].length;
+    } catch (e) {
+        r2 = 0;
+    }
+    m = Math.pow(10, Math.max(r1, r2)); //last modify by deeka //动态控制精度长度
+    n = (r1 >= r2) ? r1 : r2;
+    return ((arg1 * m - arg2 * m) / m).toFixed(n);
+}
+function initPage2() {
+    var tqlx = $("#tqlx").val();
+    var hyzk = $("#hyzk").val();
+    var tqrglgx = $("#tqrglgx").val();
+    if (tqlx && hyzk && tqrglgx) {
+        if (hyzk == "20") {
+            var spousename = $("#spousename").val();
+            var spousezjhm = $("#spousezjhm").val();
+            if (spousename && spousezjhm) {
+                myshow("xian1,fkfs1,htqdrq2,fwzlFormater2,fwzj2,btnLast,btnValid,btnBox2");
+                myhide("tqlx2,hyzk2,zgspousename,zgspousezjhm,tqrglgx1,btnClose,btnNext,btnBox1");
+            }
+        }else{
+            myshow("xian1,fkfs1,htqdrq2,fwzlFormater2,fwzj2,btnLast,btnValid,btnBox2");
+            myhide("tqlx2,hyzk2,zgspousename,zgspousezjhm,tqrglgx1,btnClose,btnNext,btnBox1");
+        }
+        if (tqlx == "55") {
+            myshow("gfhth2,zxzje2");
+            myhide("bdcqzh2,sfdy1");
+        }else{
+            myshow("bdcqzh2,sfdy1");
+            myhide("gfhth2,zxzje2");
+        }
+    }
+}
+function fnTqrglgx(){
+    var tqrglgx = $("#tqrglgx").val();
+    var validflag = $("#validflag").val();
+    var tqyy = $.val("tqyy");
+    var tqlx = $("#tqlx").val();
+    var hyzk = $("#hyzk").val();
+    var poxm = $("#spousename").val();
+    var pozjlx = $("#spousezjlx").val();
+    var pozjhm = $("#spousezjhm").val();
+    if(!tqrglgx){
+        $.dialog({title: "", content: "请选择您与产权人的关系", mode: 1}, function (index) {
+
+        });
+        return;
+    }
+    if(tqrglgx == "04"){
+        $.dialog({title: "", content: "您与产权人的关系为其他,不允许办理", mode: 1}, function (index) {
+
+        });
+        $("#tqrglgx").val("");
+        $("#zjkrxm").val("");
+        $("#zjkrzjhm").val("");
+        return;
+    }
+    if(tqrglgx == "02"){
+        $.dialog({title: "", content: "您与产权人的关系为直系亲属,请前往柜台办理", mode: 1}, function (index) {
+
+        });
+        $("#tqrglgx").val("");
+        $("#zjkrxm").val("");
+        $("#zjkrzjhm").val("");
+        return;
+    }
+    if(tqrglgx == "01"){
+        if(hyzk != "20"){
+            $.dialog({title: "", content: "您的婚姻状况不是已婚,您与产权人的关系不能为夫妻", mode: 1}, function (index) {
+
+            });
+            $("#tqrglgx").val("");
+            $("#zjkrxm").val("");
+            $("#zjkrzjhm").val("");
+            return;
+        }
+        if(hyzk == "20"){
+            if(!poxm || !pozjlx || !pozjhm){
+                $.dialog({title: "", content: "配偶信息不能为空", mode: 1}, function (index) {
+
+                });
+                $("#tqrglgx").val("");
+                return;
+            }
+        }
+    }
+    if (tqyy == "01") {
+        if($("#checkSpouse").val() == "0"){//防止正在请求协查时 选择产权人关系,导致跳过协查结果
+            $("#tqrglgx").val("");
+            return;
+        }
+        // initPage2();
+        fetchNext();
+    }
+    if(tqyy == "01" && tqlx == "55"){
+        if(tqrglgx == "05" && validflag == "0"){
+            $("#zjkrxm").val($.val("zjkrxm"));
+            $("#zjkrzjlx").val("01");
+            $("#zjkrzjhm").val($.val("codeno"));
+        }
+        if(tqrglgx == "01" && validflag == "0"){
+            $("#zjkrxm").val(poxm);
+            $("#zjkrzjlx").val(pozjlx);
+            $("#zjkrzjhm").val(pozjhm);
+        }
+    }else if(tqyy == "01" && tqlx == "61"){
+        if(tqrglgx == "05" && validflag == "0"){
+            $("#zjkrxm").val($.val("zjkrxm"));
+            $("#zjkrzjlx").val("01");
+            $("#zjkrzjhm").val($.val("codeno"));
+        }
+        if(tqrglgx == "01" && validflag == "0"){
+            $("#zjkrxm").val(poxm);
+            $("#zjkrzjlx").val(pozjlx);
+            $("#zjkrzjhm").val(pozjhm);
+        }
+    }else if(tqyy == "02" || tqyy == "82"){
+        if(tqrglgx == "05" && validflag == "0"){
+            $("#zjkrxm").val($.val("zjkrxm"));
+            $("#zjkrzjlx").val("01");
+            $("#zjkrzjhm").val($.val("codeno"));
+        }
+        if(tqrglgx == "01" && validflag == "0"){
+            $("#zjkrxm").val(poxm);
+            $("#zjkrzjlx").val(pozjlx);
+            $("#zjkrzjhm").val(pozjhm);
+        }
+    }
+}
+function fnChgFwyt() {
+    var fwyt = $("#fwyt").val();
+    if(fwyt != "01"){
+        $.dialog({title: "", content: "非住宅不允许提取", mode: 1}, function (index) {
+            $.closeCurrWin();
+        });
+        $("#fwyt").val("");
+    }
+    return;
+}
+function fnhyzk(that){
+    if ($.val("tqyy") == "01" && !$("#tqlx").val()) {
+        $.dialog({title: "", content: "请先选择提取类型后,在选择婚姻状况!", mode: 1}, function (index) {
+        });
+        $("#hyzk").val("")
+        $("#spousename").val("");
+        $("#spousezjhm").val("");
+        return
+    }
+    if(that.value == "10" || that.value == "40"){
+        removeValid("spousename,spousezjhm");
+        $("#zgspousename").hide();
+        $("#zgspousezjhm").hide();
+        $("#zgspousezjlx").hide();
+        $("#spousename").val("");
+        $("#spousezjhm").val("");
+        checkSpouseInfo();
+    }else if(that.value == "20"){
+        myaddValid("spousename,spousezjhm");
+        $("#zgspousename").show();
+        $("#zgspousezjhm").show();
+        $("#spousename").val("");
+        $("#spousezjhm").val("");
+    }
+}
+
+//提交页面返回上一页面反显之前录入的配偶信息
+function fnhyzk1(){
+    var hyzk = $("#hyzk").val();
+    var tqyy = $.val("tqyy");
+    if(hyzk == "10" || hyzk == "40"){
+        removeValid("spousename,spousezjhm");
+        $("#zgspousename").hide();
+        $("#zgspousezjhm").hide();
+        $("#zgspousezjlx").hide();
+        $("#spousename").val("");
+        $("#spousezjhm").val("");
+    }else if(hyzk == "20"){
+        myaddValid("spousename,spousezjhm");
+        $("#zgspousename").show();
+        $("#zgspousezjhm").show();
+    }
+    if(tqyy == "01" || tqyy == "02" || tqyy == "82"){
+        //初始化页面时会重置产权人关系和区县下拉选,不能去校验配偶,会报错
+    }else{
+        checkSpouseInfo();
+    }
+}
+
+var mzsm = "";
+mzsm+= "尊敬的用户:</br>";
+mzsm+= "&emsp;&emsp;为维护您的权益,请在签署本条款前,仔细阅读各条款内容。您通过南昌住房公积金互联网渠道办理业务即表示您已阅读并同意本声明条款,如您不接受本声明条款,请勿使用南昌住房公积金互联网渠道服务。</br>";
+mzsm+= "一、用户在使用南昌住房公积金互联网渠道服务时,应按照南昌住房公积金互联网渠道的规定正确操作。因操作不当而造成的损失,南昌住房公积金管理中心不承担任何责任。</br>";
+mzsm+= "二、用户必须妥善保管本人账号和密码,因网站执行指令均是通过计算机程序自动完成,无法核实账户操作者是否是用户本人,因此所有使用密码进行的操作均视为用户本人所为,对用户本人具有法律效力。依据密码办理的各类公积金业务所发生的电子信息记录均为办理该项业务的有效凭证。</br>";
+mzsm+= "三、因黑客行为或用户的保管疏忽导致账号、密码遭他人非法使用,而造成用户损失,南昌住房公积金管理中心不承担任何责任。用户应当为自身注册账户下的一切行为负责,因用户行为而导致的用户自身或其他第三方的任何损失,南昌住房公积金管理中心不承担责任。</br>";
+mzsm+= " 四、南昌住房公积金互联网渠道因以下情况没有执行用户指令的,南昌住房公积金管理中心不承担责任:</br>";
+mzsm+= "(一)南昌住房公积金互联网渠道网络系统出现故障;</br>";
+mzsm+= "(二)南昌住房公积金互联网渠道接收到的用户指令信息不明、存在乱码、不完整等;</br>";
+mzsm+= "(三)用户自有资金账户或公积金账户余额不足;</br>";
+mzsm+= "(四)用户自有资金账户或公积金账户内资金被司法冻结或划扣;</br>";
+mzsm+= "(五)不可抗力或其他不可归因于公积金中心的情况。</br>";

Some files were not shown because too many files changed in this diff