if (typeof EAS != "object") {
  var EAS = (function () {
    var fnn = {
      getUrlVars: function (e) {
        var n = [],
          r;
        var o = e.slice(e.indexOf("?") + 1).split("&");
        for (var t = 0; t < o.length; t++) {
          r = o[t].split("=");
          n.push(r[0]);
          n[r[0]] = r[1];
        }
        return n;
      },
      getUrlVar: function (e, n) {
        var r = fnn.getUrlVars(e);
        if (r[n] == null || r[n] == undefined) {
          return 0;
        } else {
          return r[n];
        }
      },
      getUrlHost: function (e) {
        var n = e.match(
          /^https?:\/\/([a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:\d+)?)/i,
        );
        if (n) {
          return n[1];
        }
        return "";
      },
      isSubdomain: function (e, n) {
        var r = n.indexOf("." + e);
        if (r == -1) {
          return false;
        }
        if (n.substr(r) != "." + e) {
          return false;
        }
        return true;
      },
      loadjs: function (e, n, r) {
        var o = document.createElement("script");
        o.type = "text/javascript";
        if (r) {
          o.setAttribute("charset", r);
        }
        if (o.readyState) {
          o.onreadystatechange = function () {
            if (o.readyState == "loaded" || o.readyState == "complete") {
              o.onreadystatechange = null;
              n();
              document.getElementsByTagName("head")[0].removeChild(this);
            }
          };
        } else {
          o.onload = function () {
            n();
            document.getElementsByTagName("head")[0].removeChild(this);
          };
        }
        o.src = e;
        document.getElementsByTagName("head")[0].appendChild(o);
      },
      loadimg: function (e, n) {
        var r = new Image();
        r.onload = function () {
          r = null;
        };
        r.onerror = function () {
          r = null;
        };
        r.src = e;
      },
      trim: function (e) {
        return e.replace(/^(\s|\u00A0)+/, "").replace(/(\s|\u00A0)+$/, "");
      },
      getEasUrl: function (e) {
        if (typeof e != "string") {
          return "";
        }
        e = e.toLowerCase();
        if (e.indexOf("?") != -1) {
          var n = e.substr(0, e.indexOf("?"));
        } else {
          var n = e;
        }
        n = n
          .replace("index.shtml", "")
          .replace("index.html", "")
          .replace("index.htm", "")
          .replace("index.php", "");
        if (n.indexOf("#") != -1) {
          n = n.substr(0, n.indexOf("#"));
        }
        var r = n.split("/");
        var o = r[r.length - 1];
        if (
          o != "" &&
          o != undefined &&
          o.indexOf(".shtml") == -1 &&
          o.indexOf(".html") == -1 &&
          o.indexOf(".htm") == -1 &&
          o.indexOf(".php") == -1
        ) {
          n = n + "/";
        }
        n = n
          .replace(/\/+/gi, "/")
          .replace(/^https?:\/+/i, "http://")
          .replace(/^\//, "http://");
        return n;
      },
      trimStr: function (e) {
        if (typeof e != "string") {
          e = e.toString();
        }
        if (e.indexOf("%") != -1) {
          e = e.substr(0, e.indexOf("%"));
        }
        if (e.indexOf("#") != -1) {
          e = e.substr(0, e.indexOf("#"));
        }
        rs = e.replace(/\/|'|#|@|\<|\>|\?|\&|\^|\"/g, "");
        return rs;
      },
      urlEncode: function (e, n, r) {
        if (e == null) return "";
        var o = "";
        var t = typeof e;
        if (t == "string" || t == "number" || t == "boolean") {
          o += "&" + n + "=" + (r == null || r ? encodeURIComponent(e) : e);
        } else {
          for (var i in e) {
            var d =
              n == null
                ? i
                : n + (e instanceof Array ? "[" + i + "]" : "." + i);
            o += fnn.urlEncode(e[i], d, r);
          }
        }
        return o;
      },
    };
    var el = document,
      Version = "27",
      LogCgi = "//logs.game.qq.com/eas/comm/eas.php?",
      LogCgiGo = "//logs.game.qq.com/easnew/go/eas.php?",
      sendClickUrl =
        "http://apps.game.qq.com/adw_sendclick/api/send_click.php?",
      GODMkUrl = "http://apps.game.qq.com/fifa/qiyehao/index.php?m=GODMLogin",
      UrlPathName = window.location.pathname,
      UrlHost = window.location.host,
      UrlHref = window.location.href,
      ReferrerUrl = document.referrer,
      EntryReferrerUrl = "",
      http_type = document.location.protocol,
      LogUrl = fnn.getEasUrl(UrlHref),
      e_code = 0,
      g_code = 0,
      ad_id = 0,
      o2_mid = 0,
      eas_type = 0,
      RandNum = Math.floor(Math.random() * 10),
      hasAMS = false,
      hasSend = false,
      EasADTAG = "EAS-ADTAG",
      ADShowArr = {},
      ADShowArr2 = {},
      ECMSysName = "",
      ECMCode = "",
      ECMCookie = "",
      GODM_user = "",
      GODM_serviceType = "",
      GODM_sysName = "",
      Sys_userId = "",
      Sys_openId = "",
      Sys_channel = "",
      Sys_serviceType = "",
      Sys_sysName = "",
      AmsId = "",
      adtagArr = new Array(),
      Close = false,
      TimeOut = false,
      StartTime = new Date().getTime();
    if (http_type == "https:") {
      LogCgiGo = http_type + "//logs.game.qq.com/easnew/go/eas.php?";
    }
    var addEvent = function (e, n, r) {
      var o = !!navigator.userAgent.match(/Trident\/7\./);
      if (o) {
        e["on" + n] = r;
      } else if (window.attachEvent) {
        e.attachEvent("on" + n, r);
      } else {
        e.addEventListener(n, r, false);
      }
    };
    var browser = {
      versions: (function () {
        var e = navigator.userAgent,
          n = navigator.appVersion;
        return {
          trident: e.indexOf("Trident") > -1,
          presto: e.indexOf("Presto") > -1,
          webKit: e.indexOf("AppleWebKit") > -1,
          gecko: e.indexOf("Gecko") > -1 && e.indexOf("KHTML") == -1,
          mobile: !!e.match(/AppleWebKit.*Mobile.*/),
          ios: !!e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
          android: e.indexOf("Android") > -1 || e.indexOf("Linux") > -1,
          iPhone: e.indexOf("iPhone") > -1 || e.indexOf("Mac") > -1,
          iPad: e.indexOf("iPad") > -1,
          webApp: e.indexOf("Safari") == -1,
          google: e.indexOf("Chrome") > -1,
        };
      })(),
    };
    var CheckAMS = function () {
      var e = {};
      e: {
        var n = document.getElementsByTagName("script");
        for (d = 0; d < n.length; d++) {
          var r = n[d].src;
          if (r && 0 <= r.toLowerCase().indexOf("reporting.js")) {
            AmsId = fnn.getUrlVar(r, "action");
            if (AmsId < 50398 && AmsId != 0) {
              hasAMS = true;
            }
            break e;
          }
        }
        d = "";
      }
    };
    var GetEasSid = function () {
      var e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
      var n = e.length;
      var r = "";
      var o = new Date().getTime().toString();
      if (typeof o != "string") {
        o = Math.floor(
          Math.random() * (9999999999999 - 1e12) + 1e12,
        ).toString();
      }
      if (o == undefined || o == null) {
        var t = Math.random().toString().split(".");
        o = t[1];
      }
      if (o) {
        o = o.split("");
      }
      for (i = 0; i < 13; i++) {
        var d = Math.floor(Math.random() * n);
        r += e.charAt(d) + o[i];
      }
      return r;
    };
    var GetCodeByRules = function (e) {
      var n = fnn.getUrlHost(e).toLowerCase();
      var r = fnn.getEasUrl(e);
      switch (n) {
        case "dnf.qq.com":
          if (r.match(/ingame/)) {
            return 486773;
          } else if (r.match(/wangba/)) {
            return 491949;
          }
          break;
      }
      return 0;
    };
    var UUID = function () {
      var e = [];
      var n = "0123456789abcdef";
      for (var r = 0; r < 36; r++) {
        e[r] = n.substr(Math.floor(Math.random() * 16), 1);
      }
      e[14] = "4";
      e[19] = n.substr((e[19] & 3) | 8, 1);
      e[8] = e[13] = e[18] = e[23] = "-";
      e[35] = n.substr(
        (e[0].charCodeAt() +
          e[10].charCodeAt() +
          e[16].charCodeAt() +
          e[22].charCodeAt() +
          e[28].charCodeAt()) %
          n.length,
        1,
      );
      e[34] = n.substr(
        (e[1].charCodeAt() +
          e[11].charCodeAt() +
          e[17].charCodeAt() +
          e[29].charCodeAt()) %
          n.length,
        1,
      );
      var o = e.join("");
      return o;
    };
    var GetTrackCode = function () {
      e_code = fnn.getUrlVar(UrlHref, "ad_id");
      if (e_code == null || e_code == undefined || e_code == 0) {
        e_code = fnn.getUrlVar(UrlHref, "e_code");
        if (e_code == null || e_code == undefined) {
          e_code = 0;
        }
      } else {
        e_code = "o2." + e_code;
      }
      o2_mid = fnn.getUrlVar(UrlHref, "mtr_id");
      if (o2_mid == null || o2_mid == undefined) {
        o2_mid = 0;
      }
      g_code = fnn.getUrlVar(UrlHref, "g_code");
      if (g_code == null || g_code == undefined) {
        g_code = 0;
      }
      e_code = fnn.trimStr(e_code);
      g_code = parseInt(g_code);
      o2_mid = parseInt(o2_mid);
      if (e_code === "0") {
        e_code = fnn.trimStr(GetCodeByRules(UrlHref));
      }
    };
    var GetECode = function (e) {
      var n = fnn.getUrlVar(e, "ad_id");
      if (n == null || n == undefined || n == 0) {
        n = fnn.getUrlVar(e, "e_code");
        if (n == null || n == undefined) {
          n = 0;
        }
      } else {
        n = "o2." + n;
      }
      n = fnn.trimStr(n);
      if (n === "0") {
        n = fnn.trimStr(GetCodeByRules(e));
      }
      return n;
    };
    var SendLog = function (e, n, r) {
      var o = e + n + "&r=" + new Date().getTime();
      if (typeof r === "function") {
        fnn.loadimg(o, function () {});
        r();
      } else {
        fnn.loadimg(o, function () {});
      }
    };
    var PingTcssHot = function (e) {
      fnn.loadjs("http://pingjs.qq.com/tcss.ping.js", function () {
        if (typeof pgvSendClick === "function") {
          pgvSendClick({ hottag: e });
        }
      });
    };
    var formatUin = function (e) {
      return e.replace(/o[0]*/, "");
    };
    var GetUin = function () {
      var e = ["p_uin", "uin"];
      for (var n = 0; n < e.length; n++) {
        var r = EASCookie(e[n]);
        if (typeof r == "string") {
          r = fnn.trim(r);
          if (r.length > 0) {
            return formatUin(r);
          }
        }
      }
      return "";
    };
    var GetOpenId = function () {
      var e = ["openid", "openId"];
      for (var n = 0; n < e.length; n++) {
        var r = fnn.getUrlVar(UrlHref, e[n]);
        if (r) {
          return r;
        }
      }
      e = ["openid"];
      for (var n = 0; n < e.length; n++) {
        var r = EASCookie(e[n]);
        if (typeof r == "string") {
          r = fnn.trim(r);
          if (r.length > 0) {
            return r;
          }
        }
      }
      return "";
    };
    var Init = function () {
      if (!hasAMS && !hasSend) {
        hasSend = true;
        var e = EASCookie("eas_sid");
        if (e == undefined || e == null) {
          e = GetEasSid();
          EASCookie("eas_sid", e, {
            expires: 525600,
            path: "/",
            domain: "qq.com",
          });
        }
        EntryReferrerUrl = EASCookie("eas_entry");
        if (!EntryReferrerUrl) {
          EntryReferrerUrl = "";
        }
        if (fnn.getUrlHost(EntryReferrerUrl) == UrlHost) {
          EntryReferrerUrl = "";
        }
        if (ReferrerUrl) {
          var n = fnn.getUrlHost(ReferrerUrl);
          if (n) {
            if (
              !fnn.isSubdomain(UrlHost, n) &&
              !fnn.isSubdomain(n, UrlHost) &&
              n != UrlHost
            ) {
              EntryReferrerUrl = ReferrerUrl;
              EASCookie("eas_entry", EntryReferrerUrl, {
                expires: 1440,
                path: "/",
              });
            }
          }
        }
        var r =
          "click_type=3&e_code=" +
          e_code +
          "&o2_mid=" +
          o2_mid +
          "&Url=" +
          encodeURIComponent(LogUrl) +
          "&ReferrerUrl=" +
          encodeURIComponent(fnn.getEasUrl(ReferrerUrl)) +
          "&EntryReferrerUrl=" +
          encodeURIComponent(fnn.getEasUrl(EntryReferrerUrl)) +
          "&Version=" +
          Version;
        SendLog(LogCgiGo, r);
        if (!GetUin()) {
          var o = setInterval(function () {
            if (GetUin()) {
              SendUinOrOpenIdLog();
              clearInterval(o);
            }
          }, 500);
        }
        if (!GetOpenId()) {
          var t = setInterval(function () {
            if (GetOpenId()) {
              SendUinOrOpenIdLog();
              clearInterval(t);
            }
          }, 500);
        }
      }
    };
    var ADTAGPop = function () {
      if (UrlHost == "x5.qq.com" || UrlHost == "lol.qq.com") {
        var e = el.getElementsByTagName("*"),
          n = e.length,
          r,
          o = new Array(),
          t = 0;
        while (n--) {
          r = e[n];
          var i = "",
            d = "",
            f = "",
            l = "",
            a = "";
          d = r.getAttribute && r.getAttribute("href");
          if (typeof d == "string" && d.length > 0) {
            f = parseInt(fnn.getUrlVar(d, "e_code"));
            if (f != null && f != undefined && f != 0) {
              o.push(f);
              l = { e_c: f, c_d: d, c_t: 102 };
            }
          }
          i = r.getAttribute && r.getAttribute(EasADTAG);
          if (typeof i == "string" && i.length > 0) {
            o.push(i);
            l = { e_c: i, c_t: 102 };
          }
          if (l || a) {
            (function (e, n) {
              EAS.addEvent(r, "click", function () {
                if (typeof e == "object") {
                  SendClick(e, function () {});
                }
                if (typeof n == "object") {
                  SendClick(n, function () {});
                }
              });
            })(l, a);
          }
          if (n == 0) {
            if (o.length > 0) {
              var c = o.join("|");
              var a = { e_c: c, c_t: 101 };
              SendClick(a, function () {});
            }
          }
        }
      }
    };
    var SendClick = function (e, n) {
      if (typeof e == "object") {
        var r = e,
          o = 0,
          t = 0,
          i = "",
          d = 0,
          f = "",
          l = "",
          a = "",
          c = 0,
          s = 0,
          u = "";
        _c_p = 0;
        var p = "";
        var g = "";
        var U = "";
        var m = "";
        var _ = "";
        if (r.e_n !== null && r.e_n !== undefined) {
          g = r.e_n;
        }
        if (r.c_t === null || r.c_t === undefined) {
          r.c_t = 4;
        }
        if (r.uin !== null && r.uin !== undefined) {
          p = p + "&Uin=" + r.uin;
        }
        if (r.openid !== null && r.openid !== undefined) {
          p = p + "&openid=" + r.openid;
        }
        if (r.ext1 !== null && r.ext1 !== undefined) {
          U = r.ext1;
        }
        if (r.ext2 !== null && r.ext2 !== undefined) {
          m = r.ext2;
        }
        if (r.ext3 !== null && r.ext3 !== undefined) {
          _ = r.ext3;
        }
        if (r.e_c !== null && r.e_c !== undefined) {
          t = r.e_c;
        } else {
          return false;
        }
        if (r.c_b !== null && r.c_b !== undefined) {
          u = r.c_b;
        }
        if (r.c_p !== null && r.c_p !== undefined) {
          _c_p = r.c_p;
        }
        if (r.c_t !== null && r.c_t !== undefined) {
          o = r.c_t;
        }
        if (r.c_d !== null && r.c_d !== undefined) {
          if (typeof r.c_d == "object") {
            if (r.c_d.href !== null && r.c_d.href !== undefined) {
              f = r.c_d.href;
            }
          } else {
            f = r.c_d;
          }
        }
        if (f) {
          if (typeof f == "string" && f.indexOf("|") != -1) {
          } else {
            f = fnn.getEasUrl(f);
          }
        }
        if (parseInt(o) == 1) {
          a =
            "show_ads=" +
            t +
            "&Url=" +
            encodeURIComponent(LogUrl) +
            "&click_type=1" +
            "&Version=" +
            Version;
        }
        if (parseInt(o) == 2) {
          a =
            "show_ads=" +
            t +
            "&ad_url=" +
            encodeURIComponent(f) +
            "&ReferrerUrl=" +
            encodeURIComponent(LogUrl) +
            "&click_type=2" +
            "&Version=" +
            Version;
          n = function () {};
        }
        if (parseInt(o) == 4) {
          if (UrlHost == "x5.qq.com") {
            if (Close == false && t != "close") {
              adtagArr.push(t);
            }
            if (adtagArr.length == 1) {
              setTimeout(function () {
                if (adtagArr.length > 0) {
                  var e = adtagArr.join("|");
                  a =
                    "click_type=4&adtag=" +
                    e +
                    "&e_code=" +
                    e_code +
                    "&o2_mid=" +
                    o2_mid +
                    "&Url=" +
                    encodeURIComponent(LogUrl) +
                    "&ReferrerUrl=" +
                    encodeURIComponent(ReferrerUrl);
                  adtagArr = new Array();
                  if (a) {
                    if (typeof n === "function") {
                      SendLog(LogCgiGo, a, function () {
                        n();
                      });
                    } else {
                      SendLog(LogCgiGo, a);
                    }
                  }
                }
              }, 5e3);
            }
            if (adtagArr.length == 5 || Close == true) {
              var t = adtagArr.join("|");
              a =
                "click_type=4&adtag=" +
                t +
                "&e_code=" +
                e_code +
                "&o2_mid=" +
                o2_mid +
                "&Url=" +
                encodeURIComponent(LogUrl) +
                "&ReferrerUrl=" +
                encodeURIComponent(ReferrerUrl);
              adtagArr = new Array();
            }
          } else {
            a =
              "click_type=4&adtag=" +
              t +
              "&e_code=" +
              e_code +
              "&o2_mid=" +
              o2_mid +
              "&Url=" +
              encodeURIComponent(LogUrl) +
              "&ReferrerUrl=" +
              encodeURIComponent(ReferrerUrl) +
              "&e_n=" +
              encodeURIComponent(g) +
              "&ext1=" +
              encodeURIComponent(U) +
              "&ext2=" +
              encodeURIComponent(m) +
              "&ext3=" +
              encodeURIComponent(_) +
              "&Version=" +
              Version;
          }
        }
        if (parseInt(o) == 99 || parseInt(o) == 100) {
          a =
            "click_type=" +
            parseInt(o) +
            "&e_code=" +
            t +
            "&Url=" +
            encodeURIComponent(LogUrl) +
            "&ReferrerUrl=" +
            encodeURIComponent(ReferrerUrl);
        }
        if (parseInt(o) == 101) {
          if (t.indexOf("|") != -1) {
            tmp_codeArr = t.split("|");
          }
          if (f) {
            a =
              "click_type=101&e_code=" +
              t +
              "&c_b=" +
              u +
              "&c_p=" +
              _c_p +
              "&Url=" +
              encodeURIComponent(f) +
              "&ReferrerUrl=" +
              encodeURIComponent(LogUrl) +
              "&Version=" +
              Version;
          } else {
            a =
              "click_type=101&e_code=" +
              t +
              "&c_b=" +
              u +
              "&c_p=" +
              _c_p +
              "&Url=" +
              encodeURIComponent("") +
              "&ReferrerUrl=" +
              encodeURIComponent(LogUrl) +
              "&Version=" +
              Version;
          }
        }
        if (parseInt(o) == 102) {
          if (f) {
            a =
              "click_type=102&e_code=" +
              t +
              "&c_b=" +
              u +
              "&c_p=" +
              _c_p +
              "&Url=" +
              encodeURIComponent(f) +
              "&ReferrerUrl=" +
              encodeURIComponent(LogUrl) +
              "&Version=" +
              Version;
          } else {
            a =
              "click_type=102&e_code=" +
              t +
              "&c_b=" +
              u +
              "&c_p=" +
              _c_p +
              "&Url=" +
              encodeURIComponent("") +
              "&ReferrerUrl=" +
              encodeURIComponent(LogUrl) +
              "&Version=" +
              Version;
          }
        }
        if (a) {
          if (typeof n === "function") {
            SendLog(LogCgiGo, a + p, function () {
              n();
            });
          } else {
            SendLog(LogCgiGo, a + p);
          }
        }
      }
    };
    var GetADShowCodeList = function (e) {
      var n = [],
        r;
      for (var o = 0, t; (t = e[o]) != null; o++) {
        r = GetECode(t);
        if (r != null && r != undefined && r != 0) {
          if (!ADShowArr[r]) {
            n.push(r);
            ADShowArr[r] = true;
          }
        }
      }
      return n;
    };
    var GetADShowSplitArr = function (e, n) {
      var r = [];
      if (typeof n == "number" || typeof n == "string") {
        n = n + "";
        if (n.length > 0) {
          r = n.split("|");
        }
      }
      var o = [];
      var t = [];
      var i = [];
      for (var d = 0; d < e.length; d++) {
        var f = fnn.getEasUrl(e[d]);
        var l = GetECode(e[d]);
        var a = "";
        if (r.length > d) {
          a = r[d];
        }
        if (a.length == 0) {
          a = "0";
        }
        var c = f + "|" + l + "|" + a;
        if (!ADShowArr2[c]) {
          ADShowArr2[c] = true;
          o.push(f);
          t.push(l);
          i.push(a);
        }
      }
      return { urls: o, codes: t, bannerIds: i };
    };
    var ADShow = function (e, n) {
      var r = new Array(),
        o = "",
        t = "";
      if (typeof e == "object") {
        if (e.href !== null && e.href !== undefined) {
          r.push(e.href);
        }
      } else if (typeof e == "string") {
        if (e.indexOf("|") != -1) {
          r = e.split("|");
        } else if (e != "") {
          r.push(e);
        }
      }
      if (r.length > 0) {
        var i = GetADShowSplitArr(r, n);
        if (i.urls.length > 0) {
          SendClick(
            {
              c_b: i.bannerIds.join("|"),
              e_c: i.codes.join("|"),
              c_d: i.urls.join("|"),
              c_t: 101,
            },
            function () {},
          );
        }
      }
    };
    var ADClick = function (e, n) {
      var r, o;
      if (typeof e == "object") {
        if (e.href !== null && e.href !== undefined) {
          o = e.href;
        }
      } else if (typeof e == "string") {
        o = e;
      }
      if (typeof o != "string") {
        o = "";
      }
      if (typeof n != "number" && typeof n != "string") {
        n = "";
      }
      if (n.length == 0) {
        n = "0";
      }
      r = GetECode(o);
      if (r != null && r != undefined) {
        o = fnn.getEasUrl(o);
        if (o != "") {
          SendClick({ c_b: n, e_c: r, c_d: o, c_t: 102 }, function () {});
        }
      }
    };
    var VShow = function (e, n) {
      var r = "",
        o = "";
      if (typeof e == "object") {
        if (typeof e.VUrl == "object") {
          if (e.VUrl.href !== null && e.VUrl.href !== undefined) {
            e.Url = e.VUrl.href;
          }
        } else if (typeof e.VUrl == "string") {
          e.Url = e.VUrl;
        } else if (e.VUrl == null || e.VUrl == undefined) {
          e.Url = UrlHref;
        }
        e.VUrl = null;
        if (e.e_code == null || e.e_code == undefined) {
          if (e.VType == "click") {
            e.e_code = GetECode(e.Url);
          } else if (e.VType == "play") {
            e.e_code = GetECode(UrlHref);
          }
        }
        if (e.Vid == null || e.Vid == undefined) {
          if (e.VType == "click") {
            e.Vid = fnn.getUrlVar(e.Url, "id");
          } else if (e.VType == "play") {
            e.Vid = fnn.getUrlVar(UrlHref, "id");
          }
        }
        if (e.Url) {
          e.Url = fnn.getEasUrl(e.Url);
        }
        if (e.VType == "click") {
          e.ReferrerUrl = encodeURIComponent(LogUrl);
          e.click_type = 202;
        } else if (e.VType == "play") {
          e.ReferrerUrl = encodeURIComponent(fnn.getEasUrl(ReferrerUrl));
          e.click_type = 203;
        }
        e.VType = null;
        for (var t in e) {
          if (e[t] != null && e[t] != undefined) {
            r += t + "=" + e[t] + "&";
          }
        }
        r += "m=SendLog";
      } else {
        return false;
      }
      if (r != null && r != undefined) {
        if (typeof n === "function") {
          SendLog(LogCgiGo, r, function () {
            n();
          });
        } else {
          SendLog(LogCgiGo, r);
        }
      }
    };
    var GShow = function (e, n) {
      var r = "",
        o = "";
      if (typeof e == "object") {
        if (typeof e.gameid == null || e.gameid == undefined) {
          return false;
        }
        e.Url = LogUrl;
        e.ReferrerUrl = encodeURIComponent(fnn.getEasUrl(ReferrerUrl));
        e.click_type = 301;
        for (var t in e) {
          if (e[t] != null && e[t] != undefined) {
            r += t + "=" + e[t] + "&";
          }
        }
        r += "m=SendLog";
      } else {
        return false;
      }
      if (r != null && r != undefined) {
        if (typeof n === "function") {
          SendLog(LogCgiGo, r, function () {
            n();
          });
        } else {
          SendLog(LogCgiGo, r);
        }
      }
    };
    var EASCookie = function (e, n, r) {
      if (typeof n != "undefined") {
        r = r || {};
        if (n === null) {
          n = "";
          r.expires = -1;
        }
        var o = "";
        if (
          r.expires &&
          (typeof r.expires == "number" || r.expires.toUTCString)
        ) {
          var t;
          if (typeof r.expires == "number") {
            t = new Date();
            t.setTime(t.getTime() + r.expires * 60 * 1e3);
          } else {
            t = r.expires;
          }
          o = "; expires=" + t.toUTCString();
        }
        var i = r.path ? "; path=" + r.path : "";
        var d = r.domain ? "; domain=" + r.domain : "";
        var f = r.secure ? "; secure" : "";
        document.cookie = [e, "=", encodeURIComponent(n), o, i, d, f].join("");
      } else {
        var l = null;
        if (document.cookie && document.cookie != "") {
          var a = document.cookie.split(";");
          for (var c = 0; c < a.length; c++) {
            var s = fnn.trim(a[c]);
            if (s.substring(0, e.length + 1) == e + "=") {
              l = decodeURIComponent(s.substring(e.length + 1));
              break;
            }
          }
        }
        return l;
      }
    };
    var GODMLogin = function (e) {
      window.location.href = GODMkUrl + "&redirect_url=" + e;
    };
    var GODMInit = function (e) {
      if (typeof e == "object") {
        if (e.user != null && e.user != undefined) {
          GODM_user = e.user;
        }
        if (e.serviceType != null && e.serviceType != undefined) {
          GODM_serviceType = e.serviceType;
        }
        if (e.sysName != null && e.sysName != undefined) {
          GODM_sysName = e.sysName;
        }
      }
      var e =
        "m=SendLog&click_type=501&e_code=" +
        e_code +
        "&GODM_user=" +
        GODM_user +
        "&GODM_serviceType=" +
        GODM_serviceType +
        "&GODM_sysName=" +
        GODM_sysName +
        "&Url=" +
        encodeURIComponent(LogUrl) +
        "&ReferrerUrl=" +
        encodeURIComponent(ReferrerUrl);
    };
    var GODMClick = function (e) {
      if (typeof e == "object") {
        if (e.adtag != null && e.adtag != undefined) {
          GODM_adtag = e.adtag;
        } else {
          return false;
        }
      } else {
        return false;
      }
      var e =
        "m=SendLog&click_type=502&GODM_adtag=" +
        GODM_adtag +
        "&e_code=" +
        e_code +
        "&GODM_user=" +
        GODM_user +
        "&GODM_serviceType=" +
        GODM_serviceType +
        "&GODM_sysName=" +
        GODM_sysName +
        "&Url=" +
        encodeURIComponent(LogUrl) +
        "&ReferrerUrl=" +
        encodeURIComponent(ReferrerUrl);
    };
    var SysInit = function (e) {
      if (typeof e == "object") {
        if (e.userId != null && e.userId != undefined) {
          Sys_userId = e.userId;
        }
        if (e.openId != null && e.openId != undefined) {
          Sys_openId = e.openId;
        }
        if (e.channel != null && e.channel != undefined) {
          Sys_channel = e.channel;
        }
        if (e.serviceType != null && e.serviceType != undefined) {
          Sys_serviceType = e.serviceType;
        }
        if (e.sysName != null && e.sysName != undefined) {
          Sys_sysName = e.sysName;
        }
      }
      var e =
        "m=SendLog&click_type=503&e_code=" +
        e_code +
        "&Sys_userId=" +
        Sys_userId +
        "&Sys_openId=" +
        Sys_openId +
        "&Sys_channel=" +
        Sys_channel +
        "&Sys_serviceType=" +
        Sys_serviceType +
        "&Sys_sysName=" +
        Sys_sysName +
        "&Url=" +
        encodeURIComponent(LogUrl) +
        "&ReferrerUrl=" +
        encodeURIComponent(ReferrerUrl);
    };
    var SysClick = function (e) {
      if (typeof e == "object") {
        if (e.adtag != null && e.adtag != undefined) {
          Sys_adtag = e.adtag;
        } else {
          return false;
        }
      } else {
        return false;
      }
      var e =
        "m=SendLog&click_type=504&Sys_adtag=" +
        Sys_adtag +
        "&e_code=" +
        e_code +
        "&Sys_userId=" +
        Sys_userId +
        "&Sys_openId=" +
        Sys_openId +
        "&Sys_channel=" +
        Sys_channel +
        "&Sys_serviceType=" +
        Sys_serviceType +
        "&Sys_sysName=" +
        Sys_sysName +
        "&Url=" +
        encodeURIComponent(LogUrl) +
        "&ReferrerUrl=" +
        encodeURIComponent(ReferrerUrl);
    };
    var DJClick = function (e) {
      if (!e) {
        return false;
      }
      var n =
        "click_type=98&e_code=" +
        e_code +
        "&o2_mid=" +
        o2_mid +
        "&DJActId=" +
        e +
        "&Url=" +
        encodeURIComponent(LogUrl) +
        "&ReferrerUrl=" +
        encodeURIComponent(ReferrerUrl);
      SendLog(LogCgiGo, n, function () {});
    };
    var TimeLine = function () {
      EAS.addEvent(window, "beforeunload", function () {
        var e = new Date().getTime();
        var n =
          "m=SendLog&click_type=601&e_code=" +
          e_code +
          "&StartTime=" +
          StartTime +
          "&EndTime=" +
          e +
          "&Url=" +
          encodeURIComponent(LogUrl) +
          "&ReferrerUrl=" +
          encodeURIComponent(ReferrerUrl);
        Close = true;
        SendLog(LogCgiGo, n, function () {});
        if (adtagArr.length > 0 && UrlHost == "x5.qq.com") {
          SendClick({ e_c: "close", c_t: 4 }, function () {});
        }
      });
    };
    var SendAmsLog = function (e, n) {
      try {
        if (Math.random() * 100 > 10) {
          return;
        }
        var r =
          "click_type=6&e_code=" +
          e_code +
          "&o2_mid=" +
          o2_mid +
          "&Url=" +
          encodeURIComponent(LogUrl) +
          "&ReferrerUrl=" +
          encodeURIComponent(fnn.getEasUrl(ReferrerUrl)) +
          "&EntryReferrerUrl=" +
          encodeURIComponent(fnn.getEasUrl(EntryReferrerUrl)) +
          "&Version=" +
          Version +
          "&amsActivityId=" +
          encodeURIComponent(e) +
          "&flowId=" +
          encodeURIComponent(n);
        SendLog(LogCgiGo, r);
      } catch (e) {}
    };
    var SendOpenIdLog = function () {
      try {
        var e =
          "click_type=3&e_code=" +
          e_code +
          "&o2_mid=" +
          o2_mid +
          "&Url=" +
          encodeURIComponent(LogUrl) +
          "&ReferrerUrl=" +
          encodeURIComponent(fnn.getEasUrl(ReferrerUrl)) +
          "&EntryReferrerUrl=" +
          encodeURIComponent(fnn.getEasUrl(EntryReferrerUrl)) +
          "&Version=" +
          Version +
          "&ForOpenId=1";
        SendLog(LogCgiGo, e);
      } catch (e) {}
    };
    var SendUinLog = function () {
      SendOpenIdLog();
    };
    var SendUinOrOpenIdLog = function () {
      try {
        var e =
          "click_type=3&e_code=" +
          e_code +
          "&o2_mid=" +
          o2_mid +
          "&Url=" +
          encodeURIComponent(LogUrl) +
          "&ReferrerUrl=" +
          encodeURIComponent(fnn.getEasUrl(ReferrerUrl)) +
          "&EntryReferrerUrl=" +
          encodeURIComponent(fnn.getEasUrl(EntryReferrerUrl)) +
          "&Version=" +
          Version +
          "&ForOpenId=1&Uin=" +
          GetUin() +
          "&openid=" +
          GetOpenId();
        SendLog(LogCgiGo, e);
      } catch (e) {}
    };
    var SendUinOrOpenIdLogForSpecialUrls = function () {
      var e = ["bns.qq.com", "cf.qq.com"];
      for (var n = 0; n < e.length; n++) {
        if (LogUrl.toLowerCase().indexOf(e[n]) > 0) {
          SendUinOrOpenIdLog();
          return;
        }
      }
      var r = [
        "http://act.daoju.qq.com/act/a20191115bnsact/",
        "http://eafifa.qq.com/cp/a20191128kaka/",
        "http://bns.qq.com/",
        "http://tiantang2.qq.com/lbact/a20191113fifteen/fifteen.html",
      ];
      for (var n = 0; n < r.length; n++) {
        if (LogUrl == r[n]) {
          if (GetUin() || GetOpenId()) {
            SendUinOrOpenIdLog();
          }
        }
      }
    };
    var needjs = function (name, callback) {
      if (eval("EAS." + name) == undefined) {
        fnn.loadjs(
          http_type + "//ossweb-img.qq.com/images/js/eas/" + name + ".js",
          function () {
            callback();
          },
        );
      } else if (
        typeof eval("EAS." + name) == "function" ||
        typeof eval("EAS." + name) == "object"
      ) {
        callback();
      }
    };
    var GetECodeExt = function () {
      return e_code;
    };
    var GetGCodeExt = function () {
      return g_code;
    };
    var GetLogUrlExt = function () {
      return LogUrl;
    };
    var GetReferrerUrlExt = function () {
      try {
        SendUinOrOpenIdLogForSpecialUrls();
        var e = ReferrerUrl;
        if (!e) {
          e = "http://noreferrer/";
        }
        e = fnn.getEasUrl(e);
        if (e.indexOf("?") == -1) {
          return e + "?reqid=" + UUID() + "&version=" + Version;
        } else {
          return e + "&reqid=" + UUID() + "&version=" + Version;
        }
      } catch (e) {}
    };
    var SendShareLog = function (e, n) {
      if (typeof n != "string") {
        n = "";
      }
      var r =
        "click_type=4&adtag=" +
        e +
        "&e_code=" +
        e_code +
        "&o2_mid=" +
        o2_mid +
        "&Url=" +
        encodeURIComponent(LogUrl) +
        "&ReferrerUrl=" +
        encodeURIComponent(ReferrerUrl) +
        "&Version=" +
        Version +
        "&ShareUrl=" +
        encodeURIComponent(fnn.getEasUrl(n)) +
        "&ShareCode=" +
        encodeURIComponent(GetECode(n));
      SendLog(LogCgiGo, r);
    };
    var SendShareClickLog = function (e) {
      SendShareLog("share.click", e);
    };
    var SendShareVisitLog = function (e) {
      SendShareLog("share.visit", e);
    };
    GetTrackCode();
    return {
      Version: Version,
      Init: Init,
      ADTAGPop: ADTAGPop,
      getUrlVar: fnn.getUrlVar,
      SendClick: SendClick,
      GetECode: GetECode,
      e_code: e_code,
      g_code: g_code,
      addEvent: addEvent,
      loadjs: fnn.loadjs,
      getEasUrl: fnn.getEasUrl,
      trimStr: fnn.trimStr,
      urlEncode: fnn.urlEncode,
      Cookie: EASCookie,
      ADShow: ADShow,
      ADClick: ADClick,
      VShow: VShow,
      GShow: GShow,
      GODMLogin: GODMLogin,
      GODMInit: GODMInit,
      GODMClick: GODMClick,
      SysInit: SysInit,
      SysClick: SysClick,
      DJClick: DJClick,
      TimeLine: TimeLine,
      need: needjs,
      LogUrl: LogUrl,
      ReferrerUrl: ReferrerUrl,
      SendLog: SendLog,
      SendAmsLog: SendAmsLog,
      SendOpenIdLog: SendOpenIdLog,
      SendUinLog: SendUinLog,
      SendShareClickLog: SendShareClickLog,
      SendShareVisitLog: SendShareVisitLog,
      GetUin: GetUin,
      GetOpenId: GetOpenId,
      LogCgi: LogCgi,
      LogCgiGo: LogCgiGo,
      StartTime: StartTime,
      GetECodeExt: GetECodeExt,
      GetGCodeExt: GetGCodeExt,
      GetLogUrlExt: GetLogUrlExt,
      GetReferrerUrlExt: GetReferrerUrlExt,
      browser: browser,
    };
  })();
  EAS.Init();
  if (window.location.host == "x5.qq.com") {
    EAS.TimeLine();
  }
}
