/* /webgame/home/js/init/PageWebGame.js */
var PageWebGame = window.PageWebGame || {};
var logoutCallBack, loginCallBack, resetLoginTop, setPopUcTopSpecial, UniLoginOver, closePopupCertifyCallback;
var getUinfoOnce = true;
var fcmChecked = false;
PageWebGame._userInit = function () {
    return UniLogin.getUid()
}, PageWebGame._setGgame = function () {
    function e(e) {
        var t = typeof e == "string" ? document.getElementById(e) : e, n = 0;
        while (t) {
            n += t.offsetTop, t = t.offsetParent
        }
        window.scrollTo(0, n)
    }

    return {init: e}
}, PageWebGame._setCookie = function (name, value) {
    var Days = 30;
    var exp = new Date();
    exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
    document.cookie = name + "=" + escape(value) + ";domain=4399.com;path=/;expires=" + exp.toGMTString()
}, PageWebGame._getCookie = function (name) {
    var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
    if (arr = document.cookie.match(reg)) {
        return unescape(arr[2])
    } else {
        return null
    }
}, PageWebGame._setPopUcTopSpecial = function () {
    return config._setPopUcTop
}, PageWebGame._resetPopLoginTop = function (e) {
    document.getElementById("loginDiv").style.top = e == "popup_login" ? config._setPopUcTop + "px" : config._resetPopTop + "px"
}, PageWebGame._JscrollAndTxtScroll = function () {
    config._appRealStatus == 1 && (typeof config._jScrollPane == "object" && $("#pane2").jScrollPane(config._jScrollPane), typeof config._txtScroll == "object" && (this.txtScroll || (this.txtScroll = txtScroll(config._txtScroll), this.txtScroll.init())))
}, PageWebGame._xfkInit = function () {
    var u = PageWebGame._userInit();
    if (config._xfkInitByUser && u) {
        PageWebGame._xfkInitByUser()
    }
    config._xfkInitByUser += 1;
    if (u) {
        if (typeof checkWebFlash == "function") {
            checkWebFlash()
        }
        $("#newsLoginBar .not_login").hide();
        $("#newsLoginBar .login").show();
        if ($.inArray(config._appShowStyle, [1]) >= 0) {
            $("#xfk").show()
        }
    }
}, PageWebGame._xfkInitByUser = function () {
    if (config._appRealStatus == 1) {
        var uid = PageWebGame._userInit();
        if (!uid) {
            return
        }
        var u = {
            id: uid,
            nick: UniLogin.getNick(),
            Qnick: UniLogin.getQnick(),
            ptusertype: UniLogin.getUserType(),
            name: function () {
                var self = u;
                return self.nick ? self.nick : (self.Qnick ? self.Qnick : UniLogin.getUname())
            },
            href: function () {
                var self = u;
                return "https://u.4399.com/profile/"
            },
            ptusertype_info: function () {
                var self = u;
                var patt1 = /(\w+).(\w+)_\w+/;
                var utype = self.ptusertype.match(patt1)[2];
                return config._appPtUserTypeArr[utype]
            }
        };
        var _html = '[_replace_name]';
        var _uhref = u.href();
        if (u.ptusertype_info() && u.ptusertype_info()['icon'] !== null) {
            _html = '<img src="[_replace_icon]">   [_replace_name]';
            _html = _html.replace(/\[_replace_icon\]/g, u.ptusertype_info()['icon'])
        }
        if (u.ptusertype_info() && u.ptusertype_info()['name'] !== null) {
            $("#newsLoginBar .username").attr("title", u.ptusertype_info()['name'])
        } else {
            $("#newsLoginBar .username").attr('title', "")
        }
        _html = _html.replace(/\[_replace_name\]/g, u.name);
        if (config._module == "wd" && config._wdType == 1) {
            _uhref = "app://openurls|" + _uhref;
        }
        $("#newsLoginBar .username").attr("href", _uhref).html(_html);
        $("#newsLoginBar .user_center").attr("href", _uhref);
        PageWebGame._xfkLastEnterServer();
        if (config._appVip) {
            PageWebGame._xfkVip()
        }
        if (config._showRole) {
            PageWebGame._checkServerStatus()
        }
    }
}, PageWebGame._xfkVip = function () {
    $.ajax({
        type: "get",
        url: config._appApi + "ajaxGetVip?_AJAX_=1&" + Math.random(),
        dataType: "json",
        success: function (rs) {
            if (rs.status == 1 && rs.data.level > 0) {
                var $kf = $("#xfkVip").find(".kf");
                var kf_url = $kf.attr("href");
                if (kf_url == "") {
                    $kf.attr("href", rs.data.ztUrl)
                }
                $("#xfkVip").show()
            } else {
                $("#xfkVip").hide()
            }
        }
    })
}, PageWebGame._xfkLastEnterServer = function () {
    var t = $("#lastEnterServer");
    t.html("");
    $.get(config._appApi + "ajaxGetLastEnter?_AJAX_=1&" + Math.random(), function (e) {
        var n = '<p class="nplay">&nbsp;&nbsp;您七天没有玩过该游戏了...</p>';
        if (e.status != 1) {
            var r = n
        } else {
            if (e.data) {
                var r = '<ul class="server_ul clearfix">';
                for (i in e.data) {
                    var obj = e.data[i];
                    r += "<li class=" + obj.ser_li_class + ">" + '<a href="javascript:;" ' + 'sid="' + obj.ser_sid + '" ' + 'onclick=" ' + obj.ser_onclick + '" ' + 'class="server_link s" ' + 'name="' + obj.ser_tj_name + '" ' + 'id="' + obj.ser_tj_name + '" ' + 'title="' + obj.ser_name + '">' + "<span>" + obj.ser_name + "</span>" + "</a>" + "</li>"
                }
                r += "</ul>"
            } else {
                var r = n
            }
        }
        t.html(r);
        if (typeof __newXfkUserJudge == "function") {
            __newXfkUserJudge()
        }
    }, "json")
}, PageWebGame._gameDoLogout = function () {
    if(typeof(PageWebApiSdk)!=="undefined" &&  PageWebApiSdk.data.fcmIframe){
        $('#loginCertify').hide();
        PageWebApiSdk.data.fcmIframe.style.cssText += ";display:none";
        PageWebApiSdk.data.fcmDialog.style.cssText += ";display:none";
    }
    $("#xfkVip").hide();
    $("#newsLoginBar .login").hide();
    $("#newsLoginBar .not_login").show();
    $("#lastEnterServer ul").html("<p class='nplay'>&nbsp;&nbsp;您七天没有玩过该游戏了...</p>");
    if (config._newwin == "") {
        $("#GameFrame").parent("div").hide();
        $("#GameFrame").attr("src", "")
    }
    if ($.inArray(config._appShowStyle, [1, 2, 3]) >= 0) {
        config._xfkInit && $("#xfk").hide();
        UniLogin.showPopupLogin("", "", !0)
    } else {
        config._xfkInit && $("#xfk").show()
    }
    if (document.getElementById("ApiIframeEmpty") != null && config._appApiIframeEmpty) {
        document.getElementById("ApiIframeEmpty").setAttribute("src", " ")
    }
    if (typeof config._atonce !== "undefined") {
        delete config._atonce
    }
    typeof myPerson != "undefined" && myPerson.init();
    config._isNewXfk && __newXfkLogout();
    fcmChecked = false;
    getUinfoOnce = true;
    return;
}, PageWebGame._getUinfo = function () {
    var def = $.Deferred();
    if (getUinfoOnce == true) {
        getUinfoOnce = false;
        return $.ajax({
            type: "get",
            url: config._homeApi + "realName-ajaxGetUinfo?_AJAX_=1&" + Math.random(),
            dataType: "json",
            async: false,
            success: function (rs) {
                if (rs.status == 1) {
                    config._uInfo = rs.data;
                    def.resolve();
                }
                getUinfoOnce = true;
            }
        })
    }
}, PageWebGame._gameDoLogin = function () {
    if (document.getElementById("ApiIframeEmpty") != null && config._appApiIframeEmpty) {
        document.getElementById("ApiIframeEmpty").setAttribute("src", "http://api.my.4399.com/" + config._appId + "/empty")
    }
    config._xfkInit && PageWebGame._xfkInit();
    typeof myPerson != "undefined" && myPerson.init();
    PageWebGame._atonceGame();
    PageWebGame._JscrollAndTxtScroll();
    if (!fcmChecked && typeof PageWebApiSdk.checkFcm == 'function') {
        PageWebApiSdk.checkFcm();
    }
}, PageWebGame._addBookMark = function () {
    var e = config._appName.indexOf("4399") ? "4399" + config._appName : config._appName.substring(4),
        t = config._appName + "，" + e + "，4399游戏社区, my.4399.com", n = config._appUrl;
    try {
        window.external.addFavorite(n, t)
    } catch (r) {
        try {
            window.sidebar.addPanel(t, n, "")
        } catch (r) {
            alert("加入收藏失败，请使用Ctrl+D进行添加")
        }
    }
}, PageWebGame._shoucanghe = function (e) {
    if (config._appRealStatus == 1) {
        $(".m_sstore a").hide(), $(".m_sstore").show(), GPRP.Collection({
            gid: e,
            sid: 0,
            showDefaultPop: !1,
            target: [{
                id: "j-gprp_addColllection", oncollected: function (e, t) {
                    $(".m_sstore .add_bstore").hide(), t == 0 ? ($(".m_sstore .store_tip").fadeIn(200), setTimeout(function () {
                        $(".m_sstore .store_tip").fadeOut(500), $(".m_sstore .my_bstore").fadeIn(500)
                    }, 1000)) : $(".m_sstore .my_bstore").show()
                }, notcollected: function (e) {
                    $(".m_sstore .add_bstore").show()
                }
            }]
        })
    }
}, PageWebGame._setJoinSid = function () {
    if (document.getElementById("1_1") != null) {
        var recomSid = document.getElementById("1_1").getAttribute("sid");
        if (recomSid) {
            if (config._csid) {
                recomSid = Number(recomSid) - config._csid
            }
            document.getElementById("join_sid").value = recomSid
        }
    }
}, PageWebGame._checkServers = function () {
    config._task = {};
    for (objI in config._server) {
        if (config._server[objI].status !== 1) {
            var objId = config._server[objI].obj;
            var obj = $("#" + objId);
            obj.parent("li").attr("class", config._server[objI].ser_li_class);
            var lastObj = $("#lastEnterServer ul li,#forecastServer ul li").find("a[sid=" + objI + "]");
            if (lastObj.length > 0) {
                lastObj.parent("li").attr("class", config._server[objI].ser_li_class)
            }
        }
        if (config._server[objI].open != 0) {
            config._task[objI] = setTimeout("PageWebGame._openGame(" + objI + ");", config._server[objI].open * 1000)
        }
    }
}, PageWebGame._switchServers = function () {
    var id = "j_server_num";
    if (document.getElementById(id) != null) {
        $("#" + id + " li").click(function () {
            if ($(this).hasClass("cur")) {
                return false
            }
            var index = $(this).index();
            $(this).addClass("cur");
            $(this).siblings().removeClass("cur");
            $("#pane2 .server_ul").eq(index).show().siblings().hide();
            PageWebGame._JscrollAndTxtScroll()
        })
    }
}, PageWebGame._checkServerStatus = function () {
    var now = (new Date()).valueOf();
    if (typeof(config._lasttime) != "undefined" && !config._showRole) {
        var interval = (now - config._lasttime) / 1000;
        if (interval < 10) {
            return
        }
    }
    config._lasttime = now;
    var checkNet = 0;
    if (config._network) {
        checkNet = 1
    }
    var multitype = typeof(config._multiCfg) != "undefined" ? config._multiCfg.type : "";
    $.ajax({
        type: "get",
        url: config._appApi + "ajaxGetSerInfo-checkNet-" + checkNet + "-multiType-" + multitype + "?_AJAX_=1&" + Math.random(),
        dataType: "json",
        async: false,
        success: function (rs) {
            if (typeof config._task != "undefined") {
                for (i in config._task) {
                    clearTimeout(config._task[i])
                }
            }
            if (typeof rs == "object") {
                config._server = rs.data;
                join._status = rs.data;
                PageWebGame._checkServers()
            }
        }
    })
}, PageWebGame._openGame = function (sid) {
    var objId = config._server[sid].obj;
    var obj = $("#" + objId);
    if (typeof(obj) == "object") {
        if (typeof(config._server[sid]) != "undefined") {
            PageWebGame._checkServerStatus()
        }
    }
}, PageWebGame._checkLoginStatus = function () {
    var u = PageWebGame._userInit();
    if (typeof loginStatus !== "undefined") {
        clearTimeout(loginStatus)
    }
    if (u !== config._lastU) {
        if (u) {
            config._dologin && loginCallBack()
        } else {
            config._dologout && logoutCallBack()
        }
        config._lastU = u
    }
    loginStatus = setTimeout(arguments.callee, 1000);
    return
}, PageWebGame._uniLoginOver = function () {
    var u = PageWebGame._userInit();
    config._xfkInitByUser = u ? 0 : 1;
    config._lastU = u;
    typeof myPerson != "undefined" && u && myPerson.init();
    if (config._appRealStatus == 1 && config._xfkInit) {
        PageWebGame._JscrollAndTxtScroll();
        PageWebGame._switchServers();
        PageWebGame._checkServers();
        PageWebGame._setJoinSid();
        join.init()
    }
    if ($.inArray(config._appShowStyle, [1, 3]) >= 0 && config._appRealStatus == 1 && !u) {
        UniLogin.showPopupLogin("", "", true)
    }
    if (typeof PageWebApiSdk.checkFcm == 'function' && u > 0) {
        fcmChecked = true;
        PageWebApiSdk.checkFcm();
    }
}, PageWebGame._atonceGame = function () {
    if (typeof config._atonce !== "undefined") {
        setTimeout(function () {
            if (config._newwin == "_blank") {
                join._blank = "_self"
            }
            $(".server_all .server_ul li").find("a[sid=" + config._atonce + "]").trigger("click");
            join._blank = config._newwin
        }, 200)
    }
}, PageWebGame._downLineGame = function () {
    ue.dialog({
        lock: true, content: baidu.template("gdownLine", {}), zIndex: 201199, force: true, init: function () {
            var _this = this;
            this.obj.find(".j-know").bind("click", function () {
                if ($(".j-check").attr("checked") == "checked") {
                    PageWebGame._setCookie("gb_box_" + config._appId, 1)
                }
                _this.close();
                return false
            })
        }
    })
}, PageWebGame._configInit = function (e) {
    config._setPopUcTop = typeof e._setPopUcTop != "undefined" ? e._setPopUcTop : !1, config._resetPopTop = typeof e._resetPopTop != "undefined" ? e._resetPopTop : !1, config._jScrollPane = typeof e._jScrollPane != "undefined" ? e._jScrollPane : {
        showArrows: !0,
        scrollbarWidth: "17"
    }, config._txtScroll = typeof e._txtScroll != "undefined" ? e._txtScroll : {
        id: "txtScroll",
        tag: "li",
        step: 3,
        dir: "up",
        speed: 30,
        delay: 3000
    },
    config._dologin && (loginCallBack = PageWebGame._gameDoLogin),
    config._dologout && (logoutCallBack = PageWebGame._gameDoLogout),
    config._setgameid && PageWebGame._setGgame.init(config._setgameid),
    config._shoucangheGid && PageWebGame._shoucanghe(config._shoucangheGid),
    config._setPopUcTop && (setPopUcTopSpecial = PageWebGame._setPopUcTopSpecial,
    config._resetPopTop && (resetLoginTop = PageWebGame._resetPopLoginTop));
    closePopupCertifyCallback = function (code) {
        window.log && console.log("closePopupCertifyCallback");
        if (code == 40000) {
            UniLogin.logout();
        } else if (code == 10000) {
            setTimeout(function () {
                PageWebGame._getUinfo();
                if (typeof($('#fcmIframe')) !== 'undefined') {
                    $('#fcmIframe').hide();
                }
            }, 500)
        } else {
            setTimeout(function () {
                PageWebGame._getUinfo();
                fcmChecked = true;
                if (typeof PageWebApiSdk.touristMode == 'function') {
                    PageWebApiSdk.touristMode();
                }
            }, 500)
        }
    }
    config._csid = typeof e._csid != "undefined" ? Number(e._csid) : 0;
    UniLoginOver = PageWebGame._uniLoginOver;
    if (config._server && config._serCutField) {
        for (var i in config._server) {
            for (var k in config._serCutField) {
                if (typeof config._server[i][k] == "undefined") {
                    config._server[i][k] = config._serCutField[k]
                }
            }
        }
    }
    if (config._appRealStatus == 1 && config._appSetStatus == 4 && config._module != "wd") {
        var _gb_tiems = PageWebGame._getCookie("gb_box_" + config._appId);
        if (_gb_tiems != 1) {
            PageWebGame._downLineGame();
            setTimeout(function () {
                $(".ui-dialog").focus(function () {
                });
                $(".ui-dialog-mask").height(document.body.scrollHeight);
                $(".ui-dialog-mask").unbind("click")
            }, 500)
        }
    }
};
var join = {
    _$: function (id) {
        return typeof id === "string" ? document.getElementById(id) : id
    },
    _status: config._server,
    _url: config._domain + config._appApi,
    _blank: config._newwin,
    _template: function (tmpl, json) {
        return tmpl.replace(/\@{([a-zA-Z_0-9\-]*)\}/g, function (all, key) {
            return typeof json[key] !== "undefined" ? json[key] : ""
        })
    },
    _check: function (t, sid, event, flag) {
        var self = join;
        var tip = "";
        var event = event || window.event;
        var _sid = sid;
        if (sid === null || typeof(sid) === "undefined" || flag) {
            sid = Number(self._$("join_sid").value);
            if (sid && config._csid) {
                sid = Number(sid) + config._csid
            }
        }
        var s = self._status[sid];
        if (typeof(s) !== "undefined") {
            var popTmpl, pop = false;
            s["status"] = Number(s["status"]);
            if (s["status"] !== 1) {
                PageWebGame._checkServerStatus();
                s["status"] = Number(config._server[sid]["status"])
            }
            if (t == 1) {
                if (s["status"] !== 1) {
                    pop = true;
                    switch (s["status"]) {
                        case-1:
                            popTmpl = -1;
                            break;
                        case-2:
                            popTmpl = -2;
                            break;
                        case 2:
                            popTmpl = 2;
                            break;
                        case 3:
                            popTmpl = 3;
                            break;
                        default:
                            pop = false;
                            break
                    }
                } else {
                    if (config._network && config._network.network != 1 && config._network.network != s["net"] && s["net"] != 1) {
                        popTmpl = -99;
                        pop = true
                    }
                    if (popTmpl == -99 && config._appId == 800152 ) {
                        if(s["net"] == 2){
                            pop = false;
                        }
                        if(pop){
                            $("#lastEnterServer").find('a').each(function(index,ele){
                                if($(this).attr('sid') == sid){
                                    pop = false;
                                    return false;
                                }
                            })
                        }
                    }
                }
                if (pop) {
                    ue.dialog({
                        lock: true,
                        content: self._template($("#server_popTmpl" + popTmpl).html(), {msg: s["msg"]}),
                        position: "absolute",
                        top: top,
                        zIndex: 10000,
                        forceLock: false,
                        init: function () {
                            var _this = this;
                            this.obj.find(".again_btn").bind("click", function () {
                                _this.close();
                                return false
                            });
                            this.obj.find(".goon_lnk").attr("sid", sid).attr("nocheck", true).bind("click", function (event) {
                                $(".server_all .server_ul li").find("a[sid=" + sid + "]").attr("nocheck", true);
                                self._play(event, this);
                                _this.close()
                            })
                        }
                    });
                    return false
                }
            }
            self._$("tip").style.display = "none";
            return true
        } else {
            if (_sid === "" && event && event.type !== "click") {
                self._$("tip").style.display = "none";
                return false
            }
            if (_sid === "") {
                tip = "请输入服务器。"
            } else {
                if (isNaN(_sid)) {
                    tip = "请输入数字"
                } else {
                    tip = "输入的游戏服务器不存在。"
                }
            }
            self._$("tip").innerHTML = tip;
            self._$("tip").style.display = "block";
            return false
        }
        return true
    },
    _closeAppCheckUserRole: function (sid) {
        if (config._appSetStatus == 4 && config._appRealStatus == 1 && config._module != "wd") {
            var roleCheck = true;
            $.ajax({
                type: "get",
                url: config._appApi + "ajaxCheckCloseAppUserRole-_AJAX_-1-sid-" + sid,
                dataType: "json",
                async: false,
                success: function (res) {
                    if (res.status <= 0) {
                        PageWebGame._downLineGame();
                        $(".m_opt label").hide();
                        roleCheck = false
                    }
                }
            });
            if (!roleCheck) {
                return false
            }
        }
        return true
    },

    //老服创角限制（未激活）
    _serverEnterRestrict: function (sid) {
        if (typeof config.serEnterRestrict !== 'undefined' && config.serEnterRestrict ) {
            var whiteSids = config.serEnterRestrict.whiteSids || [];
            $(".m_recommed_ser a").each(function(){
                var sid = parseInt($(this).attr("sid"));
                if( sid > 0){
                    whiteSids.push(sid);
                }
            });
            $("#lastEnterServer a").each(function(){
                var sid = parseInt($(this).attr("sid"));
                if( sid > 0){
                    whiteSids.push(sid);
                }
            });
            if( $.inArray(parseInt(sid), whiteSids) > -1 ){
                return true;
            }
            var checkRes = true;
            $.ajax({
                type: "get",
                url: config._appApi + "ajaxCheckUserEnterPower-_AJAX_-1-sid-" + sid,
                dataType: "json",
                async: false,
                success: function (res) {
                    if (res.status <= 0) {
                        Invitation.url = res.data.url;
                        serEnterRestrictPop(Invitation.tit, Invitation.stit, {type: '1'});
                        $(".m_opt label").hide();
                        checkRes = false;
                    }
                }
            });
            return checkRes;
        }
        return true;
    },

    _play: function (e, obj) {
        var self = join;
        var e = window.event || e;
        if (typeof(config._uInfo) !== "undefined" && config._module !== 'wd' && config._fcmDw) {
            PageWebApiSdkConf.uid = config._uInfo.uid;
            PageWebApiSdkConf.is_adult = config._uInfo.sdk;
            // var isPlayLimit = PageWebApiSdk.init(PageWebApiSdkConf);
            // if (isPlayLimit) {
            //     return false
            // }
        }
        /*else {
            getUinfoOnce = true;
            PageWebGame._getUinfo();
            self._play(e, obj);
            e.returnValue = false;
            return false;
        }*/
        var sid = obj.getAttribute("sid");
        var nocheck = obj.getAttribute("nocheck");
        if (nocheck || self._check(1, sid, e)) {
            var u = PageWebGame._userInit();
            if (!u) {
                if (config._dologin) {
                    loginCallBack = function () {
                        PageWebGame._gameDoLogin();
                        config._atonce = sid;
                        PageWebGame._atonceGame()
                    }
                }
                UniLogin.logout();
                return false
            }
            if (sid === null) {
                sid = Number(self._$("join_sid").value);
                if (sid && config._csid) {
                    sid = Number(sid) + config._csid
                }
            }
            if (!self._closeAppCheckUserRole(sid)) {
                return false
            }
            if (!self._serverEnterRestrict(sid)) {
                return false
            }
            if (sid) {
                var site = obj.getAttribute("name");
                var enterIframe = config._iframe ? "tpl" : "play";
                var enterUrl = self._url + enterIframe + "-sid-" + sid + "-site-" + site;
                if (config._from) {
                    enterUrl += "-ref-" + config._from
                }
                if (typeof config._adid !== "undefined") {
                    enterUrl += "-adid-" + config._adid
                }
                if (config._otherpara) {
                    enterUrl += config._otherpara
                }
                if (config._channel) {
                    enterUrl += config._channel
                }
                enterUrl += "-randsj-" + Math.random();
                if (self._blank == "_blank") {
                    obj.setAttribute("target", "_blank");
                    obj.setAttribute("href", enterUrl);
                    e.returnValue = true;
                    return true
                } else {
                    if (self._blank == "_self") {
                        top.location.href = enterUrl;
                        e.returnValue = true;
                        return true
                    } else {
                        if (self._blank == "_wd") {
                            var wdEnterUrl = "app://loadgame:" + encodeURI(self._status[sid].name) + "-" + encodeURI(UniLogin.getUname()) + "|" + enterUrl;
                            location.href = wdEnterUrl;
                            e.returnValue = true;
                            return true
                        } else {
                            if (self._blank == "_custom") {
                                if (typeof __play === "function") {
                                    return __play(e, obj, sid, self, enterUrl)
                                }
                            } else {
                                self._loadgame(enterUrl);
                                if ("\v" == "v") {
                                    e.returnValue = false
                                } else {
                                    return false
                                }
                            }
                        }
                    }
                }
            }
        }
        if ("\v" == "v") {
            e.returnValue = false
        } else {
            return false
        }
    },
    _loadgame: function (url) {
        var self = join;
        if (self._$("GameFrame")) {
            self._$("GameFrame").src = url;
            var xfk = self._$("xfk");
            xfk.style.display = "none";
            self._$("GameFrame").parentNode.style.display = ""
        }
        return false
    },
    init: function () {
        var self = join;
        var join_sid = self._$("join_sid");
        var join_btn = self._$("join_game");
        if (join_sid != null) {
            join_sid.onfocus = function (e) {
                if ("\v" == "v") {
                    join_sid.attachEvent("onkeyup", function () {
                        self._check(undefined, join_sid.value, e, true)
                    })
                } else {
                    if (window.attachEvent) {
                        join_sid.attachEvent('oninput', function (e) {
                            self._check(undefined, join_sid.value, e, true)
                        });
                        if (!window.ScriptEngineMinorVersion() && window.addEventListener) {
                            join_sid.attachEvent('onkeyup', function (e) {
                                if (e.keyCode === 8) {
                                    join_sid.fireEvent('oninput')
                                }
                                if (e.ctrlKey && e.keyCode === 88) {
                                    join_sid.fireEvent('oninput')
                                }
                            })
                        }
                    } else {
                        join_sid.addEventListener("input", function () {
                            self._check(undefined, join_sid.value, e, true)
                        }, false)
                    }
                    self._check(false, join_sid.value, e, true)
                }
            };
            join_sid.onblur = function () {
                self._$("tip").style.display = "none"
            }
        }
        if (join_btn != null) {
            join_btn.onblur = function () {
                self._$("tip").style.display = "none"
            }
        }
    }
};
function tracking(e) {
    e = e ? e : window.event;
    var s = e.srcElement ? e.srcElement : e.target;
    var a = s.tagName;
    var u = s.href ? s.href : s.src;
    var t = s.innerText ? s.innerText : s.textContent;
    if (a == "B" || a == "STRONG") {
        a = "A";
        u = s.parentNode.href
    }
    if (a == "IMG") {
        t = u;
        u = s.parentNode.href
    }
    if (a == "A" || a == "IMG") {
        try {
            new Image().src = "//tracenews.5054399.com/trace.js?dc63fc5?addd=" + a + "&uddd=" + escape(u) + "&tddd=" + t
        } catch (ex) {
        }
    }
    return true
};
/* /webgame/sgkd/tpl/js/cfgInit.js */
PageWebGame._configInit({
    //_setgameid : '',
    _resetPopTop : 192,//登录框top值
    _setPopUcTop : 242//登录框 快速注册top值
});




