一段代码

if (typeof HdGame == "undefined") {
    HdGame = {}
}
(function (a) {
    a.encodeHtml = function (c) {
        return c && c.replace ? (c.replace(/&/g, "&amp;").replace(/ /g, "&nbsp;").replace(/\b&nbsp;+/g, " ").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\\/g, "&#92;").replace(/\'/g, "&#39;").replace(/\"/g, "&quot;").replace(/\n/g, "<br/>").replace(/\r/g, "")) : c
    };
    a.encodeUrl = function (c) {
        return typeof c === "undefined" ? "" : encodeURIComponent(c)
    };
    a.decodeHtml = function (c) {
        return c && c.replace ? (c.replace(/&nbsp;/gi, " ").replace(/&lt;/gi, "<").replace(/&gt;/g, ">").replace(/&#92;/gi, "\\").replace(/&#39;/gi, "'").replace(/&quot;/gi, '"').replace(/\<br\/\>/gi, "\n").replace(/&amp;/gi, "&")) : c
    };
    a.decodeUrl = function (c) {
        return typeof c === "undefined" ? "" : decodeURIComponent(c)
    };
    a.checkCharacterLen = function (c, g) {
        var h = g.val().replace(/[^\x00-\xff]/g, "**");
        var f = h.trim().length;
        var e = 0;
        for (var d = 0; d < f; d++) {
            e++
        }
        return e > c
    };
    a.checkTextLength = function (o, f, k) {
        var g;
        if (k) {
            g = f
        } else {
            g = f.val()
        }
        var m = g.replace(/[^\x00-\xff]/g, "**");
        var d = m.length;
        if (d < o) {
            return {
                isOverflow: false
            }
        }
        var j = m.substr(0, o);
        var h = 0;
        var l = "";
        for (var e = 0; e < j.length; e++) {
            var c = j.substr(e, 1);
            if (c == "*") {
                h++
            }
        }
        var n = 0;
        if (h % 2 == 0) {
            n = h / 2 + (o * 1 - h);
            l = g.substr(0, n)
        } else {
            n = (h - 1) / 2 + (o * 1 - h);
            l = g.substr(0, n)
        }
        if (k) {
            return {
                isOverflow: true,
                returnValue: l
            }
        } else {
            f.val(l)
        }
    };
    a.fadOut = function (c, d) {
        if (c.is(":visible")) {
            d && d();
            return
        }
        c.css("opacity", 0);
        c.show();
        c.addClass("poupFadIn");
        setTimeout(function () {
            c.removeClass("poupFadIn");
            c.css("opacity", 1);
            d && d()
        },
        200)
    };
    a.fadIn = function (c, d) {
        if (c.is(":hidden")) {
            d && d();
            return
        }
        c.css("opacity", 1);
        c.addClass("poupFadOut");
        setTimeout(function () {
            c.hide();
            c.removeClass("poupFadOut");
            c.css("opacity", 1);
            d && d()
        },
        200)
    };
    a.statusMsg = (function () {
        var e = null;
        var g = '<div class="statusTip" style="display:none; opacity:0;"><div class="content"><div id="statusTip-msg"></div><div class="sTime">详情留意活动说明</div></div></div>';
        var c = $(g);
        var d = c.find("#statusTip-msg");
        var f = c.find(".sTime");
        var h = false;
        return function (j, i, k) {
            var l = "";
            if (j === 1) {
                l = "活动尚未开始";
                f.text("活动开始时间为" + g_config.startTime)
            }
            if (j === 3) {
                l = "活动已结束";
                f.text("请关注期待下次活动")
            }
            if (j === 4) {
                l = "您今天已经没有抽奖机会了";
                f.text("明天可继续抽奖哦")
            }
            if (j === 5) {
                l = "未授权用户无法进行游戏。"
            }
            if (j === 6) {
                l = "您的抽奖机会已经用完"
            }
            if (j === 7) {
                l = "您今天已经没有参与机会了";
                f.text("明天可继续参与哦")
            }
            if (j === 8) {
                l = "您的参与机会已经用完"
            }
            if (typeof j === "string") {
                l = j
            }
            d.html(l);
            if (typeof i === "string") {
                f.text(i)
            } else {
                if (i) {
                    f.hide()
                } else {
                    f.show()
                }
            }
            if (k) {
                c.css("width", k)
            } else {
                if (j == 4) {
                    c.css("width", "14rem")
                } else {
                    c.css("width", "11.5rem")
                }
            }
            if (j == 4 && g_config.showHelpGuide) {
                $("#helpGuideBox").show();
                return
            }
            if (!h) {
                $("body").append(c);
                h = true
            }
            clearTimeout(e);
            a.fadOut(c);
            e = setTimeout(function () {
                a.fadIn(c,
                function () {
                    c.remove();
                    h = false
                })
            },
            2000)
        }
    })();
    a.showMsgToast = function (f, d, e) {
        var c = $("<div class='msg-toast " + e + "' style='display: none;'>" + f + "</div>");
        $("body").append(c);
        c.fadeIn(300);
        setTimeout(function () {
            c.fadeOut(300,
            function () {
                c.remove()
            })
        },
        d)
    }; 
    a.share = function () {
        if ($("#sharePanel").length > 0) {
            $("#sharePanel").show();
            return
        }
        $("body").append("<div id='sharePanel'></div>");
        $("#sharePanel").on("touchend touchstart",
        function () {
            $(this).hide()
        })
    };
    a.favorite = function () { 
        if ((g_config.wxAward && g_config.wxAward.genewxcard)) {
            return
        }
        if ($("#favoritePanel").length > 0) {
            $("#favoritePanel").show();
            return
        }
        $("body").append("<div id='favoritePanel'></div>");
        $("#favoritePanel").on("touchend touchstart", function (c) {
            setTimeout(function () {
                $("#favoritePanel").hide()
            },
            500)
        })
    }; 
    a.getStatusName = function (c) {
        switch (c) {
            case 0:
                return "未领取";
            case 1:
                return "已核销";
            case 2:
                return "未核销";
            case 3:
                return "已过期";
            case 4:
                return "已作废"
        }
    };
    (function () {
        var e = null;
        _lastWrap = null,
        _stop = function (f) {
            if (f) {
                if (f.data("_guide")) {
                    f.data("_guide").remove();
                    f.removeData("_guide")
                }
            } else {
                if (e) {
                    e.remove();
                    e = null;
                    _lastWrap && _lastWrap.removeData("_guide")
                }
            }
        };
        var d = function (j, l, m) {
            var g = $('<div class="ball-scale-multiple"><div></div><div></div><div></div></div>');
            if (j.css("position") === "static") {
                j.css("position", "relative")
            }
            if (typeof l === "object" && typeof l.x !== "undefined" && typeof l.y !== "undefined" && typeof l.w !== "undefined" && typeof l.h !== "undefined") {
                var k = Math.min(l.w, l.h) * (m || 1);
                g.children().css({
                    width: k,
                    height: k
                });
                g.css({
                    left: l.x + (l.w - k) / 2,
                    top: l.y + (l.h - k) / 2
                })
            } else {
                m = m || 0.8;
                var f = j.outerHeight();
                var h = j.outerWidth();
                var i = (l === "w" ? h / 2 : (l === "h" ? f / 2 : (l === "min" ? Math.min(f, h) / 2 : Math.max(f, h) / 2))) * m;
                g.css({
                    left: h / 2 - i,
                    top: f / 2 - i
                });
                g.children().css({
                    width: 2 * i,
                    height: 2 * i
                })
            }
            j.append(g);
            e = g;
            j.data("_guide", g);
            _lastWrap = j
        };
        var c = {
            play: d,
            stop: _stop
        };
        a.Guide = c
    })();
    a.homePoup = function (c) {
        if (c == 1) {
            $("#rankBox").show()
        } else {
            if (c == 3) {
                $("#awardBox").show()
            } else {
                if (c == 4) {
                    $("#regAwardBox").show()
                }
            }
        }
        $("#poupInfoBox").show()
    };
    a.poupAjaxComplete = function (c) {
        var d = $(".ajaxLoadBar");
        d.addClass("ajaxComplete");
        $(".ajaxLoadBg").hide();
        setTimeout(function () {
            d.removeClass("ajaxLoad");
            d.removeClass("ajaxComplete")
        },
        500)
    };
    (function () {
        var q = {
            rankUrl: "",
            awardUrl: "",
            getRegAwardUrl: "",
            mhaveScore: 0,
            openid: "",
            gameId: 0,
        };
        var f = {
            menuLen: "",
            slideBarWidth: "",
            slideBarMaxWidth: "",
            marginLeft: false,
            firstTouchRank: true,
            firstTouchAward: true,
            firstTouchWinList: true,
            hasInitEvent: false,
        };
        var o = {
            isLoad: false,
            isRankAll: false,
            start: 0,
            num: 0,
            limit: 99
        };
        a.initChangePoup = function (r) {
            r && $.extend(q, r);
            if (_manage) {
                $("#Award_Round_Dot").show()
            }
            f.menuLen = 0;
            $(".poupTitleBox .poupTitleMune").each(function () {
                if ($(this).css("display") == "block") {
                    $(this).removeClass("hide");
                    f.menuLen++
                } else {
                    $(this).addClass("hide")
                }
            });
            $("#awardBox").css("height", $("#poupInfoBox").height() - $(".poupHead").height());
            $(".popTabBox").css("width", $(window).width() * f.menuLen);
            var s = null;
            $(".poupTitleBox .poupTitleMune").not(".hide").each(function (v, x) {
                var u = $(this).attr("_flag");
                for (var w = 0; w < $("#poupInfoBox .poupMain").length; w++) {
                    var t = $("#poupInfoBox .poupMain").eq(w);
                    if (t.attr("_flag") == u) {
                        t.show();
                        if (s) {
                            s = s.add(t)
                        } else {
                            s = t
                        }
                        return
                    }
                }
            });
            $("#poupInfoBox .poupMain").not(s).hide();
            $("#poupInfoBox .poupMain").css("width", 100 / f.menuLen + "%");
            $(".poupTitleBox .poupTitleMune,.poupTitleBox .slideBarTip").css("width", 13.25 / f.menuLen + "rem");
            f.slideBarWidth = parseInt($(".poupTitleBox .poupTitleMune").css("width"));
            f.slideBarMaxWidth = parseInt($(".poupTitleBox .slideBarTip").css("max-width"));
            if (f.slideBarWidth > f.slideBarMaxWidth) {
                f.marginLeft = true
            }
            $("#poupInfoBox .poupMain").height($("#poupInfoBox").height() - $(".poupHead").outerHeight() - g_rem);
            if (!f.hasInitEvent) {
                l();
                f.hasInitEvent = true
            }
        };
        function l() {
            var s = _manage ? "click" : "touchstart";
            var r = $(".poupTitleBox .poupTitleMune");
            r.on(s,
            function () {
                if (r.length == r.not(".hide").length) {
                    var u = $(this).index()
                } else {
                    var u = r.filter(":visible").index(this);
                    u = u < 0 ? 0 : u
                }
                var t = parseInt($(this).attr("_flag"));
                a.changePoup(t, u)
            });
            $("#rankBox").scroll(function (t) {
                if (_manage) {
                    return
                }
                if (o.isClose) {
                    return
                }
                if ($("#rankHeight").height() - $("#rankHeight").height() / 3 <= $(window).height() + $("#rankBox").scrollTop()) {
                    if (!o.isLoad && !o.isRankAll) {
                        o.isLoad = true;
                        i()
                    }
                }
            })
        }
        a.changePoup = function (s, t) {
            o.isClose = false;
            $("#poupInfoBox").show();
            $(".poupTitleMune").removeClass("checked");
            if (s == 5 && q.hasReport == true) {
                $("#informResultBox h3").text("你已经投诉过了!");
                $("#informResultBox").show()
            } else {
                if (typeof t === "number") {
                    var u = $(".poupTitleMune").filter(":visible").eq(t);
                    u.addClass("checked");
                    s = parseInt(u.attr("_flag"))
                } else {
                    $(".poupTitleBox .poupTitleMune").filter(":visible").each(function (w, x) {
                        if ($.trim($(this).attr("_flag")) == s) {
                            t = w;
                            $(this).addClass("checked")
                        }
                    })
                }
            }
            if (_manage) {
                var v = $.trim($(".poupTitleMune").eq(t).find(".item").text());
                var r = parent.$("#editActive .topBar .column");
                if (v == "活动说明") {
                    r.each(function () {
                        if ($(this).find(".name").text().trim() == "活动奖品") {
                            $(this).addClass("checked");
                            parent.$(".topBar .transitionPanel").css("left", ($(this).offset().left + 2) + "px")
                        }
                    })
                } else {
                    r.each(function () {
                        var w = $.trim($(this).find(".name").text());
                        if (w == v) {
                            parent.$(".topBar .transitionPanel").css("left", ($(this).offset().left + 2) + "px");
                            r.removeClass("checked");
                            $(this).addClass("checked")
                        }
                    })
                }
            }
            if (f.marginLeft) {
                $(".poupSlideBar .slideBarTip").css("left", ((13.25 / f.menuLen) * t + (f.slideBarWidth - f.slideBarMaxWidth) / 40) + "rem")
            } else {
                $(".poupSlideBar .slideBarTip").css("left", (13.25 / f.menuLen) * t + "rem")
            }
            e(s);
            $(".popTabBox").css("left", -$(window).width() * t)
        };
        function e(r) {
            $("#poupInfoBox").removeClass("poupFadOut").addClass("poupFadIn");
            if (!_manage) {
                $(".gameBox,.home,.body").addClass("overflow-y-hidden");
                g_config.showSkillSup && $(".bottomSkill").hide()
            }
            $(".poupClose").off("touchend");
            setTimeout(function () {
                $(".poupClose").on("touchend",
                function (t) {
                    t.preventDefault();
                    t.stopPropagation();
                    f.firstTouchRank = true;
                    f.firstTouchAward = true;
                    f.firstTouchWinList = true;
                    o.isClose = true;
                    o.isRankAll = false;
                    o.num = o.start = 0;
                    $("#rankInfoBox").html("");
                    $(".poupTitleMune").removeClass("checked");
                    $(".poupTitleMune").eq(0).addClass("checked");
                    var s = $("#poupInfoBox");
                    s.removeClass("poupFadIn").addClass("poupFadOut");
                    if (!_manage) {
                        $(".gameBox,.home,.body").removeClass("overflow-y-hidden");
                        g_config.showSkillSup && $(".bottomSkill").show()
                    }
                    setTimeout(function () {
                        s.hide();
                        $(".popTabBox").css("left", 0);
                        $(".poupSlideBar .slideBarTip").css("left", (f.slideBarWidth - f.slideBarMaxWidth) / 40 + "rem")
                    },
                    100);
                    hg.fire("hidePoup", r)
                })
            },
            300);
            if (r === 1) {
                d(r)
            } else {
                if (r === 2) {
                    g(r)
                } else {
                    if (r === 3) {
                        k(r)
                    } else {
                        if (r === 4) {
                            h(r)
                        } else {
                            if (r === 5) {
                                j(r)
                            }
                        }
                    }
                }
            }
            hg.fire("showPoup", r)
        }
        function n() {
            var r = $("#loadingTxt").html();
            if (r === "正在加载中..." || r === "") {
                $("#loadingTxt").html("正在加载中.")
            } else {
                if (r === "正在加载中.") {
                    $("#loadingTxt").html("正在加载中..")
                } else {
                    $("#loadingTxt").html("正在加载中...")
                }
            }
            o.timer = setTimeout(arguments.callee, 300)
        }
        function m() {
            $("#rankHeight").find("#loadingTxt").remove();
            clearTimeout(o.timer)
        }
        function i(r) {
            if ($("#loadingTxt").length == 0) {
                $("#rankHeight").append('<div id="loadingTxt" class="rankInfo" style="text-align: left; margin: 0 auto; line-height:2.5rem; font-size:0.6rem; width: 3.8rem; ">正在加载中...</div>');
                n()
            } else {
                return
            }
            console.log('[需设置]排行榜'); 
            $.ajax({
                //type: "post",
                //url: q.rankUrl + "&start=" + o.start + "&limit=" + o.limit + "&playerId=" + g_config.playerId,
                type: "post",
                url: '/Weixin/GameActivity/ListRank',
                data:{gameActivityId:g_config.gameId,pageSize:100},
                error: function () {
                    if (o.num == 0) {
                        a.poupAjaxComplete(r)
                    }
                    o.isLoad = false
                },
                success: function (u) { 
                    var v = u;
                    var s = v.list;
                    var w = v.total;
                    var t = $("#rankInfoBox");
                    //if (v.isRankAll) {
                    //    o.isRankAll = true
                    //}
                    o.isRankAll = true
                    if (o.num == 0) {
                        a.poupAjaxComplete(r)
                    }
                    setTimeout(function () {
                        if (w == 0) {
                            $("#rank").text("无")
                        } else {
                            $("#rank").text(w + "位")
                        }
                        var x = s.length;
                        if (x == 0) {
                            $("#noRank").show()
                        } else {
                            $("#rankMain").show();
                            for (var z = 0; z < s.length; z++) {
                                if (o.start + z + 1 >= rankShowNum) {
                                    o.isRankAll = true
                                }
                                var F = s[z].headimgurl.length > 0 ? s[z].headimgurl : null;
                                var y = F == null ? "" : "src='" + F + "'";
                                var E = "";
                                //if (g_config.isDoubleGame) {
                                //    var A = s[z].info.length > 0 ? $.parseJSON(s[z].info).headImgB : null;
                                //    var D = A == null ? "" : "src='" + A + "'";
                                //    E = '<img class="userImg" ' + D + " />"
                                //}
                                var C = '<tr class="rankInfo"><td>No.' + (o.start + z + 1) + '</td><td><div><img class="userImg" ' + y + " />" + E + '</div></td><td class="nickname">' + s[z].nickName + "</td><td >" + s[z].bestScore + '<span class="scoreUnit">' + g_config.scoreUnit + "</span></td></tr>";
                                t.append(C)
                            }
                            //if (o.isRankAll && w > rankShowNum) {
                            //    var y = g_config.headimgurl ? "src='" + g_config.headimgurl + "'" : "";
                            //    var B = '<tr class="rankInfo" style="line-height:0.85rem"><td colspan="4" style="padding-bottom:0.35rem">......</td></tr><tr class="rankInfo"><td>No.' + w + '</td><td><div><img class="userImg" ' + y + ' /></div></td><td class="nickname">' + g_config.nickname + "</td><td >" + (g_config.scoreType ? a.currentScore : parseInt(a.currentScore)) + '<span class="scoreUnit">' + g_config.scoreUnit + "</span></td></tr>";
                            //    t.append(B)
                            //}
                        }
                        o.isLoad = false;
                        o.num++;
                        o.start = o.num * (o.limit + 1);
                        hg.fire("updateRankList", v)
                    }, 500);
                    if (o.num == 0) {
                        f.firstTouchRank = false
                    }
                    m()
                }
            })
        }
        function d(x) {
            if (g_config.isDoubleGame) {
                $("#rankBox").addClass("isDoubleGame")
            }
            if (f.firstTouchRank) {
                $(".ajaxLoadBg").show();
                $(".ajaxLoadBar").addClass("ajaxLoad");
                $("#noRank").hide();
                $("#rankMain").hide();
                i(x)
            }
        }
        function g(r) {
            if (!_manage) {
                a.logDog(1000009);
                if (skillSupportType == 2 || skillSupportType == 3) {
                    if (g_config.authVer == HdVerDef.FREE) {
                        a.logDog(1000069, 1)
                    } else {
                        if (g_config.authVer == HdVerDef.BJ) {
                            a.logDog(1000069, 3)
                        } else {
                            if (g_config.authVer == HdVerDef.BY) {
                                a.logDog(1000069, 5)
                            }
                        }
                    }
                }
            }
            if (isLimitDraw && (drawTimesLimit == drawTotalLimit)) {
                $("#explainBox").find(".dayFont").hide();
                $("#explainBox").find(".drawTotalFont").hide()
            }
            if (!isLimitDraw) {
                $("#explainBox").find(".drawTotalFont").hide()
            }
            $("#ruleBox").show();
            $("#poupInfoBox").show();
            if (!q.mhaveScore) {
                $("#haveScore").hide()
            }
        }
        function k(y) {  
            var v = $("#awardInfo");
            $("#awardInfoBox").css("height", $("#awardBox").height() - $("#awardBox .attentionBox").height() - 18);
            $("#poupInfoBox,#awardBox").show();
            if (!_manage && g_config.showSkillSup) {
                if (g_config.authVer == HdVerDef.FREE) {
                    a.logDog(1000069, 0)
                } else {
                    if (g_config.authVer == HdVerDef.BJ) {
                        a.logDog(1000069, 2)
                    } else {
                        if (g_config.authVer == HdVerDef.BY) {
                            a.logDog(1000069, 4)
                        }
                    }
                }
                a.logDog(1000028, 1);
                typeof g_config.isAOpenId == "number" && a.logDog(1000115, 1 + g_config.isAOpenId)
            }
            if (g_config.aid == 7171826 && g_config.showSkillSup) {
                a.logDog(1000062, 0)
            } else {
                if (g_config.aid == 8566249 && g_config.showSkillSup) {
                    a.logDog(1000067, 0)
                }
            }  
            if (f.firstTouchAward) {
                $(".ajaxLoadBg").show();
                $(".ajaxLoadBar").addClass("ajaxLoad");
                console.log('[需设置]中奖纪录')
                $.ajax({
                    type: "post",
                    url: '/Weixin/GameActivity/ListPrize', 
                    data: { gameActivityId: g_config.gameId, openid: g_config.openid },
                    error: function () {
                        a.poupAjaxComplete(y)
                    },
                    success: function (result) {
                        a.poupAjaxComplete(y); 
                        //var C = E;
                        $("#Award_Round_Dot").hide(); 
                        if (result.status == 200) {
                            p(result.list)
                        } else {
                            $("#awardInfo").html('<div style="line-height: 2.6rem; padding-left: 0.05rem;">暂无中奖纪录</div>')
                        }
                        //if (C.userInfo && (C.userInfo.ausername || C.userInfo.aphone || C.userInfo.aadress)) {
                        //    $("#awardContactInfo").show();
                        //    if (C.userInfo.ausername) {
                        //        $("#awardContactInfo .contactName").show();
                        //        $("#awardContactInfo .contactName span").text(C.userInfo.ausername)
                        //    }
                        //    if (C.userInfo.aphone) {
                        //        $("#awardContactInfo .contactPhone").show();
                        //        $("#awardContactInfo .contactPhone span").text(C.userInfo.aphone)
                        //    }
                        //    if (C.userInfo.aadress) {
                        //        var D = a.checkTextLength(14, C.userInfo.aadress, true);
                        //        if (D.isOverflow) {
                        //            $("#awardContactInfo .contactAddress span").text(D.returnValue + "...")
                        //        } else {
                        //            $("#awardContactInfo .contactAddress span").text(C.userInfo.aadress)
                        //        }
                        //        $("#awardContactInfo .contactAddress").show()
                        //    }
                        //}
                        f.firstTouchAward = false
                    }
                })
            }
        }
        function c(s, r) {
            var t = s.repalce(/-/g, "/");
            t = new Date(t).getTime();
            return t > r
        }
        function p(list) {
            var I = [];
            $.each(list, function (index, item) {
                I.push({
                    "code": item.tTicketCode,
                    "aid": 12222924,
                    "used": "used",
                    "level": item.code,
                    "gameid": g_config.gameId,
                    "custom": "",
                    "playerId": 0,
                    "awardName": item.name,
                    "awardTime": item.createTime,
                    "codeStatus": item.isTicket,
                    "name": g_config.nickname,
                    "achievement": "442",
                    "openId": g_config.openid,
                    "info": { "headImg": g_config.headimgurl },
                    "awardInfo": { 
                        "amount": 100,
                        "awardtype": 2,
                        "cashtype": 1,
                        "attention": 1,
                        "cashsite": "http://",
                        "pot": 0,
                        "style": item.displayCodeName,
                        "t_type": "DATE_TYPE_FIX_TIME_RANGE",
                        "cbt": item.exchangeStartTime,
                        "cet": item.exchangeEndTime,
                        "cft": 30,
                        "cfbt": 0,
                        "tlmt": "[8]",
                        "ocimg": false,
                        "opqrc": true,
                        "optx": false,
                        "oct": false,
                        "oplink": false,
                        "genewxcard": false,
                        "iscuscode": false,
                        "stl": item.displayCodeName,
                        "opti": "请截屏此页面发送至“九个秘书”服务号",
                        "btn": "了解更多",
                        "btl": "",
                        "servicepho": "400-6185-567",
                        "cashinfo": "1、中奖后截图发九个秘书微信公众号,告知联系方式即可;\r\n2、所有奖品需到公司领取,若需快递,需个人承担快递费。",
                        "aimg": item.image,
                        "aimgw": "6rem",
                        "aimgh": "6rem",
                        "attentionimg": "",
                        "onlinect": 1,
                        "continfo": 0,
                        "usedAmount": 1,
                        "name": item.name,
                        "level": 1,
                        "passwordrednum": 100,
                        "onlinewxnum": ""
                    },
                    "awardStyle":item.displayCodeName
                }); 
                //z = '<div id="codeInfo' + index + '" class="codeInfoBox" _level="' + item.code + '"><div class="djqImgBox"></div><div class="isEmptyAward ellipsis" style="width: 11rem;margin-left:0.6rem;font-size:0.7rem;">' + item.displayCodeName + ":" + item.name + '</div><div class="codeperiod" style="margin: 0.25rem 0.6rem;line-height:1.4rem;"><span>' + y + "</span>:" + item.exchangeStartTime + " 至 " + item.exchangeEndTime + '</div><div class="goDetailIcon"></div><div class="awardWrap"></div><div style="color: #ecb208;margin-left:0.6rem;">' + a.getStatusName(item.isTicket) + "</div></div>";
                //s.append(z);
                //$("#codeInfo" + index).data("data", item);
            })
            var s = $("#awardInfo");
            var z = "";
            s.html("");
            var u = $("#resulte-gift-showMyAward").data("openCode");
            //var y = "兑奖期限";
            //$.each(I, function (index, item) {
            //    z = '<div id="codeInfo' + index + '" class="codeInfoBox" _level="' + item.code + '"><div class="djqImgBox"></div><div class="isEmptyAward ellipsis" style="width: 11rem;margin-left:0.6rem;font-size:0.7rem;">' + item.displayCodeName + ":" + item.name + '</div><div class="codeperiod" style="margin: 0.25rem 0.6rem;line-height:1.4rem;"><span>' + y + "</span>:" + item.exchangeStartTime + " 至 " + item.exchangeEndTime + '</div><div class="goDetailIcon"></div><div class="awardWrap"></div><div style="color: #ecb208;margin-left:0.6rem;">' + a.getStatusName(item.isTicket) + "</div></div>";
            //    s.append(z);
            //    $("#codeInfo" + index).data("data", item);
            //})  
            var r = null;
            for (var F = 0; F < I.length; F++) {
                var B = I[F]; 
                var t = B.awardInfo;
                var D = t.awardtype;
                var y = "兑奖期限";
                var A = "兑奖码";
                var K = "收藏兑奖码";
                var L = "兑奖地址";
                var E = "兑奖券详情";
                var C = "兑奖须知"
                var E = "优惠券详情";  
                var G = (t.cbt).replace("-", ".").replace("-", ".");
                var H = (t.cet).replace("-", ".").replace("-", ".");
                B.collectionBtn = K;
                B.collectionBtn = K;
                B.addressName = L;
                B.awardCusText = E;
                B.titleNotice = C;
                B.codeName = A;
                B.codeEndTime = H;
                B.codeBgTime = G;
                B.awardTypeName = y;
                var w = (B.custom && B.custom.length > 0) ? B.custom : B.code;
                var x = B.level;
                var v = B.awardName;
                
                B.awardCode = w;
                z = '<div id="codeInfo' + F + '" class="codeInfoBox" _level="' + x + '"><div class="djqImgBox"></div><div class="isEmptyAward ellipsis" style="width: 11rem;margin-left:0.6rem;font-size:0.7rem;">' + a.encodeHtml(B.awardStyle) + ":" + a.encodeHtml(v) + '</div><div class="codeperiod" style="margin: 0.25rem 0.6rem;line-height:1.4rem;"><span>' + a.encodeHtml(y) + "</span>:" + G + " 至 " + H + '</div><div class="goDetailIcon"></div><div class="awardWrap"></div><div style="color: #ecb208;margin-left:0.6rem;">' + a.getStatusName(B.codeStatus) + "</div></div>";
                s.append(z);
                $("#codeInfo" + F).data("data", B);
                if (u == w) {
                    r = B
                }
            }
            if (r) {
                a.openAwardDetail(r);
                $("#resulte-gift-showMyAward").removeData("openCode")
            }
        }
        a.shouldRegInfo = function (s, u, v) {
            var r = false;
            if (g_config.afterLinkModify) {
                if (g_config.linkInfoType != 1 && g_config.linkInfoType == s) {
                    r = true
                }
                if (a._isZhuliPlayer && (g_config.linkInfoType == 2 || g_config.linkInfoType == 3)) {
                    r = false
                }
            } else {
                if ((gameType == 3 || gameType == 1) && g_config.openAwardLinkNoDraw) {
                    r = true
                }
            }
            if (r && !t()) {
                a.aUserInfo.show(u, v);
                return true
            }
            return false;
            function t() {
                if (!g_config.awardUsername && !g_config.awardPhone && !g_config.awardAddress) {
                    return false
                }
                return true
            }
        };
        a.openAwardDetail = function (u) {
            if (!u || !u.awardInfo) {
                u = $(this).data("data")
            }
            $(".codeInfoBox").removeClass("checked");
            $(this).addClass("checked");
            var r = u.awardInfo;
            g_config.award = u;
            g_config.wxAward = r;
            if (g_config.afterLinkModify && a.shouldRegInfo(4, arguments, this)) {
                return
            } else {
                if (typeof r.continfo !== "undefined") {
                    if ((g_config.award && ((gameType == 0 || gameType == 4 || gameType == 5) && r.oplink))) {
                        var w = r.continfo;
                        var F = w & 1;
                        var t = w & 2;
                        var C = w & 4;
                        var x = F && !g_config.awardUsername;
                        var v = t && !g_config.awardPhone;
                        var z = C && !g_config.awardAddress;
                        if (x || v || z) {
                            a.aUserInfo.show(arguments, this);
                            if (w) {
                                $("#awardUserInfoBox .contactInput").hide();
                                if (F) {
                                    $("#awardUserInfoBox .contactInput").eq(0).show()
                                }
                                if (t) {
                                    $("#awardUserInfoBox .contactInput").eq(1).show()
                                }
                                if (C) {
                                    $("#awardUserInfoBox .contactInput").eq(2).show()
                                }
                            }
                            return
                        }
                    }
                } else {
                    if (!g_config.linkInfoType && !g_config.awardUsername && !g_config.awardPhone && !g_config.awardAddress && g_config.award && ((gameType == 0 || gameType == 4) && r.oplink)) {
                        a.aUserInfo.show(arguments, this);
                        $("#addressInput").hide();
                        return
                    }
                }
            }
            var H = $("#awardDetailBox");
            var s = $("#ticketDetailBox");
            if (u.codeStatus == 4) {
                $("#codeStatusBtn").html("已作废");
                $("#codeStatusBox").show();
                $("#codeDetailInfoBox").hide()
            } else {
                if (u.codeStatus == 1) {
                    $("#codeStatusBtn").html("已核销");
                    $("#codeStatusBox").show();
                    $("#codeDetailInfoBox").hide();
                    $("#codeStatusInfo").hide();
                    if (r.genewxcard) {
                        $("#awardCollectionBtn").hide()
                    }
                } else {
                    if (u.codeStatus == 3) {
                        $("#codeStatusBtn").html("已过期");
                        $("#codeStatusBox").show();
                        $("#codeDetailInfoBox").hide();
                        $("#codeStatusInfo").hide()
                    } else {
                        var B = new Date().getTime();
                        var D = u.codeBgTime.replace(/\./g, "/");
                        var E = new Date(D).getTime();
                        if (E > B) {
                            var A = Math.ceil((E - B) / (1000 * 60 * 60 * 24));
                            var y = "";
                            if (r.awardtype == 0 || r.awardtype == 1) {
                                y = "优惠券"
                            }
                            if (r.awardtype == 2) {
                                y = "兑奖券"
                            }
                            $("#codeStatusTips .giftNameA").text(y);
                            $("#codeStatusTips .targetDateMin").text(A);
                            $("#codeStatusBox").show();
                            $("#codeDetailInfoBox").hide();
                            $("#codeStatusInfo").hide();
                            $("#codeStatusBtn").html("未到兑奖时间").css("width", "5.5rem");
                            $("#codeStatusTips").show()
                        } else {
                            $("#codeStatusBox").hide();
                            $("#codeDetailInfoBox").show();
                            $("#codeStatusInfo").show()
                        }
                    }
                }
            }
            H.find(".awardName").text(r.name);
            H.find(".awardSubTitle").text(r.stl);
            H.find(".awardCodeTime em").text(u.awardTypeName);
            H.find(".awardCodeTime .codeBgTime").text(u.codeBgTime);
            $("#codeName").text(u.codeName);
            $("#awardCollectionBtn").text(u.collectionBtn);
            var G = u.gameid || u.gameId;
            H.find(".awardCodeTime .codeEndTime").text(u.codeEndTime);
            H.find(".codeImg").attr("src", r.aimg ? r.aimg : 'image/gift.png').show();
            //H.find(".codeImg").attr("src", "http://" + a.gameDomain + "/manage/qrCode.jsp?cmd=qrurl&siteUrl=" + a.encodeUrl(u.awardLevel == 900 ? ("id=" + u.id + "&code=" + u.code + "&gameId=" + G) : ("code=" + u.awardCode + "&gameId=" + G)));
            H.find(".code").text(u.awardCode);
            H.find(".code").attr("code", u.code);
            H.find(".codeOptInfo").text(r.opti);
            if (q.afterWxCard) {
                $(".awardCusText").show();
                $(".awardCusBtn").show();
                if (r.awardtype == 1 || (r.awardtype == 2 && r.cashtype != 2)) {
                    s.find(".addressLine").hide();
                    H.find(".awardCusText").show();
                    if (r.awardtype == 1) {
                        H.find(".awardCusBtn .text").text("商城地址")
                    } else {
                        H.find(".awardCusBtn .text").text("兑奖地址")
                    }
                    if (r.awardtype == 2 && r.cashtype == 1 && r.onlinect == 1) {
                        $("#QRImg_1").attr("src", r.onlinewxnum);
                        $("#awardCusBtnInfo").attr("href", "###");
                        H.find("#awardCusBtnInfo").off("click").on("click",
                        function () {
                            $("#newAttentionMask").show()
                        })
                    } else {
                        if (r.awardtype == 2 && r.cashtype == 3) {
                            $("#awardDetailBox").find(".codeOptInfo").hide();
                            $("#awardDetailBox").find(".wxCashOptInfo").show();
                            $("#attentionCashBtn").show();
                            $("#awardCusBtnInfo").hide();
                            $("#QRImg_1").attr("src", r.attentionimg);
                            $("#attentionCashBtn").attr("href", "###");
                            H.find("#attentionCashBtn").off("click").on("click",
                            function () {
                                $("#newAttentionMask").show()
                            })
                        } else {
                            if (r.awardtype == 2 && r.cashtype == 4) {
                                $("#webCashBtn").show();
                                $("#awardCusBtnInfo").hide();
                                $("#webCashBtn").attr("href", r.cashsite)
                            } else {
                                H.find("#awardCusBtnInfo").attr("href", r.cashsite)
                            }
                        }
                    }
                    s.find(".itemList .address").html(r.cashsite);
                    if (!$.trim(r.servicepho) && !$.trim(r.cashinfo) && (!r.tlmt || r.tlmt == "[8]" || r.tlmt == "[1,2,3,4,5,6,7]")) {
                        H.find(".awardCusText").hide()
                    }
                } else {
                    s.find(".itemList .address").text(r.cashsite.replace("http://", ""));
                    if (r.oct) {
                        H.find(".awardCusBtn .text").text(r.btn);
                        H.find("#awardCusBtnInfo").attr("href", r.btl)
                    } else {
                        $(".awardCusBtn").hide()
                    }
                }
                H.find(".awardCusText .text").html(u.awardCusText);
                s.find(".ticketitle .text").html(u.awardCusText);
                s.find(".itemList .beginTime").html(u.codeBgTime.replace(/-/g, "."));
                s.find(".itemList .endTime").html(u.codeEndTime.replace(/-/g, "."));
                s.find(".itemList .timelimit").text(a.changeTimeLimit(r.tlmt));
                s.find(".itemList .titleAdress").html(u.addressName);
                s.find(".itemList .tel").text(r.servicepho);
                s.find(".itemList .titleNotice").text(u.titleNotice);
                s.find(".itemList .notice").html('<pre style="word-wrap: break-word;"></pre>');
                s.find(".itemList .notice pre").text(r.cashinfo)
            } else {
                if (r.optx) {
                    H.find(".awardCusText .text").text(r.txn);
                    H.find("#awardCusTextInfo").text(r.txc)
                } else {
                    $(".awardCusText").hide()
                }
                if (r.oct) {
                    H.find(".awardCusBtn .text").text(r.btn);
                    H.find("#awardCusBtnInfo").attr("href", r.btl)
                } else {
                    $(".awardCusBtn").hide()
                }
            }
            if (typeof r.cashtype === "undefined" || (r.awardtype != 1 && r.cashtype == 2)) {
                a.logDog(1000085);
                if (r.attention == 3) {
                    $("#awardCusBtnInfo").attr("href", "###");
                    $("#QRImg_1").attr("src", r.attentionimg);
                    $("#awardCusBtnInfo").on("touchend",
                    function () {
                        a.logDog(1000086);
                        $("#newAttentionMask").show()
                    })
                } else {
                    if (r.attention == 2) {
                        $("#awardCusBtnInfo").attr("href", r.btl)
                    }
                }
            } 
            if (typeof r.opqrc === "undefined" || r.opqrc) {
                $("#awardDetailBox .codeImg ").show()
            } else {
                $("#awardDetailBox .codeImg,#awardDetailBox .codeDetailImgBox").hide()
            }
            a.wxConfig.setWxShareUrlArg(["fromFav", u.awardCode]);
            a.logDog(1000056);
            a.logDog(1000045, 1);
            $("#awardDeailBg").show();
            $("#awardDetailBox").show();
            setTimeout(function () {
                $("#awardDeailBg").hide()
            },
            800)
        };
        function h(r) {
            $("#regAwardBox").show();
            if (_manage) {
                a.homePoup(r);
                var v = [];
                var u = ["lvox、hubert", '<span style="color:#fff000">magazine</span>、tina', "monica、hth"];
                var t = $(".regAwardList");
                t.find(".playerName").html("");
                t.each(function (w) {
                    $(this).find(".playerName").html(u[w])
                })
            } else {
                a.logDog(1000034);
                var s = q.getRegAwardUrl;
                if (g_config.isDoubleGame) {
                    var s = s + "&openIdB=" + a.otherOpenId
                }
                if (f.firstTouchWinList) {
                    $(".ajaxLoadBg").show();
                    $(".ajaxLoadBar").addClass("ajaxLoad");
                    $.ajax({
                        type: "post",
                        url: s,
                        error: function () {
                            a.poupAjaxComplete(r)
                        },
                        success: function (w) {
                            a.tlog(w);
                            var x = $.parseJSON(w);
                            a.poupAjaxComplete(r);
                            $("#Mingdan_Round_Dot").hide();
                            setTimeout(function () {
                                var B = [];
                                var y = $(".regAwardList");
                                y.find(".playerName").html("");
                                $("#noRegAward").hide();
                                $("#regAwardMain").show();
                                for (var z = 0; z < y.length; z++) {
                                    var A = {};
                                    A.name = [];
                                    B.push(A)
                                }
                                if (x.length == 0) {
                                    $("#noRegAward").show();
                                    $("#regAwardMain").hide();
                                    return
                                }
                                $(x).each(function () {
                                    var E = $(this)[0].isSelf;
                                    var G = $(this)[0].awardLevel;
                                    var D = G - 1;
                                    if (G == 900) {
                                        D = y.length - 1
                                    }
                                    var F = "";
                                    if (E) {
                                        F = 'style="color:#fff000;"'
                                    }
                                    var C = "<span " + F + ">" + $(this)[0].name + "</span>";
                                    B[D].name.push(C)
                                });
                                for (var z = 0; z < B.length; z++) {
                                    y.eq(z).find(".playerName").append(B[z].name.join("、"))
                                }
                                $("#regAwardMain").show()
                            },
                            500);
                            f.firstTouchWinList = false
                        }
                    })
                }
            }
        }
        function j(r) {
            $("#informBox").show();
            $(".unPublish").hide();
            $("#inform-reason-page").show();
            $("#inform-desc-page").hide();
            $("#next-inform-btn").hide();
            $("#inform-reason-box .reasonItem").removeClass("checked");
            $("#informResultBox .confirm-btn").off("touchend").on("touchend", function (event) {
                event.preventDefault();
                if (!_manage) {
                    $(".gameBox,.home,.body").removeClass("overflow-y-hidden");
                    g_config.showSkillSup && $(".bottomSkill").show()
                }
                $("#informBox").hide();
                $("#informResultBox").hide();
                $(".unPublish").show();
                $("#inform-reason-box .reasonItem").removeClass("checked");
                $("#inform-reason-box .reasonItem em").hide();
                $("#poupInfoBox").hide();
                hg.fire("hidePoup", r)
            });
            $("#cancel-inform-btn").off("touchend").on("touchend", function (event) {
                event.preventDefault();
                var s = $("#poupInfoBox");
                s.removeClass("poupFadIn").addClass("poupFadOut");
                if (!_manage) {
                    $(".gameBox,.home,.body").removeClass("overflow-y-hidden");
                    g_config.showSkillSup && $(".bottomSkill").show()
                }
                s.hide();
                $(".unPublish").show();
                $("#informBox").hide();
                hg.fire("hidePoup", r)
            })
        }
        $("#inform-reason-box .reasonItem").on("touchend",
        function () {
            var r = $(this).attr("_index");
            a.logDog(1000068, r);
            $("#inform-reason-box .reasonItem").removeClass("checked");
            $(this).addClass("checked");
            $("#next-inform-btn").show()
        });
        $("#next-inform-btn").on("touchend",function () {
            $("#inform-reason-page").hide();
            $("#inform-desc-page").show();
            $("#spxdPage").addClass("imp-hide")
        });
        $("#submit-inform-btn").on("touchend",function () {
            if (!q.hasReport) {
                var s = $("#inform-desc-box #informDesc").val();
                s = $.trim(s);
                if (s == null || s == "") {
                    a.showMsgToast("描述不能为空", 2000);
                    return
                } else {
                    if (s.length > 50) {
                        a.showMsgToast("填写超出限制", 2000);
                        return
                    } else {
                        $.ajax({
                            type: "post",
                            url: q.informUrl,
                            error: function (t) {
                                a.tlog(t)
                            },
                            success: function (t) {
                                a.tlog(t);
                                q.hasReport = true;
                                $("#informResultBox h3").text("投诉成功");
                                $("#informResultBox").show()
                            }
                        })
                    }
                }
            } else {
                $("#informResultBox h3").text("你已经投诉过了!");
                $("#informResultBox").show()
            }
            var r = $("#poupInfoBox");
            r.removeClass("poupFadIn").addClass("poupFadOut");
            setTimeout(function () {
                $("#spxdPage").removeClass("imp-hide")
            },
            400)
        });
        $("#awardContactInfo .updateBtn").on("touchend",function () {
            a.aUserInfo.show()
        })
    })();
    (function () {
        var f = false;
        a.sortRuleBox = {
            init: d,
            addBtn: c,
        };
        function d(i) {
            var h = $("#ruleBox");
            var g = h.find(".poupLine").sort(function (l, j) {
                var m = i.indexOf($(l).data("sortkey"));
                var k = i.indexOf($(j).data("sortkey"));
                if (m == -1 || k == -1) {
                    return 0
                }
                return m > k ? 1 : -1
            });
            h.append(g)
        }
        function c() {
            a.addModuleLayer("#ruleBox .poupLine", {
                name: "下移",
                onshow: function (g) {
                    var h = g.target;
                    if (h.next().length == 0) {
                        $(this).hide()
                    } else {
                        $(this).show()
                    }
                },
                onclick: function (h) {
                    var i = h.data.target;
                    var g = i.next();
                    if (g.length != 0) {
                        e(i, g)
                    }
                }
            });
            a.addModuleLayer("#ruleBox .poupLine", {
                name: "上移",
                onshow: function (g) {
                    var h = g.target;
                    if (h.prev().length == 0) {
                        $(this).hide()
                    } else {
                        $(this).show()
                    }
                },
                onclick: function (h) {
                    var i = h.data.target;
                    var g = i.prev();
                    if (g.length != 0) {
                        e(g, i)
                    }
                }
            })
        }
        function e(i, h) {
            if (f) {
                return
            }
            f = true;
            a.removeAllEditLayer();
            var g = i.height();
            var j = h.height();
            i.animate({
                top: j + 0.7 * g_rem
            },
            300);
            h.animate({
                top: -g - 0.7 * g_rem
            },300,function () {
                f = false;
                i.insertAfter(h);
                i.css("top", 0);
                h.css("top", 0)
            })
        }
    })();
    (function () {
        var c = {};
        c.show = function (d, e) {
            $("#awardUserInfoBg").data({
                _aUserInfoArg: d,
                _aUserInfoThis: e
            }).show();
            $("#spxdPage").addClass("spxdPageHide");
            $("#nameInput").val(g_config.awardUsername);
            $("#phoneInput").val(g_config.awardPhone);
            $("#addressInput").text(g_config.awardAddress);
            if (g_config.contactNoDraw && $.parseJSON(g_config.contactNoDraw)[0] != -1) {
                $("#awardUserInfoBox .contactInput").hide();
                $.each($.parseJSON(g_config.contactNoDraw),
                function (f, g) {
                    $("#awardUserInfoBox .contactInput").eq(g).show()
                })
            } else {
                $("#addressInput").hide()
            }
            if (!d) {
                $("#awardUserInfoBg").removeData("_aUserInfoArg");
                $("#awardUserInfoBox .contactInput").hide();
                g_config.awardUsername && $("#awardUserInfoBox .contactInput").eq(0).show();
                g_config.awardPhone && $("#awardUserInfoBox .contactInput").eq(1).show();
                g_config.awardAddress && $("#awardUserInfoBox .contactInput").eq(2).show()
            }
        };
        c.hide = function () {
            $("#awardUserInfoBg").hide();
            $("#spxdPage").removeClass("spxdPageHide");
            var f = $("#awardUserInfoBg").data("_aUserInfoArg");
            if (!f) {
                return
            }
            if (d(f)) {
                var e = f[2];
                if (e && e.info) {
                    e.info = $.parseJSON(e.info);
                    e.info.ausername = g_config.awardUsername;
                    e.info.aphone = g_config.awardPhone;
                    e.info.aadress = g_config.awardAddress;
                    e.info = $.toJSON(e.info)
                }
            }
            c.afterUserInfoHide = true;
            f.callee.apply($("#awardUserInfoBg").data("_aUserInfoThis"), f);
            setTimeout(function () {
                c.afterUserInfoHide = false
            },
            0);
            function d(g) {
                if (typeof gameOver != "undefined" && g.callee === gameOver) {
                    return true
                }
                if (typeof startBtnAjax != "undefined" && g.callee === startBtnAjax) {
                    return true
                }
                if (typeof luckDraw != "undefined" && g.callee === luckDraw) {
                    return true
                }
                return false
            }
        };
        a.aUserInfo = c
    })();
    a.showLotsWait = function (c, e) {
        var d = $("#lots-wait-Box #lots-wait-hint-num");
        d.text(c);
        $("#lots-wait-Box").show();
        var f = setInterval(function () {
            c--;
            d.text(c);
            if (c <= 0) {
                clearInterval(f);
                $("#lots-wait-Box").hide();
                e()
            }
        },
        1000)
    }; 
    (function () {
        var c = Math.max($(window).height() / $(window).width(), $(window).width() / $(window).height()) > 22 / 16;
        var g = {
            startStatus: false,
            exposeFlag: false,
            disable: false,
            result_disable: false,
            gift_disable: false,
        };
        var f = {
            drawType: false,
            home: function () { },
            again: function () { },
            giftInit: function (h) {
                h && h()
            }
        };
        var e = (function () {
            var m = 1.5;
            var j = 0;
            var i, o, n;
            var l, k, h;
            return function (q) {
                if (!g.startStatus) {
                    return
                }
                var s = new Date().getTime();
                if ((s - j) > 100) {
                    var p = q.accelerationIncludingGravity;
                    j = s;
                    i = p.x;
                    o = p.y;
                    n = p.z;
                    var r = Math.sqrt(i * i + o * o + n * n) / Math.sqrt(l * l + k * k + h * h);
                    if (r > m) {
                        g.startStatus = false;
                        f.giftInit(function (t) {
                            hg.sound.play("yiy");
                            setTimeout(function () {
                                g.showGift(t)
                            },
                            1500)
                        })
                    }
                    l = i;
                    k = o;
                    h = n
                }
            }
        })();
        var d = {};
        g.initArg = function (h) {
            if (this.disable) {
                return
            }
            $.extend(d, h)
        };
        g.init = function (h) {
            if (this.disable) {
                return
            }
            $.extend(f, h);
            $.extend(f, d);
            this.giftBox = $("#resule-gift-box");
            this.resuleBox = $(".resuleBox");
            this.statusBox = $("#resule-status-box");
            var i = this;
            if (a.currentScore >= g_config.scoreSet && g_config.scoreSet != "") {
                a.isplaySucess = true
            } else {
                a.isplaySucess = false
            }
            $(".resule-status-home , .resule-gift-home, .resule-gift-home2").on("touchend", function (event) {
                event.preventDefault();
                event.stopPropagation();
                a.fadIn(i.resuleBox, function () {
                    i.giftBox.hide();
                    i.statusBox.hide();
                    $(".gameBox,.home,.body").removeClass("overflow-y-hidden");
                    if (g_config.showSkillSup) {
                        $(".bottomSkill").show();
                    }
                });
                f.home()
            });
            $(".resule-gift-draw").off("touchend").on("touchend", function () { 
                window.addEventListener("devicemotion", e, false);
                if (window.DeviceMotionEvent && !a.IsPC()) {
                    if (i.resuleArg.isLimitDrawTotal && i.resuleArg.totalCount === 0) {
                        a.statusMsg(6);
                        return
                    } else {
                        if (i.resuleArg.count === 1) {
                            a.statusMsg(4);
                            if (!g_config.showHelpGuide) {
                                f.home()
                            }
                            return
                        }
                    }
                    $("#resule-status-scrollWrap,#resule-gift-box").hide();
                    $("#resule-status-lotsBox,#resule-status-box").show();
                    setTimeout(function () {
                        g.startStatus = true;
                        i.resuleArg.count > 0 && i.resuleArg.count--
                    },
                    1000)
                } else {
                    setTimeout(function () {
                        f.giftInit(function (j) {
                            i.showGift(j)
                        })
                    },1000)
                }
                g.exposeFlag = false
            });
            if (f.drawType === 0 || f.drawType === 2) {
                $(".resule-gift-home").css({
                    width: "10rem",
                    height: "2rem",
                    "line-height": "2rem"
                });
                $(".resule-gift-home2").css({
                    width: "4.75rem",
                    height: "2rem",
                    "line-height": "2rem"
                });
                this.giftBox.find(".resule-gift-seeRank").remove();
                this.show = this.showGift
            } else {
                if (f.drawType === 1) {
                    $(".resule-status-seeRank,.resule-gift-seeRank").on("touchstart", function (event) {
                        event.preventDefault();
                        event.stopPropagation(); 
                        window.showRank()
                    });
                    $(".resule-status-again").on("touchstart", function (event) {
                        event.preventDefault();
                        event.stopPropagation();
                        if (_manage) {
                            return
                        } 
                        $(".gameBox,.home,.body").removeClass("overflow-y-hidden");
                        if (!g_config.isDoubleGame) {
                            a.fadIn(i.resuleBox,
                            function () {
                                i.giftBox.hide();
                                i.statusBox.hide()
                            })
                        }
                        f.again()
                    });
                    hg.sound.load(_resRoot + "/image/yaoyiyao.wav", "yiy");
                    window.addEventListener("devicemotion", e, false);
                    if (m_debug || g_config.test) {
                        $("#resule-status-lotsHand").on("touchstart",  function () {
                            g.startStatus = false;
                            f.giftInit(function (j) {
                                i.showGift(j)
                            })
                        })
                    }
                    this.giftEvent = function () { 
                        if (g_config.afterLinkModify && a.shouldRegInfo(3, arguments, this)) {
                            return
                        }
                        if (!subscribe)
                        { $("#newAttentionMask").show(); }
                        if (window.DeviceMotionEvent && !a.IsPC()) {
                            if (i.resuleArg.isLimitDrawTotal && i.resuleArg.totalCount === 0) {
                                a.statusMsg(6);
                                return
                            } else {
                                if (i.resuleArg.count === 0) {
                                    a.statusMsg(4);
                                    return
                                }
                            }
                            $("#resule-status-scrollWrap").hide();
                            $("#resule-status-lotsBox").show();
                            a.resulePoup.statusBox.show();
                            a.resulePoup.resuleBox.show();
                            g.startStatus = true
                        } else {
                            f.giftInit(function (j) {
                                i.showGift(j)
                            })
                        }
                        g.exposeFlag = false
                    };
                    $(".resule-status-gift").on("touchstart", this.giftEvent);
                    this.regEvent = function () {
                        if (_manage) {
                            return
                        }
                        if (a.shouldRegInfo(3, arguments, this)) {
                            return
                        } 
                        $(".ajaxLoadBg").show();
                        $(".ajaxLoadBar").addClass("ajaxLoad");
                        var j = f.regUrl;
                        if (g_config.isDoubleGame) {
                            j += "&openIdB=" + a.otherOpenId
                        }
                        $.ajax({
                            type: "post",
                            url: j,
                            error: function () {
                                a.otherAjaxComplete()
                            },
                            success: function (l) {
                                var k = $.parseJSON(l);
                                a.otherAjaxComplete();
                                if (k.isOutofTestNum) {
                                    a.statusMsg("活动尚未发布", "最多测试人数为100人!");
                                    return
                                }
                                if (!k.isOutofRegNum) {
                                    a.isReg = true;
                                    var k = $.parseJSON(l);
                                    if (k.success) {
                                        $(".resule-foot-one .resule-status-again").html("继续刷记录");
                                        $(".resule-foot-one .resule-status-reg").hide();
                                        $(".resule-foot-one .resule-status-again").show();
                                        $("#resule-status-count").hide();
                                        $("#resule-sucReg").show()
                                    }
                                } else {
                                    a.statusMsg("报名人数已经满了")
                                }
                            }
                        })
                    };
                    $(".resule-status-reg").on("touchstart", this.regEvent);
                    this.show = this.showResult
                }
            }
        };
        g.showResult = function (k) {
            if (this.disable || this.result_disable) {
                return
            }
            var j = {
                isSuc: false,
                gameScore: 0,
                minScore: 0,
                bestScore: 10,
                rank: 10,
                count: 3,
                beat: 99,
                notreal: false,
                gameType: 0
            };
            var i = $.extend(j, k);
            this.resuleArg = i; !i.notreal && (a.currentRank = i.rank); !i.notreal && (a.currentScore = i.bestScore);
            a.wxConfig.setWxShareByStatus();
            $("#resule-status-scrollWrap").show();
            $("#resule-status-lotsBox,#resule-gift-box").hide();
            $(".resule-one-button").hide();
            this.statusBox.show();
            a.fadOut(this.resuleBox);
            var l = $(".resuleArg");
            var h = i.isReg;
            if (!i.notreal && g_config.sortType == (i.gameScore >= g_config.drawLimitDef)) {
                if (typeof a.oss_aof === "undefined") {
                    a.oss_aof = 0
                }
                a.oss_aof++;
                if (a.oss_aof >= 2) {
                    a.oss_aof = 0
                }
            }
            $("#resule-status-scrollWrap").css("height", $(window).height() - $("#resule-status-box .attentionBox").height() - 1.5 * g_rem);
           
            if (!_manage) {
                $(".gameBox,.home,.body").addClass("overflow-y-hidden");
                $(".bottomSkill").is(":visible") && $(".bottomSkill").hide()
            }
            if (i.gameType == 3) {
                $("#resule-foot-box").css("padding-bottom", "1rem");
                if (i.gameScore == "fail") {
                    $("#resule-status-bird").show();
                    $("#resule-status-ribbon").removeClass("resule-status-ribbon").addClass("resule-status-faiRibbon");
                    $("#resule-status-bird").removeClass("resule-status-birdfly").addClass("resule-status-birdfly");
                    $("#resule-status-box .resule-bgLight").hide();
                    $(".resule-status-userImg").css("border-color", "#B5B5B5");
                    $("#resule-status-body .beat-Percent").hide();
                    if (i.rank == 0) { } else {
                        $("#resule-status-body .result-scoreUnit").show()
                    }
                    l.eq(0).text("无");
                    if (l.eq(2).text().length == 0) {
                        l.eq(2).text(i.bestScore);
                        l.eq(3).text(i.rank > 0 ? i.rank : "无")
                    } else {
                        if (l.eq(0).text() == "无") {
                            $("#resule-status-body .youraward .result-scoreUnit").hide()
                        } else {
                            $("#resule-status-body .result-scoreUnit").show()
                        }
                    }
                    a.isplaySucess = false
                } else {
                    $("#resule-status-bird").hide();
                    $(".resule-status-userImg").css("border-color", "#70D572");
                    $("#resule-status-ribbon").removeClass("resule-status-faiRibbon").addClass("resule-status-ribbon");
                    $("#resule-status-box .resule-bgLight").show();
                    $("#resule-status-body .beat-Percent span").text(i.beat);
                    $("#resule-status-body .beat-Percent").show();
                    l.eq(0).text(i.gameScore);
                    l.eq(2).text(i.bestScore);
                    l.eq(3).text(i.rank);
                    $("#resule-status-body .result-scoreUnit").show();
                    a.isplaySucess = true
                }
                $(".resule-status-minscore").hide();
                $("#resule-status-count").hide();
                $(".resule-foot-one .resule-status-gift").hide();
                $(".resule-foot-one .resule-status-reg").hide();
                $(".resule-foot-one .resule-status-again").show();
                $(".resule-foot-two .resule-status-again").hide();
                $(".resule-foot-two .resule-status-home").show()
            } else {
                if (i.gameScore === "fail") {
                    $(".resuleArg-fail").text(i.minScore);
                    $("#resule-status-body").hide();
                    $("#resule-status-other").show()
                } else {
                    $("#resule-status-body").show();
                    $("#resule-status-other").hide()
                }
                if (i.isSuc) {
                    a.isplaySucess = true;
                    $("#resule-status-bird").hide();
                    $("#resule-status-ribbon").removeClass("resule-status-faiRibbon").addClass("resule-status-ribbon");
                    $(".resule-status-userImg").css("border-color", "#70D572");
                    $(".resule-status-minscore").hide();
                    $("#resule-status-count").show();
                    if (i.gameType == 0) {
                        $(".resule-foot-one .resule-status-gift").show();
                        $(".resule-foot-one .resule-status-again").hide();
                        $(".resule-foot-two .resule-status-again").show();
                        $(".resule-foot-two .resule-status-home").hide();
                     } else {
                        if (i.gameType == 4) {
                            $(".resule-foot-one .resule-status-send").show();
                            $(".resule-foot-two .resule-status-again").hide();
                            $(".resule-foot-two .resule-status-home").show();
                            $("#resule-status-count").hide()
                        } else {
                            if (i.gameType == 1) {
                                $("#resule-status-count").hide();
                                $("#resule-foot-box").css("margin-top", "0.6rem");
                                $(".resule-foot-two .resule-status-again").hide();
                                $(".resule-foot-two .resule-status-home").show();
                                a.logDog(1000035);
                                if (!h) {
                                    $(".resule-foot-one .resule-status-reg").show()
                                } else {
                                    $(".resule-foot-one .resule-status-again").html("继续刷记录");
                                    $(".resule-foot-one .resule-status-reg").hide();
                                    $(".resule-foot-one .resule-status-again").show();
                                    $("#resule-sucReg").show()
                                }
                            }
                        }
                    }
                    g.exposeFlag = true;
                    $("#resule-status-box .resule-bgLight").show();
                    l.eq(0).text(i.gameScore);
                    l.eq(1).text(i.minScore);
                    l.eq(2).text(i.bestScore);
                    l.eq(3).text(i.rank);
                    l.eq(4).text(i.totalCount);
                    l.eq(5).text(i.count);
                    l.eq(6).text(i.count);
                    $("#resule-status-body .dayDrawCount").text(i.count);
                    $("#resule-status-body #totalDrawCount").text(i.totalCount);
                    $("#msxbSucTip").text("恭喜你获得密室小能手称号!");
                    //$("#resule-status-body .beat-Percent span").text(i.beat);
                    //$("#resule-status-body .beat-Percent").show()
                } else {
                    $("#resule-status-bird").show();
                    $("#resule-status-ribbon").removeClass("resule-status-ribbon").addClass("resule-status-faiRibbon");
                    $(".resule-status-userImg").css("border-color", "#B5B5B5");
                    $(".resule-status-minscore").show();
                    $("#resule-status-count").hide();
                    $("#resule-status-box .resule-bgLight").hide();
                    $(".resule-foot-one .resule-status-gift").hide();
                    $(".resule-foot-one .resule-status-reg").hide();
                    $(".resule-foot-one .resule-status-again").show();
                    $(".resule-foot-two .resule-status-again").hide();
                    $(".resule-foot-two .resule-status-home").show();
                    $("#resule-status-bird").removeClass("resule-status-birdfly").addClass("resule-status-birdfly");
                    l.eq(0).text(i.gameScore);
                    l.eq(1).text(i.minScore);
                    l.eq(2).text(i.bestScore);
                    l.eq(3).text(i.rank);
                    l.eq(4).text(i.count);
                    $("#resule-status-body .beat-Percent").hide();
                    a.isplaySucess = false
                }
            }
            hg.fire("showResult", i, l)
        };
        g.showGift = function (l) {
            if (this.disable || this.gift_disable) {
                return
            }
            var j = {
                isSuc: false,
                giftName: "",
                giftStyle: "",
                giftCode: 0,
                giftImage: "",
                awardImageW: "6rem",
                awardImageH: "6rem",
                awardTypeNum: 0,
                awardIndex: 1,
                genewxcard: false
            };
            var s = $.extend({}, j, l);
            if (this.statusBox) {
                a.fadIn(this.statusBox)
            }
            $("#resulte-gift-showMyAward").data("openCode", s.giftCode);
            a.fadOut(this.resuleBox);
            a.fadOut(this.giftBox);
            if ((gameType == 0 || gameType == 4 || gameType == 5) && !_manage) {
                var t = $(".cannotGetThePriceBox").height();
                var i = $(".resuleBox").height() - $("#resule-gift-box").find(".attentionBox").height() - 2.5 * g_rem;
                if (t > i) {
                    $(".cannotGetThePriceBox").height(i);
                    var n = 16 * g_rem - parseFloat($("#faiImgBox img").css("left"));
                    var k = i - parseFloat($("#faiImgBox img").css("top"));
                    var q = $("#faiImgBox img").width() / $("#faiImgBox img").height();
                    var r = $("#faiImgBox img").height();
                    if (r > k) {
                        if ((k * q) > n) {
                            $("#faiImgBox img").height(n / q).width(n)
                        } else {
                            $("#faiImgBox img").height(k).width(k * q)
                        }
                    }
                }
            }
            $(".menuAgain,.menuBack,.backListen,.repeatDraw").css({
                bottom: $("#resule-gift-box").find(".attentionBox").height(),
                "line-height": "1.9rem"
            });
            $("#resule-gift-scrollWrap").css("height", $(window).height() - $("#resule-gift-box .attentionBox").height() - $(".menuAgain").outerHeight(true) - 1.6 * g_rem);
            var p = $(".gifArg"); 
            if (s.isSuc) {
                $("#resule-gift-box").css("height", "auto");
                $("#resule-gift-scrollWrap").show();
                $("#faiImgBox").hide();
                $("#Award_Round_Dot").css("display", "inline-block");
                a.currentAward = s.giftName;
                a.currentAwardStyle = s.giftStyle;
                a.wxConfig.setWxShareByStatus();
                this.hasGift = true;
                p.eq(0).text(s.giftStyle);
                p.eq(1).text(s.giftName);
                $("#resule-gift-sucImg").attr("src", s.giftImage);
                $("#resule-gift-sucImg").css({
                    width: s.awardImageW,
                    height: s.awardImageH,
                    margin: "1.6rem auto"
                });
                if (s.awardIndex == 900) {
                    if (g_config.comfort.comAwardtype == 0 || g_config.comfort.comAwardtype == 1) {
                        $(".awardCodeTime em").text("使用期限");
                        $("#codeName").text("优惠码");
                        if (g_config.afterWxCard) {
                            $(".awardCusText .text").text("优惠券详情")
                        }
                    } else {
                        $(".awardCodeTime em").text("兑奖期限");
                        $("#codeName").text("兑奖码");
                        $("#awardCollectionBtn").text("收藏兑奖券");
                        if (g_config.afterWxCard) {
                            $(".awardCusText .text").text("兑奖券详情")
                        }
                    }
                } else {
                    if (!g_config.award) {
                        g_config.award = g_config.awardList[s.awardIndex - 1];
                        g_config.wxAward = g_config.awardList[s.awardIndex - 1]
                    }
                    if (s.awardTypeNum == 0 || s.awardTypeNum == 1) {
                        $(".awardCodeTime em").text("使用期限");
                        $("#codeName").text("优惠码");
                        if (g_config.afterWxCard) {
                            $(".awardCusText .text").text("优惠券详情")
                        }
                    } else {
                        $(".awardCodeTime em").text("兑奖期限");
                        $("#codeName").text("兑奖码");
                        $("#awardCollectionBtn").text("收藏兑奖券");
                        if (g_config.afterWxCard) {
                            $(".awardCusText .text").text("兑奖券详情")
                        }
                    }
                    if (g_config.award.genewxcard) {
                        $(".awardCodeTime em").text("兑奖期限");
                        $("#codeName").text("兑奖码");
                        var m = true;
                        var o = awardInfo.depositTime;
                        if (o && o < Date.parse(new Date())) {
                            m = false
                        }
                        var h = (m ? "放入" : "打开") + "微信卡券";
                        $("#awardCollectionBtn").text(h).attr("isWxCard", true)
                    }
                } 
                if (!_manage) {
                    $(".gameBox,.home,.body").addClass("overflow-y-hidden");
                    $(".bottomSkill").is(":visible") && $(".bottomSkill").hide()
                }
            } else {
                $("#resule-gift-box").css("height", $(window).height() - $("#resule-gift-box .attentionBox").height());
                $("#resule-gift-scrollWrap").hide();
                $("#faiImgBox").show()
            }
            if (g_config.haveAward) {
                $("#myAwardBtn").show()
            }
        };
        a.resulePoup = g
    })();
    a.otherAjaxComplete = function () {
        var c = $(".ajaxLoadBar");
        c.addClass("ajaxComplete");
        setTimeout(function () {
            c.removeClass("ajaxLoad");
            c.removeClass("ajaxComplete");
            $(".ajaxLoadBg").hide()
        },
        500)
    };
    (function () {
        var i = (function () {
            var j = 1;
            return function (k) {
                var l = k.data("layerId");
                if (!l) {
                    l = "layerId-" + j;
                    k.addClass(l);
                    k.data("layerId", l);
                    j++
                }
            }
        })();
        function e(k) {
            var l = $("." + k);
            var m = ["Left", "Right", "Top", "Bottom"];
            var j = "";
            $.each(m,
            function (n, o) {
                if ($("#" + k + "moveFrame" + o).length == 0) {
                    j += '<div id="' + k + "moveFrame" + o + '" class="moveFrame" style="border-' + o.toLowerCase() + '-width:1px"></div>'
                }
            });
            if (j) {
                $("body").append(j);
                f(l)
            }
        }
        function f(j, p) {
            var k = j.data("layerId");
            var m = j.offset().left;
            var s = j.offset().top;
            var q = j.outerWidth();
            var n = j.outerHeight();
            $("#" + k + "moveFrameLeft").css({
                left: m,
                top: s,
                width: 0,
                height: n,
                borderLeftWidth: 1
            });
            $("#" + k + "moveFrameRight").css({
                left: m + q - 1,
                top: s,
                width: 0,
                height: n,
                borderRightWidth: 1
            });
            $("#" + k + "moveFrameTop").css({
                left: m,
                top: s,
                width: q,
                height: 0,
                borderTopWidth: 1
            });
            $("#" + k + "moveFrameBottom").css({
                left: m,
                top: s + n - 1,
                width: q,
                height: 0,
                borderBottomWidth: 1
            });
            if (p) {
                var u = j.closest(".ui-wrapper");
                if (u.length == 0) {
                    u = j
                }
                var r = u.find(".recoverBtn");
                var o = false;
                if (q < 2 * r.width()) {
                    o = true
                }
                if (n < 2 * r.height()) {
                    o = true
                }
                if (o && !j.data("_minRecoverBtn")) {
                    j.data("_minRecoverBtn", true);
                    u.find(".ui-resizable-imgTopRightTip").css({
                        backgroundPositionX: 0,
                        backgroundPositionY: 11,
                        right: -11,
                        top: -11
                    });
                    u.find(".ui-resizable-imgTopLeftTip").css({
                        backgroundPositionX: 11,
                        backgroundPositionY: 11,
                        left: -11,
                        top: -11
                    });
                    u.find(".ui-resizable-imgBottomLeftTip").css({
                        backgroundPositionX: 11,
                        backgroundPositionY: 0,
                        left: -11,
                        bottom: -11
                    });
                    u.find(".ui-resizable-imgBottomRightTip").css({
                        backgroundPositionX: 0,
                        backgroundPositionY: 0,
                        right: -11,
                        bottom: -11
                    });
                    r.css("right", -24)
                } else {
                    if (j.data("_minRecoverBtn")) {
                        j.data("_minRecoverBtn", false);
                        u.find(".ui-resizable-imgTopRightTip").css({
                            backgroundPositionX: 11,
                            backgroundPositionY: 0,
                            right: 0,
                            top: 0
                        });
                        u.find(".ui-resizable-imgTopLeftTip").css({
                            backgroundPositionX: 0,
                            backgroundPositionY: 0,
                            left: 0,
                            top: 0
                        });
                        u.find(".ui-resizable-imgBottomLeftTip").css({
                            backgroundPositionX: 0,
                            backgroundPositionY: 11,
                            left: 0,
                            bottom: 0
                        });
                        u.find(".ui-resizable-imgBottomRightTip").css({
                            backgroundPositionX: 11,
                            backgroundPositionY: 11,
                            right: 0,
                            bottom: 0
                        });
                        r.css("right", 3)
                    }
                }
            }
        }
        a.removeMoveFrame = function (j) {
            $("#" + j + "moveFrameLeft,#" + j + "moveFrameRight,#" + j + "moveFrameTop,#" + j + "moveFrameBottom").remove();
            $$("#imgSizeShow").hide()
        };
        a.removeAllEditLayer = function () {
            $(".moveFrame").remove();
            $(".moduleLayer").remove()
        };
        a.initModuleLayer = d(function (m, l, o, k, n, p, j) {
            i(m);
            m.addClass("defBgColor");
            m.data("mouseover",
            function (r) {
                var q = $(this).data("layerId");
                clearTimeout($(this).data("initModuleTimer"));
                if (a.ResizeDoc || $("#" + q + "moduleLayer").length > 0) {
                    return
                }
                a.removeAllEditLayer();
                e(q);
                h(q)
            });
            m.off("mouseover").off("mouseleave").on("mouseover", m.data("mouseover")).on("mouseleave",
            function (r) {
                if ($(this).data("moduleLayerClose")) {
                    return
                }
                var q = $(this).data("layerId");
                $(this).data("initModuleTimer", setTimeout(function () {
                    if (!a.ResizeDoc) {
                        a.removeMoveFrame(q);
                        $("#" + q + "moduleLayer").remove()
                    }
                },
                100))
            });
            if (j || l != -2) {
                a.addModuleLayer(m, {
                    name: typeof j === "string" ? j : "编辑",
                    onclick: function (r) {
                        parent.Edit.showEditByGame.call(r.data.target, l, o, k);
                        parent.operateFlagList[17] = true;
                        a.logDog(1000078, 3);
                        if (o == "awardSetting") {
                            var q = $(this).data("layerId");
                            a.removeMoveFrame(q);
                            $("#" + q + "moduleLayer").remove()
                        }
                        return false
                    }
                })
            }
            if (n) {
                a.addModuleLayer(m, {
                    name: typeof n === "string" ? n : "样式",
                    onclick: function (q) {
                        parent.Edit.Css.showCssByGame.call(q.data.target, o, p);
                        parent.operateFlagList[21] = true;
                        a.logDog(1000078, 5);
                        return false
                    }
                })
            }
            m = null
        });
        a.addModuleLayer = d(function (l, k) {
            var j = l.data("hd-moduleLayerList");
            if (!j) {
                j = []
            }
            j.push(k);
            l.data("hd-moduleLayerList", j)
        });
        function h(k) {
            var o = k + "moduleLayer";
            var p = $("." + k);
            var m = p.data("hd-moduleLayerList");
            if (!m) {
                return
            }
            $("#" + o).remove();
            var j = $("<div id='" + o + "' class='moduleLayer' _mouseIn='0'></div>");
            $("body").append(j);
            for (var q = m.length - 1; q >= 0; q--) {
                var r = m[q];
                if (r && r.onclick) {
                    var l;
                    if (r.html) {
                        l = $(r.html)
                    } else {
                        var n = r["class"] ? (" " + r["class"]) : "";
                        l = $("<a class='item tool" + n + "' hidefocus='true' href='javascript:;'>" + r.name + "</a>")
                    }
                    j.append(l);
                    r.data = r.data || {};
                    r.data.target = p;
                    l.on("click", r.data, r.onclick);
                    r.onshow && r.onshow.call(l, r.data)
                }
            }
            j.css("margin", 0);
            g(p, j);
            j.mouseover(function () {
                clearTimeout(p.data("initModuleTimer"))
            }).mouseleave(function (s) {
                p.data("initModuleTimer", setTimeout(function () {
                    a.removeMoveFrame(k);
                    $("#" + o).remove();
                    p.siblings(".ui-resizable-handle,.recoverBtn").hide()
                },
                100))
            });
            return j
        }
        function g(m, n) {
            if (!n) {
                n = $(".moduleLayer")
            }
            if (n.length < 1) {
                return
            }
            var j = m.outerWidth();
            var k = m.offset().left + j - n.outerWidth();
            if (k < 0) {
                k = 0
            }
            if (m.offset().left < $(window).width() && m.offset().left + j > $(window).width()) {
                k = $(window).width() - n.outerWidth()
            }
            n.css("left", k);
            var l = (m.offset().top - n.height() - 1);
            n.css("top", l > 0 ? l : 0 + "px")
        }
        a.moduleSlaveImgResize = d(function (m, n, o) {
            var j = o || "body";
            if (m.parents(".home").length > 0) {
                j = "#limitRange"
            }
            m.parent("div.ui-wrapper").css({
                padding: "0"
            });
            m.resizable("destroy");
            var k = $(m).parents("div.imgContainer");
            var l = k.find(".slaveImg");
            if (k.length == 0) {
                k = m
            }
            if (l.length == 0) {
                l = m
            }
            i(l);
            l.data("defData", n);
            m.resizable($.extend({
                handles: "n,e,s,w,ne,nw,sw,se",
                autoHide: true,
                maxWidth: 318,
                maxHeight: 504,
                minWidth: 20,
                minHeight: 20,
                aspectRatio: true,
                containment: j,
                alsoResize: m,
                create: function (p, r) {
                    var t = $(this);
                    var q = 0;
                    if (Math.abs(t.width() - parseRemToPx(n.width)) > 1 || Math.abs(t.height() - parseRemToPx(n.height)) > 1) {
                        l.attr("resize", 1)
                    }
                    t.css({
                        position: "relative",
                        "float": "none",
                        "z-index": "100"
                    });
                    if (t.width() < 40 || t.height() < 40) {
                        t.css("padding", "2px")
                    } else {
                        t.css("padding", "0")
                    }
                    t.append("<a class='recoverBtn' href='javascript:;'></a>");
                    t.find(".recoverBtn").on("click",
                    function (u) {
                        $(this).hide();
                        l.attr("resize", 0);
                        t.add(l).css(n);
                        a.logDog(1000078, 4);
                        l.data("hd-resizable-recover") && l.data("hd-resizable-recover").fireWith(l[0], [u, n]);
                        setTimeout(function () {
                            g(l);
                            f(l, true)
                        },
                        10)
                    });
                    t.attr("_from", l.attr("id")); (function () {
                        var w = [["s", "Bottom"], ["n", "Top"], ["w", "Left"], ["e", "Right"]];
                        for (var v = 0; v < 4; v++) {
                            t.children(".ui-resizable-" + w[v][0]).addClass("ui-resizable-img" + w[v][1] + "Tip").css({
                                "z-index": "9030"
                            });
                            if (v < 2) {
                                for (var u = 2; u < 4; u++) {
                                    t.children(".ui-resizable-" + w[v][0] + w[u][0]).addClass("ui-resizable-img" + w[v][1] + w[u][1] + "Tip").css({
                                        "z-index": "9030"
                                    })
                                }
                            }
                        }
                    })();
                    var s = t.parent();
                    t.children(".ui-resizable-handle").mousedown(function (v) {
                        var u = s.attr("href");
                        if (typeof u != "undefined" && u.length > 0) {
                            s.removeAttr("href");
                            s.attr("onclick", "return false;")
                        }
                    });
                    if (l.data("layerId")) {
                        l.off("mouseover").off("mouseleave")
                    }
                    t.mouseover(function () {
                        clearTimeout(l.data("initModuleTimer"));
                        if (a.ResizeDoc) {
                            return
                        }
                        t.children(".ui-resizable-handle").show();
                        if (l.attr("resize") == 1) {
                            k.find(".recoverBtn").show()
                        }
                        if (l.data("layerId")) {
                            l.data("mouseover").call(l)
                        }
                        l.removeData("resizable-isLeave")
                    }).mouseleave(function () {
                        l.data("initModuleTimer", setTimeout(function () {
                            if (!a.ResizeDoc) {
                                var u = l.data("layerId");
                                a.removeMoveFrame(u);
                                $("#" + u + "moduleLayer").remove();
                                t.children(".ui-resizable-handle").hide();
                                k.find(".recoverBtn").hide()
                            } else {
                                l.data("resizable-isLeave", true)
                            }
                        },
                        100))
                    });
                    l.data("hd-resizable-create") && l.data("hd-resizable-create").fireWith(l[0], [p, r])
                },
                start: function (p, q) {
                    if (q.axis.length === 2) {
                        $(this).resizable("option", "aspectRatio", true)
                    } else {
                        $(this).resizable("option", "aspectRatio", false)
                    }
                    e(l.data("layerId"));
                    a.ResizeDoc = k;
                    $$("#imgSizeShow").show();
                    $("#" + l.data("layerId") + "moduleLayer").remove();
                    q.originalElement.parent().find(".recoverBtn").hide();
                    $(this).css("position", "relative");
                    $(".ui-resizable-bottomTip,.ui-resizable-cancelTip,.draggableBtn").css({
                        opacity: "0"
                    });
                    l.data("hd-resizable-start") && l.data("hd-resizable-start").fireWith(l[0], [p, q])
                },
                resize: function (q, r) {
                    l.data("hd-resizable-resize") && l.data("hd-resizable-resize").fireWith(l[0], [q, r]);
                    f(l, true);
                    var p = $$("#imgSizeShow");
                    p.css({
                        top: q.pageY + 15,
                        left: q.pageX - 30
                    });
                    p.find("span").eq(0).text(Math.round(l.width()) * 2);
                    p.find("span").eq(1).text(Math.round(l.height()) * 2)
                },
                stop: function (q, s) {
                    var r = 0;
                    delete a.ResizeDoc;
                    if (l.data("resizable-isLeave")) {
                        $(this).mouseleave();
                        l.removeData("resizable-isLeave")
                    } else {
                        l.mouseover()
                    }
                    $$("#imgSizeShow").hide();
                    $(".ui-resizable-bottomTip,.ui-resizable-cancelTip,.draggableBtn").css({
                        opacity: "1"
                    });
                    k.find(".slaveImg").attr("resize", "1");
                    k.find(".recoverBtn").show();
                    if ($(this).width() < 40 || $(this).height() < 40) {
                        $(this).css("padding", "2px")
                    } else {
                        $(this).css("padding", "0")
                    }
                    var t = $(this).parent();
                    var p = t.attr("link");
                    if (typeof p != "undefined" && p.length > 0) {
                        setTimeout(function () {
                            t.attr("href", p);
                            t.removeAttr("onclick")
                        },
                        100)
                    }
                    parent.operateFlagList[17] = true;
                    a.logDog(1000078, 0);
                    l.data("hd-resizable-stop") && l.data("hd-resizable-stop").fireWith(l[0], [q, s])
                }
            },
            l.data("hd-resizable-option")));
            m.off(".slaveImg")
        });
        a.moduleDraggale = d(function (o, n, p) {
            var m = o.parent();
            var l = o;
            var k = p || "body";
            if (n) {
                l = m
            }
            if (n === false) {
                m = l
            }
            l.css("cursor", "move");
            l.css("position", "absolute");
            if (l.parents(".home").length > 0) {
                k = "#limitRange"
            }
            var j = m.css("z-index");
            l.draggable($.extend({
                start: function (q, r) {
                    o.mouseover();
                    m.children(".ui-resizable-handle").hide();
                    j = m.css("z-index");
                    m.css("z-index", "9999");
                    o.data("hd-draggable-start") && o.data("hd-draggable-start").fireWith(o[0], [q, r])
                },
                drag: function (q, r) {
                    f(o);
                    $("#" + o.data("layerId") + "moduleLayer").remove();
                    o.parent().find(".recoverBtn").hide();
                    o.data("hd-draggable-drag") && o.data("hd-draggable-drag").fireWith(o[0], [q, r])
                },
                stop: function (q, r) {
                    o.mouseover();
                    m.css("z-index", j);
                    parent.operateFlagList[17] = true;
                    a.logDog(1000078, 1);
                    o.data("hd-draggable-stop") && o.data("hd-draggable-stop").fireWith(o[0], [q, r])
                },
                opacity: 0.5,
                scroll: false,
                distance: 1,
                containment: k,
                addClasses: false
            },
            o.data("hd-draggable-option")))
        });
        function d(j) {
            return function () {
                var n = this;
                var k = arguments.callee;
                var l = arguments[0];
                if (a.getType(l) === "array") {
                    if (a.getType(l[0]) === "array") {
                        $.each(l,
                        function (o, p) {
                            if (a.getType(p) === "array") {
                                k.call(n, p)
                            }
                        })
                    } else {
                        k.apply(n, l)
                    }
                } else {
                    (typeof l === "string" || l.nodeType) && (l = $(l));
                    if (l instanceof jQuery && l.length > 0) {
                        var m = Array.prototype.slice.call(arguments);
                        if (l.length > 1) {
                            l.each(function () {
                                m[0] = $(this);
                                j.apply(n, m)
                            })
                        } else {
                            m[0] = l;
                            j.apply(n, m)
                        }
                    }
                    return n
                }
            }
        }
        function c(n, j, m, k) {
            var l = "hd-" + m + "-" + k;
            n.each(function () {
                var o = $(this).data(l);
                if (k === "option") {
                    if (o) {
                        $(this).data(l, $.extend({},
                        o, j))
                    } else {
                        $(this).data(l, j)
                    }
                } else {
                    if (!o) {
                        o = $.Callbacks("unique memory");
                        $(this).data(l, o)
                    }
                    o.add(j)
                }
            })
        } 
        a.Img = {
            MODE_SCALE_FILL: 1,
            MODE_SCALE_WIDTH: 2,
            MODE_SCALE_HEIGHT: 3,
            MODE_SCALE_DEFLATE_WIDTH: 4,
            MODE_SCALE_DEFLATE_HEIGHT: 5,
            MODE_SCALE_DEFLATE_FILL: 6,
            MODE_SCALE_DEFLATE_MAX: 7
        };
        a.Img.isNull = function (j) {
            return (typeof j == "undefined") || (j == null)
        };
        a.Img.optimize = function (n, p, l) {
            var k = new Image();
            k.src = n.src;
            var m = k.width;
            var j = k.height;
            if (a.Img.isNull(m) || m == 0 || a.Img.isNull(j) || j == 0) {
                m = n.width;
                j = n.height
            }
            var o = a.Img.calcSize(m, j, p.width, p.height, p.mode, l);
            n.width = o.width;
            n.height = o.height;
            if (p.display == 1) {
                n.style.display = "inline"
            } else {
                if (p.display == 2) {
                    n.style.display = "none"
                } else {
                    n.style.display = "block"
                }
            }
            return {
                width: n.width,
                height: n.height
            }
        };
        a.Img.calcSize = function (j, q, o, p, l, k) {
            if (isNaN(o)) {
                o = parseFloat(o) * g_rem
            }
            if (isNaN(p)) {
                p = parseFloat(p) * g_rem
            }
            var r = {
                width: j,
                height: q
            };
            if (l == a.Img.MODE_SCALE_FILL) {
                var n = j / o;
                var m = q / p;
                if (n > m) {
                    r.width = o;
                    r.height = q / n
                } else {
                    r.width = j / m;
                    r.height = p
                }
            } else {
                if (l == a.Img.MODE_SCALE_WIDTH) {
                    var n = j / o;
                    r.width = o;
                    r.height = q / n
                } else {
                    if (l == a.Img.MODE_SCALE_HEIGHT) {
                        var m = q / p;
                        r.width = j / m;
                        r.height = p
                    } else {
                        if (l == a.Img.MODE_SCALE_DEFLATE_WIDTH) {
                            var n = j / o;
                            if (n > 1) {
                                r.width = o;
                                r.height = q / n
                            }
                        } else {
                            if (l == a.Img.MODE_SCALE_DEFLATE_HEIGHT) {
                                var m = q / p;
                                if (m > 1) {
                                    r.width = j / m;
                                    r.height = p
                                }
                            } else {
                                if (l == a.Img.MODE_SCALE_DEFLATE_FILL) {
                                    var n = j / o;
                                    var m = q / p;
                                    if (n > m) {
                                        if (n > 1) {
                                            r.width = o;
                                            r.height = q / n
                                        }
                                    } else {
                                        if (m > 1) {
                                            r.width = j / m;
                                            r.height = p
                                        }
                                    }
                                } else {
                                    if (l == a.Img.MODE_SCALE_DEFLATE_MAX) {
                                        if (j > o && q > p) {
                                            var n = j / o;
                                            var m = q / p;
                                            if (n < m) {
                                                r.width = o;
                                                r.height = q / n
                                            } else {
                                                r.width = j / m;
                                                r.height = p
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            if (!k) {
                r.width = Math.floor(r.width);
                r.height = Math.floor(r.height)
            }
            if (r.width == 0) {
                r.width = 1
            }
            if (r.height == 0) {
                r.height = 1
            }
            return r
        }
    })();
    a.tlog = (function () {
        var i = '<div id="logBox"><div id="log_head"><div id="log_close" class="log_icon">╳</div><div id="log_min" class="log_icon">━</div><div id="log_share" class="log_icon">share</div></div><div id="log_text_wrap"><div id="log_text"></div></div></div>';
        var g = $('<div id="log_max"><div id="log_max_inner">+</div></div>');
        var d = $(i);
        var e = d.find("#log_text");
        var j = d.find("#log_head");
        var f = {};
        var h = true;
        var c = 0;
        $(function () {
            var k = $("body");
            if (k.length < 0) {
                return
            }
            k.append(d);
            k.append(g);
            j.on("touchstart", function (l) {
                l.preventDefault();
                l.stopPropagation();
                var m = l.originalEvent.targetTouches[0];
                f.x = m.pageX;
                f.y = m.pageY
            }).on("touchmove", function (l) {
                l.preventDefault();
                l.stopPropagation();
                var o = l.originalEvent.targetTouches[0];
                var n = d.offset().left + o.pageX - f.x;
                var m = d.offset().top + o.pageY - f.y;
                f.x = o.pageX;
                f.y = o.pageY;
                if (n > -0.2 * d.width() && n + 0.5 * d.width() < $(window).width()) {
                    d[0].style.left = n + "px"
                }
                if (m > 0 && m + 0.5 * d.height() < $(window).height()) {
                    d[0].style.top = m + "px"
                }
            });
            d.find("#log_close").on("touchstart", function () {
                g.hide();
                d.hide();
                e.empty();
                c = 0
            });
            d.find("#log_min").on("touchstart", function () {
                g.show();
                d.hide()
            });
            d.find("#log_share").on("touchstart", function () {
                console.log("shareUrl:%s", a.wxConfigArg.url);
                a.tlog("shareUrl", a.wxConfigArg.url)
            });
            g.on("touchstart", function () {
                g.hide();
                d.show()
            });
            e.on("touchstart", ".log_flag", function () {
                var l = $(this).parent();
                if (l.hasClass("log_line_ellipsis")) {
                    l.removeClass("log_line_ellipsis")
                } else {
                    l.addClass("log_line_ellipsis")
                }
            });
            d.hide();
            g.hide()
        });
        return function (l, k) {
            if (arguments.length <= 1) {
                k = l;
                l = "###"
            }
            if (a.IsPC()) {
                console.log(l, k);
                return
            }
            if (a.getType(k) === "object" || a.getType(k) === "array") {
                k = $.toJSON(k)
            } else {
                k = String(k)
            }
            if (!m_debug) {
                return
            }
            $(function () {
                if (c === 0) {
                    d.show()
                }
                c++;
                var m = $('<div class="log_line log_line_ellipsis"><span class="log_flag"></span><span class="log_text"></span></div>');
                m.find(".log_flag").text(l);
                m.find(".log_text").text(k);
                e.append(m);
                $("#log_text_wrap")[0].scrollTop = $("#log_text_wrap")[0].scrollHeight
            })
        }
    })();
    (function (h) {
        function p(v, A) {
            var z = (v & 65535) + (A & 65535),
            w = (v >> 16) + (A >> 16) + (z >> 16);
            return (w << 16) | (z & 65535)
        }
        function t(v, w) {
            return (v << w) | (v >>> (32 - w))
        }
        function e(B, y, w, v, A, z) {
            return p(t(p(p(y, B), p(v, z)), A), w)
        }
        function d(y, w, C, B, v, A, z) {
            return e((w & C) | ((~w) & B), y, w, v, A, z)
        }
        function j(y, w, C, B, v, A, z) {
            return e((w & B) | (C & (~B)), y, w, v, A, z)
        }
        function o(y, w, C, B, v, A, z) {
            return e(w ^ C ^ B, y, w, v, A, z)
        }
        function c(y, w, C, B, v, A, z) {
            return e(C ^ (w | (~B)), y, w, v, A, z)
        }
        function f(G, B) {
            G[B >> 5] |= 128 << ((B) % 32);
            G[(((B + 64) >>> 9) << 4) + 14] = B;
            var y, A, z, w, v, F = 1732584193,
            E = -271733879,
            D = -1732584194,
            C = 271733878;
            for (y = 0; y < G.length; y += 16) {
                A = F;
                z = E;
                w = D;
                v = C;
                F = d(F, E, D, C, G[y], 7, -680876936);
                C = d(C, F, E, D, G[y + 1], 12, -389564586);
                D = d(D, C, F, E, G[y + 2], 17, 606105819);
                E = d(E, D, C, F, G[y + 3], 22, -1044525330);
                F = d(F, E, D, C, G[y + 4], 7, -176418897);
                C = d(C, F, E, D, G[y + 5], 12, 1200080426);
                D = d(D, C, F, E, G[y + 6], 17, -1473231341);
                E = d(E, D, C, F, G[y + 7], 22, -45705983);
                F = d(F, E, D, C, G[y + 8], 7, 1770035416);
                C = d(C, F, E, D, G[y + 9], 12, -1958414417);
                D = d(D, C, F, E, G[y + 10], 17, -42063);
                E = d(E, D, C, F, G[y + 11], 22, -1990404162);
                F = d(F, E, D, C, G[y + 12], 7, 1804603682);
                C = d(C, F, E, D, G[y + 13], 12, -40341101);
                D = d(D, C, F, E, G[y + 14], 17, -1502002290);
                E = d(E, D, C, F, G[y + 15], 22, 1236535329);
                F = j(F, E, D, C, G[y + 1], 5, -165796510);
                C = j(C, F, E, D, G[y + 6], 9, -1069501632);
                D = j(D, C, F, E, G[y + 11], 14, 643717713);
                E = j(E, D, C, F, G[y], 20, -373897302);
                F = j(F, E, D, C, G[y + 5], 5, -701558691);
                C = j(C, F, E, D, G[y + 10], 9, 38016083);
                D = j(D, C, F, E, G[y + 15], 14, -660478335);
                E = j(E, D, C, F, G[y + 4], 20, -405537848);
                F = j(F, E, D, C, G[y + 9], 5, 568446438);
                C = j(C, F, E, D, G[y + 14], 9, -1019803690);
                D = j(D, C, F, E, G[y + 3], 14, -187363961);
                E = j(E, D, C, F, G[y + 8], 20, 1163531501);
                F = j(F, E, D, C, G[y + 13], 5, -1444681467);
                C = j(C, F, E, D, G[y + 2], 9, -51403784);
                D = j(D, C, F, E, G[y + 7], 14, 1735328473);
                E = j(E, D, C, F, G[y + 12], 20, -1926607734);
                F = o(F, E, D, C, G[y + 5], 4, -378558);
                C = o(C, F, E, D, G[y + 8], 11, -2022574463);
                D = o(D, C, F, E, G[y + 11], 16, 1839030562);
                E = o(E, D, C, F, G[y + 14], 23, -35309556);
                F = o(F, E, D, C, G[y + 1], 4, -1530992060);
                C = o(C, F, E, D, G[y + 4], 11, 1272893353);
                D = o(D, C, F, E, G[y + 7], 16, -155497632);
                E = o(E, D, C, F, G[y + 10], 23, -1094730640);
                F = o(F, E, D, C, G[y + 13], 4, 681279174);
                C = o(C, F, E, D, G[y], 11, -358537222);
                D = o(D, C, F, E, G[y + 3], 16, -722521979);
                E = o(E, D, C, F, G[y + 6], 23, 76029189);
                F = o(F, E, D, C, G[y + 9], 4, -640364487);
                C = o(C, F, E, D, G[y + 12], 11, -421815835);
                D = o(D, C, F, E, G[y + 15], 16, 530742520);
                E = o(E, D, C, F, G[y + 2], 23, -995338651);
                F = c(F, E, D, C, G[y], 6, -198630844);
                C = c(C, F, E, D, G[y + 7], 10, 1126891415);
                D = c(D, C, F, E, G[y + 14], 15, -1416354905);
                E = c(E, D, C, F, G[y + 5], 21, -57434055);
                F = c(F, E, D, C, G[y + 12], 6, 1700485571);
                C = c(C, F, E, D, G[y + 3], 10, -1894986606);
                D = c(D, C, F, E, G[y + 10], 15, -1051523);
                E = c(E, D, C, F, G[y + 1], 21, -2054922799);
                F = c(F, E, D, C, G[y + 8], 6, 1873313359);
                C = c(C, F, E, D, G[y + 15], 10, -30611744);
                D = c(D, C, F, E, G[y + 6], 15, -1560198380);
                E = c(E, D, C, F, G[y + 13], 21, 1309151649);
                F = c(F, E, D, C, G[y + 4], 6, -145523070);
                C = c(C, F, E, D, G[y + 11], 10, -1120210379);
                D = c(D, C, F, E, G[y + 2], 15, 718787259);
                E = c(E, D, C, F, G[y + 9], 21, -343485551);
                F = p(F, A);
                E = p(E, z);
                D = p(D, w);
                C = p(C, v)
            }
            return [F, E, D, C]
        }
        function q(w) {
            var x, v = "";
            for (x = 0; x < w.length * 32; x += 8) {
                v += String.fromCharCode((w[x >> 5] >>> (x % 32)) & 255)
            }
            return v
        }
        function k(w) {
            var x, v = [];
            v[(w.length >> 2) - 1] = undefined;
            for (x = 0; x < v.length; x += 1) {
                v[x] = 0
            }
            for (x = 0; x < w.length * 8; x += 8) {
                v[x >> 5] |= (w.charCodeAt(x / 8) & 255) << (x % 32)
            }
            return v
        }
        function l(v) {
            return q(f(k(v), v.length * 8))
        }
        function g(x, A) {
            var w, z = k(x),
            v = [],
            y = [],
            B;
            v[15] = y[15] = undefined;
            if (z.length > 16) {
                z = f(z, x.length * 8)
            }
            for (w = 0; w < 16; w += 1) {
                v[w] = z[w] ^ 909522486;
                y[w] = z[w] ^ 1549556828
            }
            B = f(v.concat(k(A)), 512 + A.length * 8);
            return q(f(y.concat(B), 512 + 128))
        }
        function u(y) {
            var A = "0123456789abcdef",
            w = "",
            v, z;
            for (z = 0; z < y.length; z += 1) {
                v = y.charCodeAt(z);
                w += A.charAt((v >>> 4) & 15) + A.charAt(v & 15)
            }
            return w
        }
        function n(v) {
            return unescape(encodeURIComponent(v))
        }
        function r(v) {
            return l(n(v))
        }
        function m(v) {
            return u(r(v))
        }
        function i(v, w) {
            return g(n(v), n(w))
        }
        function s(v, w) {
            return u(i(v, w))
        }
        h.md5 = function (w, x, v) {
            if (!x) {
                if (!v) {
                    return m(w)
                } else {
                    return r(w)
                }
            }
            if (!v) {
                return s(x, w)
            } else {
                return i(x, w)
            }
        }
    }(typeof jQuery === "function" ? jQuery : this));
    a.encodeBase64 = function (k) {
        var j, h, f;
        var d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
        var g = 0,
        c = k.length,
        e = "";
        while (g < c) {
            j = k.charCodeAt(g++) & 255;
            if (g == c) {
                e += d.charAt(j >> 2);
                e += d.charAt((j & 3) << 4);
                e += "==";
                break
            }
            h = k.charCodeAt(g++);
            if (g == c) {
                e += d.charAt(j >> 2);
                e += d.charAt(((j & 3) << 4) | ((h & 240) >> 4));
                e += d.charAt((h & 15) << 2);
                e += "=";
                break
            }
            f = k.charCodeAt(g++);
            e += d.charAt(j >> 2);
            e += d.charAt(((j & 3) << 4) | ((h & 240) >> 4));
            e += d.charAt(((h & 15) << 2) | ((f & 192) >> 6));
            e += d.charAt(f & 63)
        }
        return e
    };
    a.imgReady = (function () {
        var f = [],
        e = null,
        d = function () {
            var g = 0;
            for (; g < f.length; g++) {
                f[g].end ? f.splice(g--, 1) : f[g]()
            } !f.length && c()
        },
        c = function () {
            clearInterval(e);
            e = null
        };
        return function (h, m, o, l) {
            var n, i, p, k, g, j = new Image();
            if (typeof h === "object") {
                j = h
            } else {
                j.src = h
            }
            if (j.complete) {
                m.call(j);
                o && o.call(j);
                return
            }
            i = j.width;
            p = j.height;
            j.onerror = function () {
                l && l.call(j);
                n.end = true;
                j = j.onload = j.onerror = null
            };
            n = function () {
                k = j.width;
                g = j.height;
                if (k !== i || g !== p || k * g > 1024) {
                    m.call(j);
                    n.end = true
                }
            };
            n();
            j.onload = function () {
                !n.end && n();
                o && o.call(j);
                j = j.onload = j.onerror = null
            };
            if (!n.end) {
                f.push(n);
                if (e === null) {
                    e = setInterval(d, 40)
                }
            }
        }
    })();
    a.initEdit = function (d) {
        var o = d.origin,
        k = d.originDef,
        r = d.originMod,
        c = {};
        (function () {
            if (!r) {
                return
            }
            $.each(r,function (s, u) {
                var v = o[s];
                if (u.css) {
                    function t(w) {
                        if (typeof w.opt !== "undefined") {
                            w.opt = 0
                        }
                        if (w.tra !== "undefined") {
                            w.defTra = w.tra
                        }
                        w.defVal = w.val
                    }
                    $.each(u.css, function (w, x) {
                        if (x.css) {
                            $.each(x.css,function (y, z) {
                                t(z)
                            })
                        } else {
                            t(x)
                        }
                    });
                    if (g_config.isNewGame) {
                        $.extend(true, v.css, u.css)
                    }
                }
                if (u.text) {
                    $.each(u.text,
                    function (w, x) {
                        if (g_config.isNewGame) {
                            $.extend(true, v.text, u.text)
                        }
                        if (x.type == 2) {
                            x.txtopt = 0;
                            delete x.numLimit
                        }
                    })
                }
            });
            $.extend(true, k, r)
        })();
        function q(t, z) {
            var A = "getImgInfo-" + t;
            if (z) {
                A = "getImgInfo-rem-" + t
            }
            var w = c[A];
            if (w) {
                return w
            }
            var v = h(t)[0];
            if (!v) {
                return
            }
            w = {
                name: t,
                css: v.css
            };
            if (v.path) {
                if (a.getType(v.path[0]) === "array") {
                    w.path = [];
                    for (var s = 0; s < v.path.length; s++) {
                        w.path[s] = a.getSrc(v.path[s][0])
                    }
                } else {
                    w.path = a.getSrc(v.path[0])
                }
            }
            var x = z ? parseFloat : parseRemToPx;
            var B = {
                size: ["width", "height"],
                pos: ["left", "top"]
            };
            for (var A in B) {
                var y = B[A];
                var u = v[A];
                if (!u) {
                    continue
                }
                if (a.getType(u) === "array") {
                    w[y[0]] = [],
                    w[y[1]] = [];
                    $.each(u,
                    function (C, D) {
                        w[y[0]].push(x(D[y[0]]));
                        w[y[1]].push(x(D[y[1]]))
                    })
                } else {
                    w[y[0]] = x(u[y[0]]);
                    w[y[1]] = x(u[y[1]])
                }
            }
            c[A] = w;
            return w
        }
        function l(w, t, s) {
            var v = s ? t.defVal : t.val;
            var u = s ? t.defTra : t.tra;
            if (!v) {
                return
            }
            if (t.from) {
                w = $(t.from)
            }
            if (t.type !== "color") {
                w.css(t.name, v)
            } else {
                if (t.name === "text-shadow") {
                    w.css(t.name, g(j(v, u)))
                } else {
                    w.css(t.name, j(v, u))
                }
            }
        }
        function g(s) {
            return s + " -1px -1px 0px, " + s + " 0px -1px 0px, " + s + " 1px -1px 0px, " + s + " 1px 0px 0px, " + s + " 1px 1px 0px, " + s + " 0px 1px 0px, " + s + " -1px 1px 0px, " + s + " -1px 0px 0px"
        }
        function j(t, s) {
            if (typeof s === "undefined" || s == -1) {
                return t
            }
            return "rgba" + t.substring(t.indexOf("("), t.indexOf(")")) + "," + (s ? s : 0) + ")"
        }
        function h(t) {
            for (var u = 0; u < o.length; u++) {
                var s = o[u];
                if (s.name === t) {
                    return [s, k[u]]
                }
            }
            return [false, false]
        }
        function f(u, t) {
            var s = {};
            s.from = u;
            s.title = t[1];
            s.limit = t[2];
            s.defSrc = a.getSrc(t[0]);
            return s
        }
        function p(s, t) {
            s.each(function () {
                if (/img/i.test($(this)[0].nodeName)) {
                    $(this).attr("src", t)
                } else {
                    $(this).css("background-image", 'url("' + t + '")')
                }
            })
        }
        function n(t, s) {
            a.getType(s) === "undefined" && (s = 0);
            return a.getType(t) === "array" ? (t[s] || t[0]) : t
        }
        function m(R) {
            var Q = typeof R === "object" ? R : h(R),
            x = Q[0],
            H = Q[1],
            R = x.name,
            z = $(".editTarget-" + R),
            y = x.pos,
            E = x.size,
            G = H.path,
            u = H.size,
            w = H.pos;
            z = z.not(function () {
                return $(this).data("hasBindEdit")
            });
            var B = -2,
            P = null,
            v = false,
            N = null,
            J = true;
            if (H.edit) {
                if (typeof H.edit === "number") {
                    B = H.edit
                } else {
                    if (H.edit === "_background") {
                        !d.bgList && (d.bgList = []);
                        d.bgList.push({
                            from: ".editTarget-" + R + ",.editRelate-" + R,
                            defSrc: a.getSrc(G[0])
                        });
                        z.data("hasBindEdit", true);
                        return
                    } else {
                        if (H.edit !== "_none") {
                            P = [];
                            if (c["edit-" + H.edit]) {
                                P = c["edit-" + H.edit]
                            } else {
                                var D = [];
                                if (H.edit === "all") {
                                    D = d.originDef.filter(function (S) {
                                        return !S.formDefaultStyle && S.edit != "_background"
                                    })
                                } else {
                                    $.each(H.edit.split(","),
                                    function (S, T) {
                                        D.push(h(T)[1])
                                    })
                                }
                                for (var O = 0; O < D.length; O++) {
                                    var C = D[O].path;
                                    var I = D[O].name;
                                    var t = ".editTarget-" + I + ",.editRelate-" + I;
                                    if (typeof C != "undefined") {
                                        if (a.getType(C[0]) === "array") {
                                            for (var K = 0; K < C.length; K++) {
                                                K > 0 && (t = ".editTarget-" + I + "-" + K + ",.editRelate-" + I + "-" + K);
                                                P.push(f(t, C[K]))
                                            }
                                        } else {
                                            P.push(f(t, C))
                                        }
                                    }
                                } !c["edit-" + H.edit] && (c["edit-" + H.edit] = P)
                            }
                            B = -1
                        } else {
                            J = false
                        }
                    }
                }
            } else {
                J = false
            }
            var A = "editTarget-" + R,
            M = null,
            L = false;
            if (H.css || H.cssAll) {
                if (H.cssAll) {
                    N = [];
                    $.each(H.cssAll,
                    function (S, T) {
                        if (h(T)[1].css) {
                            N = N.concat(h(T)[1].crrCssArg)
                        }
                    })
                } else {
                    N = H.crrCssArg
                }
                v = !N[0].targetName ? true : N[0].targetName;
                if (H.cssEdit == 1) {
                    var s = N;
                    parent.Edit.addEditBtn("编辑背景", "." + A,
                    function () {
                        parent.Edit.Css.showCssByGame.call($("." + A), "." + A, s);
                        parent.operateFlagList[21] = true;
                        a.logDog(1000078, 5);
                        return false
                    });
                    v = false,
                    N = null
                }
            }
            if (H.text) {
                J = !H.text[0].targetName ? true : H.text[0].targetName;
                x.text = $.extend(true, [], H.text, x.text);
                if (H.text[0].type == 1) {
                    J = false
                }
                if (x.text.filter(function (S) {
                    return S.type == 2
                }).length > 0) {
                    B = 0;
                    A = function () {
                        i.call(this, x.text, H.text, R)
                    }
                }
            }
            if (H.edit || N) {
                a.initModuleLayer(z, B, A, P, v, N, J)
            }
            var F = (a.getType(w) === "array" && a.getType(u) !== "array");
            z.each(function (X) {
                var V = n(y, X),
                U = n(E, X),
                T = n(u, X),
                W = n(w, X);
                if (U) {
                    $(this).addClass("slaveImg");
                    if (!$(this).parents().hasClass("imgContainer")) {
                        $(this).wrap('<div class="imgContainer absCenter"></div>')
                    }
                    if (!T.disable) {
                        if (F) {
                            var S = null;
                            $(this).addResizableFn("start", function (Z, aa) {
                                S = z.not(this);
                                if (/n|w/.test(aa.axis) && !T.noSyncOffset) {
                                    S.each(function (ac, ae) {
                                        var ab = $(this),
                                        ad = ab.parents(".ui-wrapper");
                                        ab.data("originalPosition-relative", {
                                            left: parseFloat(ad.css("left")) - aa.originalPosition.left,
                                            top: parseFloat(ad.css("top")) - aa.originalPosition.top,
                                        })
                                    })
                                }
                            });
                            $(this).addResizableFn("resize", function (Z, aa) {
                                S.add(S.parents(".ui-wrapper")).css({
                                    width: $(aa.element).width(),
                                    height: $(aa.element).height()
                                });
                                if (/n|w/.test(aa.axis) && !T.noSyncOffset) {
                                    S.each(function (ac, ad) {
                                        var ab = $(this);
                                        var ae = ab.data("originalPosition-relative");
                                        ab.add(ab.parents(".ui-wrapper")).css({
                                            left: aa.position.left + ae.left,
                                            top: aa.position.top + ae.top
                                        })
                                    })
                                }
                            });
                            $(this).addResizableFn("stop", function (Z, aa) {
                                if (!T.noSyncOffset) {
                                    S.each(function (ab, ac) {
                                        $(this).removeData("originalPosition-relative").attr("resize", "1")
                                    })
                                }
                                S = null
                            })
                        }
                        var Y = {
                            width: T.width,
                            height: T.height
                        };
                        if (W && W.disable) {
                            Y.left = W.left;
                            Y.top = W.top
                        }
                        a.moduleSlaveImgResize($(this), Y);
                        if (F) {
                            $(this).addResizableFn("recover", function () {
                                var Z = $(this).parents(".ui-wrapper");
                                z.each(function (aa, ab) {
                                    if (aa === X) {
                                        return
                                    }
                                    var ad = $(ab).add($(ab).parents(".ui-wrapper"));
                                    ad.width(Z.width()).height(Z.height());
                                    var ac = n(w, aa);
                                    if (ac && ac.disable) {
                                        ad.css({
                                            left: ac.left,
                                            top: ac.top
                                        })
                                    }
                                    ad.attr("resize", 0)
                                })
                            })
                        }
                    }
                }
                if (V && !W.disable) {
                    if (W.forParent != "false" && !$(this).parents().hasClass("imgContainer")) {
                        $(this).wrap('<div class="imgContainer absCenter"></div>')
                    }
                    a.moduleDraggale($(this), W.forParent == "false" ? false : true)
                }
            });
            z.data("hasBindEdit", true)
        }
        function i(w, t, v) {
            $$("#uploadBg").fadeIn(200);
            $$("#uploadImgBox").css("left", $$(".editDetail").offset().left + 12).removeClass("uploadUp").addClass("uploadDown");
            var x = $$("#uploadInfoBox");
            x.css("overflow-y", "auto").html("");
            $$("#uploadBoxTitle").html(t[0].allTitel || "编辑内容");
            var s = [];
            $.each(w,
            function (E, A) {
                if (A.type != 2) {
                    return
                }
                var H = t[E]; !H.from && (H.from = ".editTarget-" + v + ",.editRelate-" + v);
                var G = A.val;
                var D = H.numLimit;
                if (a.getType(D) != "array") {
                    D = [0, D]
                }
                var C = D[0];
                var J = D[1];
                var I = A.txtopt;
                var L = A.shouInput;
                var M = "";
                var B = H.val;
                var K = $(H.from);
                s.push([K.data("hd-editUpload-editClose"), this, [A, H, K]]);
                M += '<div class="uploadLine"  >';
                if (A.shouInput) {
                    M += z((H.title || "文字内容") + ":", "内容", G, "title")
                } else {
                    M += y((H.title || "文字内容") + ":", "内容", G, "title", E, I)
                }
                M += "</div>";
                x.append(M);
                var F = $$(".newTextArea .activeInput").eq(E);
                F.off().on("blur",
                function () {
                    var N = $(this).val();
                    if ($.trim(N).length < (C + 1)) {
                        if (!$(this).hasClass("inputErr")) {
                            $(this).addClass("inputErr")
                        }
                        $(this).parent().find(".editErr").show().text("输入的文字不可少于" + (C + 1) + "个!");
                        K.text(A.val)
                    }
                    var O = K.data("hd-editUpload-textBlur");
                    O && O.fireWith(this, [A, H, K])
                }).on("focus",
                function () {
                    $(this).removeClass("inputErr");
                    $(this).parent().find(".editErr").hide();
                    $(this).parent().find(".editErr2").hide();
                    var N = K.data("hd-editUpload-textFocus");
                    N && N.fireWith(this, [A, H, K])
                }).on("input propertychange",
                function () {
                    var R = $(this).val();
                    R = R.substr(0, J);
                    var O = $.trim($(this).val()).length;
                    if (O > J) {
                        $(this).val(R)
                    }
                    K.text(R);
                    var N = K.data("hd-editUpload-textBeforeSave");
                    if (N) {
                        var Q = {};
                        N.fireWith(this, [A, H, K, Q]);
                        Q.str && (R = Q.str);
                        Q.len && (O = Q.len)
                    }
                    if (u(O, C, J)) {
                        A.val = R
                    }
                    var P = K.data("hd-editUpload-textKeyUp");
                    if (P) {
                        P.fireWith(this, [A, H, K])
                    }
                });
                if (I) {
                    F.css("display", "inline-block").val(A.val)
                } else {
                    F.hide()
                }
                $$("#TheOnlyOne" + E + "").on("click",
                function () {
                    A.txtopt = 0;
                    K.text(B);
                    $$(".newTextArea .activeInput").hide().removeClass("inputErr").val(B);
                    $$(".newTextArea .activeInput").siblings(".editErr").hide();
                    $$(".newTextArea .activeInput").siblings(".editErr2").hide()
                });
                $$("#TheOnlytwo" + E + "").on("click",
                function () {
                    A.txtopt = 1;
                    $$(".newTextArea .activeInput").css("display", "inline-block").val(A.val);
                    K.text(A.val)
                })
            });
            $$("#uploadImgBox").data("editClose",
            function () {
                $.each(s,
                function (A, C) {
                    var B = C[0];
                    B && B.fireWith(C[1], C[2])
                })
            });
            g_config.closeWin && g_config.closeWin();
            function u(B, C, A) {
                if (typeof A !== "undefined") {
                    return B > C && B <= A
                } else {
                    return B > C
                }
            }
            function z(E, B, C, A) {
                var D = C;
                D = a.encodeHtml(D);
                return '<div class="answerLine clearfix"><div class="floatLeft newTextT" style="width: 70px; margin-top: 12px" >' + E + '</div><div style="width: 320px;" class="floatLeft"><div class="newTextArea"><input type="text" class="input scrollBox activeInput" style="width: 300px;height: 32px; padding-left: 5px;" value="' + D + '" ' + (isPublish ? "disabled" : "") + '><div style="color:#888; padding-top: 5px;">确认发布后无法修改,请认真输入!</div><div class="editErr hide" style="color: red;margin-top: 10px;">输入文字不能为空</div><div class="editErr2 hide" style="color: red; margin-top: 10px; display: none;">输入仅限中文字母跟数字</div></div></div></div>'
            }
            function y(F, B, H, G, D, E) {
                var A = H;
                A = a.encodeHtml(A);
                var I = E ? "checked" : "";
                var C = E ? "" : "checked";
                return '<div class="answerLine clearfix"><div class="floatLeft newTextT" style="width: 100px;">' + F + '</div><div class="floatLeft" style="width: 320px;"><div><input id="TheOnlyOne' + D + '" type="radio" name="theRealOnly"' + C + '><label for="TheOnlyOne' + D + '" style="height: 16px;line-height: 16px;">默认</label><input id="TheOnlytwo' + D + '" type="radio" name="theRealOnly"' + I + '><label for="TheOnlytwo' + D + '" style="height: 16px;line-height: 16px;">自定义</label></div><div class="newTextArea" style="margin-top: 12px;"><textarea class="input scrollBox activeInput" style="width: 300px;height: 100px;">' + A + '</textarea><div class="editErr hide" style="color: red;margin-top: 10px;">输入文字不可少于10个!</div><div class="editErr2 hide" style="color: red; margin-top: 10px; display: none;">输入仅限中文</div></div></div></div>'
            }
            return false
        }
        if (_manage) {
            d.setAllEdit = function () {
                e();
                $.each(k, function (s, t) {
                    if (t.css) {
                        t.crrCssArg = $.extend(true, [], t.css, o[s].css)
                    }
                });
                $.each(o,
                function (t, s) {
                    m([s, k[t]])
                })
            }
        } else {
            e()
        }
        function e() {
            $.each(o, function (v, t) {
                var w = k[v],
                u = $(".editTarget-" + t.name),
                x = t.pos,
                A = t.size,
                z = t.path;
                var s = function (B) {
                    B.each(function (E) {
                        var D = n(x, E),
                        C = n(A, E);
                        if (D && D.top && D.left) {
                            $(this).css({
                                top: D.top,
                                left: D.left
                            }).addClass("abs")
                        }
                        if (C && C.width && C.height) {
                            $(this).css({
                                width: C.width,
                                height: C.height
                            })
                        }
                    })
                };
                s(u);
                if (z) {
                    var y = ".editRelate-" + t.name;
                    if (a.getType(z[0]) === "array") {
                        $.each(z,
                        function (C, E) {
                            var D = a.getSrc(E[0]);
                            var B = "editTarget-" + t.name;
                            if (C !== 0) {
                                B = "editTarget-" + t.name + "-" + C;
                                y = ".editRelate-" + t.name + "-" + C
                            }
                            if ($("." + B).length > 0) {
                                p($("." + B), D);
                                s($("." + B))
                            } else {
                                $("body").append('<input class="' + B + '" type="hidden" value="' + D + '">')
                            }
                            if ($(y).length > 0) {
                                p($(y), D)
                            }
                        })
                    } else {
                        p(u.add(y), a.getSrc(z[0]))
                    }
                }
                if (t.css) {
                    $.extend(true, w.css, t.css);
                    $.each(w.css,
                    function (B, C) {
                        if (!C.from) {
                            C.from = ".editTarget-" + t.name + ",.editRelate-" + t.name
                        }
                        if (C.css) {
                            $.each(C.css,
                            function (E, D) {
                                if (!D.from) {
                                    D.from = C.from
                                }
                                l($(D.from), D, D.opt === 0)
                            })
                        } else {
                            l($(C.from), C, C.opt === 0)
                        }
                    })
                }
                if (t.text) {
                    $.each(t.text,
                    function (C, D) {
                        var B = w.text[C]; !B.from && (B.from = ".editTarget-" + t.name + ",.editRelate-" + t.name);
                        if (B.type == 2) {
                            var E = Fai.encodeHtml(D.txtopt ? D.val : B.val);
                            $(B.from).html(E)
                        } else {
                            $(B.from).val(D.value)
                        }
                    })
                }
            })
        }
        d.getImgInfo = q;
        d.getInfoByName = h;
        d.getRgba = j;
        d.initEdit = e;
        d.cache = c;
        delete d.originMod;
        return d
    };
    a.initSound = function (e, f, d) {
        if (d) {
            $.each(d,
            function (i, j) {
                f[i].path = j.path;
                if (g_config.isModel) {
                    e[i].optFlag = f[i].optFlag
                }
            })
        }
        if (e) {
            $.each(e,
            function (j, k) {
                var i = f[j];
                if (j !== 0 && k.optFlag === 1) {
                    k.optFlag = 2
                }
                k.path = a.getSrc(k.path);
                i.path = a.getSrc(i.path)
            })
        }
        var c = {};
        var h = LF.sound.webAudioEnabled && LF.global.webAudio;
        $(function () {
            $.setSoundM()
        });
        var g = {
            list: e,
            listDef: f,
            allowPlay: true,
            setPlayPower: function (j, k) {
                if (typeof j == "boolean") {
                    this.allowPlay = j
                }
                var i = c[j];
                if (!i) {
                    a.tlog("Sound_play_err", "这个key:" + j + " 不存在!");
                    return this
                }
                i._allowPlay = k
            },
            play: function (m, n, k) {
                if (_manage) {
                    return
                }
                if (!this.allowPlay) {
                    return this
                }
                if (e && a.getType(m) === "number") {
                    var j = m === 0 ? 1 : 3;
                    if (e[m].optFlag === j) {
                        return this
                    }
                }
                if (m !== 0 && e && e[0].optFlag !== 1 && !h) {
                    return this
                }
                var i = c[m];
                if (!i) {
                    a.tlog("Sound_play_err", "这个key:" + m + " 不存在!");
                    return this
                }
                if (!i._allowPlay) {
                    return
                }
                i.play(n, k);
                return this
            },
            readyPlay: function (k, m, i) {
                if (_manage) {
                    return
                }
                var j = this;
                j.onReady(k,
                function () {
                    j.play(k, m, i)
                })
            },
            pause: function (j) {
                if (_manage) {
                    return
                }
                var i = c[j];
                if (!i) {
                    a.tlog("Sound_pause_err", "这个key:" + j + " 不存在!");
                    return this
                }
                i.stop();
                return this
            },
            pauseAll: function () {
                if (_manage) {
                    return
                }
                var i = null;
                for (var j in c) {
                    i = c[j];
                    if (i) {
                        i.stop()
                    }
                }
                return this
            },
            load: function (n, j, k) {
                if (_manage) {
                    return
                }
                if (c[j]) {
                    a.tlog("Sound_load_err", "这个key:" + j + " 已经存在!");
                    return this
                }
                var i = null,
                m = h;
                typeof k !== "undefined" && (m = k);
                if (m) {
                    i = new LF.webAudio()
                } else {
                    i = new LF.media();
                    try {
                        i.data = new Audio()
                    } catch (l) {
                        console.warn("ReferenceError: Can't find variable: Audio");
                        i.data = {}
                    }
                    i.data.loop = false;
                    i.data.autoplay = false
                }
                i._type = "audio";
                if (n) {
                    i.load(n)
                }
                i.readyCallBack = $.Callbacks("unique memory");
                i.addEventListener(LF.event.COMPLETE,
                function (o) {
                    i.complete = true;
                    i.readyCallBack.fire(i);
                    i.readyCallBack = null
                });
                i._allowPlay = true;
                c[j] = i;
                return this
            },
            onReady: function (j, k) {
                if (_manage) {
                    return
                }
                var i = c[j];
                if (!i) {
                    a.tlog("Sound_onReady_err", "这个key:" + j + " 不存在!");
                    return this
                }
                if (i.complete) {
                    k(i)
                } else {
                    i.readyCallBack.add(k)
                }
                return this
            },
            cache: c,
        };
        g.load(_resRoot + "/image/button.mp3", "startButton");
        if (e) {
            $.each(e,
            function (i, j) {
                var l = j.path;
                if (i === 0) {
                    g.load(l, i, false);
                    if (g.cache["0"]) {
                        var k = g.cache["0"].data;
                        if (Audio && k instanceof Audio) {
                            document.getElementById("pageMusic").appendChild(k)
                        }
                    }
                } else {
                    g.load(l, i)
                }
            });
            if (!_manage) {
                g.cache["0"].data.addEventListener("play",
                function () {
                    $(function () {
                        $(".soundIcon").removeClass("soundIconOff")
                    })
                },
                false);
                g.cache["0"].data.addEventListener("pause",
                function () {
                    $(function () {
                        $(".soundIcon").addClass("soundIconOff")
                    })
                },
                false)
            }
        }
        return g
    };
    a.initCallBack = function (d, c) {
        d = d || {};
        var e = {};
        d.addCallBack = function (f) {
            if (a.getType(f) == "array") {
                for (var g = f.length - 1; g >= 0; g--) {
                    arguments.callee(f[g])
                }
                return
            }
            if (typeof f == "string" && typeof e[f] == "undefined") {
                e[f] = null
            }
        };
        d.on = function (f, h) {
            var g = e[f];
            if (typeof g === "undefined") {
                return this
            }
            if (g === null) {
                e[f] = g = $.Callbacks("unique memory stopOnFalse")
            }
            g.add(h);
            return this
        };
        d.off = function (f, i) {
            var h = this;
            if (typeof f === "undefined") {
                $.each(e,
                function (j, k) {
                    h.off(k, i)
                });
                return h
            }
            var g = e[f];
            if (!g) {
                return h
            }
            if (typeof i === "undefined") {
                g.empty()
            } else {
                g.remove(i)
            }
            return h
        };
        d.fire = function (g) {
            var f = e[g];
            if (f) {
                var h = Array.prototype.slice.call(arguments);
                h.shift();
                return f.fire.apply(f, h)
            }
            return true
        };
        d.fireWith = function (g) {
            var f = e[g];
            if (f) {
                var h = Array.prototype.slice.call(arguments);
                h.shift();
                return f.fireWith.apply(f, h)
            }
            return true
        };
        if (typeof c !== "undefined") {
            d.addCallBack(c)
        }
        return d
    };
    a.initTime = function (c) {
        var g = null,
        e, h = 0;
        function d(i) {
            var j = Math.round(i * 100) / 100;
            var k = j.toString();
            var l = k.indexOf(".");
            if (l < 0) {
                l = k.length;
                k += "."
            }
            while (k.length <= l + 2) {
                k += "0"
            }
            return k
        }
        var f = {
            val: 0,
            pastTime: 0,
            interval: 140,
            range: [70, 280],
            target: null,
            isDesc: !g_config.countsTimeType,
            acceList: null,
            initTime: c,
            status: "ended",
            updateFlag: true,
            targetFlag: true,
            frameInc: 0,
            setAcceList: function (k) {
                if (typeof k === "number") {
                    var l = k;
                    k = [];
                    for (var j = 0; j < l; j++) {
                        k.push((l - j) * (this.initTime / (l + 1)))
                    }
                }
                this.acceList = k
            },
            setTarget: function () {
                var i = d(this.val);
                this.targetFlag && this.target.text(i);
                this.fireWith("setTime", this, [i])
            },
            init: function () {
                if (this.initTime === 99999) {
                    return
                } !this.target && (this.target = $(".time"));
                this.val = this.initTime;
                this.pastTime = 0;
                $(".timeUpImg").hide();
                this.setTarget();
                return this
            },
            start: function () {
                if (this.initTime === 99999) {
                    return
                }
                e = new Date().getTime() / 1000;
                if (this.updateFlag && this.status === "ended") {
                    this.status = "runing";
                    this.play()
                } else {
                    this.status = "runing"
                }
                return this
            },
            isRunning: function () {
                return this.status === "runing"
            },
            pause: function () {
                this.status = "pause"
            },
            end: function () {
                if (this.status === "ended") {
                    return
                }
                clearTimeout(g);
                h = 0;
                this.update();
                this.status = "ended";
                return this
            },
            setTime: function () {
                var j = (new Date).getTime() / 1000;
                var n = j - e;
                var l = this.isDesc ? -1 : 1;
                if (n < this.range[0] / 1000) {
                    n = this.range[0] / 1000
                } else {
                    if (n > this.range[1] / 1000) {
                        n = this.range[1] / 1000
                    }
                }
                this.val += l * n;
                this.pastTime = l * (this.val - this.initTime);
                e = j;
                if (this.isDesc) {
                    if (this.acceList) {
                        for (var k = 0; k < this.acceList.length; k++) {
                            if (this.val <= this.acceList[k] && h == k) {
                                h++;
                                this.fireWith("acce", this, [h]);
                                break
                            }
                        }
                    }
                    if (this.val <= 0) {
                        this.val = 0;
                        this.setTarget();
                        clearTimeout(g);
                        h = 0;
                        this.status = "ended";
                        this.fireWith("end", this);
                        var m = $(".timeUpImg");
                        m.removeClass("tada");
                        m.addClass("tada");
                        m.show();
                        return
                    }
                }
                this.setTarget()
            },
            update: function () {
                if (this.initTime === 99999) {
                    return
                }
                if (this.status !== "pause") {
                    this.setTime()
                }
                this.fireWith("timer", this, [this.status !== "pause"])
            },
            play: function () {
                this.update();
                if (this.status !== "ended") {
                    g = setTimeout(arguments.callee.bind(this), this.interval)
                }
            },
            updateInFrame: function (i) {
                if (this.initTime === 99999) {
                    return
                }
                if (this.status === "ended") {
                    return
                }
                this.frameInc += i;
                if (this.frameInc >= this.interval) {
                    this.update();
                    this.frameInc = 0
                }
            }
        };
        a.initCallBack(f, ["end", "timer", "acce", "setTime"]);
        f.init();
        f.changeTwoDecimal_f = d;
        return f
    };
    a.initGrade = function () {
        var c = function (d) {
            c.set(c.val + d)
        };
        $.extend(c, {
            val: 0,
            set: function (d) {
                c.val = d;
                c.val < 0 && (c.val = 0);
                c.fireWith("setGrade", c, [c.val]);
                c.target && c.target.text(c.val)
            }
        });
        $(function () {
            c.target = $("#grade")
        });
        a.initCallBack(c, ["setGrade"]);
        return c
    };
    a.initAreaLimit = function (e) {
        if (!_manage && e) {
            var c = 5;
            var d = 0;
            var f = setInterval(function () {
                if (d >= c) {
                    clearInterval(f);
                    return
                }
                d++;
                if (!g_config.ipInfo || !g_config.ipInfo.provice) {
                    $.ajax({
                        type: "post",
                        url: g_config.ajaxUrl + "hdgame_h.jsp?cmd=getIPInfo",
                        success: function (h) {
                            var g = $.parseJSON(h);
                            if (g.success) {
                                g_config.ipInfo = g.ipInfo
                            }
                            console.log(g.ipInfo)
                        }
                    })
                } else {
                    clearInterval(f);
                    return
                }
            },
            1500)
        }
    };
    a.initWxConfig = function (k) {
        a.wxConfigArg = {
            url: k.fullUrl
        };
        i({
            haveAward: g_config.haveAward,
            plInfo: k.plInfo,
            bestRankInfo: g_config.bestRankInfo
        });
        wx.config({
            debug: false,
            appId: k.AppId,
            timestamp: k.Timestamp,
            nonceStr: k.NonceStr,
            signature: k.Signature,
            jsApiList: ["checkJsApi", "onMenuShareTimeline", "onMenuShareAppMessage", "onMenuShareQQ", "onMenuShareWeibo", "hideMenuItems", "showMenuItems", "hideAllNonBaseMenuItem", "showAllNonBaseMenuItem", "translateVoice", "startRecord", "stopRecord", "onRecordEnd", "playVoice", "pauseVoice", "stopVoice", "uploadVoice", "downloadVoice", "chooseImage", "previewImage", "uploadImage", "downloadImage", "getNetworkType", "openLocation", "getLocation", "hideOptionMenu", "showOptionMenu", "closeWindow", "scanQRCode", "chooseWXPay", "openProductSpecificView", "addCard", "chooseCard", "openCard"]
        });
        //wx.ready(function () {
        //    $("#awardCollectionBtn").on("touchstart",function () {
        //        var r = true;
        //        var o = g_config.wxAward;
        //        var m = o.genewxcard;
        //        if (m) {
        //            if (g_config.status == 0) {
        //                a.statusMsg("活动尚未发布", "无法加入到微信卡券");
        //                return
        //            }
        //            var n = o.wxcardid;
        //            var l = $("#awardDetailBox .codeLine .code").text();
        //            var q = $("#awardDetailBox .codeLine .code").attr("code");
        //            var p = g_config.award.depositTime;
        //            a.tlog(n);
        //            a.tlog(l);
        //            $.ajax({
        //                type: "post",
        //                url: g_config.ajaxUrl + "hdgame_h.jsp?cmd=getCardSign&cardTick=" + k.cardTicket + "&cardId=" + n + "&code=" + l + "&openid=" + g_config.openid,
        //                error: function () {
        //                    if (m_debug) {
        //                        alert("服务繁忙,请稍候重试")
        //                    }
        //                },
        //                success: function (t) {
        //                    a.tlog("getCardSign", t);
        //                    var s = $.parseJSON(t);
        //                    var u = '{"Timestamp":"' + s.Timestamp + '","openid":"' + g_config.openid + '","NonceStr":"' + s.NonceStr + '","code":"' + l + '","Signature":"' + s.sign + '"}';
        //                    if (p && p < Date.parse(new Date())) {
        //                        r = false
        //                    }
        //                    a.tlog("depositTime=" + p);
        //                    if (r) {
        //                        wx.addCard({
        //                            cardList: [{
        //                                cardId: n,
        //                                cardExt: u
        //                            }],
        //                            success: function (w) {
        //                                a.tlog("addCard", w);
        //                                a.logDog(1000108, 1);
        //                                var v = w.cardList[0];
        //                                r = false;
        //                                $("#awardCollectionBtn").text("打开微信卡券");
        //                                if (v.isSuccess) {
        //                                    $.ajax({
        //                                        type: "get",
        //                                        url: g_config.ajaxUrl + "hdgame_h.jsp?cmd=setCode&code=" + q + "&gameId=" + g_config.gameId,
        //                                        error: function () {
        //                                            if (m_debug) {
        //                                                alert("服务繁忙,请稍候重试")
        //                                            }
        //                                        },
        //                                        success: function (y) {
        //                                            a.tlog("setCode", y);
        //                                            var x = $.parseJSON(y)
        //                                        }
        //                                    })
        //                                }
        //                            }
        //                        })
        //                    } else {
        //                        wx.openCard({
        //                            cardList: [{
        //                                cardId: n,
        //                                code: l
        //                            }]
        //                        })
        //                    }
        //                }
        //            })
        //        }
        //    })
        //});
        wx.ready(function () {
            if (k.isHideMenuItems) {
                wx.hideMenuItems({
                    menuList: ["menuItem:copyUrl"]
                })
            } else {
                wx.showAllNonBaseMenuItem()
            }
            try {
                if (k.isHideShareBtn) {
                    wx.hideMenuItems({
                        menuList: ["menuItem:share:timeline"]
                    })
                }
                wx.error(function (m) {
                    if (m_debug) {
                        alert($.toJSON(m))
                    }
                })
            } catch (l) {
                alert(l.message)
            }
        });
        wx.ready(function () {
            var l = window.navigator.userAgent.indexOf("iPhone") > -1 || window.navigator.userAgent.indexOf("iPad") > -1 || window.navigator.userAgent.indexOf("iPod") > -1;
            var m = window.navigator.userAgent.indexOf("Android") > -1;
            var n = "unknown";
            if (l) {
                n = "apple"
            } else {
                if (m) {
                    n = "android"
                }
            }
            wx.getNetworkType({
                success: function (o) {
                    var p = o.networkType;
                    var q = "other";
                    if (p === "wifi") {
                        q = "wifi"
                    } else {
                        q = "other"
                    }
                    console.log("[需设置]纪录活动人")
                    //返回值为:{"success": true, "rt": 0, "msg": "设置设备信息成功"}
                    //$.ajax({
                    //    url: g_config.ajaxUrl + "hdgame_h.jsp?cmd=setBehavior&gameId=" + g_config.gameId + "&openid=" + g_config.openid,
                    //    type: "post",
                    //    data: {
                    //        netType: q,
                    //        sysType: n
                    //    },
                    //    success: function (r) { }
                    //})
                }
            })
        });
        function j(s, p, r) {
            if (!_manage) {
                s = s.replace("红包", "")
            }
            s = a.decodeHtml(s);
            var n = p;
            //if (!k.dynamicShareUrlRootEmpty) {
            //    var m = p.split("?")[1].split("&");
            //    var o = "";
            //    for (var q = 0; q < m.length; q++) {
            //        var l = m[q];
            //        if (l.split("=")[0] === "aid" || l.split("=")[0] === "id" || l.split("=")[0] === "style") {
            //            continue
            //        }
            //        if (o.length > 0) {
            //            o += "&"
            //        }
            //        o += l
            //    }
            //    if (m_debug) {
            //        n = k.dynamicShareUrlRoot + "share.jsp?fsl=" + k.fsl + "&aid=" + g_config.aid + "&id=" + g_config.gameId + "&" + o
            //    } else {
            //        n = k.dynamicShareUrlRoot + g_config.aid + "/" + g_config.gameId + "/share.jsp?fsl=" + k.fsl + "&" + o
            //    }
            //}
            //p = a.setUrlArg(p, ["otherplayer", g_config.openid]);
            //n = a.setUrlArg(n, ["otherplayer", g_config.openid]);
            //p = a.setUrlArg(p, ["shareDeep", k.shareDeep << 1]);
            //n = a.setUrlArg(n, ["shareDeep", k.shareDeep << 1]);
            //a.tlog(k.openStrongAttention);
            //if (k.openStrongAttention) {
            //    p = a.setUrlArg(p, ["isOfficialLianjie", "false"]);
            //    n = a.setUrlArg(n, ["isOfficialLianjie", "false"])
            //}
            //if (p === a.wxConfigArg.url && a.wxConfigArg.desc === s && a.wxConfigArg.callBack === r && a.wxConfigArg.pyqUrl === n) {
            //    return
            //}
            wx.ready(function () {
                var u = k.shareImg;
                if (!/^http:/.test(u) && /^\/\//.test(u)) {
                    u = "http:" + u
                }
                try {
                    wx.onMenuShareAppMessage({
                        title: a.decodeHtml(k.activeName),
                        desc: s,
                        link: p,
                        imgUrl: u,
                        type: "link",
                        success: function () {
                            $.ajax({
                                type: "post",
                                url: '/Weixin/GameActivity/UpdateLuckDrawCount',
                                data: { gameActivityId: g_config.gameId, openid: g_config.openid}, 
                                success: function (v) { 
                                    g(v);
                                    r && r(v)
                                }
                            })
                        },
                        cancel: function () { }
                    });
                    wx.onMenuShareTimeline({
                        title: s,
                        link: n,
                        imgUrl: u,
                        success: function (v) {
                            $.ajax({
                                type: "post",
                                url: '/Weixin/GameActivity/UpdateLuckDrawCount',
                                data: { gameActivityId: g_config.gameId, openid: g_config.openid },
                                success: function (w) { 
                                    g(w);
                                    r && r(w)
                                }
                            })
                        },
                        cancel: function (v) { }
                    });
                    a.tlog("当前分享朋友链接:", p);
                    a.tlog("当前分享朋友圈链接:", n)
                } catch (t) {
                    alert(t.message)
                }
            });
            a.wxConfigArg.desc = s;
            a.wxConfigArg.url = p;
            a.wxConfigArg.callBack = r;
            a.wxConfigArg.pyqUrl = n
        }
        function h() {
            var l = Array.prototype.slice.call(arguments);
            l.unshift(a.wxConfigArg.url);
            j(a.wxConfigArg.desc, a.setUrlArg.apply(a, l), a.wxConfigArg.callBack)
        }
        function f() {
            var l = Array.prototype.slice.call(arguments);
            l.unshift(a.wxConfigArg.url);
            j(a.wxConfigArg.desc, a.removeUrlArg.apply(a, l), a.wxConfigArg.callBack)
        }
        function e(l) {
            l = l.replace(/\u200b/g, "").replace(/&nbsp;/g, " ").replace(/&lt;/g, "<").replace(/&gt;/g, ">");
            return l.replace(/<span class=["']tag["'] contenteditable=["']?false["']?>(.+?)<\/span>/g,
            function (n, m) {
                switch (m) {
                    case "玩家名称":
                        if (g_config.style == 48) {
                            return a.hykjUserName
                        } else {
                            if (a.captainUserName) {
                                return a.captainUserName
                            } else {
                                return g_config.nickname
                            }
                        }
                    case "游戏成绩":
                        if (g_config.style == 49) {
                            return parseInt(a.currentScore) + g_config.scoreUnit
                        } else {
                            return g_config.scoreType ? a.currentScore : parseInt(a.currentScore)
                        }
                    case "游戏排名":
                        return a.currentRank;
                    case "奖品名称":
                        return a.currentAward;
                    case "奖项等级":
                        return a.currentAwardStyle;
                    case "收集的字":
                        return '"' + a.ccndrmTitle + '"'
                }
            })
        }
        function c(l, m) {
            if (_manage) {
                return
            }
            typeof l === "undefined" && (l = a.wxConfigArg.url);
            typeof m === "undefined" && (m = a.wxConfigArg.callBack);
            if (g_config.drawType != 3) {
                if (g_config.style == 49) {
                    j(e(k.wxShareText_def), l, m);
                    return
                }
                if (a.currentAward) {
                    j(e(k.wxShareText_award), l, m)
                } else {
                    if (a.currentRank) {
                        j(e(k.wxShareText_rank), l, m)
                    } else {
                        j(e(k.wxShareText_def), l, m)
                    }
                }
            }
        }
        function g(n) {
            var l = n;
            if (l.status == 200) {
                a.statusMsg("分享成功,恭喜您获得" + k.addDrawTime + "次抽奖机会");
                $(".dayDrawCount").text(parseInt($(".dayDrawCount").first().text()) + 1);
                g_config.showHelpGuide = false;
                qdydjAddText($("#grade .specil"), k.addDrawTime);
                drawTimesLimit += k.addDrawTime;
                if (g_config.drawType != 0 && a.resulePoup.resuleArg) {
                    a.resulePoup.resuleArg.count += k.addDrawTime
                }
      
                //if (g_config.style == 200) {
                //    var m = $(".gameScoreUnit").eq(0).text();
                //    console.log("m=" + m);
                //    console.log(" k.addDrawTime=" + k.addDrawTime);
                //    qdydjAddText($("#grade .specil"), k.addDrawTime);
                //    a.statusMsg("分享成功,获得" + k.addDrawTime + m)
                //}
            } 
            $("#helpGuideBox").hide()
        }
        function i(n) {
            if (_manage) {
                return
            }
            var l = ["一", "二", "三", "四", "五", "六", "七", "八"];
            var q = n.haveAward;
            if (q) {
                var m = n.plInfo;
                a.currentAward = m.award;
                var o = m.awardLevel;
                if (o != 900 && o > 0) {
                    if (k.nameList && k.nameList.length >= o) {
                        a.currentAwardStyle = k.nameList[o - 1]
                    } else {
                        a.currentAwardStyle = l[o - 1]
                    }
                } else {
                    a.currentAwardStyle = n.comfortAwardStyle
                }
            }
            var p = n.bestRankInfo;
            a.currentRank = p.rank;
            a.currentScore = p.score;
            c()
        }
        var d = {};
        d.handleShareAward = g;
        d.setWxShareByStatus = c;
        d.setShareText = e;
        d.removeWxShareUrlArg = f;
        d.setWxShareUrlArg = h;
        d.setWxShare = j;
        d.setWxShareArg = i;
        a.wxConfig = d
    };
    a.addJoinGameBehavior = function () {
        console.log('[需设置]添加参加游戏行为成功');
        //$.ajax({
        //    url: g_config.ajaxUrl + "hdgame_h.jsp?cmd=joinGameBehavior",
        //    type: "post",
        //    data: {
        //        gameId: g_config.gameId,
        //        openid: g_config.openid,
        //        shareDeep: g_config.shareDeep
        //    },
        //    success: function (c) { }
        //})
    };
    a.setGameEnd = function () {
        var e = $(".bottomSkill");
        var d = $(window).height() / $(window).width() < 1.575;
        var c = d ? $(window).width() * 1.575 : $(window).height();
        $(".home").html("");
        $(".home").append(e);
        $(".home").append('<p style="font-size:0.9rem; color:#e7e7e7; text-align: center; padding-top:10rem; line-height: 1.3rem">活动已结束<br>请期待下次活动</p>');
        $(".home").css({
            height: c,
            background: "#424242",
            width: "100%",
            position: "fixed",
            "z-index": "500"
        });
        document.title = "活动已结束";
        $(".gameInfoBox").hide();
        $(".showAwardBox").hide();
        $(".homeBtnBox").show();
        $("#informBtn").hide();
        hg.sound.allowPlay = false;
        hg.sound.pauseAll()
    };
    a.initJsFoot = function (d) {
        $(function () {
            a.sortRuleBox.init(d.rulesortstr); 
            var l = a.decodeHtml(d.hostName);
            var g = a.decodeHtml(d.hostLink).replace("http://", "");
            var j = a.decodeHtml(d.menuLink).replace("http://", "");
            var f = $(".menuName");
            if (d.fromFav && g_config.haveAward) {
                $("#resulte-gift-showMyAward").data("openCode", d.fromFav);
                showAwardDetail4Draw("fromFav")
            }
            if (!_manage && d.openAwardExp) {
                var h = g_config.aid + "|" + g_config.gameId + "|" + g_config.openid;
                if (!a.getLocalStorage(h)) {
                    a.setLocalStorage(h, "-");
                    showRule()
                }
            }
            $("#showRankNum").text(rankShowNum);
            $(".hostName").text(l);
            $("#phoneInput,#nameInput,#addressInput").click(function () {
                $("#spxdPage").addClass("spxdPageHide")
            });
            $("#userSubmitBtn").on("touchstart",
            function () {
                if (!$(this).hasClass("submit")) {
                    return
                }
                $("#awardContactInfo").show();
                var p = $.trim($("#nameInput").val());
                var o = $("#phoneInput").val().replace(/\s/g, "");
                var n = $.trim($("#addressInput").val());
                function s(t) {
                    if ((/^1[34578]\d{9}$/.test(t) || /^([0-9]{3,4}-)?[0-9]{7,8}$/.test(t))) {
                        return true
                    }
                    return false
                }
                if ($("#nameInput").is(":visible")) {
                    $("#awardContactInfo .contactName").show();
                    if (p.length == 0) {
                        a.showMsgToast("请输入姓名", 2000, "msg-toastBig");
                        return
                    }
                    if (a.checkCharacterLen(10, $("#nameInput"))) {
                        a.showMsgToast("姓名不能超过5个中文或10个英文字母", 2000, "msg-toastBig");
                        return
                    }
                }
                if ($("#phoneInput").is(":visible")) {
                    var q = /^[0-9]*$/;
                    $("#awardContactInfo .contactPhone").show();
                    if (!s(o)) {
                        a.showMsgToast("请输入正确的号码", 2000, "msg-toastBig");
                        return
                    }
                }
                if ($("#addressInput").is(":visible")) {
                    $("#awardContactInfo .contactAddress").show();
                    if (n.length == 0) {
                        a.showMsgToast("请输入联系地址", 2000, "msg-toastBig");
                        return
                    }
                    if (a.checkCharacterLen(200, $("#addressInput"))) {
                        a.showMsgToast("联系地址不能超过100个中文或200个英文字母", 2000, "msg-toastBig");
                        return
                    }
                }
                p = p || "";
                o = o || "";
                n = n || "";
                g_config.awardUsername = p;
                g_config.awardPhone = o;
                g_config.awardAddress = n;
                if (o) {
                    a.logDog(1000113)
                }
                var r = $(".codeInfoBox.checked").index();
                if (r == -1) {
                    r = 0
                }
                $(".ajaxLoadBg").show();
                $(".ajaxLoadBar").addClass("ajaxLoad");
                var m = {
                    ausername: p,
                    aphone: o,
                    aadress: n,
                    headimgurl: g_config.headimgurl,
                };
                $.ajax({
                    type: "post",
                    url: g_config.ajaxUrl + "hdgame_h.jsp?cmd=setPhone&aid=" + g_config.aid + "&gameId=" + g_config.gameId + "&openid=" + g_config.openid + "&name=" + a.encodeUrl(g_config.nickname) + "&userInfo=" + a.encodeUrl($.toJSON(m)),
                    error: function () {
                        a.otherAjaxComplete();
                        $("#spxdPage").removeClass("spxdPageHide")
                    },
                    success: function (v) {
                        $("#spxdPage").removeClass("spxdPageHide");
                        var B = $.parseJSON(v);
                        a.otherAjaxComplete();
                        $("#awardUserInfoBg").hide();
                        if (B.success) {
                            var x = B.codeInfoList;
                            g_config.playerId = B.id;
                            for (var w = 0; w < x.length; w++) {
                                var z = x[w];
                                var t = z.code;
                                var A = z.awardCode;
                                if (w == r) {
                                    $("#awardDetailBox").find(".code").text(A);
                                    $("#awardDetailBox").find(".code").attr("code", t)
                                }
                                var u = $("#codeInfo" + w).data("data");
                                u && (u.awardCode = A);
                                $("#codeInfo" + w).data("data", u)
                            }
                            console.log("lvox in");
                            $("#awardContactInfo .contactName span").text($("#nameInput").val());
                            $("#awardContactInfo .contactPhone span").text($("#phoneInput").val());
                            if (g_config.awardAddress) {
                                var y = a.checkTextLength(14, $("#addressInput").val(), true);
                                if (y.isOverflow) {
                                    $("#awardContactInfo .contactAddress span").text(y.returnValue + "...")
                                } else {
                                    $("#awardContactInfo .contactAddress span").text($("#addressInput").val())
                                }
                            }
                            a.aUserInfo.hide()
                        }
                    }
                })
            });
            $("#userCancelBtn").on("touchstart", function (event) {
                event.preventDefault();
                event.stopPropagation();
                $("#awardUserInfoBg").hide();
                $("#spxdPage").removeClass("spxdPageHide");
                $(".safetyBg").hide();
                if (gameType == 3) {
                    home()
                }
            });
            $(".resule-status-send").on("touchstart", function () {
                if (_manage) {
                    return
                }
                if (g_config.haveAward) {
                    a.changePoup(3)
                } else {
                    luckDraw()
                }
            });
            $("#helpGuideBox").on("touchend",function () {
                $("#helpGuideBox").hide()
            });
            $("#awardInfo").on("click", ".codeInfoBox", a.openAwardDetail);
            $("#resulte-gift-showMyAward").on("touchstart", showAwardDetail4Draw);
            $(".awardCloseIcon").on("touchstart",  function () {
                a.wxConfig.removeWxShareUrlArg("fromFav");
                $("#awardDetailBox").hide();
                $("#resule-gift-box,resule-status-box").hide();
                $(".gameBox").add(".home").removeClass("overflow-y-hidden");
                g_config.showSkillSup && $(".bottomSkill").show()
            });
            $(".codeImg").on("click",  function () {
                $(".codeDetailImgBox").show()
            });
            $(".codeDetailImgBox").click(function () {
                $(this).hide()
            });
            $(".awardCusText").on("touchstart",  function () {
                if (g_config.afterWxCard) {
                    $("#ticketDetailBox").show()
                } else {
                    var m = $("#awardCusTextInfo");
                    if (m.css("display") == "block") {
                        $(this).find(".awardDeailIcon").removeClass("awardIncoSlideDown");
                        $(this).find(".awardDeailIcon").addClass("awardIncoSlideUp")
                    } else {
                        $(this).find(".awardDeailIcon").removeClass("awardIncoSlideUp");
                        $(this).find(".awardDeailIcon").addClass("awardIncoSlideDown")
                    }
                    m.slideToggle()
                }
            });
            $(".ticketitle .closeBtn").on("touchstart",  function () {
                $("#ticketDetailBox").hide()
            });
            if (d.isHideFxts) {
                $(".resule-fxts").hide()
            }
            g_config.style != 9 && g_config.showSkillSup && a.logDog(1000028, 0);
            if (g_config.aid == 7171826 && g_config.style != 9 && g_config.showSkillSup) {
                a.logDog(1000062, 2)
            } else {
                if (g_config.aid == 8566249 && g_config.style != 9 && g_config.showSkillSup) {
                    a.logDog(1000067, 2)
                }
            }
            
            $(".homePoupMask").on("touchend",function (m) {
                m.preventDefault();
                m.stopPropagation();
                if (_manage) {
                    return
                }
                if ($(m.target).hasClass("homePoupMask")) {
                    $(this).hide()
                }
            });
            $(".menuBtnBox").on("touchend",  function () {
                a.logDog(1000012)
            });
            if (d.showJoinNum) {
                $("#joinNumLine").show()
            } else {
                $("#joinNumLine").hide()
            }
            if (d.showRedDot) {
                $("#Award_Round_Dot").css("display", "inline-block")
            }
            if (d.showMDRedDot) {
                $("#Mingdan_Round_Dot").css("display", "inline-block")
            }
            if (d.showAwardBtn) {
                $("#myAwardBtn").show()
            }
            if (d.isSelAwardLine) {
                $("#selfAwardLine").show();
                $("#awardLineBox").hide()
            } else {
                $("#awardLineBox").show();
                $("#selfAwardLine").hide()
            } 
            if (d.menuStyle == 1) {
                $(".menuBtnBox").hide()
            } else {
                if (d.menuStyle == 2) {
                    if ($.trim(j).length == 0) {
                        f.css("text-decoration", "none")
                    } else {
                        f.attr("href", a.decodeHtml(d.menuLink))
                    }
                } else {
                    if (d.menuStyle == 3) {
                        (function () {
                            var m = $("#attentionMask");
                            if (a.decodeHtml(d.menuLink) === "") {
                                $("#QRImg").remove()
                            }
                            $(".menuBtnBox").on("touchend",
                            function () {
                                m.show()
                            })
                        })()
                    }
                }
            }
            if ($.trim(g).length == 0) {
                $(".hostName").css("text-decoration", "none");
                $("a.hostName").attr("href", "#")
            }
            if (!isLimitDraw) {
                $(".totalDraw").hide()
            } else {
                $(".totalDraw").show();
                $(".dayDraw").hide();
                if ((drawTimesLimit - count) < (drawTotalLimit - totalCount)) {
                    $(".dayDraw4Total").show()
                }
            }
            if ($("#awardExplain").text().length == 0) {
                $("#awardExplain_h").hide()
            }
            $("a.hostName").click(function () {
                a.logDog(1000013)
            });
            if (skillSupportType == 1) {
                $(".skillLine").css("padding", "0");
                $(".skillCont").hide()
            } else {
                if (skillSupportType == 3) {
                    $(".skillName").text(skillName);
                    $(".skillName").attr("href", skillLink)
                }
            }  
            if (hg.sound.list && hg.sound.list.length > 0) {
                $(".home").add(".gameBgBox").append('<div class="' + (_manage ? "" : "soundIconOff ") + "soundIcon" + (hg.sound.list[0].optFlag != 1 ? "" : " soundIconHide") + '" style="z-index:90"></div>');
                $('.home .soundIcon:not(".soundIconPlay")').css({
                    left: d.soundIcon_l,
                    top: d.soundIcon_t
                });
                if (d.drawType == 1 || g_config.style == 4) {
                    $(".home .soundIcon").hide()
                }
            }
            if (!_manage) {
                $(".gameBgBox .soundIcon").css("z-index", "100");
                $(".soundIcon").addClass("soundIconPlay");
                var k = "soundPause|" + g_config.aid + "|" + g_config.gameId + "|" + g_config.openid;
                $(".soundIcon").on("touchstart",
                function () {
                    var m = $(".soundIcon");
                    if (!m.hasClass("soundIconOff")) {
                        hg.sound.allowPlay = false;
                        hg.sound.pauseAll();
                        a.setLocalStorage(k, "-")
                    } else {
                        hg.sound.allowPlay = true;
                        hg.sound.readyPlay(0, 0, "loop");
                        a.setLocalStorage(k, "")
                    }
                });
                if (a.getLocalStorage(k)) {
                    hg.sound.allowPlay = false;
                    hg.sound.pauseAll()
                }
                $("#ruleImg").addClass("ruleImgAnimate");
                $("#startBtnImg,.startBtnImg").on("touchend", function (m) {
                    if (!startBtnAjax.call(this, m)) {
                        return
                    }
                    hg.sound.play("startButton");
                    if (typeof hg.sound.cache[0] !== "undefined" && typeof hg.sound.cache[0].playing !== "undefined" && !hg.sound.cache[0].playing && g_config.style != 51 && g_config.style != 9 && g_config.style != 48) {
                        hg.sound.readyPlay(0, 0, "loop")
                    }
                });
                hg.assets.onload(startBtnDelay)
            } 
        });
        function c() {
            $(".one").hide().siblings().show();
            $("#resule-status-box").show();
            $("#resule-status-head p").show();
            $(".resuleBox").show();
            $(".resule-bgLight").hide();
            $("#resule-status-ribbon").hide();
            $(".little-PK").show().siblings().hide();
            $(".resule-status-again").hide();
            $(".resule-status-home").hide();
            $(".resule-status-rightNow").show().siblings().hide();
            $(".resule-status-firstPage").show()
        }
        function e() {
            $("#resule-status-box").hide();
            $("#resule-status-head p").hide();
            $(".resuleBox").hide();
            $(".resule-bgLight").show();
            $("#resule-status-ribbon").show();
            $(".little-PK").hide().siblings().show();
            $(".resule-status-again").show();
            $(".resule-status-home").show();
            $(".resule-status-rightNow").hide().siblings().show();
            $(".one").show().siblings().hide();
            $("#resule-status-ribbon").show();
            $(".resule-status-firstPage").hide()
        }
        $(function () {
            $(".one").show();
            $(".resule-status-firstPage").hide();
            if (g_config.drawType == 1 && !_manage && otherPlayerInfo && typeof otherPlayerInfo.headimgurl !== "undefined" && typeof otherPlayerInfo.name !== "undefined" && typeof otherPlayerInfo.score !== "undefined" && typeof otherPlayerInfo.rank !== "undefined" && typeof otherPlayerInfo.award !== "undefined" && false) {
                var f = "PKrecord|" + otherPlayerInfo.aid + "|" + otherPlayerInfo.gameId + "|" + otherPlayerInfo.openid;
                if (!a.getLocalStorage(f)) {
                    if (otherPlayerInfo.award != "") {
                        $(".WhetherAward").text("获得" + otherPlayerInfo.award).show()
                    }
                    $(".PKner-A img").attr("src", otherPlayerInfo.headimgurl);
                    $(".userA-name").text(otherPlayerInfo.name);
                    $(".fighter-B").text(otherPlayerInfo.name);
                    $(".othergrade .resuleArg").text(otherPlayerInfo.score);
                    $("#rankB .resuleArg").text(otherPlayerInfo.rank);
                    c();
                    a.setLocalStorage(f, "-")
                }
            }
            $(".winAWard a").on("touchend",function () {
                showRule()
            });
            $(".resule-status-rightNow").on("touchend",function () {
                hg.on("startGame",function () {
                    e();
                    hg.off("startGame", arguments.callee)
                });
                $("#startBtnImg").trigger("touchstart");
                $("#startBtnImg").trigger("touchend")
            });
            $(".resule-status-firstPage").on("touchend",  function () {
                e()
            });
            function h(i) {
                return function (m, l) {
                    var k, j;
                    if (typeof m === "object" && typeof l === "object" && m && l) {
                        k = m[i];
                        j = l[i];
                        if (k === j) {
                            return 0
                        }
                        if (typeof k === typeof j) {
                            return k < j ? -1 : 1
                        }
                        return typeof k < typeof j ? -1 : 1
                    }
                }
            }
            //if (!_manage && playerAwardList.length > 3) {
            //    $(".home,.showAwardBoxPage").append('<div class="showAwardBox"><ul class="awardInfoList"><li></li></ul></div>');
            //    var g = "";
            //    $.each(playerAwardList,  function (i, j) {
            //        g += '<div><img src="' + JSON.parse(this.info).headimgurl + '"><span class="winner">' + this.name + '<span>获得了<span class="award">' + this.award + "</span></div>"
            //    });
            //    $(".awardInfoList li").append(g)
            //}
            //if (!_manage) {
            //    $(".showAwardBox").awardSlide({
            //        margin_right: "0.8rem",
            //        speed: 15
            //    });
            //    if (d.dangerType == 0) {
            //        if (g_config.status == 3) {
            //            a.setGameEnd()
            //        }
            //    }
            //}
            //setTimeout(function () {
            //    var k = $(window).height() / $(window).width() < 1.575;
            //    var i = k ? $(window).width() * 1.575 : $(window).height();
            //    var j = g_config.showSkillSup ? 1 : 0;
            //    if (_manage) {
            //        $(".showAwardBox").css("top", (i - $(".bottomSkill").outerHeight() * j - $(".showAwardBox").outerHeight() - 2) / g_rem + "rem")
            //    } else {
            //        $(".showAwardBox").css("top", (i - $(".bottomSkill").outerHeight() * j - $(".showAwardBox").outerHeight()) / g_rem + "rem")
            //    }
            //    if (g_config.showSkillSup) {
            //        $(".showAwardBox").css("top", (i - $(".bottomSkill").outerHeight() * j - $(".showAwardBox").outerHeight() - 2) / g_rem + "rem")
            //    }
            //}, 50);
            //if (!g_config.showSlide) {
            //    $(".showAwardBox").hide()
            //} else {
            //    if (!_manage) {
            //        $(".showAwardBox").addClass("footerBox")
            //    }
            //}
        })
    };
    a.setStartBtnHeight = function (g, e) {
        var o = $(window).height();
        if (o === 0) {
            console.log("window高度为零!");
            setTimeout(function () {
                a.setStartBtnHeight(g, e)
            },
            20);
            return
        }
        typeof g === "undefined" && (g = g_config.showSlide);
        typeof e === "undefined" && (e = g_config.showSkillSup);
        var f = g ? 1 : 0;
        var h = e ? 1 : 0;
        var d = $(".bottomSkill").outerHeight() * h + $(".showAwardBox").outerHeight() * f;
        var p = $("#startBtnImg").parent();
        var m = $("#ruleImg");
        var n = $("#joinNumLine");
        var r = $("#drawInfo");
        var s = $(".homeBtnBox");
        var q = $("#gameTips");
        var c = parseInt(p.css("top")) + p.outerHeight();
        var l = parseInt(n.css("top")) + n.outerHeight();
        var k = parseInt(r.css("top")) + r.outerHeight();
        var j = parseInt(m.css("top")) + m.outerHeight();
        var i = parseInt(q.css("top")) + q.outerHeight();
        if (p.length > 0 && c > o - d) {
            p.css("top", (o - d - p.outerHeight() - 5) / g_rem + "rem")
        }
        if (m.length > 0 && j > o - d) {
            m.css("top", (o - d - m.outerHeight() - 5) / g_rem + "rem")
        }
        if (n.length > 0 && l > o - d) {
            n.css("top", (o - d - n.outerHeight() - 5) / g_rem + "rem")
        }
        if (r.length > 0 && k > o - d) {
            r.css("top", (o - d - r.outerHeight() - 5) / g_rem + "rem")
        }
        if (s.length > 0) {
            s.css("bottom", (d + 8) / g_rem + "rem")
        }
        if (q.length > 0 && i > o - d) {
            q.css("top", (o - d - q.outerHeight() - 5) / g_rem + "rem")
        }
        $("#limitRange").css("height", ($(window).height() - d) / g_rem + "rem")
    };
    a.getSrc = function (c) {
        return c.replace("*_resRoot*", _resRoot)
    };
    a.setCookie = function (d, e, c) {
        var f = new Date();
        f.setDate(f.getDate() + c);
        document.cookie = d + "=" + escape(e) + ((c == null) ? "" : ";expires=" + f.toGMTString())
    };
    a.getCookie = function (c) {
        if (document.cookie.length > 0) {
            c_start = document.cookie.indexOf(c + "=");
            if (c_start != -1) {
                c_start = c_start + c.length + 1;
                c_end = document.cookie.indexOf(";", c_start);
                if (c_end == -1) {
                    c_end = document.cookie.length
                }
                return unescape(document.cookie.substring(c_start, c_end))
            }
        }
        return ""
    };
    a.setLocalStorage = function (d, e, c) {
        if (!localStorage) {
            if (c) {
                a.setCookie(d, e, c)
            }
            a.tlog("不支持localStorage");
            return
        }
        localStorage.setItem(d, e)
    };
    a.getLocalStorage = function (d, c) {
        if (!localStorage) {
            if (c) {
                return a.getCookie(d)
            }
            a.tlog("不支持localStorage");
            return ""
        }
        return localStorage.getItem(d)
    };
    a.refresh = function () {
        window.location.reload()
    };
    a.noLoadingRefresh = function () {
        window.location.href = document.URL.indexOf("noLoading") >= 0 ? document.URL : (document.URL + (document.URL.indexOf("?") >= 0 ? "&" : "?") + "noLoading=fff")
    };
    a.isIPhone = function () {
        return window.navigator.userAgent.indexOf("iPhone") !== -1
    };
    a.IsPC = function () {
        //var c = navigator.userAgent;
        //var f = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
        //var d = true;
        //for (var e = 0; e < f.length; e++) {
        //    if (c.indexOf(f[e]) > 0) {
        //        d = false;
        //        break
        //    }
        //}
        //return d
        return false;
    };
    a.getType = function (c) {
        return Object.prototype.toString.call(c).match(/\[object\s(\w+)]/)[1].toLowerCase()
    };
    a.changeTimeLimit = function (c) {
        if (!c || c == "[8]") {
            return "周一至周日"
        }
        var f = $.parseJSON(c);
        var g = "";
        for (var e = 0; e < f.length; e++) {
            var h = e,
            d = e;
            while (f[d + 1] == (f[d] + 1)) {
                d++
            }
            if (h == d) {
                g = g + (g ? "、" : "") + b(f[h])
            } else {
                g = g + (g ? "、" : "") + b(f[h]) + "至" + b(f[d])
            }
            e = d
        }
        return g
    };
    function b(c) {
        switch (c) {
            case 1:
                return "周一";
            case 2:
                return "周二";
            case 3:
                return "周三";
            case 4:
                return "周四";
            case 5:
                return "周五";
            case 6:
                return "周六";
            case 7:
                return "周日"
        }
        return ""
    }
    a.jointUrlArg = function (d, c) {
        if (c) {
            return d + (d.indexOf("?") >= 0 ? "&" : "?") + c
        } else {
            return d
        }
    };
    a.setUrlArg = function () {
        if (arguments.length < 2) {
            return
        }
        var d = arguments[0],
        g = Array.prototype.slice.call(arguments),
        c = [d],
        h = "";
        for (var e = 1; e < g.length; e++) {
            var f = g[e];
            if (a.getType(f) === "array") {
                c.push(f[0]);
                if (e > 1) {
                    h += "&"
                }
                h += (f[0] + "=" + f[1])
            }
        }
        d = a.removeUrlArg.apply(a, c);
        return a.jointUrlArg(d, h)
    };
    a.removeUrlArg = function () {
        var f = Array.prototype.slice.call(arguments),
        c = f.length;
        if (c < 2) {
            return
        }
        var d = f[0];
        var g = d.split(/[?|&]/);
        var e = g.filter(function (k, h) {
            if (h === 0) {
                return false
            }
            var l = k.split("=")[0];
            for (var j = 1; j < f.length; j++) {
                if (l === f[j]) {
                    f.splice(j, 1);
                    return false
                }
            }
            return true
        }).join("&");
        d = a.jointUrlArg(g[0], e);
        return d
    };
    a.shuffle = function (e) {
        var d = e.length;
        for (var g = 0; g < d - 1; g++) {
            var c = Math.floor(Math.random() * (d - g));
            var f = e[c];
            e[c] = e[d - g - 1];
            e[d - g - 1] = f
        }
        return e
    };
    a.logErr = function (d, f, c) {
        if (typeof a.logErr[d] == "undefined") {
            a.logErr[d] = 0
        } else {
            a.logErr[d]++
        }
        if (a.logErr[d] > (c || 2)) {
            return
        }
        $.ajax({
            type: "post",
            url: g_config.ajaxUrl + "logJsErr_h.jsp?cmd=jsErr",
            data: "msg=setErr-" + d + " aid=" + g_config.aid + " gameId=" + g_config.gameId + " openid=" + g_config.openid + " err:" + f
        })
    };
    a.logDog = function (d, c) {
        //if (g_config.testCMD.indexOf("oss") === -1 && (d !== 1000078 && _manage)) {
        //    return
        //}
        //$.ajax({
        //    type: "get",
        //    url: g_config.ajaxUrl + "log_h.jsp?cmd=dog&dogId=" + a.encodeUrl(d) + "&dogSrc=" + a.encodeUrl(c)
        //})
    };
    a.logObjDog = function (e, c, d) {
        //if (g_config.testCMD.indexOf("oss") === -1 && _manage) {
        //    return
        //}
        //$.ajax({
        //    type: "get",
        //    url: g_config.ajaxUrl + "log_h.jsp?cmd=dogObj&dogId=" + a.encodeUrl(e) + "&dogSrc=" + a.encodeUrl(c) + "&objId=" + a.encodeUrl(d),
        //})
    };
    a.bulletparam = {
        wxheadimg: true,
        loop: true,
        gutter: 34,
        autoplay: true,
        isScroll: true
    };
    a.initComment = function (c) {
        $.extend(a.bulletparam, c)
    }
})(HdGame);
$.fn.extend({
    addResizableFn: function (k, j) {
        c($(this), j, "resizable", k);
        return $(this)
    }
});
 
 
 

 

转载于:https://www.cnblogs.com/vali/p/6239223.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值