Advertisement
Guest User

Untitled

a guest
May 24th, 2016
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. EBGInfra = {
  2.     declareNamespace: function(a) {
  3.         for (var b = window.EBG, a = a.split("."), c = 0; c < a.length; c++) {
  4.             var d = a[c],
  5.                 e = b[d];
  6.             e || (e = b[d] = {});
  7.             b = e
  8.         }
  9.     },
  10.     declareClass: function(a, b) {
  11.         a.prototype.constructor = a;
  12.         if (b) a.__superClass = b, a.__basePrototypePending = !0, EBG._resolveInheritance(a);
  13.         return a
  14.     },
  15.     runTimed: function(a, b, c, d) {
  16.         return setTimeout(function() {
  17.             b.apply(a, c)
  18.         }, d)
  19.     },
  20.     setInterval: function(a, b, c, d) {
  21.         return setInterval(function() {
  22.             b.apply(a, c)
  23.         }, d)
  24.     },
  25.     clearInterval: function(a) {
  26.         clearInterval(a)
  27.     },
  28.     sequence: function() {
  29.         var a = [],
  30.             b =
  31.             function(c) {
  32.                 c.count--;
  33.                 if (0 <= c.count) return EBG.runTimed(this, b, [c], c.interval), c.tfunc.apply(c.context, c.args);
  34.                 EBG.isFunc(c.callback) && c.callback.apply(c.cbContext, c.cbArgs);
  35.                 a[c.index] = null
  36.             };
  37.         return function(c, d, e, f, g, h, i, j, k, m) {
  38.             if (EBG.isFunc(d)) {
  39.                 var l;
  40.                 a: {
  41.                     for (l = 0; l < a.length; l++)
  42.                         if (a[l] && a[l].func == d) break a;l = !1
  43.                 }
  44.                 h = EBG.isNumber(h) ? h : g;
  45.                 m = m || {};
  46.                 if (EBG.isFunc(j) && !EBG.isDefined(m.trailing)) m.trailing = !1;
  47.                 c = {
  48.                     context: c,
  49.                     func: d,
  50.                     tfunc: !1 === l ? this.throttle(d, h, m) : a[l].tfunc,
  51.                     args: e ? e : [],
  52.                     count: f,
  53.                     interval: g,
  54.                     cbContext: i,
  55.                     callback: j,
  56.                     cbArgs: k ? k : []
  57.                 };
  58.                 d = a.push(c) - 1;
  59.                 a[d].index = d;
  60.                 return b(c)
  61.             }
  62.             return !1
  63.         }
  64.     }(),
  65.     debounce: function(a, b, c) {
  66.         var d, e, f, g, h, i = function() {
  67.             var j = (new Date).getTime() - g;
  68.             j < b && 0 <= j ? d = setTimeout(i, b - j) : (d = null, c || (h = a.apply(f, e), d || (f = e = null)))
  69.         };
  70.         return function() {
  71.             f = this;
  72.             e = arguments;
  73.             g = (new Date).getTime();
  74.             var j = c && !d;
  75.             d || (d = setTimeout(i, b));
  76.             j && (h = a.apply(f, e), f = e = null);
  77.             return h
  78.         }
  79.     },
  80.     throttle: function(a, b, c) {
  81.         var d, e, f, g = null,
  82.             h = 0;
  83.         c || (c = {});
  84.         var i = function() {
  85.             h = !1 === c.leading ? 0 : (new Date).getTime();
  86.             g = null;
  87.             f = a.apply(d, e);
  88.             g || (d = e = null)
  89.         };
  90.         return function() {
  91.             var j = (new Date).getTime();
  92.             !h && !1 === c.leading && (h = j);
  93.             var k = b - (j - h);
  94.             d = this;
  95.             e = arguments;
  96.             0 >= k || k > b ? (g && (clearTimeout(g), g = null), h = j, f = a.apply(d, e), g || (d = e = null)) : !g && !1 !== c.trailing && (g = setTimeout(i, k));
  97.             return f
  98.         }
  99.     },
  100.     _resolveInheritance: function(a) {
  101.         if (a.__basePrototypePending) {
  102.             var b = a.__superClass;
  103.             EBG._resolveInheritance(b);
  104.             var b = b.prototype,
  105.                 c = a.prototype,
  106.                 d;
  107.             for (d in b) c[d] = c[d] || b[d];
  108.             delete a.__basePrototypePending
  109.         }
  110.     },
  111.     callSuperConstructor: function(a, b, c) {
  112.         (a = a.__superClass) &&
  113.         (c ? a.apply(b, c) : a.apply(b));
  114.         return b
  115.     },
  116.     callSuperFunction: function(a, b, c, d) {
  117.         if (a = a.__superClass) var e = a.prototype[c];
  118.         try {
  119.             if (e) return d ? e.apply(b, d) : e.apply(b)
  120.         } catch (f) {}
  121.     },
  122.     typeOf: function(a) {
  123.         var b = typeof a;
  124.         if ("object" == b)
  125.             if (a) {
  126.                 if (a instanceof Array || !(a instanceof Object) && "[object Array]" == Object.prototype.toString.call(a) || "number" == typeof a.length && "undefined" != typeof a.splice && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("splice")) return "array";
  127.                 if (!(a instanceof Object) && ("[object Function]" ==
  128.                         Object.prototype.toString.call(a) || "undefined" != typeof a.call && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("call"))) return "function"
  129.             } else return "function" == b && "undefined" == typeof a.call ? "object" : "null";
  130.         return b
  131.     },
  132.     isFunc: function(a) {
  133.         return "function" == EBG.typeOf(a)
  134.     },
  135.     isDefined: function(a) {
  136.         return "undefined" != EBG.typeOf(a)
  137.     },
  138.     notNull: function(a) {
  139.         return null != a
  140.     },
  141.     isDefinedNotNull: function(a) {
  142.         return this.isDefined(a) && this.notNull(a)
  143.     },
  144.     hasValue: function(a) {
  145.         return null != a && "undefined" !=
  146.             EBG.typeOf(a)
  147.     },
  148.     hasOwnValue: function(a, b, c) {
  149.         for (var d in a)
  150.             if (a.hasOwnProperty(d))
  151.                 if (c) {
  152.                     if (a[d].toLowerCase() === b.toLowerCase()) return !0
  153.                 } else if (a[d] === b) return !0;
  154.         return !1
  155.     },
  156.     getRandomNumber: function() {
  157.         var a = "";
  158.         try {
  159.             a = Math.random().toString(), a = a.substr(a.indexOf(".") + 1)
  160.         } catch (b) {
  161.             a = ""
  162.         }
  163.         return a
  164.     },
  165.     isObj: function(a) {
  166.         return "object" == EBG.typeOf(a)
  167.     },
  168.     isArray: function(a) {
  169.         return "array" == EBG.typeOf(a)
  170.     },
  171.     isBool: function(a) {
  172.         return "boolean" == EBG.typeOf(a)
  173.     },
  174.     isNumber: function(a) {
  175.         return !isNaN(parseFloat(a)) && isFinite(a)
  176.     },
  177.     format: function(a) {
  178.         for (var b = 1; b < arguments.length; b++) a = a.replace(RegExp("\\{" + (b - 1) + "\\}", "gi"), "" + arguments[b]);
  179.         return a
  180.     },
  181.     throwEx: function(a) {
  182.         throw {
  183.             name: "",
  184.             message: a
  185.         };
  186.     },
  187.     mergeObj: function(a, b, c) {
  188.         var c = !!c,
  189.             d;
  190.         for (d in a)
  191.             if (a.hasOwnProperty(d) && (!b.hasOwnProperty(d) || c)) b[d] = a[d]
  192.     },
  193.     cloneObj: function(a) {
  194.         if (!EBG.isObj(a)) return null;
  195.         var b = {},
  196.             c;
  197.         for (c in a) a.hasOwnProperty(c) && (b[c] = EBG.isObj(a[c]) ? EBG.cloneObj(a[c]) : a[c]);
  198.         return b
  199.     },
  200.     combinePaths: function(a, b) {
  201.         a = a || "";
  202.         b = b || "";
  203.         a && "/" != a[a.length - 1] && b && "/" !=
  204.             b[0] && (a += "/");
  205.         var c = a;
  206.         b && (c += b);
  207.         return c
  208.     },
  209.     px: function(a) {
  210.         return EBG.format("{0}px", a)
  211.     },
  212.     strEQ: function(a, b, c) {
  213.         return a && b ? c ? a === b : a.toLowerCase() === b.toLowerCase() : !1
  214.     },
  215.     indexOfArray: function(a, b) {
  216.         for (var c = 0; c < a.length; c++)
  217.             if (a[c] == b) return c;
  218.         return -1
  219.     },
  220.     filterArray: function(a, b, c) {
  221.         var d = a.length >>> 0;
  222.         if ("function" != typeof b) throw new TypeError;
  223.         for (var e = [], f = 0; f < d; f++)
  224.             if (f in a) {
  225.                 var g = a[f];
  226.                 b.call(c || window, g, f, a) && e.push(g)
  227.             }
  228.         return e
  229.     },
  230.     mapArray: function(a, b, c) {
  231.         var d = a.length >>> 0;
  232.         if ("function" != typeof b) throw new TypeError;
  233.         for (var e = [], f = 0; f < d; f++) f in a && e.push(b.call(c || window, a[f], f, a));
  234.         return e
  235.     },
  236.     isGlobalDef: function(a, b) {
  237.         var c = "undefined" != typeof window[a];
  238.         b && c && (c = eval(a + "==" + b));
  239.         return c
  240.     },
  241.     numberToEnum: function(a, b) {
  242.         var c = "",
  243.             d;
  244.         for (d in b)
  245.             if (b.hasOwnProperty(d) && b[d] === a) {
  246.                 c = d;
  247.                 break
  248.             }
  249.         return c
  250.     },
  251.     getPageUrl: function(a) {
  252.         try {
  253.             return a && a.location && a.location.href ? a.location.href : null
  254.         } catch (b) {
  255.             return null
  256.         }
  257.     },
  258.     _isXMLHttpRequestSupported: function() {
  259.         var a = window.XMLHttpRequest ? new XMLHttpRequest : null;
  260.         return a && EBG.isBool(a.withCredentials)
  261.     },
  262.     htmlDecode: function(a) {
  263.         this.helperDiv = this.helperDiv ? this.helperDiv : document.createElement("div");
  264.         this.helperDiv.innerHTML = a;
  265.         return this.helperDiv.textContent
  266.     },
  267.     htmlEncode: function(a) {
  268.         this.helperDiv = this.helperDiv ? this.helperDiv : document.createElement("div");
  269.         this.helperDiv.textContent = a;
  270.         return this.helperDiv.innerHTML
  271.     },
  272.     getDataFromRemoteServer: function(a, b, c, d, e) {
  273.         if (!a || EBG.isOfflineDemo) return !1;
  274.         var d = EBG.isBool(d) ? d : !0,
  275.             e = EBG.isBool(e) ? e : !1,
  276.             f = function() {
  277.                 try {
  278.                     if (e) {
  279.                         var a, d;
  280.                         9 === document.documentMode ?
  281.                             d = (new window.DOMParser).parseFromString(i.responseText, "text/xml") : (a = document.createElement("div"), a.innerHTML = "<xml>" + i.responseText + "</xml>", document.body.appendChild(a), d = a.firstChild.XMLDocument, document.body.removeChild(a));
  282.                         b.call(c, d)
  283.                     } else b.call(c, i.responseText)
  284.                 } catch (f) {
  285.                     b.call(c)
  286.                 }
  287.             },
  288.             g = !1;
  289.         try {
  290.             if (this._isXMLHttpRequestSupported()) {
  291.                 var h = new XMLHttpRequest;
  292.                 h.open("GET", a, d);
  293.                 g = !0;
  294.                 if (d) h.onreadystatechange = function() {
  295.                     4 == h.readyState && (200 == h.status ? b.call(c, e ? h.responseXML : h.responseText) : b.call(c))
  296.                 };
  297.                 h.send();
  298.                 d || b.call(c, e ? h.responseXML : h.responseText)
  299.             } else if (window.XDomainRequest && d) {
  300.                 var i = new XDomainRequest;
  301.                 if (i) i.onerror = function() {
  302.                     EBG.log.error("XDomain request error");
  303.                     b.call(c)
  304.                 }, i.ontimeout = function() {
  305.                     EBG.log.error("XDomain request timeout");
  306.                     b.call(c)
  307.                 }, i.onload = f, i.onprogress = function() {}, i.open("get", a), i.send(), g = !0
  308.             }
  309.         } catch (j) {
  310.             g = !1
  311.         }
  312.         return g
  313.     },
  314.     getFeatureFlagValue: function(a, b) {
  315.         if (!EBG.isDefined(a)) return !1;
  316.         if (EBG.isArray(a)) {
  317.             for (var c = 0; c < a.length; c++)
  318.                 if (a[c].name == b) return a[c].state;
  319.             return !1
  320.         }
  321.         return !!a[b]
  322.     },
  323.     isPercentage: function(a) {
  324.         return a instanceof String ? -1 < a.indexOf("%") : !1
  325.     },
  326.     getTime: function() {
  327.         var a = (new Date).getTime() / 1E3;
  328.         return function() {
  329.             return (new Date).getTime() / 1E3 - a
  330.         }
  331.     }(),
  332.     getObjKeys: function(a) {
  333.         a = a || {};
  334.         if (Object.keys) return Object.keys(a);
  335.         var b = [],
  336.             c;
  337.         for (c in a) a.hasOwnProperty(c) && b.push(c);
  338.         return b
  339.     },
  340.     serializeObject: function(a) {
  341.         var b = [],
  342.             c;
  343.         for (c in a) a.hasOwnProperty(c) && b.push(c + "=" + a[c]);
  344.         return b.join("&")
  345.     },
  346.     capitalize: function(a) {
  347.         return a.charAt(0).toUpperCase() + a.slice(1)
  348.     },
  349.     getTopAccessibleWindow: function() {
  350.         var a =
  351.             window.ebO && ebO.ffs && ebO.ffs || window.EB && EB._adConfig && EB._adConfig.ffs;
  352.         if (!a) {
  353.             var b = arguments.callee;
  354.             return function() {
  355.                 return b()()
  356.             }
  357.         }
  358.         var c = window;
  359.         if (c.location.ancestorOrigins && a && a.CFF_ancestorOrigins) {
  360.             for (var d = window, e = window, a = c.location.ancestorOrigins, f = !1, g = 0; g < a.length; g++) {
  361.                 var c = c.parent,
  362.                     h = document.createElement("a");
  363.                 h.href = a[g];
  364.                 h = h.hostname;
  365.                 window.location.origin === a[g] || "" === window.location.hostname && "" === h ? (e = c, f || (d = c)) : f = !0
  366.             }
  367.             return function(a) {
  368.                 return ("boolean" == typeof a ? a : 1) ? d : e
  369.             }
  370.         }
  371.         try {
  372.             if (c.top.document.domain ||
  373.                 "" === c.parent.document.domain) c = c.top;
  374.             else throw new DOMException;
  375.         } catch (i) {
  376.             try {
  377.                 for (c = window; c !== c.parent && c.self !== c.parent;)
  378.                     if (c.parent.document.domain || "" === c.parent.document.domain) c = c.parent
  379.             } catch (j) {}
  380.         }
  381.         return function() {
  382.             return c
  383.         }
  384.     }(),
  385.     getBigScript: function() {
  386.         var a;
  387.         if (document.currentScript) a = document.currentScript;
  388.         else {
  389.             var b = document.getElementsByTagName("script");
  390.             a = b[b.length - 1]
  391.         }
  392.         return function() {
  393.             return a
  394.         }
  395.     }(),
  396.     valueFromPath: function(a, b, c) {
  397.         for (var b = b.split("."), d = 0; d < b.length; d++) a = a[b[d]];
  398.         return EBG.isObj(a) &&
  399.             c ? EBG.cloneObj(a) : a
  400.     }
  401. };
  402. EBG = window.EBG || {};
  403. EBGInfra.mergeObj(EBGInfra, EBG, !1);
  404. EBG.declareNamespace("Logging");
  405. EBG.Logging.LoggerLevels = {
  406.     NONE: 0,
  407.     ERROR: 1,
  408.     INFO: 2,
  409.     WARN: 3,
  410.     DEBUG: 4
  411. };
  412. EBG.Logging.Logger = function(a) {
  413.     this._level = a;
  414.     this.startNestingGroupNames = [];
  415.     this.endNestingGroupNames = [];
  416.     this._stringFilters = [];
  417.     this._fGroupFilter = !1;
  418.     this._maxIndent = 15
  419. };
  420. EBG.Logging.Logger.prototype = {
  421.     setLevel: function(a) {
  422.         this._level = a
  423.     },
  424.     setFilter: function(a, b) {
  425.         "string" == EBG.typeOf(a) && (a = [a]);
  426.         this._fGroupFilter = EBG.isDefined(b) ? b : !0;
  427.         this._stringFilters = a
  428.     },
  429.     debug: function(a) {
  430.         this._reportToLog(EBG.Logging.LoggerLevels.DEBUG, arguments)
  431.     },
  432.     info: function(a) {
  433.         this._reportToLog(EBG.Logging.LoggerLevels.INFO, arguments)
  434.     },
  435.     warn: function(a) {
  436.         this._reportToLog(EBG.Logging.LoggerLevels.WARN, arguments)
  437.     },
  438.     error: function(a) {
  439.         this._reportToLog(EBG.Logging.LoggerLevels.ERROR, arguments)
  440.     },
  441.     exception: function(a,
  442.         b) {
  443.         var c = "string" !== b ? EBG.format("Exception in {0}. message: {1}", a, b.message) : EBG.format("Exception in: {0}. message: {1}", a, b);
  444.         b.stack && (c += EBG.format(" stack: {0}", b.stack));
  445.         this._reportToLog(EBG.Logging.LoggerLevels.ERROR, [c])
  446.     },
  447.     startGroup: function(a) {
  448.         this._supportNesting() && this._passesFilter(a) && this.startNestingGroupNames.push(a)
  449.     },
  450.     endGroup: function() {
  451.         this._supportNesting() && 0 < this.endNestingGroupNames.length && window.console.groupEnd(this.endNestingGroupNames.pop())
  452.     },
  453.     _consoleAvailable: function() {
  454.         return void 0 !==
  455.             window.console
  456.     },
  457.     _supportNesting: function() {
  458.         return this._consoleAvailable() ? void 0 !== window.console.group : !1
  459.     },
  460.     _supportErrorMessage: function() {
  461.         return void 0 !== window.console.error
  462.     },
  463.     _supportInfoMessage: function() {
  464.         return void 0 !== window.console.info || void 0 !== window.opera
  465.     },
  466.     _supportWarnMessage: function() {
  467.         return void 0 !== window.console.warn || void 0 !== window.opera
  468.     },
  469.     _supportObjectView: function() {
  470.         return void 0 !== window.console.dir || void 0 !== window.opera
  471.     },
  472.     _callConsoleFunction: function(a, b) {
  473.         var c = !1;
  474.         switch (a) {
  475.             case EBG.Logging.LoggerLevels.INFO:
  476.                 this._supportInfoMessage() &&
  477.                     (window.console.info(b), c = !0);
  478.                 break;
  479.             case EBG.Logging.LoggerLevels.WARN:
  480.                 this._supportWarnMessage() && (window.console.warn(b), c = !0);
  481.                 break;
  482.             case EBG.Logging.LoggerLevels.ERROR:
  483.                 this._supportErrorMessage() && (consoleFunction = window.console.error(b), c = !0)
  484.         }
  485.         c || window.console.log(b)
  486.     },
  487.     _resetNesting: function() {
  488.         for (var a = 0; a <= this._maxIndent; a++) this.endGroup();
  489.         console.warn("Reset log group nesting. MaxIndent = " + this._maxIndent)
  490.     },
  491.     _passesFilter: function(a) {
  492.         var b = !1;
  493.         if (0 == this._stringFilters.length) b = !0;
  494.         else
  495.             for (var c =
  496.                     0; c < this._stringFilters.length; c++)
  497.                 if (-1 < a.indexOf(this._stringFilters[c])) {
  498.                     b = !0;
  499.                     break
  500.                 } return b
  501.     },
  502.     _reportToLog: function(a, b) {
  503.         if (this._level >= a && this._consoleAvailable()) {
  504.             var c = b[0];
  505.             "[object String]" !== Object.prototype.toString.call(c) ? this._supportObjectView() || (c = c.toString()) : c = EBG.format.apply(null, b);
  506.             if (void 0 === window.opera) {
  507.                 for (; this.startNestingGroupNames.length;) window.console.group(this.startNestingGroupNames[0]), this.endNestingGroupNames.push(this.startNestingGroupNames.shift());
  508.                 (this._passesFilter(c) ||
  509.                     this._fGroupFilter && 0 < this.endNestingGroupNames.length) && this._callConsoleFunction(a, c);
  510.                 this.endNestingGroupNames.length > this._maxIndent && this._resetNesting()
  511.             } else this._passesFilter(c) && opera.postError(c)
  512.         }
  513.     }
  514. };
  515. EBG.declareClass(EBG.Logging.Logger, null);
  516. EBG.log = EBG.log || new EBG.Logging.Logger(EBG.Logging.LoggerLevels.DEBUG);
  517. EBG.declareNamespace("Reporter");
  518. EBG.Reporter.ServerReporter = function(a) {
  519.     this.reportFrequency = a.reportFrequency || 0;
  520.     this.bs = a.bs
  521. };
  522. EBG.Reporter.ServerReporter.prototype = {
  523.     bs: null,
  524.     report: function(a) {
  525.         this._shouldReport() && this._reportMessage(a)
  526.     },
  527.     getCallStack: function() {
  528.         try {
  529.             throw Error();
  530.         } catch (a) {
  531.             return formatCallStack(a.stack)
  532.         }
  533.     },
  534.     _shouldReport: function() {
  535.         var a = !1;
  536.         0 < this.reportFrequency && this.reportFrequency / 100 > Math.random() && (a = !0);
  537.         return a
  538.     },
  539.     formatCallStack: function(a) {
  540.         if (a) {
  541.             for (var b; b != a;) b = a, a = a.replace(/((https?:\/..*\/)[^\/:]*:\d+(?:.|\n)*)\2/, "$1");
  542.             a = a.replace(/\n/g, "")
  543.         }
  544.         return a
  545.     },
  546.     _reportMessage: function(a) {
  547.         var b = EBG.format("{0}{1}/BurstingPipe/adServer.bs?cn=cLog&ord={2}",
  548.                 EBG.protocol, this.bs, Math.random()),
  549.             c;
  550.         for (c in a) a.hasOwnProperty(c) && (b += "&" + c + "=" + a[c]);
  551.         EBG.adaptor.reportToRemoteServerUsingImage(b)
  552.     }
  553. };
  554. EBG.declareClass(EBG.Reporter.ServerReporter, null);
  555. (function(a, b, c) {
  556.     b || (b = {
  557.         fn: {},
  558.         extend: function() {
  559.             for (var a = arguments[0], b = 1, c = arguments.length; b < c; b++) {
  560.                 var d = arguments[b],
  561.                     i;
  562.                 for (i in d) a[i] = d[i]
  563.             }
  564.             return a
  565.         }
  566.     });
  567.     b.fn.pm = function() {
  568.         return this
  569.     };
  570.     b.pm = EBG.pm = function(a) {
  571.         d.send(a)
  572.     };
  573.     b.pm.bind = EBG.bind = function(a, b, c, h, i) {
  574.         d.bind(a, b, c, h, i)
  575.     };
  576.     b.pm.unbind = EBG.unbind = function(a, b) {
  577.         d.unbind(a, b)
  578.     };
  579.     b.pm.dispatch = function(a, b, c, h) {
  580.         d._dispatch({
  581.             data: JSON.stringify({
  582.                 data: b,
  583.                 type: a
  584.             }),
  585.             source: c,
  586.             target: h,
  587.             origin: null
  588.         })
  589.     };
  590.     b.pm.origin = EBG.pm.origin = null;
  591.     var d = {
  592.         send: function(a) {
  593.             var a =
  594.                 b.extend({}, d.defaults, a),
  595.                 c = a.target;
  596.             if (a.target && a.type) {
  597.                 var g = {
  598.                     data: a.data,
  599.                     type: a.type
  600.                 };
  601.                 if (a.success) g.callback = d._callback(a.success);
  602.                 if (a.error) g.errback = d._callback(a.error);
  603.                 "postMessage" in c && !a.hash && (d._bind(), c.postMessage(JSON.stringify(g), a.origin || "*"))
  604.             }
  605.         },
  606.         bind: function(c, f, g, h, i, j) {
  607.             "postMessage" in a && !j && (d._bind(h), h = d.data("listeners.postmessage"), h || (h = {}, d.data("listeners.postmessage", h)), j = h[c], j || (j = [], h[c] = j), j.push({
  608.                 fn: f,
  609.                 origin: i || b.pm.origin,
  610.                 bindObj: g
  611.             }))
  612.         },
  613.         unbind: function(a, b) {
  614.             var c =
  615.                 d.data("listeners.postmessage");
  616.             if (c && a)
  617.                 if (b) {
  618.                     var h = c[a];
  619.                     if (h) {
  620.                         for (var i = [], j = 0, k = h.length; j < k; j++) {
  621.                             var m = h[j];
  622.                             m.fn !== b && i.push(m)
  623.                         }
  624.                         c[a] = i
  625.                     }
  626.                 } else delete c[a]
  627.         },
  628.         data: function(a, b) {
  629.             return b === c ? d._data[a] : d._data[a] = b
  630.         },
  631.         _data: {},
  632.         _CHARS: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),
  633.         _random: function() {
  634.             for (var a = [], b = 0; 32 > b; b++) a[b] = d._CHARS[0 | 32 * Math.random()];
  635.             return a.join("")
  636.         },
  637.         _callback: function(a) {
  638.             var b = d.data("callbacks.postmessage");
  639.             b || (b = {}, d.data("callbacks.postmessage",
  640.                 b));
  641.             var c = d._random();
  642.             b[c] = a;
  643.             return c
  644.         },
  645.         _bind: function(b) {
  646.             d.data("listening.postmessage") || (b = b ? b : a, b.addEventListener ? b.addEventListener("message", d._dispatch, !1) : a.attachEvent && b.attachEvent("onmessage", d._dispatch), d.data("listening.postmessage", 1))
  647.         },
  648.         _dispatch: function(a) {
  649.             var b = {};
  650.             try {
  651.                 b = JSON.parse(a.data)
  652.             } catch (c) {
  653.                 return
  654.             }
  655.             if (b.type) {
  656.                 var h = (d.data("callbacks.postmessage") || {})[b.type];
  657.                 if (h) h(b.data);
  658.                 else
  659.                     for (var h = (d.data("listeners.postmessage") || {})[b.type] || [], i = 0, j = h.length; i < j; i++) {
  660.                         var k = h[i];
  661.                         if (k.origin && a.origin !== k.origin) b.errback && d.send({
  662.                             target: a.source,
  663.                             data: {
  664.                                 message: "postmessage origin mismatch",
  665.                                 origin: [a.origin, k.origin]
  666.                             },
  667.                             type: b.errback
  668.                         });
  669.                         else try {
  670.                             var m;
  671.                             m = k.bindObj ? k.fn.apply(k.bindObj, [b.data, a]) : k.fn(b.data, a);
  672.                             b.callback && d.send({
  673.                                 target: a.source,
  674.                                 data: m,
  675.                                 type: b.callback
  676.                             })
  677.                         } catch (l) {
  678.                             b.errback && d.send({
  679.                                 target: a.source,
  680.                                 data: l,
  681.                                 type: b.errback
  682.                             })
  683.                         }
  684.                     }
  685.             }
  686.         }
  687.     };
  688.     b.extend(d, {
  689.         defaults: {
  690.             target: null,
  691.             url: null,
  692.             type: null,
  693.             data: null,
  694.             success: null,
  695.             error: null,
  696.             origin: "*",
  697.             hash: !1
  698.         }
  699.     })
  700. })(this, "undefined" === typeof jQuery ?
  701.     null : jQuery);
  702. "JSON" in window && window.JSON || (JSON = {});
  703. (function() {
  704.     function a(a) {
  705.         return 10 > a ? "0" + a : a
  706.     }
  707.  
  708.     function b(a) {
  709.         e.lastIndex = 0;
  710.         return e.test(a) ? '"' + a.replace(e, function(a) {
  711.             var b = h[a];
  712.             return "string" === typeof b ? b : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4)
  713.         }) + '"' : '"' + a + '"'
  714.     }
  715.  
  716.     function c(a, d) {
  717.         var e, h, p, n, r = f,
  718.             q, o = d[a];
  719.         o && "object" === typeof o && "function" === typeof o.toJSON && (o = o.toJSON(a));
  720.         "function" === typeof i && (o = i.call(d, a, o));
  721.         switch (typeof o) {
  722.             case "string":
  723.                 return b(o);
  724.             case "number":
  725.                 return isFinite(o) ? "" + o : "null";
  726.             case "boolean":
  727.             case "null":
  728.                 return "" +
  729.                     o;
  730.             case "object":
  731.                 if (!o) return "null";
  732.                 f += g;
  733.                 q = [];
  734.                 if ("[object Array]" === Object.prototype.toString.apply(o)) {
  735.                     n = o.length;
  736.                     for (e = 0; e < n; e += 1) q[e] = c(e, o) || "null";
  737.                     p = 0 === q.length ? "[]" : f ? "[\n" + f + q.join(",\n" + f) + "\n" + r + "]" : "[" + q.join(",") + "]";
  738.                     f = r;
  739.                     return p
  740.                 }
  741.                 if (i && "object" === typeof i) {
  742.                     n = i.length;
  743.                     for (e = 0; e < n; e += 1) h = i[e], "string" === typeof h && (p = c(h, o)) && q.push(b(h) + (f ? ": " : ":") + p)
  744.                 } else
  745.                     for (h in o) Object.hasOwnProperty.call(o, h) && (p = c(h, o)) && q.push(b(h) + (f ? ": " : ":") + p);
  746.                 p = 0 === q.length ? "{}" : f ? "{\n" + f + q.join(",\n" + f) + "\n" +
  747.                     r + "}" : "{" + q.join(",") + "}";
  748.                 f = r;
  749.                 return p
  750.         }
  751.     }
  752.     if ("function" !== typeof Date.prototype.toJSON) Date.prototype.toJSON = function() {
  753.         return this.getUTCFullYear() + "-" + a(this.getUTCMonth() + 1) + "-" + a(this.getUTCDate()) + "T" + a(this.getUTCHours()) + ":" + a(this.getUTCMinutes()) + ":" + a(this.getUTCSeconds()) + "Z"
  754.     }, String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  755.         return this.valueOf()
  756.     };
  757.     var d = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  758.         e = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  759.         f, g, h = {
  760.             "\u0008": "\\b",
  761.             "\t": "\\t",
  762.             "\n": "\\n",
  763.             "\u000c": "\\f",
  764.             "\r": "\\r",
  765.             '"': '\\"',
  766.             "\\": "\\\\"
  767.         },
  768.         i;
  769.     if ("function" !== typeof JSON.stringify) JSON.stringify = function(a, b, d) {
  770.         var e;
  771.         g = f = "";
  772.         if ("number" === typeof d)
  773.             for (e = 0; e < d; e += 1) g += " ";
  774.         else "string" === typeof d && (g = d);
  775.         if ((i = b) && "function" !== typeof b && ("object" !== typeof b || "number" !== typeof b.length)) throw Error("JSON.stringify");
  776.         return c("", {
  777.             "": a
  778.         })
  779.     };
  780.     if ("function" !== typeof JSON.parse) JSON.parse = function(a, b) {
  781.         function c(a, d) {
  782.             var e, f, g = a[d];
  783.             if (g && "object" === typeof g)
  784.                 for (e in g) Object.hasOwnProperty.call(g, e) && (f = c(g, e), void 0 !== f ? g[e] = f : delete g[e]);
  785.             return b.call(a, d, g)
  786.         }
  787.         var e;
  788.         d.lastIndex = 0;
  789.         d.test(a) && (a = a.replace(d, function(a) {
  790.             return "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4)
  791.         }));
  792.         if (/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
  793.                 "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) return e = eval("(" + a + ")"), "function" === typeof b ? c({
  794.             "": e
  795.         }, "") : e;
  796.         throw new SyntaxError("JSON.parse");
  797.     }
  798. })();
  799. MsgProtocol = function() {};
  800. MsgProtocol.prototype = {
  801.     _interval_id: null,
  802.     _last_hash: "",
  803.     _cache_bust: 1,
  804.     postMessage: function(a, b, c) {
  805.         c = c || parent;
  806.         if (b) c.location ? c.location = b.replace(/#.*$/, "") + "#" + +new Date + this._cache_bust++ + "&" + a : c.src = b.replace(/#.*$/, "") + "#" + +new Date + this._cache_bust++ + "&" + a
  807.     },
  808.     receiveMessages: function(a, b) {
  809.         this._interval_id && clearInterval(this._interval_id);
  810.         this._interval_id = null;
  811.         if (a) this._interval_id = setInterval(function() {
  812.             var b = document.location.hash,
  813.                 d = /^#?\d+&/;
  814.             if (b !== this._last_hash && d.test(b)) this._last_hash =
  815.                 b, a({
  816.                     data: b.replace(d, "")
  817.                 })
  818.         }, b)
  819.     },
  820.     finishMessaging: function() {
  821.         clearInterval(this._interval_id);
  822.         this._interval_id = null
  823.     }
  824. };
  825. "undefined" != typeof EBG ? EBG.msgProtocol = new MsgProtocol : EBG = {
  826.     msgProtocol: new MsgProtocol
  827. };
  828. EBG.declareNamespace("API");
  829. EBG.API.InjectionMethod = {
  830.     APPEND: "append",
  831.     INSERT_BEFORE: "insertBefore",
  832.     INSERT_AFTER: "insertAfter",
  833.     FIRST_CHILD: "firstChild",
  834.     LAST_CHILD: "lastChild"
  835. };
  836. EBG.API.BrowserTypes = {
  837.     NON_SUPPORTED: 0,
  838.     IE: 1,
  839.     FF: 2,
  840.     NN: 3,
  841.     SAFARI: 4,
  842.     CHROME: 5,
  843.     AOL: 6,
  844.     OPERA: 7,
  845.     EDGE: 8
  846. };
  847. EBG.API.PlatformTypes = {
  848.     NON_SUPPORTED: 0,
  849.     WIN_95: 1,
  850.     WIN_98: 2,
  851.     WIN_2000: 3,
  852.     WIN_XP: 4,
  853.     WIN_ME: 5,
  854.     WIN_NT: 6,
  855.     MAC: 7,
  856.     WIN_VISTA: 8,
  857.     WIN_7: 9,
  858.     IPHONE: 10,
  859.     IPAD: 11,
  860.     IPOD: 12,
  861.     ANDROID_2_TAB: 13,
  862.     ANDROID_3_TAB: 14,
  863.     WIN_10: 15,
  864.     ANDROID_5_TAB: 16,
  865.     ANDROID_2_MOBILE: 17,
  866.     ANDROID_3_MOBILE: 18,
  867.     WIN_MOBILE_7: 19,
  868.     ANDROID_4_TAB: 20,
  869.     ANDROID_4_MOBILE: 21,
  870.     WIN_8: 22,
  871.     MAC_NEW: 23,
  872.     MAC_YOSEMITE: 24,
  873.     ANDROID_5_MOBILE: 25,
  874.     CROS: 26,
  875.     FBAN: 27,
  876.     SMART_TV: 28,
  877.     UBUNTU: 29,
  878.     LINUX: 30,
  879.     ANDROID_1: 31
  880. };
  881. EBG.API.DeviceTypes = {
  882.     DESKTOP: 0,
  883.     MOBILE: 1,
  884.     TABLET: 2,
  885.     UNKNOWN: 3
  886. };
  887. EBG.API.EventNames = {
  888.     CREATE_AD: "CREATE_AD",
  889.     CREATE_ADAPTOR: "CREATE_ADAPTOR",
  890.     CREATE_INT_MGR: "CREATE_INT_MGR",
  891.     CREATE_ANIM_MGR: "CREATE_ANIM_MGR",
  892.     CREATE_POSITIONING_HELPER: "CREATE_POSITIONING_HELPER",
  893.     SHOW_AD: "SHOW_AD",
  894.     ADD_CREATIVES: "ADD_CREATIVES",
  895.     ADD_INTERACTION: "ADD_INTERACTION",
  896.     ADD_EYE_DIV: "ADD_EYE_DIV",
  897.     ADD_HTML5_MAIN_CREATIVE: "ADD_HTML5_MAIN_CREATIVE",
  898.     ADD_HTML5_PANEL_CREATIVE: "ADD_HTML5_PANEL_CREATIVE",
  899.     ADD_EMPTY_BANNER_CREATIVE: "ADD_EMPTY_BANNER_CREATIVE",
  900.     ADD_BANNER_DEFAULT_IMAGE_CREATIVE: "ADD_BANNER_DEFAULT_IMAGE_CREATIVE",
  901.     ADD_BANNER_PRELOAD_IMAGE_CREATIVE: "ADD_BANNER_PRELOAD_IMAGE_CREATIVE",
  902.     ADD_BANNER_DEFAULT_FLASH_CREATIVE: "ADD_BANNER_DEFAULT_FLASH_CREATIVE",
  903.     ADD_BANNER_RICH_FLASH_CREATIVE: "ADD_BANNER_RICH_FLASH_CREATIVE",
  904.     ADD_FLOATING_INTRO_CREATIVE: "ADD_FLOATING_INTRO_CREATIVE",
  905.     ADD_FLOATING_REMINDER_CREATIVE: "ADD_FLOATING_REMINDER_CREATIVE",
  906.     ADD_FLOATING_MINISITE_CREATIVE: "ADD_FLOATING_MINISITE_CREATIVE",
  907.     ADD_PANEL_RICH_FLASH_CREATIVE: "ADD_PANEL_RICH_FLASH_CREATIVE",
  908.     SHOW_BANNER_RICH_FLASH_CREATIVE: "SHOW_BANNER_RICH_FLASH_CREATIVE",
  909.     SHOW_PANEL_RICH_FLASH_CREATIVE: "SHOW_PANEL_RICH_FLASH_CREATIVE",
  910.     SHOW_PANEL_CREATIVE: "SHOW_PANEL_CREATIVE",
  911.     SHOW_REMINDER: "SHOW_REMINDER",
  912.     SHOW_MINISITE: "SHOW_MINISITE",
  913.     PAGE_LOAD: "PAGE_LOAD",
  914.     COLLECT_TIMERS: "COLLECT_TIMERS",
  915.     PAGE_UNLOAD: "PAGE_UNLOAD",
  916.     PAGE_BEFORE_UNLOAD: "PAGE_BEFORE_UNLOAD",
  917.     PAGE_HIDE: "PAGE_HIDE",
  918.     PAGE_RESIZE: "PAGE_RESIZE",
  919.     PAGE_SCROLL: "PAGE_SCROLL",
  920.     PAGE_FOCUS: "PAGE_FOCUS",
  921.     PAGE_FOCUSIN: "PAGE_FOCUSIN",
  922.     PAGE_FOCUSOUT: "PAGE_FOCUSOUT",
  923.     PAGE_BLUR: "PAGE_BLUR",
  924.     PAGE_HIDDEN: "PAGE_HIDDEN",
  925.     PAGE_VISIBLE: "PAGE_VISIBLE",
  926.     INTERACTION_REPORT_REMOTE_SERVERS: "INTERACTION_REPORT_REMOTE_SERVERS",
  927.     START_TIMER: "START_TIMER",
  928.     STOP_TIMER: "STOP_TIMER",
  929.     UPDATE_TIMER: "UPDATE_TIMER",
  930.     HANDLE_COUNTER_INTERACTION: "HANDLE_COUNTER_INTERACTION",
  931.     HANDLE_TIMER_INTERACTION: "HANDLE_TIMER_INTERACTION",
  932.     DEFAULT_CLICK: "DEFAULT_CLICK",
  933.     EXPAND: "EXPAND",
  934.     COLLAPSE: "COLLAPSE",
  935.     USER_INTERACTION: "USER_INTERACTION",
  936.     MOUSE_OVER: "MOUSE_OVER",
  937.     MOUSE_OUT: "MOUSE_OUT",
  938.     MOUSE_MOVE: "MOUSE_MOVE",
  939.     MODULE_LOAD: "MODULE_LOAD",
  940.     USER_INITIATED_VIDEO: "USER_INITIATED_VIDEO",
  941.     DWELL_UNIQUE: "DWELL_UNIQUE",
  942.     DWELL_VIDEO_START: "DWELL_VIDEO_START",
  943.     DWELL_VIDEO_STOP: "DWELL_VIDEO_STOP",
  944.     CREATIVE_CONTAINER_READY: "CREATIVE_CONTAINER_READY",
  945.     RICH_FLASH_PLAYED: "RICH_FLASH_PLAYED",
  946.     REPLAY_AD: "REPLAY_AD",
  947.     BANDWITH_DETECTED: "BANDWITH_DETECTED",
  948.     FULL_SCREEN_START: "FULL_SCREEN_START",
  949.     FULL_SCREEN_END: "FULL_SCREEN_STOP",
  950.     ANIMATE_PANEL: "ANIMATE_PANEL",
  951.     CLOSE_AD: "CLOSE_AD",
  952.     OPEN_PAGE: "OPEN_PAGE",
  953.     MAX_AD_DURATION: "MAX_AD_DURATION",
  954.     FLASH_IN_FRAME_TWO: "FLASH_IN_FRAME_TWO",
  955.     SHOW_HIDE_ELEMENTS: "SHOW_HIDE_ELEMENTS",
  956.     DEFAULT_IMPRESSION: "DEFAULT_IMPRESSION",
  957.     AIE_LOADED: "AIE_LOADED",
  958.     INIT_MANAGERS: "INIT_MANAGERS",
  959.     MOUSE_MOVE_NEEDED: "MOUSE_MOVE_NEEDED",
  960.     VISIBILITY_CHECK: "VISIBILITY_CHECK",
  961.     VISIBILITY_HIDDEN: "VISIBILITY_HIDDEN",
  962.     AD_START: "AD_START",
  963.     ELEMENT_LOADED: "ELEMENT_LOADED",
  964.     AD_STACKING: "AD_STACKING",
  965.     SCREEN_ORIENTATION: "SCREEN_ORIENTATION",
  966.     PORTRAIT: "PORTRAIT",
  967.     LANDSCAPE: "LANDSCAPE",
  968.     CHANGE_PANEL_POSITION: "CHANGE_PANEL_POSITION",
  969.     PANEL_FREQUENCY_LOADED: "PANEL_FREQUENCY_LOADED",
  970.     THROTTLED: "THROTTLED",
  971.     FLASH_DETECTED: "FLASH_DETECTED",
  972.     ANIMATION: "ANIMATION"
  973. };
  974. EBG.API.EbEventNames = {
  975.     PAGE_LOAD: EBG.API.EventNames.PAGE_LOAD,
  976.     SCREEN_ORIENTATION: EBG.API.EventNames.SCREEN_ORIENTATION,
  977.     VISIBILITY: EBG.API.EventNames.VISIBILITY_CHECK
  978. };
  979. EBG.VideoInteraction = {
  980.     STARTED: "ebVideoStarted",
  981.     PERCENT_25_PLAYED: "eb25Per_Played",
  982.     PERCENT_50_PLAYED: "eb50Per_Played",
  983.     PERCENT_75_PLAYED: "eb75Per_Played",
  984.     FULLPLAY: "ebVideoFullPlay",
  985.     MUTE: "ebVideoMute",
  986.     UNMUTE: "ebVideoUnmute",
  987.     PAUSE: "ebVideoPause",
  988.     REPLAY: "ebVideoReplay",
  989.     UNMUTED: "ebVideoUnmuted",
  990.     FULLSCREEN_START: "ebFSStart",
  991.     FULLSCREEN_END: "ebFSEnd",
  992.     FULLSCREEN_MUTE: "ebFSVideoMute",
  993.     FULLSCREEN_PAUSE: "ebFSVideoPause",
  994.     SLIDER_DRAGGED: "ebSliderDragged",
  995.     VIDEO_PLAY_DURATION: "ebVideoPlayDuration",
  996.     VIDEO_ASSET_DURATION: "ebVideoAssetDuration",
  997.     FULLSCREEN_DURATION: "ebFSVideoPlayDuration",
  998.     FULLSCREEN_ASSET_DURATION: "ebFSVideoAssetDuration",
  999.     USER_INITIATED_VIDEO: "ebUserInitiatedVideo"
  1000. };
  1001. EBG.VideoQuartiles = [EBG.VideoInteraction.STARTED, EBG.VideoInteraction.PERCENT_25_PLAYED, EBG.VideoInteraction.PERCENT_50_PLAYED, EBG.VideoInteraction.PERCENT_75_PLAYED, EBG.VideoInteraction.FULLPLAY];
  1002. EBG.EBMessage = {
  1003.     REQ_INIT: "reqInit",
  1004.     INIT: "ebInit",
  1005.     INITDONE: "ebInitDone",
  1006.     GET_ENVIROMENT: "ebGetEnvironment",
  1007.     SHOW_DEFAULT_IMAGE: "ebShowDefaultImage",
  1008.     CLICKTHROUGH: "ebclickthrough",
  1009.     NOTIFIED_INTERACTION: "ebNotifiedInteraction",
  1010.     VERSION_TRACKING_IMPRESSION: "ebversiontrackingimpression",
  1011.     USER_ACTION_COUNTER: "ebCIUserActionCounter",
  1012.     AUTOMATIC_EVENT_COUNTER: "ebCIAutomaticEventCounter",
  1013.     START_TIMER: "ebCIStartTimer",
  1014.     UPDATE_TIMER: "ebUpdateTimer",
  1015.     STOP_TIMER: "ebCIStopTimer",
  1016.     START_VIDEO_TIMER: "ebStartVideoTimer",
  1017.     STOP_VIDEO_TIMER: "ebendvideotimer",
  1018.     VIDEO_INTERACTION: "ebVideoInteraction",
  1019.     VIDEO_LOAD: "ebVideoLoad",
  1020.     INIT_VIDEO_LOADER: "ebInitVideoLoader",
  1021.     VIDEO_FS_OPEN: "ebVideoFSOpen",
  1022.     VIDEO_FS_CLOSE: "ebVideoFSClose",
  1023.     VIDEO_FS_AUTO_CLOSE: "ebVideoFSAutoClose",
  1024.     START_VIDEO: "ebtStartVideo",
  1025.     STOP_VIDEO: "ebtStoptVideo",
  1026.     UPDATE_VIDEO_DURATION: "ebtUpdateVideoDuration",
  1027.     FULL_SCREEN_OPEN: "ebFullScreenOpen",
  1028.     FULL_SCREEN_CLOSE: "ebFullScreenClose",
  1029.     FULL_SCREEN_AUTO_CLOSE: "ebFullScreenAutoClose",
  1030.     MOUSE_MOVE: "ebMouseMove",
  1031.     PAGE_LOAD: "ebPageLoad",
  1032.     TRIGGER_AD_START: "ebTriggerAdStart",
  1033.     INIT_EXPANSION_PARAMS: "ebInitExpansionParams",
  1034.     RESET_COLLAPSE_TIMER: "ebResetCollapseTimer",
  1035.     NEW_SE: "ebNewSE",
  1036.     EXPAND: "ebExpandPanel",
  1037.     EXPAND_DONE: "ebExpandDone",
  1038.     COLLAPSE: "ebCollapsePanel",
  1039.     COLLAPSE_DONE: "ebCollapseDone",
  1040.     NOTIFY_INTERACTION_MONITOR: "NotifyInteractionMonitor",
  1041.     HIDE_INTRO: "ebHideIntro",
  1042.     INTRO_FULL_PLAY: "ebIntroFullPlay",
  1043.     KEEP_AD_OPREN: "ebKeepAdOpen",
  1044.     GO_TO_MINISITE: "ebGoToMiniSite",
  1045.     UPDATE_CLICK: "ebUpdateClick",
  1046.     DOCUMENT_LOADED: "ebDocumentLoaded",
  1047.     PLAY_VIDEO_ON_NATIVE_PLAYER: "playVideoOnNativePlayer",
  1048.     CREATE_CALENDAR_EVENT: "createCalendarEvent",
  1049.     STORE_PICTURE: "storePicture",
  1050.     SDK_DATA_CHANGE: "sdkDataChange",
  1051.     SDK_EVENT: "sdkEvent",
  1052.     ADAPTOR_READY: "adaptorReady",
  1053.     SWIPE: "ebSwipe",
  1054.     DISPOSE: "ebDispose",
  1055.     SET_RESIZE_PROPS: "ebResizeProperties",
  1056.     RESIZE: "ebResize",
  1057.     SET_EXPAND_PROPS: "ebExpandProperties",
  1058.     SET_ORIENTATION_PROPS: "ebOrientationProperties",
  1059.     CLOSE: "ebClose",
  1060.     CLOSE_AD: "ebclosead",
  1061.     SET_STATE: "ebSetstate",
  1062.     RESET_STATE: "ebResetstate",
  1063.     REQ_MOUSE_MOVE: "ebReqMouseMove",
  1064.     ANIMATION: "ebAnimation",
  1065.     VISIBILITY: "ebVisibility"
  1066. };
  1067. EBG.DurationInteraction = {
  1068.     TIMER: "Timer",
  1069.     AGGREGATE: "Aggregate"
  1070. };
  1071. EBG.Animation = {
  1072.     Easing: {
  1073.         linear: "linear",
  1074.         easeInQuad: "easeInQuad",
  1075.         easeOutQuad: "easeOutQuad",
  1076.         easeInOutQuad: "easeInOutQuad",
  1077.         easeInCubic: "easeInCubic",
  1078.         easeOutCubic: "easeOutCubic",
  1079.         easeInOutCubic: "easeInOutCubic",
  1080.         easeInQuart: "easeInQuart",
  1081.         easeOutQuart: "easeOutQuart",
  1082.         easeInOutQuart: "easeInOutQuart",
  1083.         easeInQuint: "easeInQuint",
  1084.         easeOutQuint: "easeOutQuint",
  1085.         easeInOutQuint: "easeInOutQuint"
  1086.     },
  1087.     TransitionEasing: {
  1088.         ease: "ease",
  1089.         linear: "linear",
  1090.         easeIn: "easeIn",
  1091.         easeOut: "easeOut",
  1092.         easeInOut: "easeInOut"
  1093.     }
  1094. };
  1095. EBG.INNERIFRAMEMessage = {
  1096.     LOADED: "ebInnerIframeLoaded",
  1097.     INIT: "ebInitInnerIframe",
  1098.     VERIFY: "ebVerifyInnerIframe",
  1099.     EBO: "ebO",
  1100.     GLOBALPARAMS: "ebGlobalParams",
  1101.     CONTINUE_SENDING: "ContinueSending",
  1102.     NOT_LASTMSG: "NotLastMsg",
  1103.     LASTMSG: "LastMsg",
  1104.     ADCONFIG_REQUEST: "AdConfig_Request",
  1105.     SECRET_TAGS: "Secret_Tags"
  1106. };
  1107. EBG.FS = {
  1108.     EB_VERSION_TRACKING_IMPRESSION: "ebversiontrackingimpression",
  1109.     EB_CLICKTHROUGH: "ebclickthrough",
  1110.     EB_CREATIVE_EVENT_SUBSCRIPTION: "ebcreativeaddhdr",
  1111.     EB_CI_USER_ACTION_COUNTER: "ebciuseractioncounter",
  1112.     EB_CI_AUTOMATIC_EVENT_COUNTER: "ebciautomaticeventcounter",
  1113.     EB_VIDEO_INTERACTION: "ebvideointeraction",
  1114.     EB_START_TIMER: "ebstarttimer",
  1115.     EB_END_TIMER: "ebendtimer",
  1116.     EB_CI_START_TIMER: "ebcistarttimer",
  1117.     EB_CI_STOP_TIMER: "ebcistoptimer",
  1118.     EB_UPDATE_TIMER: "ebupdatetimer",
  1119.     EB_START_VIDEO_TIMER: "ebstartvideotimer",
  1120.     EB_STOP_VIDEO_TIMER: "ebendvideotimer",
  1121.     EB_PAGE_LOAD: "ebpageload",
  1122.     EB_COMMAND: "ebcommand",
  1123.     EB_MSG: "ebmsg",
  1124.     EB_EXPAND_PANEL: "ebexpandpanel",
  1125.     EB_COLLAPSE_PANEL: "ebcollapsepanel",
  1126.     EB_SET_STATE: "ebsetstate",
  1127.     EB_RESET_STATE: "ebresetstate",
  1128.     EB_MOUSE_TRACKER: "ebmousetracker",
  1129.     EB_MOUSE_MOVE: "ebmousemove",
  1130.     EB_TEST_DC: "ebtestdc",
  1131.     EB_CLOSE_AD: "ebclosead",
  1132.     EB_REPLAY_AD: "ebreplayad",
  1133.     EB_REPLAY_EXP: "ebreplayexp",
  1134.     EB_LOAD_RICH_BANNER: "ebloadrichbanner",
  1135.     EB_SHOW_RICH_BANNER: "ebshowrichbanner",
  1136.     EB_INIT_VIDEO_LOADER: "ebinitvideoloader",
  1137.     EB_HIDE_INTRO: "ebhideintro",
  1138.     EB_INTRO_FULL_PLAY: "ebintrofullplay",
  1139.     EB_KEEP_AD_OPREN: "ebkeepadopen",
  1140.     EB_GO_TO_MINISITE: "ebgotominisite",
  1141.     EB_VIDEO_LOAD: "ebvideoload",
  1142.     EB_VIDEO_LOAD_AND_PLAY: "ebvideoloadandplay",
  1143.     EB_FULL_SCREEN_OPEN: "ebfullscreenopen",
  1144.     EB_FULL_SCREEN_CLOSE: "ebfullscreenclose",
  1145.     EB_FULL_SCREEN_AUTO_CLOSE: "ebfullscreenautoclose",
  1146.     EB_VIDEO_FS_OPEN: "ebvideofsopen",
  1147.     EB_VIDEO_FS_CLOSE: "ebvideofsclose",
  1148.     EB_VIDEO_FS_AUTO_CLOSE: "ebvideofsautoclose",
  1149.     EB_START_VIDEO: "ebtstartvideo",
  1150.     EB_STOP_VIDEO: "ebtstopvideo",
  1151.     EB_UPDATE_VIDEO_DURATION: "ebtupdatevideoduration",
  1152.     EB_GET_JS_VAR: "ebgetjsvar",
  1153.     EB_GET_ALL_JS_VARS: "ebgetalljsvars",
  1154.     EB_SET_JS_VAR: "ebsetjsvar",
  1155.     EB_INIT_SE: "ebinitse",
  1156.     EB_SET_SE_PROXY: "ebsetseproxy",
  1157.     EB_SE_EXPAND_STARTED: "ebseexpandstarted",
  1158.     EB_SE_RETRACT_STARTED: "ebseretractstarted",
  1159.     EB_SE_RETRACT_FINISHED: "ebseretractfinished",
  1160.     EB_NOTIFICATION: "notification",
  1161.     EB_VIDEO_ACTIVE_MODE: "ebvideoactivemode",
  1162.     EB_THROTTLE: "ebthrottle"
  1163. };
  1164. EBG.ActionType = {
  1165.     USER: "user",
  1166.     AUTO: "auto"
  1167. };
  1168. EBG.ExpBaseInteractions = {
  1169.     PANELS_VIEWED: "ebPanelsViewed",
  1170.     AUTO_SHOW: "autoshow",
  1171.     DURATION: "duration"
  1172. };
  1173. EBG.SingleExpInteractions = EBG.ExpBaseInteractions;
  1174. EBG.orientation = {
  1175.     Both: "BOTH",
  1176.     Landscape: "LANDSCAPE",
  1177.     Portrait: "PORTAIT"
  1178. };
  1179. EBG.adTypes = {
  1180.     RichBannerHtml5: "Html5Banner",
  1181.     PoliteBannerHtml5: "Html5PoliteBanner",
  1182.     SEBannerHtml5: "Html5SEBanner",
  1183.     ExpBannerHtml5: "Html5ExpBanner",
  1184.     StdBanner: "StdBanner",
  1185.     Banner: "Banner",
  1186.     SingleExpBanner: "SingleExpBanner",
  1187.     ExpBanner: "ExpBanner",
  1188.     VisibilityAd: "Visibility",
  1189.     FloatingAd: "FloatingAd",
  1190.     FloatingAdWithRem: "FloatingAdWithReminder",
  1191.     TrackingAd: "Tracking",
  1192.     StdBannerHtml5: "Html5StdBanner",
  1193.     WallpaperAd: "WallpaperAd"
  1194. };
  1195. EBG.adParts = {
  1196.     BANNER: "banner",
  1197.     PANEL: "panel",
  1198.     DEFAULTBANNER: "defaultBanner",
  1199.     RICHBANNER: "richBanner"
  1200. };
  1201. EBG.WindowTarget = {
  1202.     BLANK: "_blank",
  1203.     SELF: "_self",
  1204.     PARENT: "_parent",
  1205.     TOP: "_top"
  1206. };
  1207. EBG.Const = {
  1208.     OUTER_DIV: "eyeDiv",
  1209.     DATACAPTURE: "/BurstingPipe/BurstingDataCapturePipe.asp",
  1210.     AKAMAIFCS_PLUID_9: "rtmp://flv.stream.atwola.com/flash/flv/mm",
  1211.     AKAMAIFCS_PLUID_43: "rtmp://eyeblaster.fcod.msecnd.net/vod/a10061/e1",
  1212.     AKAMAIFCS_PLUID_42_45: "rtmp://cp57388.edgefcs.net/ondemand",
  1213.     AKAMAI_DEFAULT: "rtmp://cp16207.edgefcs.net/ondemand",
  1214.     SHOW_HIDE_FLAG: "data-ebhidingoverlappingelement",
  1215.     SHOW_HIDE_BACKUP: "data-ebvisibilitybackup"
  1216. };
  1217. EBG.PanelPositionType = {
  1218.     PAGE_RELATIVE_PERCENTAGE: 0,
  1219.     BANNER_RELATIVE_PIXELS: 1,
  1220.     PAGE_RELATIVE_PIXELS: 2,
  1221.     VIEWPORT_RELATIVE_PERCENTAGE: 3,
  1222.     VIEWPORT_RELATIVE_PIXELS: 4
  1223. };
  1224. EBG.PanelCorner = {
  1225.     TOP_LEFT: 1,
  1226.     TOP_RIGHT: 2,
  1227.     BOTTOM_LEFT: 3,
  1228.     BOTTOM_RIGHT: 4
  1229. };
  1230. EBG.AnimationType = {
  1231.     NONE: "none",
  1232.     LINEAR: "linear",
  1233.     EASE_OUT: "easeout",
  1234.     EASE_OUT_SNAP: "easeoutsnap"
  1235. };
  1236. EBG.ExpandCollapseMethod = {
  1237.     CLIP: "clip",
  1238.     RESIZE: "resize"
  1239. };
  1240. EBG.AnimationDefaults = {
  1241.     easeOutCoefficient: 0.1,
  1242.     stepTime: 10,
  1243.     linearSteps: 50,
  1244.     snapThreshold: 10,
  1245.     animationType: EBG.AnimationType.NONE,
  1246.     snap: !1,
  1247.     checkShowHideOnEachStep: !1,
  1248.     hideAssetAfterExpand: !1,
  1249.     removeAssetAfterExpand: !1,
  1250.     hideAssetAfterCollapse: !0,
  1251.     removeAssetAfterCollapse: !0,
  1252.     method: EBG.ExpandCollapseMethod.ExpBanner,
  1253.     endAnimationHideAsset: !1,
  1254.     endAnimationRemoveAsset: !1
  1255. };
  1256. EBG.AnimationPushDownDefaults = {
  1257.     easeOutCoefficient: 0.1,
  1258.     stepTime: 50,
  1259.     linearSteps: 20,
  1260.     snapThreshold: 10,
  1261.     animationType: EBG.AnimationType.LINEAR,
  1262.     snap: !1,
  1263.     method: EBG.ExpandCollapseMethod.RESIZE,
  1264.     checkShowHideOnEachStep: !1,
  1265.     hideAssetAfterExpand: !1,
  1266.     removeAssetAfterExpand: !1,
  1267.     hideAssetAfterCollapse: !0,
  1268.     removeAssetAfterCollapse: !0,
  1269.     method: EBG.ExpandCollapseMethod.ExpBanner,
  1270.     endAnimationHideAsset: !1,
  1271.     endAnimationRemoveAsset: !1
  1272. };
  1273. EBG.AnimProps = {
  1274.     easeOutCoefficient: "easeOutCoefficient",
  1275.     snapThreshold: "snapThreshold",
  1276.     method: "method",
  1277.     endAnimationHideAsset: "endAnimationHideAsset",
  1278.     endAnimationRemoveAsset: "endAnimationRemoveAsset"
  1279. };
  1280. EBG.AnimDefaultProps = {
  1281.     stepTime: "stepTime",
  1282.     linearSteps: "linearSteps",
  1283.     animationType: "animationType"
  1284. };
  1285. EBG.AnimNonDefaultPanelValues = {
  1286.     animationType: EBG.AnimationType.NONE,
  1287.     stepTime: 0,
  1288.     linearSteps: 1
  1289. };
  1290. EBG.AnimExpansionProps = {
  1291.     hideAssetAfterExpand: "hideAssetAfterExpand",
  1292.     removeAssetAfterExpand: "removeAssetAfterExpand"
  1293. };
  1294. EBG.AnimCollapseProps = {
  1295.     hideAssetAfterCollapse: "hideAssetAfterCollapse",
  1296.     removeAssetAfterCollapse: "removeAssetAfterCollapse"
  1297. };
  1298. EBG.ProtectedElementIds = ["ebAd", "eyeDiv", "ebDefault", "ebRich", "ebDiv"];
  1299. EBG.VisibilityMode = {
  1300.     DEFAULT_MODE: "defaultMode",
  1301.     BASIC_MODE: "basicMode",
  1302.     ENHANCED_MODE: "enhancedMode"
  1303. };
  1304. EBG.AcCertProgram = {
  1305.     IAB_EU: 0,
  1306.     NAI_US: 1
  1307. };
  1308. EBG.AcIconPosition = {
  1309.     TopRight: 0,
  1310.     TopLeft: 1,
  1311.     BottomRight: 2,
  1312.     BottomLeft: 3
  1313. };
  1314. EBG.PreloadType = {
  1315.     DefaultImg: 0,
  1316.     PreloadImg: 1,
  1317.     DefaultFlash: 2
  1318. };
  1319. EBG.ThrottleStates = {
  1320.     LOAD: "load",
  1321.     THROTTLE: "throttle",
  1322.     RESUME: "resume",
  1323.     PAUSE: "pause",
  1324.     POLLED: "polled"
  1325. };
  1326. EBG.WebEnvironment = {
  1327.     BROWSER: 0,
  1328.     ANDROID_MOBILE_BROWESR: 1,
  1329.     ANDROID_WEB_VIEW: 2,
  1330.     IOS_MOBILE_BROWSER: 3,
  1331.     IOS_WEB_VIEW: 4,
  1332.     OTHER_MOBILE_BROWSER: 5,
  1333.     OTHER_WEB_VIEW: 6,
  1334.     ANDROID_UNKNOWN: 97,
  1335.     IOS_UNKNOWN: 98,
  1336.     UNKNOWN: 99
  1337. };
  1338. EBG.SDK_STATES = EBG.SDK_STATES || {};
  1339. EBG.SDK_STATES.API = {
  1340.     DEFAULT: "SDKdefault",
  1341.     EXPANDED: "SDKexpanded",
  1342.     LOADING: "SDKloading",
  1343.     RESIZED: "SDKresized"
  1344. };
  1345. EBG.SDK_EVENTS = EBG.SDK_EVENTS || {};
  1346. EBG.SDK_EVENTS.API = {
  1347.     STATE_CHANGE: "SDKstateChange",
  1348.     ERROR: "SDKerror",
  1349.     READY: "SDKready",
  1350.     VIEWABLE_CHANGE: "SDKviewableChange",
  1351.     SIZE_CHANGE: "SDKsizeChange",
  1352.     RESIZE_PROPS_CHANGE: "SDKresizePropsChange",
  1353.     EXPAND_PROPS_CHANGE: "SDKexpandPropsChange",
  1354.     WINDOW_SIZE_CHANGE: "windowSizeChange"
  1355. };
  1356. EBG.declareNamespace("Events");
  1357. EBG.Events.EventTiming = {
  1358.     BEFORE: "BEFORE",
  1359.     ONTIME: "ONTIME",
  1360.     AFTER: "AFTER",
  1361.     ONTIME_AND_AFTER: "ONTIME_AND_AFTER"
  1362. };
  1363. EBG.Events.EventNames = EBG.API.EventNames;
  1364. EBG.Events.EbEventNames = EBG.API.EbEventNames;
  1365. EBG.Events.EventSubscription = function(a, b, c) {
  1366.     this.eventName = a;
  1367.     this.callback = b;
  1368.     this.callbackBinding = c ? c : null
  1369. };
  1370. EBG.Events.EventSubscription.prototype = {
  1371.     dispatcherFilters: null,
  1372.     timing: EBG.Events.EventTiming.ONTIME,
  1373.     isElementEvent: !1,
  1374.     elementId: "",
  1375.     isDocumentEvent: !1,
  1376.     isValid: function() {
  1377.         return EBG.isFunc(this.callback) && (!this.callbackBinding || EBG.isObj(this.callbackBinding))
  1378.     },
  1379.     toString: function() {
  1380.         return EBG.format("EventSubscription: eventName={0}, timing={1}, callback={2}, callbackBinding={3}, dispatcherFilters={4}", this.eventName, this.timing, EBG.typeOf(this.callback), EBG.typeOf(this.callbackBinding), EBG.typeOf(this.dispatcherFilters))
  1381.     }
  1382. };
  1383. EBG.declareClass(EBG.Events.EventSubscription, null);
  1384. EBG.Events.Event = function(a) {
  1385.     this.name = a;
  1386.     this.creationTime = +new Date
  1387. };
  1388. EBG.Events.Event.prototype = {
  1389.     dispatcher: null,
  1390.     eventData: null,
  1391.     timing: null,
  1392.     toString: function() {
  1393.         return EBG.format("Event: name={0}, creationTime={1}, dispatcher={2}, eventData={3}", this.name, this.creationTime, EBG.typeOf(this.dispatcher), EBG.typeOf(this.eventData))
  1394.     }
  1395. };
  1396. EBG.declareClass(EBG.Events.Event, null);
  1397. EBG.Events.EventManager = function() {
  1398.     this._subscriptions = {}
  1399. };
  1400. EBG.Events.EventManager.prototype = {
  1401.     _subscriptions: {},
  1402.     subscribeToEvent: function(a) {
  1403.         if (a.isValid())
  1404.             if (a.isElementEvent) EBG.adaptor && EBG.adaptor.subscribeToEventOnElement(a.eventName, a.elementId, a.callback);
  1405.             else {
  1406.                 var b = this._subscriptions[a.eventName] = this._subscriptions[a.eventName] || {},
  1407.                     c;
  1408.                 for (c in EBG.Events.EventTiming) EBG.Events.EventTiming.hasOwnProperty(c) && (b[c] = b[c] || []); - 1 == this._getSubscriptionId(a, b[a.timing]) && (b[a.timing].push(a), EBG.adaptor && EBG.adaptor.hasEvent(a.eventName) && EBG.adaptor.subscribeToEvent(a.eventName,
  1409.                     a.isDocumentEvent))
  1410.             }
  1411.     },
  1412.     unsubscribeFromEvent: function(a) {
  1413.         if (a && a.isValid())
  1414.             if (a.isElementEvent) EBG.adaptor && EBG.adaptor.unsubscribeFromEventOnElement(a.eventName, a.elementId, a.callback);
  1415.             else if (this._subscriptions[a.eventName] && this._subscriptions[a.eventName][a.timing]) {
  1416.             var b = this._subscriptions[a.eventName][a.timing],
  1417.                 a = this._getSubscriptionId(a, b); - 1 != a && (b[a] = null)
  1418.         }
  1419.     },
  1420.     dispatchEvent: function(a) {
  1421.         var b = !1;
  1422.         switch (a.timing) {
  1423.             case EBG.Events.EventTiming.BEFORE:
  1424.             case EBG.Events.EventTiming.ONTIME:
  1425.             case EBG.Events.EventTiming.AFTER:
  1426.                 b =
  1427.                     this._dispatchEventByTiming(a, a.timing);
  1428.                 break;
  1429.             case EBG.Events.EventTiming.ONTIME_AND_AFTER:
  1430.                 b = (b = this._dispatchEventByTiming(a, EBG.Events.EventTiming.ONTIME)) || this._dispatchEventByTiming(a, EBG.Events.EventTiming.AFTER);
  1431.                 break;
  1432.             default:
  1433.                 b = (b = (b = this._dispatchEventByTiming(a, EBG.Events.EventTiming.BEFORE)) || this._dispatchEventByTiming(a, EBG.Events.EventTiming.ONTIME)) || this._dispatchEventByTiming(a, EBG.Events.EventTiming.AFTER)
  1434.         }
  1435.         return b
  1436.     },
  1437.     attachToAdaptor: function() {
  1438.         EBG.adaptor.setListener(this.dispatchEvent,
  1439.             this)
  1440.     },
  1441.     _dispatchEventByTiming: function(a, b) {
  1442.         var c = this._subscriptions[a.name];
  1443.         if (!c) return !1;
  1444.         for (var c = c[b], d = !1, e = 0; e < c.length; e++) {
  1445.             var f = c[e];
  1446.             if (f && (f = this._dispatchEventToSubscription(a, f), EBG.isBool(f) && !f)) {
  1447.                 d = !0;
  1448.                 break
  1449.             }
  1450.         }
  1451.         return d
  1452.     },
  1453.     _dispatchEventToSubscription: function(a, b) {
  1454.         var c = b.dispatcherFilters;
  1455.         if (EBG.isObj(c))
  1456.             for (var d in c)
  1457.                 if (c.hasOwnProperty(d)) {
  1458.                     var e = c[d],
  1459.                         f = !0,
  1460.                         g = d.split("."),
  1461.                         h = a.dispatcher;
  1462.                     if (h)
  1463.                         for (var i = 0; i < g.length; i++) {
  1464.                             var h = h[g[i]],
  1465.                                 j = i == g.length - 1;
  1466.                             if (!h || j && h !== e) {
  1467.                                 f = !1;
  1468.                                 break
  1469.                             }
  1470.                         }
  1471.                     if (!f) return null
  1472.                 }
  1473.         c =
  1474.             null;
  1475.         d = b.callback;
  1476.         if (EBG.isFunc(d)) {
  1477.             e = [a];
  1478.             try {
  1479.                 c = d.apply(b.callbackBinding, e)
  1480.             } catch (k) {}
  1481.         }
  1482.         return c
  1483.     },
  1484.     _getSubscriptionId: function(a, b) {
  1485.         for (var c = 0; c < b.length; c++)
  1486.             if (b[c] && b[c].callback === a.callback && b[c].callbackBinding === a.callbackBinding && b[c].isDocumentEvent === a.isDocumentEvent && this._compareFilters(b[c].dispatcherFilters, a.dispatcherFilters)) return c;
  1487.         return -1
  1488.     },
  1489.     _compareFilters: function(a, b) {
  1490.         if (!EBG.isObj(a)) return EBG.isObj(b) ? !1 : !0;
  1491.         if (!EBG.isObj(b)) return !1;
  1492.         for (var c in a)
  1493.             if (a.hasOwnProperty(c))
  1494.                 if (b.hasOwnProperty(c)) {
  1495.                     if (a[c] !==
  1496.                         b[c]) return !1
  1497.                 } else return !1;
  1498.         for (c in b)
  1499.             if (b.hasOwnProperty(c) && !a.hasOwnProperty(c)) return !1;
  1500.         return !0
  1501.     }
  1502. };
  1503. EBG.declareClass(EBG.Events.EventManager, null);
  1504. EBG.eventMgr = EBG.eventMgr || new EBG.Events.EventManager;
  1505. EBG.declareNamespace("Adaptors");
  1506. EBG.Adaptors.TagNames = {
  1507.     DIV: "div",
  1508.     IFRAME: "iframe",
  1509.     IMG: "img",
  1510.     SCRIPT: "script",
  1511.     OBJECT: "object",
  1512.     EMBED: "embed",
  1513.     SPAN: "span",
  1514.     A: "a",
  1515.     BODY: "body"
  1516. };
  1517. EBG.Adaptors.InjectionMethod = EBG.API.InjectionMethod;
  1518. EBG.Adaptors.WindowProp = {
  1519.     top: "top",
  1520.     left: "left",
  1521.     location: "location",
  1522.     menubar: "menubar",
  1523.     width: "width",
  1524.     height: "height"
  1525. };
  1526. EBG.Adaptors.MoreSupportedEvent = {
  1527.     visibilitychange: 1,
  1528.     mozvisibilitychange: 1,
  1529.     msvisibilitychange: 1,
  1530.     webkitvisibilitychange: 1
  1531. };
  1532. EBG.Adaptors.StdWebAdaptor = function() {
  1533.     this._setEvents()
  1534. };
  1535. EBG.Adaptors.StdWebAdaptor.onEnvEvent = function() {
  1536.     EBG.adaptor._handleEvent.apply(EBG.adaptor, arguments)
  1537. };
  1538. EBG.Adaptors.StdWebAdaptor.prototype = {
  1539.     _environmentEvents: {},
  1540.     _logicalEvents: {},
  1541.     _subscribedEvents: {},
  1542.     _subscribedEventsOnElement: [],
  1543.     _listener: null,
  1544.     _listenerBinding: null,
  1545.     _loadedModules: {},
  1546.     initInnerModules: function(a, b, c, d, e) {
  1547.         if (!this.browser) this.browser = new EBG.Adaptors.Browser(a, b, c, d, e);
  1548.         if (!this.flash) this.flash = EBG.Adaptors.FlashDetector ? new EBG.Adaptors.FlashDetector : null
  1549.     },
  1550.     registerSpecialBrowserEvents: function() {},
  1551.     loadModule: function(a, b, c, d) {
  1552.         if (!a || !b || !b.modulesDir) return !1;
  1553.         var e = this,
  1554.             b = 0 == a.indexOf("http") ?
  1555.             a : b.modulesDir + a + ".js",
  1556.             a = a.toLowerCase(),
  1557.             f = new EBG.Events.Event(EBG.Events.EventNames.MODULE_LOAD);
  1558.         f.dispatcher = this;
  1559.         f.eventData = {
  1560.             name: a
  1561.         };
  1562.         f.timing = EBG.Events.EventTiming.BEFORE;
  1563.         if (!EBG.eventMgr.dispatchEvent(f))
  1564.             if (this._loadedModules[a]) this._loadedModules[a].loading && c ? this._loadedModules[a].callback.push({
  1565.                 func: c,
  1566.                 binding: d || window
  1567.             }) : EBG.runTimed(this, function() {
  1568.                 this._handleModuleLoaded(a)
  1569.             }, [], 0);
  1570.             else {
  1571.                 this._loadedModules[a] = {
  1572.                     loading: !0,
  1573.                     loaded: !1,
  1574.                     callback: c ? [{
  1575.                         func: c,
  1576.                         binding: d || window
  1577.                     }] : []
  1578.                 };
  1579.                 var g = document.createElement("script");
  1580.                 g.type = "text/javascript";
  1581.                 g.async = !0;
  1582.                 g.readyState ? g.onreadystatechange = function() {
  1583.                     if ("loaded" === g.readyState || "complete" === g.readyState) g.onreadystatechange = null, e._handleModuleLoaded(a)
  1584.                 } : g.onload = function() {
  1585.                     e._handleModuleLoaded(a)
  1586.                 };
  1587.                 g.src = b;
  1588.                 (EBG.getBigScript().parentElement || document.getElementsByTagName("html")[0]).appendChild(g)
  1589.             }
  1590.     },
  1591.     _handleModuleLoaded: function(a) {
  1592.         var b = this._loadedModules[a];
  1593.         b.loading = !1;
  1594.         b.loaded = !0;
  1595.         var c = new EBG.Events.Event(EBG.Events.EventNames.MODULE_LOAD);
  1596.         c.dispatcher = this;
  1597.         c.eventData = {
  1598.             name: a
  1599.         };
  1600.         c.timing = EBG.Events.EventTiming.ONTIME;
  1601.         if (!EBG.eventMgr.dispatchEvent(c)) {
  1602.             for (a = 0; a < b.callback.length; a++) {
  1603.                 var d = b.callback[a];
  1604.                 d.func.apply(d.binding)
  1605.             }
  1606.             c.timing = EBG.Events.EventTiming.AFTER;
  1607.             EBG.eventMgr.dispatchEvent(c)
  1608.         }
  1609.     },
  1610.     copy: function(a) {
  1611.         for (var b in this._subscribedEvents) this._subscribedEvents.hasOwnProperty(b) && (this._removeEventListener(window, this._environmentEvents[b].name, EBG.Adaptors.StdWebAdaptor.onEnvEvent), a.subscribeToEvent(b));
  1612.         for (b = 0; b < this._subscribedEventsOnElement.length; b++) {
  1613.             var c =
  1614.                 this._subscribedEventsOnElement[b];
  1615.             if (c) {
  1616.                 var d = c.elementId,
  1617.                     e = c.eventName,
  1618.                     c = c.callback,
  1619.                     f = this.getElementById(d);
  1620.                 f && (this._removeEventListener(f, e, c), a.subscribeToEventOnElement(e, d, c))
  1621.             }
  1622.         }
  1623.         a.flash = this.flash || null
  1624.     },
  1625.     intMonitorExist: function() {
  1626.         return EBG.isPreview && top.ebHandleFsCommandsPrev
  1627.     },
  1628.     notifyIntMonitor: function(a) {
  1629.         top.ebHandleFsCommandsPrev(a.command, a.args, a.objName, a.adId, a.elapsedTime)
  1630.     },
  1631.     hasEvent: function(a) {
  1632.         return !!this._environmentEvents[a]
  1633.     },
  1634.     generateElementId: function(a, b) {
  1635.         return EBG.format("eb{0}_{1}",
  1636.             a, b)
  1637.     },
  1638.     _getTags: function(a, b) {
  1639.         EBG.isGlobalDef("JSON");
  1640.         var c = "";
  1641.         if (b && a.tagName == EBG.Adaptors.TagNames.SCRIPT && a.text && !a.attributes) b.push(a);
  1642.         else {
  1643.             c = "";
  1644.             a.attributes && (this._setObjDefaultAttributes(a), c = this._getObjAttributesStr(a));
  1645.             c = EBG.format("<{0} {1}>", a.tagName, c);
  1646.             a.innerHTML && (c += a.innerHTML);
  1647.             a.text && (c += a.text);
  1648.             a.params && (c += this._getObjParamsStr(a));
  1649.             if (a.children)
  1650.                 for (var d = 0; d < a.children.length; d++) c += this._getTags(a.children[d], b);
  1651.             c += EBG.format("</{0}>", a.tagName)
  1652.         }
  1653.         return c
  1654.     },
  1655.     writeReportingIFrame: function(a,
  1656.         b, c) {
  1657.         this.inject({
  1658.             tagName: EBG.Adaptors.TagNames.IFRAME,
  1659.             attributes: {
  1660.                 id: a,
  1661.                 src: b,
  1662.                 style: {
  1663.                     width: "0px",
  1664.                     height: "0px"
  1665.                 },
  1666.                 frameborder: 0
  1667.             }
  1668.         }, EBG.Adaptors.InjectionMethod.APPEND, this.getElementById(c))
  1669.     },
  1670.     writeScript: function(a, b, c) {
  1671.         try {
  1672.             this.inject({
  1673.                 tagName: EBG.Adaptors.TagNames.SCRIPT,
  1674.                 attributes: {
  1675.                     id: a,
  1676.                     name: a,
  1677.                     src: b
  1678.                 }
  1679.             }, EBG.Adaptors.InjectionMethod.APPEND, this.getElementById(c))
  1680.         } catch (d) {}
  1681.     },
  1682.     write: function(a) {
  1683.         this._documentWrite(this._getTags(a))
  1684.     },
  1685.     inject: function(a, b, c) {
  1686.         if (c && a) {
  1687.             var d = c.ownerDocument.createElement(a.tagName);
  1688.             if (a.attributes) {
  1689.                 this._setObjDefaultAttributes(a);
  1690.                 for (var e in a.attributes) EBG.isObj(a.attributes[e]) ? this.setStyleToElem(d, a.attributes[e]) : d.setAttribute(e, a.attributes[e])
  1691.             }
  1692.             switch (b) {
  1693.                 case EBG.Adaptors.InjectionMethod.INSERT_BEFORE:
  1694.                     c.parentNode.insertBefore(d, c);
  1695.                     break;
  1696.                 case EBG.Adaptors.InjectionMethod.INSERT_AFTER:
  1697.                     c.nextSibling ? c.parentNode.insertBefore(d, c.nextSibling) : c.parentNode.appendChild(d);
  1698.                     break;
  1699.                 case EBG.Adaptors.InjectionMethod.FIRST_CHILD:
  1700.                     c.firstChild ? c.insertBefore(d, c.firstChild) : c.appendChild(d);
  1701.                     break;
  1702.                 default:
  1703.                     c.appendChild(d)
  1704.             }
  1705.             e = "";
  1706.             if (a.innerHTML) e = a.innerHTML;
  1707.             var f = [];
  1708.             if (a.children)
  1709.                 for (var g = 0; g < a.children.length; g++) {
  1710.                     var h = a.children[g];
  1711.                     e += EBG.adaptor._getTags(h, f);
  1712.                     h.meta && !0 == h.meta.isChromePowerSaver && this._resizeAfterPaint(h.attributes.id, h.meta.origWidth, h.meta.origHeight)
  1713.                 }
  1714.             if (e) d.innerHTML = e;
  1715.             if (a.text) d.text = a.text;
  1716.             for (g = 0; g < f.length; g++) this.inject(f[g], b, c);
  1717.             return d
  1718.         }
  1719.     },
  1720.     addInlineDOM: function(a, b) {
  1721.         this.inject(a, EBG.Adaptors.InjectionMethod.APPEND, this.getElementById(b))
  1722.     },
  1723.     setInnerHtml: function(a,
  1724.         b) {
  1725.         if (a) a.innerHTML = b
  1726.     },
  1727.     setStyleToElem: function(a, b, c) {
  1728.         if (a && "object" === typeof b)
  1729.             if (c)
  1730.                 for (var d in b) {
  1731.                     if (b.hasOwnProperty(d))
  1732.                         if (void 0 === a.style[d])
  1733.                             for (var c = ["Webkit", "Moz", "ms", "O"], e = window.getComputedStyle ? window.getComputedStyle(a, null) : a.style, f = 0; f < c.length; f++) {
  1734.                                 var g = c[f] + EBG.capitalize(d);
  1735.                                 if (void 0 !== e[g]) {
  1736.                                     a.style[g] = b[d];
  1737.                                     break
  1738.                                 }
  1739.                             } else a.style[d] = b[d]
  1740.                 } else
  1741.                     for (d in b) b.hasOwnProperty(d) && (a.style[d] = b[d])
  1742.     },
  1743.     getStyleOfElem: function(a) {
  1744.         if (a) return a.style
  1745.     },
  1746.     setListener: function(a, b) {
  1747.         this._listener =
  1748.             a;
  1749.         this._listenerBinding = b
  1750.     },
  1751.     hasHiddenParent: function(a) {
  1752.         if (!a) return !1;
  1753.         for (var b = "none" == window.getComputedStyle(a).display;
  1754.             (a = a.parentElement) && !(b = "none" == window.getComputedStyle(a).display););
  1755.         return b
  1756.     },
  1757.     subscribeToEvent: function(a, b) {
  1758.         var c = this.getDisplayWin(),
  1759.             d = this.getPageWin();
  1760.         if (this.hasEvent(a) && !this._subscribedEvents[a]) {
  1761.             var e = this._environmentEvents[a],
  1762.                 f = e.inCurWin ? window : this.getPageWin();
  1763.             if (b) f = f.document;
  1764.             this._logicalEvents[e.name].signInAllWindows && this.serving.detectServingMode(!0) ===
  1765.                 EBG.Adaptors.ServingMode.FRIENDLY_IFRAME && c !== d ? (this._addEventListener(d, e.name, EBG.Adaptors.StdWebAdaptor.onEnvEvent), this._addEventListener(c, e.name, EBG.Adaptors.StdWebAdaptor.onEnvEvent)) : this._addEventListener(f, e.name, EBG.Adaptors.StdWebAdaptor.onEnvEvent);
  1766.             this._subscribedEvents[a] = {}
  1767.         }
  1768.     },
  1769.     subscribeToEventOnElement: function(a, b, c) {
  1770.         var d = !1,
  1771.             e = "string" == typeof b ? this.getDisplayWin().document.getElementById(b) : b;
  1772.         e || (d = !0);
  1773.         for (var f = this._subscribedEventsOnElement.length, g = 0; g < f; g++)
  1774.             if (this._subscribedEventsOnElement[g] &&
  1775.                 this._subscribedEventsOnElement[g].elementId == b && this._subscribedEventsOnElement[g].eventName == a) {
  1776.                 d = !0;
  1777.                 break
  1778.             }
  1779.         d || (this._addEventListener(e, a, c), this._subscribedEventsOnElement[f] = {
  1780.             elementId: b,
  1781.             eventName: a,
  1782.             callback: c
  1783.         })
  1784.     },
  1785.     unsubscribeFromEventOnElement: function(a, b, c) {
  1786.         var d = "string" == typeof b ? this.getDisplayWin().document.getElementById(b) : b;
  1787.         if (d) {
  1788.             for (var e = this._subscribedEventsOnElement.length, f = -1, g = 0; g < e; g++)
  1789.                 if (this._subscribedEventsOnElement[g] && this._subscribedEventsOnElement[g].elementId == b && this._subscribedEventsOnElement[g].eventName ==
  1790.                     a && this._subscribedEventsOnElement[g].callback == c) {
  1791.                     f = g;
  1792.                     break
  1793.                 }
  1794.             0 <= g && (this._removeEventListener(d, a, c), this._subscribedEventsOnElement[f] = null)
  1795.         }
  1796.     },
  1797.     _addEventListener: function(a, b, c) {
  1798.         "load" == b && this.isPageLoaded() ? setTimeout(function() {
  1799.             c({
  1800.                 type: "load"
  1801.             })
  1802.         }, 5) : window.addEventListener ? a.addEventListener(b, c, !1) : window.attachEvent && a.attachEvent("on" + b, c)
  1803.     },
  1804.     _removeEventListener: function(a, b, c) {
  1805.         window.removeEventListener ? a.removeEventListener(b, c, !1) : window.detachEvent && a.detachEvent("on" + b, c)
  1806.     },
  1807.     _checkIfPropExist: function(a,
  1808.         b) {
  1809.         return a && 0 <= a ? EBG.format(", {0}={1}", b, a) : ""
  1810.     },
  1811.     openPage: function(a, b) {
  1812.         var c = EBG.WindowTarget.BLANK,
  1813.             d = "",
  1814.             e = null;
  1815.         if (b && (c = b.target, b.xPos || b.yPos || b.width || b.height)) d = "titlebar=1,resizable=1,scrollbars=1,directories=0,toolbar=1,status=1" + this._checkIfPropExist(b.yPos, EBG.Adaptors.WindowProp.top), d += this._checkIfPropExist(b.xPos, EBG.Adaptors.WindowProp.left), d += this._checkIfPropExist(b.showAddressBar, EBG.Adaptors.WindowProp.location), d += this._checkIfPropExist(b.showMenuBar, EBG.Adaptors.WindowProp.menubar),
  1816.             d += this._checkIfPropExist(b.width, EBG.Adaptors.WindowProp.width), d += this._checkIfPropExist(b.height, EBG.Adaptors.WindowProp.height);
  1817.         return e = "" != d ? window.open(a, c, d) : window.open(a, c)
  1818.     },
  1819.     reportBeacon: function(a) {
  1820.         navigator && EBG.isFunc(navigator.sendBeacon) && navigator.sendBeacon(a)
  1821.     },
  1822.     reportToRemoteServerUsingImage: function() {
  1823.         var a = [];
  1824.         return function(b) {
  1825.             for (var c = 0; c < a.length; c++)
  1826.                 if (a[c] === b) return;
  1827.             this.ReportingImg = new Image;
  1828.             this.ReportingImg.src = b;
  1829.             a.push(b)
  1830.         }
  1831.     }(),
  1832.     getDataFromRemoteServer: function(a, b, c, d,
  1833.         e) {
  1834.         return EBG.getDataFromRemoteServer(a, b, c, d, e)
  1835.     },
  1836.     reportToRemoteServer: function(a, b, c, d) {
  1837.         if (a && !EBG.isOfflineDemo) {
  1838.             var b = !!b,
  1839.                 d = d || this.getRequestMethod(a),
  1840.                 e;
  1841.             "POST" == d && (e = a.split("?"), a = e[0], e = e[1]);
  1842.             var f = !1;
  1843.             try {
  1844.                 if (this.browser.isSafari() && "POST" == d) {
  1845.                     var g = document.createElement("iframe");
  1846.                     g.style.display = "none";
  1847.                     g.style.width = "0px";
  1848.                     g.style.height = "0px";
  1849.                     document.body.appendChild(g);
  1850.                     g = g.contentWindow ? g.contentWindow : g.contentDocument.document ? g.contentDocument.document : g.contentDocument;
  1851.                     g.document.open();
  1852.                     g.document.write(this.getIframeFormScript(a, e));
  1853.                     g.document.close();
  1854.                     f = !0
  1855.                 } else if (EBG._isXMLHttpRequestSupported()) {
  1856.                     var h = new XMLHttpRequest;
  1857.                     h.setRequestHeader("Content-type", "text/plain");
  1858.                     h.open(d, a, b);
  1859.                     if (b || !b && !this.browser.isFF()) h.withCredentials = !0;
  1860.                     try {
  1861.                         h.send(e)
  1862.                     } catch (i) {
  1863.                         if (b) throw i;
  1864.                     }
  1865.                     f = !0
  1866.                 } else if (window.XDomainRequest && !c && b) {
  1867.                     var j = new XDomainRequest;
  1868.                     j.open(d, a);
  1869.                     j.send(e);
  1870.                     f = !0
  1871.                 }
  1872.             } catch (k) {
  1873.                 f = !1
  1874.             }
  1875.             f || this.reportToRemoteServerUsingImage(a)
  1876.         }
  1877.     },
  1878.     getIframeFormScript: function(a, b) {
  1879.         return '<script>var e=document.createElement("form"),t="' +
  1880.             b + '".split("&");e.setAttribute("method","post"),e.setAttribute("action","' + a + '");for(var i=0;i<t.length;++i){var a=t[i].substr(0,t[i].indexOf("=")),r=t[i].substr(t[i].indexOf("=")+1),m=document.createElement("input");m.setAttribute("type","hidden"),m.setAttribute("name",a),m.setAttribute("value",r),e.appendChild(m)}e.submit();<\/script>'
  1881.     },
  1882.     getElementById: function(a, b) {
  1883.         var c = null,
  1884.             b = b ? b : this.getDisplayWin();
  1885.         EBG.isDefinedNotNull(a) && (c = b.document.getElementById(a));
  1886.         return c
  1887.     },
  1888.     supportsPageLoadEvents: function() {
  1889.         return !(this.browser.isOpera() &&
  1890.             14 > this.browser.getVersion()) && !(this.browser.isIE() && 7 > this.browser.getVersion())
  1891.     },
  1892.     getHostName: function(a) {
  1893.         return (a ? a : this.getDisplayWin()).location.hostname
  1894.     },
  1895.     getDomain: function(a) {
  1896.         return (a ? a : this.getDisplayWin()).document.domain
  1897.     },
  1898.     getDisplayWin: function() {
  1899.         return window
  1900.     },
  1901.     getPageWin: function() {
  1902.         return window
  1903.     },
  1904.     inInnerIframe: function() {
  1905.         return !1
  1906.     },
  1907.     inPlacementIframe: function() {
  1908.         return !1
  1909.     },
  1910.     _setEvents: function() {
  1911.         this.supportsPageLoadEvents && (this._setEvent(EBG.Events.EventNames.PAGE_LOAD, "load"), this._setEvent(EBG.Events.EventNames.PAGE_UNLOAD,
  1912.             "unload", !0), this._setEvent(EBG.Events.EventNames.PAGE_BEFORE_UNLOAD, "beforeunload", !0), this._setEvent(EBG.Events.EventNames.PAGE_HIDE, "pagehide", !0));
  1913.         this._setEvent(EBG.Events.EventNames.PAGE_RESIZE, "resize");
  1914.         this._setEvent(EBG.Events.EventNames.SCREEN_ORIENTATION, "orientationchange");
  1915.         this._setEvent(EBG.Events.EventNames.MOUSE_MOVE, "mousemove", !1, ["clientX", "clientY", "pageX", "pageY", "view"], !0)
  1916.     },
  1917.     _setEvent: function(a, b, c, d, e) {
  1918.         this._environmentEvents[a] = {
  1919.             name: b,
  1920.             inCurWin: c ? c : !1
  1921.         };
  1922.         this._logicalEvents[b] = {
  1923.             name: a,
  1924.             signInAllWindows: e
  1925.         };
  1926.         if (d) {
  1927.             this._logicalEvents[b].attr = [];
  1928.             for (a = 0; a < d.length; a++) this._logicalEvents[b].attr[a] = d[a]
  1929.         }
  1930.     },
  1931.     _documentWrite: function(a) {
  1932.         document.write(a)
  1933.     },
  1934.     isPageLoaded: function() {
  1935.         if (this._isPageLoaded) return !0;
  1936.         this._isPageLoaded = EBGInfra.isDefined(window.gEBMainWindow) && EBGInfra.isDefined(gEBMainWindow.EBP) && gEBMainWindow.EBP.isPageLoaded;
  1937.         if (!this._isPageLoaded && this.getPageWin().document.readyState) this._isPageLoaded = "complete" == this.getPageWin().document.readyState;
  1938.         return EBG.adaptor._isPageLoaded
  1939.     },
  1940.     _handleEvent: function(a) {
  1941.         var b = this._logicalEvents[a.type].name;
  1942.         switch (b) {
  1943.             case EBG.Events.EventNames.PAGE_LOAD:
  1944.                 this._isPageLoaded = !0;
  1945.                 break;
  1946.             case EBG.Events.EventNames.PAGE_RESIZE:
  1947.                 EBG.adaptor.inInnerIframe() && this.serving.rehidePlacementIframe();
  1948.                 break;
  1949.             case EBG.Events.EventNames.SCREEN_ORIENTATION:
  1950.                 this._handleOrientationEvent();
  1951.                 return;
  1952.             case EBG.Events.EventNames.PAGE_BEFORE_UNLOAD:
  1953.                 if (this.browser.isIE() && this._isPageLoaded) return
  1954.         }
  1955.         b && (b = new EBG.Events.Event(b), EBGInfra.isDefinedNotNull(this._logicalEvents[a.type].attr) &&
  1956.             this._prepareLogicalEventData(b, a, this._logicalEvents[a.type].attr), EBG.isFunc(this._listener) && this._listener.call(this._listenerBinding, b))
  1957.     },
  1958.     _handleOrientationEvent: function() {},
  1959.     _prepareLogicalEventData: function(a, b, c) {
  1960.         try {
  1961.             a.eventData = {};
  1962.             for (var d = 0; d < c.length; d++) a.eventData[c[d]] = b[c[d]]
  1963.         } catch (e) {}
  1964.     },
  1965.     _getDefaultAttributes: function(a) {
  1966.         var b = {};
  1967.         switch (a.toLowerCase()) {
  1968.             case EBG.Adaptors.TagNames.IFRAME:
  1969.                 b = {
  1970.                     marginheight: "0px",
  1971.                     marginwidth: "0px",
  1972.                     frameborder: "0",
  1973.                     scrolling: "no"
  1974.                 }
  1975.         }
  1976.         return b
  1977.     },
  1978.     _getDefaultStyle: function(a) {
  1979.         var b = {
  1980.             border: "0px",
  1981.             padding: "0px",
  1982.             margin: "0px"
  1983.         };
  1984.         switch (a.toLowerCase()) {
  1985.             case EBG.Adaptors.TagNames.DIV:
  1986.                 EBG.mergeObj({
  1987.                     top: "0px",
  1988.                     left: "0px",
  1989.                     overflow: "visible",
  1990.                     fontSize: "0px",
  1991.                     lineHeight: "0px",
  1992.                     textAlign: "left"
  1993.                 }, b, !0)
  1994.         }
  1995.         return b
  1996.     },
  1997.     _setObjDefaultAttributes: function(a) {
  1998.         var b = this._getDefaultAttributes(a.tagName);
  1999.         EBG.mergeObj(a.attributes, b, !0);
  2000.         b.style = this._getDefaultStyle(a.tagName);
  2001.         a.attributes.style && EBG.mergeObj(a.attributes.style, b.style, !0);
  2002.         a.attributes = b
  2003.     },
  2004.     _getObjParamsStr: function(a) {
  2005.         var a = a.params,
  2006.             b = "",
  2007.             c;
  2008.         for (c in a) a.hasOwnProperty(c) && (b += EBG.format("<PARAM name='{0}' value='{1}'>", c, a[c]));
  2009.         return b
  2010.     },
  2011.     _getObjAttributesStr: function(a) {
  2012.         var a = a.attributes,
  2013.             b = "",
  2014.             c;
  2015.         for (c in a)
  2016.             if (a.hasOwnProperty(c)) {
  2017.                 var d = a[c];
  2018.                 if (EBG.isObj(d)) {
  2019.                     var e = d,
  2020.                         d = "",
  2021.                         f;
  2022.                     for (f in e)
  2023.                         if (e.hasOwnProperty(f)) {
  2024.                             var g = e[f];
  2025.                             "textAlign" == f && (f = "text-align");
  2026.                             d += EBG.format("{0}:{1}; ", f, g)
  2027.                         }
  2028.                 }
  2029.                 if (d) try {
  2030.                     d = d.toString().replace(/\"/ig, "&quot;"), b += EBG.format(' {0}="{1}"', c, d)
  2031.                 } catch (h) {}
  2032.             }
  2033.         return b
  2034.     },
  2035.     _resizeAfterPaint: function(a, b, c) {
  2036.         b && c && EBG.runTimed(this,
  2037.             function() {
  2038.                 var d = this.getElementById(a);
  2039.                 this.setElemStyle(d, "width", b);
  2040.                 this.setElemStyle(d, "height", c)
  2041.             }, [], 50)
  2042.     },
  2043.     handleEvent: function(a) {
  2044.         this._handleEvent(a)
  2045.     },
  2046.     setElemStyle: function(a, b, c) {
  2047.         a.style[b] = c
  2048.     },
  2049.     getBrowserLanguage: function() {
  2050.         var a = "en-US";
  2051.         if ("undefined" !== typeof navigator.language) a = navigator.language;
  2052.         else if ("undefined" !== typeof navigator.userLanguage) a = navigator.userLanguage;
  2053.         return a
  2054.     },
  2055.     getPositioningById: function(a, b, c) {
  2056.         return this.getPositioningByElement(this.getElementById(a), b, c)
  2057.     },
  2058.     getPositioningByElement: function(a,
  2059.         b, c) {
  2060.         a = a && a.getBoundingClientRect ? a.getBoundingClientRect() : null;
  2061.         if (!a) return null;
  2062.         b = this.getScrollLeftTop(b, c);
  2063.         return {
  2064.             X: Math.floor(a.left) + b.X,
  2065.             Y: Math.floor(a.top) + b.Y
  2066.         }
  2067.     },
  2068.     getScrollLeftTop: function(a, b) {
  2069.         var c = this._getCurrentWindow(a, b),
  2070.             d = c.document,
  2071.             e = {
  2072.                 X: {
  2073.                     "0": "XOffset",
  2074.                     1: "Left"
  2075.                 },
  2076.                 Y: {
  2077.                     "0": "YOffset",
  2078.                     1: "Top"
  2079.                 }
  2080.             },
  2081.             f;
  2082.         for (f in e) e[f] = c["page" + e[f][0]] || (d.documentElement ? d.documentElement["scroll" + e[f][1]] : d.documentElement["page" + e[f][0]]) || (d.body ? d.body["scroll" + e[f][1]] : 0);
  2083.         return e
  2084.     },
  2085.     _getCurrentWindow: function(a) {
  2086.         try {
  2087.             return a ?
  2088.                 this.getDisplayWin() : top
  2089.         } catch (b) {}
  2090.     },
  2091.     getRequestMethod: function(a) {
  2092.         return this.browser.isIE() && 6 == this.browser.getVersion() || this.isInApp() ? "GET" : 2E3 < a.length ? "POST" : "GET"
  2093.     },
  2094.     removeElement: function(a) {
  2095.         if (a = this.getElementById(a)) a.parentNode.removeChild(a), a.removeNode && a.removeNode(!0)
  2096.     },
  2097.     appendChildElement: function(a, b) {
  2098.         a && b && this.getElementById(a).appendChild(b)
  2099.     },
  2100.     getMaxZIndex: function(a) {
  2101.         if (this.browser.isIE() && 8 > this.browser.getVersion()) return 10001;
  2102.         var b = 0;
  2103.         if (a) {
  2104.             var c = this.getStyleOfElem(a);
  2105.             c && c.zIndex &&
  2106.                 (b = c.zIndex);
  2107.             for (var d in a.childNodes) d && a.childNodes[d] && (c = this.getMaxZIndex(a.childNodes[d]), b = b > c ? b : c)
  2108.         }
  2109.         return b
  2110.     },
  2111.     setCookieKeyValuePair: function(a, b, c) {
  2112.         if (EBG.isDefined(a) && "" != a && EBG.isDefined(b)) b = EBG.isDefined(c) && c ? escape(b) : b, document.cookie = a + "=" + b + ";"
  2113.     },
  2114.     isSafeFrame: function() {
  2115.         return !(!window.$sf || !$sf.ext)
  2116.     },
  2117.     isInApp: function() {
  2118.         return !1
  2119.     },
  2120.     isSkype: function() {
  2121.         try {
  2122.             return !!(window.$WLXRmAd || window.parent && window.parent.$WLXRmAd)
  2123.         } catch (a) {
  2124.             return !1
  2125.         }
  2126.     },
  2127.     isReady: function() {
  2128.         return !0
  2129.     },
  2130.     getBoundingClientRect: function(a,
  2131.         b) {
  2132.         if (!a || !this.getElementById(a.id)) return null;
  2133.         var b = b || {},
  2134.             c = a.getBoundingClientRect(),
  2135.             c = {
  2136.                 top: ~~c.top,
  2137.                 left: ~~c.left,
  2138.                 bottom: ~~c.bottom,
  2139.                 right: ~~c.right
  2140.             };
  2141.         c.width = ~~c.width || c.right - c.left;
  2142.         c.height = ~~c.height || c.bottom - c.top;
  2143.         if (b.clip) try {
  2144.             var d = /rect\((.*?)px(.*?)px(.*?)px(.*?)px\)/g.exec(this.getComputedStyle(a).getPropertyValue("clip"));
  2145.             if (d) {
  2146.                 for (var e = 1; e < d.length; e++) d[e] = parseFloat(d[e].replace(",", ""));
  2147.                 if (0 != d[1] + d[2] + d[3] + d[4]) {
  2148.                     var f = {
  2149.                         top: c.top + d[1],
  2150.                         left: c.left + d[4]
  2151.                     };
  2152.                     f.right = Math.min(f.left +
  2153.                         (d[2] - d[4]), c.right);
  2154.                     f.bottom = Math.min(f.top + (d[3] - d[1]), c.bottom);
  2155.                     f.width = f.right - f.left;
  2156.                     f.height = f.bottom - f.top;
  2157.                     c = f
  2158.                 }
  2159.             }
  2160.         } catch (g) {}
  2161.         if (b.relativeToTop) {
  2162.             for (var e = d = 0, f = EBG.getTopAccessibleWindow(), h = a.ownerDocument, h = h.defaultView || h.parentWindow; h !== f && h.frameElement;) var i = h.frameElement.getBoundingClientRect(),
  2163.                 d = d + i.top,
  2164.                 e = e + i.left,
  2165.                 h = h.parent;
  2166.             c.top += d;
  2167.             c.left += e;
  2168.             c.bottom += d;
  2169.             c.right += e
  2170.         }
  2171.         b.relativeToWindow && (h = this.getElementWindow(a), d = h.pageXOffset || h.document.documentElement.scrollLeft, e = h.pageYOffset ||
  2172.             h.document.documentElement.scrollTop, c.top += e, c.left += d, c.bottom += e, c.right += d);
  2173.         return c
  2174.     },
  2175.     getComputedStyle: function() {
  2176.         return window.getComputedStyle ? function(a, b) {
  2177.             return (this.getElementWindow(a) || window).getComputedStyle(a, b)
  2178.         } : function(a) {
  2179.             var b = {};
  2180.             b.el = a;
  2181.             b.getPropertyValue = function(b) {
  2182.                 var d = /(\-([a-z]){1})/g;
  2183.                 "float" == b && (b = "styleFloat");
  2184.                 d.test(b) && (b = b.replace(d, function(a, b, c) {
  2185.                     return c.toUpperCase()
  2186.                 }));
  2187.                 return a.currentStyle[b] ? a.currentStyle[b] : a.style[b] ? a.style[b] : null
  2188.             };
  2189.             return b
  2190.         }
  2191.     }(),
  2192.     isPageVisible: function(a) {
  2193.         var b = !0;
  2194.         (b = (b = this._getVisibilityEventHidden()) && document[b] ? !1 : !0) && this.browser.isIE() && this.serving.detectServingMode(!0) != EBG.Adaptors.ServingMode.IFRAME && (b = b && (this.focused || a));
  2195.         return b
  2196.     },
  2197.     _getVisibilityEventHidden: function() {
  2198.         var a = null;
  2199.         "undefined" !== typeof document.hidden ? a = "hidden" : "undefined" !== typeof document.mozHidden ? a = "mozHidden" : "undefined" !== typeof document.msHidden ? a = "msHidden" : "undefined" !== typeof document.webkitHidden && (a = "webkitHidden");
  2200.         return a
  2201.     },
  2202.     getObjKeys: function(a) {
  2203.         a = a || {};
  2204.         if (Object.keys) return Object.keys(a);
  2205.         var b = [],
  2206.             c;
  2207.         for (c in a) a.hasOwnProperty(c) && b.push(c);
  2208.         return b
  2209.     },
  2210.     isNode: function(a) {
  2211.         return "object" === typeof Node ? a instanceof Node : a && "object" === typeof a && "number" === typeof a.nodeType && "string" === typeof a.nodeName
  2212.     },
  2213.     isElement: function(a) {
  2214.         return "object" === typeof HTMLElement ? a instanceof HTMLElement : a && "object" === typeof a && null !== a && 1 === a.nodeType && "string" === typeof a.nodeName
  2215.     },
  2216.     isElementOrNode: function(a) {
  2217.         return this.isElement(a) || this.isNode(a)
  2218.     }
  2219. };
  2220. EBG.declareClass(EBG.Adaptors.StdWebAdaptor, null);
  2221. EBG.Adaptors.WebAdaptor = function() {
  2222.     this._init();
  2223.     EBG.callSuperConstructor(EBG.Adaptors.WebAdaptor, this);
  2224.     EBG.adaptor && EBG.adaptor.copy(this)
  2225. };
  2226. EBG.Adaptors.WebAdaptor.prototype = {
  2227.     _previousWidth: -1,
  2228.     _previousHeight: -1,
  2229.     _screenOrientation: "",
  2230.     scrollBarWidth: 0,
  2231.     _isReady: !1,
  2232.     focused: !1,
  2233.     _init: function() {
  2234.         this._sendReady()
  2235.     },
  2236.     isReady: function() {
  2237.         return this._isReady
  2238.     },
  2239.     isSDKDefined: function() {
  2240.         return !1
  2241.     },
  2242.     updateScrollBarWidth: function() {
  2243.         EBG.adaptor.scrollBarWidth = EBG.adaptor.getScrollerWidth()
  2244.     },
  2245.     initInnerModules: function(a, b, c, d, e, f) {
  2246.         EBG.callSuperFunction(EBG.Adaptors.WebAdaptor, this, "initInnerModules", [a, b, c, d, e]);
  2247.         this.updateScrollBarWidth();
  2248.         if (!this.serving) this.serving =
  2249.             EBG.Adaptors.ServingMgr ? new EBG.Adaptors.ServingMgr : null;
  2250.         this.serving.noInDapIFFlag = f;
  2251.         this._addEventListener(this.getDisplayWin(), "resize", EBG.adaptor.updateScrollBarWidth)
  2252.     },
  2253.     _pageResizeHandler: function() {
  2254.         this._handleOrientationEvent()
  2255.     },
  2256.     _handleOrientationEvent: function() {
  2257.         this._checkOrientationEvent();
  2258.         EBG.runTimed(this, this._checkOrientationEvent, [], 300)
  2259.     },
  2260.     _checkOrientationEvent: function() {
  2261.         if (this.browser.isMobile() && this._isOrientationChange()) {
  2262.             this._setScreenOrientation();
  2263.             var a = new EBG.Events.Event(EBG.Events.EventNames.SCREEN_ORIENTATION);
  2264.             a.dispatcher = this;
  2265.             a.eventData = {
  2266.                 screenOrientation: this._screenOrientation
  2267.             };
  2268.             EBG.eventMgr.dispatchEvent(a)
  2269.         }
  2270.     },
  2271.     registerSpecialBrowserEvents: function() {
  2272.         if (this.browser.isIE()) this._addEventListener(this.getPageWin(), "focus", this._updateFocused), 10 > this.browser.getVersion() && (this._addEventListener(this.getPageWin().document, "focusout", this._updateFocusOut), this._addEventListener(this.getPageWin().document, "focusin", this._updateFocused)), this.focused = this.focused || "undefined" != typeof gEBMainWindow && "undefined" !=
  2273.             typeof gEBMainWindow.EBP && gEBMainWindow.EBP.focused;
  2274.         EBG.eventMgr.subscribeToEvent(new EBG.Events.EventSubscription(EBG.Events.EventNames.PAGE_RESIZE, this._pageResizeHandler, this));
  2275.         this._updateInitialOrientationValues()
  2276.     },
  2277.     _updateInitialOrientationValues: function() {
  2278.         this.browser.isMobile() && this._setScreenOrientation(EBG.adaptor.serving._getTopFriendlyIframe(EBG.adaptor.getDisplayWin()))
  2279.     },
  2280.     _updateFocusOut: function() {
  2281.         EBG.runTimed(EBG.adaptor, function() {
  2282.             if (!(EBG.adaptor.getPageWin().screenTop > -2 * EBG.adaptor.getPageWin().screen.availHeight)) {
  2283.                 var a =
  2284.                     new EBG.Events.Event(EBG.Events.EventNames.PAGE_HIDDEN);
  2285.                 a.dispatcher = EBG.adaptor;
  2286.                 EBG.eventMgr.dispatchEvent(a)
  2287.             }
  2288.         }, [], 50)
  2289.     },
  2290.     _updateFocused: function() {
  2291.         EBG.adaptor.focused = !0;
  2292.         var a = new EBG.Events.Event(EBG.Events.EventNames.PAGE_VISIBLE);
  2293.         a.dispatcher = EBG.adaptor;
  2294.         EBG.eventMgr.dispatchEvent(a);
  2295.         try {
  2296.             EBG.adaptor._removeEventListener(EBG.adaptor.getPageWin(), "focus", EBG.adaptor._updateFocused), 10 > EBG.adaptor.browser.getVersion() && EBG.adaptor._removeEventListener(EBG.adaptor.getPageWin().document, "focusin", EBG.adaptor._updateFocused)
  2297.         } catch (b) {}
  2298.     },
  2299.     _setEvents: function() {
  2300.         EBG.callSuperFunction(EBG.Adaptors.WebAdaptor, this, "_setEvents", []);
  2301.         this._setEvent(EBG.Events.EventNames.PAGE_SCROLL, "scroll");
  2302.         this._setEvent(EBG.Events.EventNames.PAGE_FOCUS, "focus");
  2303.         this._setEvent(EBG.Events.EventNames.PAGE_BLUR, "blur");
  2304.         var a = this._getVisibilityEventName();
  2305.         "undefined" === typeof document.addEventListener || "undefined" === typeof a || (this._setEvent(EBG.Events.EventNames.PAGE_HIDDEN, a, !0), this._setEvent(EBG.Events.EventNames.PAGE_VISIBLE, a, !0))
  2306.     },
  2307.     initServingMode: function(a,
  2308.         b, c, d) {
  2309.         b = b ? b : !1;
  2310.         switch (a) {
  2311.             case EBG.Adaptors.ServingMode.INNER_IFRAME:
  2312.                 this.serving.setServingMode(EBG.Adaptors.ServingMode.INNER_IFRAME);
  2313.                 break;
  2314.             case -1:
  2315.                 this.serving.detectServingMode(!1);
  2316.                 break;
  2317.             case 0:
  2318.                 !EBG.isPreview && c == EBG.Adaptors.ServingMode.FRIENDLY_IFRAME && !b ? this.serving.setServingMode(EBG.Adaptors.ServingMode.FRIENDLY_IFRAME) : !EBG.isPreview && c == EBG.Adaptors.ServingMode.IFRAME && !b ? d ? this.isSkype() || this.isSafeFrame() ? this.serving.setServingMode(EBG.Adaptors.ServingMode.TOPMOST_FRIENDLY_IFRAME) :
  2319.                     this.serving.setServingMode(EBG.Adaptors.ServingMode.IFRAME) : this.serving.setServingMode(EBG.Adaptors.ServingMode.TOPMOST_FRIENDLY_IFRAME) : b && this.serving.setServingMode(EBG.Adaptors.ServingMode.SCRIPT);
  2320.                 break;
  2321.             case 1:
  2322.             case 2:
  2323.                 this.serving.setServingMode(EBG.Adaptors.ServingMode.IFRAME)
  2324.         }
  2325.     },
  2326.     addPlaceHolder: function(a) {
  2327.         this.inInnerIframe() && (this.inject(a, EBG.Adaptors.InjectionMethod.INSERT_BEFORE, this.serving.placementIframe), this.serving.hidePlacementIframe())
  2328.     },
  2329.     getPageWin: function() {
  2330.         return this.serving &&
  2331.             this.serving.pageWin ? this.serving.pageWin : window
  2332.     },
  2333.     getDisplayWin: function() {
  2334.         return this.serving && this.serving.displayWin ? this.serving.displayWin : window
  2335.     },
  2336.     _getDocument: function() {
  2337.         return this.getDisplayWin().document
  2338.     },
  2339.     isCookiesSupported: function() {
  2340.         var a = navigator.cookieEnabled ? !0 : !1;
  2341.         if ("undefined" == typeof navigator.cookieEnabled)
  2342.             if (document.cookie = "ebTestcookie", -1 != document.cookie.indexOf("ebTestcookie")) {
  2343.                 var a = !0,
  2344.                     b = new Date;
  2345.                 b.setTime(b.getTime() - 1E3);
  2346.                 document.cookie = "ebTestcookie; expires=" + b.toGMTString()
  2347.             } else a = !1;
  2348.         return a
  2349.     },
  2350.     inInnerIframe: function() {
  2351.         return this.serving && this.serving.placementIframe
  2352.     },
  2353.     inPlacementIframe: function() {
  2354.         return this.serving && this.serving.servingMode === EBG.Adaptors.ServingMode.IFRAME
  2355.     },
  2356.     setElemStyle: function(a, b, c) {
  2357.         a.style[b] = c
  2358.     },
  2359.     setElemAttribute: function(a, b, c) {
  2360.         a[b] = c
  2361.     },
  2362.     getClipTag: function(a, b, c, d) {
  2363.         return EBG.format("rect({0}px {1}px {2}px {3}px)", a, b, c, d)
  2364.     },
  2365.     clip: function(a, b, c, d, e) {
  2366.         a.style.clip = this.getClipTag(b, c, d, e)
  2367.     },
  2368.     unclip: function(a) {
  2369.         a.style.clip = "rect(auto auto auto auto)"
  2370.     },
  2371.     expand: function(a,
  2372.         b) {
  2373.         this.setElemStyle(a, "left", EBG.px(-b.x));
  2374.         this.setElemStyle(a, "top", EBG.px(-b.y));
  2375.         this.setElemStyle(a, "width", EBG.px(b.width));
  2376.         this.setElemStyle(a, "height", EBG.px(b.height));
  2377.         this.unclip(a)
  2378.     },
  2379.     collapse: function(a, b, c) {
  2380.         b = this.getClipParams(b, c);
  2381.         this.clip(a, b.top, b.right, b.bottom, b.left)
  2382.     },
  2383.     resize: function(a, b, c) {
  2384.         this.setElemStyle(a, "width", EBG.px(b));
  2385.         this.setElemStyle(a, "height", EBG.px(c))
  2386.     },
  2387.     getClipParams: function(a, b) {
  2388.         return {
  2389.             top: a.y,
  2390.             right: a.x + b.width,
  2391.             bottom: a.y + b.height,
  2392.             left: a.x
  2393.         }
  2394.     },
  2395.     getCurrentStyleAttr: function(a,
  2396.         b) {
  2397.         var c = null;
  2398.         try {
  2399.             c = a.currentStyle ? a.currentStyle[b] : a.ownerDocument.defaultView.getComputedStyle(a, null).getPropertyValue(b)
  2400.         } catch (d) {}
  2401.         if (!c && "embed" == a.tagName.toLowerCase() && a.parentNode && "object" == a.parentNode.tagName.toLowerCase()) a = a.parentNode, c = a.currentStyle ? a.currentStyle[b] : a.ownerDocument.defaultView.getComputedStyle(a, null).getPropertyValue(b);
  2402.         return c
  2403.     },
  2404.     getViewPortMetrics: function() {
  2405.         return this.getWindowViewPortMetrics()
  2406.     },
  2407.     getWindowViewPortMetrics: function(a) {
  2408.         try {
  2409.             var a = a ? a : this.getDisplayWin(),
  2410.                 b = a.document,
  2411.                 c = {
  2412.                     Height: 0,
  2413.                     Width: 0
  2414.                 },
  2415.                 d = b.documentMode;
  2416.             if (this.browser.isIE() && (5 == d || !this.browser.isStrictType(b))) c.Width = b.body.clientWidth, c.Height = b.body.clientHeight;
  2417.             else if (this.browser.isIE()) c.Width = b.documentElement.clientWidth, c.Height = b.documentElement.clientHeight;
  2418.             else if (c.Width = a.innerWidth, c.Height = a.innerHeight, "hidden" != b.body.style.overflow) {
  2419.                 if (b.body.offsetWidth > c.Width || b.body.scrollWidth > c.Width || 0 < a.scrollMaxX) c.Height -= this.scrollBarWidth;
  2420.                 if (b.body.offsetHeight > c.Height || b.body.scrollHeight >
  2421.                     c.Height || 0 < a.scrollMaxY) c.Width -= this.scrollBarWidth
  2422.             }
  2423.         } catch (e) {}
  2424.         return c
  2425.     },
  2426.     getPageMetrics: function(a) {
  2427.         try {
  2428.             var b = a ? a.document : this.getDisplayWin().document,
  2429.                 a = {
  2430.                     Height: 0,
  2431.                     Width: 0
  2432.                 };
  2433.             a.Height = Math.max(b.body.scrollHeight, b.documentElement.scrollHeight, b.body.offsetHeight, b.documentElement.offsetHeight, b.body.clientHeight, b.documentElement.clientHeight);
  2434.             a.Width = Math.max(b.body.scrollWidth, b.documentElement.scrollWidth, b.body.offsetWidth, b.documentElement.offsetWidth, b.body.clientWidth, b.documentElement.clientWidth);
  2435.             return a
  2436.         } catch (c) {}
  2437.     },
  2438.     saveInitialScrollBarState: function(a) {
  2439.         a.EBG = a.EBG || {};
  2440.         var b = a.document;
  2441.         a.EBG._scrollBarsInitialState = null != a.EBG._scrollBarsInitialState ? a.EBG._scrollBarsInitialState : b.body.style.overflow
  2442.     },
  2443.     showScrollBars: function(a) {
  2444.         a = a ? a : this.getDisplayWin();
  2445.         this.saveInitialScrollBarState(a);
  2446.         a.document.body.style.overflow = "auto"
  2447.     },
  2448.     hideScrollBars: function(a) {
  2449.         a = a ? a : this.getDisplayWin();
  2450.         this.saveInitialScrollBarState(a);
  2451.         a.document.body.style.overflow = "hidden"
  2452.     },
  2453.     restoreScrollBarsState: function(a) {
  2454.         var a =
  2455.             a ? a : this.getDisplayWin(),
  2456.             b = a.document;
  2457.         if (null != a.EBG._scrollBarsInitialState) b.body.style.overflow = a.EBG._scrollBarsInitialState
  2458.     },
  2459.     _getCurrentWindow: function(a, b) {
  2460.         try {
  2461.             return this.serving.servingMode == EBG.Adaptors.ServingMode.INNER_IFRAME ? a = !0 : b == EBG.Adaptors.ServingMode.IFRAME && this.browser.isFF() && (a = !0), a ? this.getDisplayWin() : top
  2462.         } catch (c) {}
  2463.     },
  2464.     getPositioningById: function(a, b, c, d) {
  2465.         b = this.serving.servingMode == EBG.Adaptors.ServingMode.INNER_IFRAME ? !0 : b;
  2466.         return this.getPositioningByElement(this.getElementById(a),
  2467.             b, c, d)
  2468.     },
  2469.     getIframePosition: function() {
  2470.         var a = {
  2471.             X: 0,
  2472.             Y: 0
  2473.         };
  2474.         if (EBG.adaptor.serving.detectServingMode(!0) == EBG.Adaptors.ServingMode.IFRAME && "undefined" != typeof this.getDisplayWin().mozInnerScreenX) a.X = this.getDisplayWin().mozInnerScreenX, a.Y = this.getDisplayWin().mozInnerScreenY;
  2475.         return a
  2476.     },
  2477.     getPositioningByElement: function(a, b, c, d) {
  2478.         if (!a) return null;
  2479.         var b = this.serving.servingMode == EBG.Adaptors.ServingMode.INNER_IFRAME || EBG.isPreview ? !0 : b,
  2480.             e = a.getBoundingClientRect ? a.getBoundingClientRect() : null;
  2481.         if (!e) return null;
  2482.         a = Math.round(e.left);
  2483.         e = Math.round(e.top);
  2484.         if (!EBG.isDefined(d) || !d) b = this.getScrollLeftTop(b, c), a += b.X, e += b.Y;
  2485.         return {
  2486.             X: a,
  2487.             Y: e
  2488.         }
  2489.     },
  2490.     getScrollLeftTop: function(a, b) {
  2491.         a = b == EBG.Adaptors.ServingMode.IFRAME ? !0 : a;
  2492.         return EBG.callSuperFunction(EBG.Adaptors.WebAdaptor, this, "getScrollLeftTop", [a, b])
  2493.     },
  2494.     getBodyPositioning: function(a) {
  2495.         var b = this.getDisplayWin(),
  2496.             c = this.isCurrWin();
  2497.         (a = EBG.adaptor.getPositioningByElement(b.document.body, !c, a)) || (a = {
  2498.             X: 0,
  2499.             Y: 0
  2500.         });
  2501.         return a
  2502.     },
  2503.     isCurrWin: function() {
  2504.         return this.getDisplayWin() === this.getPageWin()
  2505.     },
  2506.     _calculatePositioning: function() {
  2507.         return null
  2508.     },
  2509.     getScrollerWidth: function() {
  2510.         try {
  2511.             if (EBG.adaptor.browser._platform == EBG.adaptor.browser._platformTypes.IPAD || EBG.adaptor.browser._platform == EBG.adaptor.browser._platformTypes.IPHONE) return 0;
  2512.             var a = null,
  2513.                 b = null,
  2514.                 c = 0,
  2515.                 d = 0,
  2516.                 e = 0,
  2517.                 a = document.createElement("div");
  2518.             a.style.position = "absolute";
  2519.             a.style.top = "-1000px";
  2520.             a.style.left = "-1000px";
  2521.             a.style.width = "100px";
  2522.             a.style.height = "50px";
  2523.             a.style.overflow = "auto";
  2524.             b = document.createElement("div");
  2525.             b.style.width = "100%";
  2526.             b.style.height =
  2527.                 "200px";
  2528.             a.appendChild(b);
  2529.             document.body.appendChild(a);
  2530.             d = b.offsetWidth;
  2531.             document.body.removeChild(document.body.lastChild);
  2532.             a.style.overflow = "hidden";
  2533.             document.body.appendChild(a);
  2534.             c = b.offsetWidth;
  2535.             document.body.removeChild(document.body.lastChild);
  2536.             return c - d ? c - d : 0
  2537.         } catch (f) {}
  2538.     },
  2539.     getResolution: function() {
  2540.         var a = 0;
  2541.         switch (window.screen.width) {
  2542.             case 640:
  2543.                 a = 1;
  2544.                 break;
  2545.             case 800:
  2546.                 a = 2;
  2547.                 break;
  2548.             case 1024:
  2549.                 a = 4;
  2550.                 break;
  2551.             case 1152:
  2552.                 a = 8;
  2553.                 break;
  2554.             case 1280:
  2555.                 a = 16;
  2556.                 break;
  2557.             case 1600:
  2558.                 a = 32;
  2559.                 break;
  2560.             case 1400:
  2561.                 a = 64;
  2562.                 break;
  2563.             case 1920:
  2564.                 a = 128;
  2565.                 break;
  2566.             case 1680:
  2567.                 a =
  2568.                     256;
  2569.                 break;
  2570.             case 1366:
  2571.                 a = 512;
  2572.                 break;
  2573.             case 1440:
  2574.                 a = 1024;
  2575.                 break;
  2576.             case 1360:
  2577.                 a = 2048;
  2578.                 break;
  2579.             case 768:
  2580.                 a = 4096;
  2581.                 break;
  2582.             case 1093:
  2583.                 a = 8192;
  2584.                 break;
  2585.             case 960:
  2586.                 a = 16384;
  2587.                 break;
  2588.             case 2560:
  2589.                 a = 32768
  2590.         }
  2591.         return a
  2592.     },
  2593.     _handleEvent: function(a) {
  2594.         var b = this._logicalEvents[a.type].name;
  2595.         switch (b) {
  2596.             case EBG.Events.EventNames.PAGE_HIDDEN:
  2597.             case EBG.Events.EventNames.PAGE_VISIBLE:
  2598.                 b = this.isPageVisible() ? EBG.Events.EventNames.PAGE_VISIBLE : EBG.Events.EventNames.PAGE_HIDDEN;
  2599.                 break;
  2600.             default:
  2601.                 EBG.callSuperFunction(EBG.Adaptors.WebAdaptor, this, "_handleEvent", [a]);
  2602.                 return
  2603.         }
  2604.         b && (b = new EBG.Events.Event(b), EBGInfra.isDefinedNotNull(this._logicalEvents[a.type].attr) && this._prepareLogicalEventData(b, this._logicalEvents[a.type].eventData, this._logicalEvents[a.type].attr), EBG.isFunc(this._listener) && this._listener.call(this._listenerBinding, b))
  2605.     },
  2606.     _isOrientationChange: function() {
  2607.         var a = EBG.adaptor.serving._getTopFriendlyIframe(EBG.adaptor.getDisplayWin());
  2608.         return a.innerWidth !== this._previousWidth || a.innerHeight != this._previousHeight ? this._screenOrientation !== (a.innerHeight >=
  2609.             a.innerWidth ? EBG.Events.EventNames.PORTRAIT : EBG.Events.EventNames.LANDSCAPE) : !1
  2610.     },
  2611.     _setScreenOrientation: function(a) {
  2612.         a = a ? a : EBG.adaptor.serving._getTopFriendlyIframe(EBG.adaptor.getDisplayWin());
  2613.         this._screenOrientation = a.innerHeight >= a.innerWidth ? EBG.Events.EventNames.PORTRAIT : EBG.Events.EventNames.LANDSCAPE;
  2614.         this._previousWidth = a.innerWidth;
  2615.         this._previousHeight = a.innerHeight
  2616.     },
  2617.     getScreenOrientation: function(a) {
  2618.         ("boolean" == typeof a ? a : 1) && this._setScreenOrientation();
  2619.         return this._screenOrientation
  2620.     },
  2621.     _sendReady: function() {
  2622.         this._isReady = !0;
  2623.         var a = new EBG.Events.Event(EBG.EBMessage.ADAPTOR_READY);
  2624.         a.dispatcher = this;
  2625.         a.timing = EBG.Events.EventTiming.BEFORE;
  2626.         if (!EBG.eventMgr.dispatchEvent(a)) a.timing = EBG.Events.EventTiming.ONTIME, EBG.eventMgr.dispatchEvent(a)
  2627.     },
  2628.     getMouseCoordinates: function(a) {
  2629.         var b = {
  2630.             mouseX: 0,
  2631.             mouseY: 0
  2632.         };
  2633.         if (a) EBG.adaptor.browser.isIE() ? (b.mouseX = a.clientX ? a.clientX : 0, b.mouseY = a.clientY ? a.clientY : 0) : (b.mouseX = a.pageX ? a.pageX : 0, b.mouseY = a.pageY ? a.pageY : 0), b.view = a.view;
  2634.         return b
  2635.     },
  2636.     _getVisibilityEventName: function() {
  2637.         var a = null;
  2638.         "undefined" !==
  2639.         typeof document.hidden ? a = "visibilitychange" : "undefined" !== typeof document.mozHidden ? a = "mozvisibilitychange" : "undefined" !== typeof document.msHidden ? a = "msvisibilitychange" : "undefined" !== typeof document.webkitHidden && (a = "webkitvisibilitychange");
  2640.         return a
  2641.     },
  2642.     getElementWindow: function(a) {
  2643.         if (!a) return null;
  2644.         a = a.ownerDocument;
  2645.         return a.defaultView || a.parentWindow || window
  2646.     }
  2647. };
  2648. EBG.declareClass(EBG.Adaptors.WebAdaptor, EBG.Adaptors.StdWebAdaptor);
  2649. EBG.Adaptors = EBG.Adaptors || {};
  2650. EBG.Adaptors.Browser = function(a, b, c, d, e) {
  2651.     this.set(a, b, c, d, e)
  2652. };
  2653. EBG.Adaptors.Browser.prototype = {
  2654.     _platform: 0,
  2655.     _browserType: 0,
  2656.     _browserVer: 0,
  2657.     _browserCode: 0,
  2658.     _deviceType: 0,
  2659.     _browserTypes: EBG.API.BrowserTypes,
  2660.     _platformTypes: EBG.API.PlatformTypes,
  2661.     _deviceTypes: EBG.API.DeviceTypes,
  2662.     set: function(a, b, c, d, e) {
  2663.         a = a ? a : this._platformTypes.NON_SUPPORTED;
  2664.         b = b ? b : this._browserTypes.NON_SUPPORTED;
  2665.         e = e ? e : this._browserTypes.NON_SUPPORTED;
  2666.         this._platform = a;
  2667.         this._browserType = b;
  2668.         this._browserVer = c ? c : 0;
  2669.         this._browserCode = e;
  2670.         this._deviceType = d ? d : 0
  2671.     },
  2672.     getVersion: function() {
  2673.         return this._browserVer
  2674.     },
  2675.     getDocumentMode: function() {
  2676.         return window.document.documentMode
  2677.     },
  2678.     isIE: function() {
  2679.         return this._browserType == this._browserTypes.IE || this._browserType == this._browserTypes.AOL
  2680.     },
  2681.     isEdge: function() {
  2682.         return this._browserType == this._browserTypes.EDGE
  2683.     },
  2684.     isStrictType: function(a) {
  2685.         var b = !1;
  2686.         this.isIE() && (b = a ? "CSS1Compat" == a.compatMode : "CSS1Compat" == document.compatMode);
  2687.         return b
  2688.     },
  2689.     isFF: function() {
  2690.         return this._browserType == this._browserTypes.FF
  2691.     },
  2692.     isSafari: function() {
  2693.         return this._browserType == this._browserTypes.SAFARI
  2694.     },
  2695.     isChrome: function() {
  2696.         return this._browserType == this._browserTypes.CHROME
  2697.     },
  2698.     isOpera: function() {
  2699.         return this._browserType == this._browserTypes.OPERA
  2700.     },
  2701.     isMac: function() {
  2702.         return this._platform == this._platformTypes.MAC || this._platform == this._platformTypes.MAC_NEW || this._platform == this._platformTypes.MAC_YOSEMITE
  2703.     },
  2704.     isMobile: function() {
  2705.         var a = !1;
  2706.         if (this._deviceType == this._deviceTypes.MOBILE || this._deviceType == this._deviceTypes.TABLET) a = !0;
  2707.         return a
  2708.     },
  2709.     isiOS: function() {
  2710.         for (var a in this._platformTypes)
  2711.             if (this._platformTypes[a] == this._platform && a.match(/mac|iphone|ipad|ipod/i)) return !0;
  2712.         return !1
  2713.     },
  2714.     isAndroid: function() {
  2715.         for (var a in this._platformTypes)
  2716.             if (this._platformTypes[a] == this._platform && 0 <= a.indexOf("ANDROID")) return !0;
  2717.         return !1
  2718.     },
  2719.     isAndroidNative: function() {
  2720.         return this.isAndroid() && this.isSafari()
  2721.     },
  2722.     isThirdPartyAllowed: function() {
  2723.         return !this.isSafari() || this.isMobile()
  2724.     },
  2725.     getEnvironment: function() {
  2726.         var a = navigator.userAgent || navigator.vendor || window.opera;
  2727.         if (EBG.adaptor.browser.isMobile()) {
  2728.             if (EBG.adaptor.browser.isiOS()) {
  2729.                 var b = window.navigator && window.navigator.standalone;
  2730.                 return !a.match(/safari/i) &&
  2731.                     !b ? EBG.WebEnvironment.IOS_WEB_VIEW : EBG.WebEnvironment.IOS_MOBILE_BROWSER
  2732.             }
  2733.             return EBG.adaptor.browser.isAndroid() ? a.match(/version/i) ? EBG.WebEnvironment.ANDROID_WEB_VIEW : EBG.adaptor.browser.isChrome() || EBG.adaptor.browser.isFF() ? EBG.WebEnvironment.ANDROID_MOBILE_BROWESR : EBG.WebEnvironment.ANDROID_UNKNOWN : EBG.adaptor.browser.isIE() ? EBG.WebEnvironment.OTHER_MOBILE_BROWSER : EBG.WebEnvironment.UNKNOWN
  2734.         }
  2735.         return EBG.WebEnvironment.BROWSER
  2736.     }
  2737. };
  2738. EBG.Adaptors.ServingMode = {
  2739.     SCRIPT: "SCRIPT",
  2740.     IFRAME: "IFRAME",
  2741.     FRIENDLY_IFRAME: "FRIENDLY_IFRAME",
  2742.     INNER_IFRAME: "INNER_IFRAME",
  2743.     TOPMOST_FRIENDLY_IFRAME: "TOPMOST_FRIENDLY_IFRAME"
  2744. };
  2745. EBG.Adaptors.IframeMode = {
  2746.     SERVE: "SERVE",
  2747.     VERIFY: "VERIFY",
  2748.     SERVEANDVERIFY: "SERVEANDVERIFY"
  2749. };
  2750. EBG.Adaptors.ServingMgr = function() {
  2751.     this.displayWin = window;
  2752.     this.servingMode = EBG.Adaptors.ServingMode.SCRIPT;
  2753.     this._supportPostMessage = !!window.postMessage
  2754. };
  2755. EBG.Adaptors.ServingMgr.prototype = {
  2756.     noInDapIFFlag: null,
  2757.     displayWin: null,
  2758.     pageWin: null,
  2759.     placementIframe: null,
  2760.     _placementIframeAttr: null,
  2761.     servingMode: null,
  2762.     ebO: null,
  2763.     addinEyeRef: null,
  2764.     aieServerRequestPrefix: "/BurstingPipe/adServer.bs?cn=chdm&referrer=",
  2765.     aieServerRequestPrefixVersion: "&cv=2",
  2766.     setDisplayWin: function(a) {
  2767.         this.displayWin = a
  2768.     },
  2769.     setPageWin: function() {
  2770.         var a = this.detectServingMode(!0);
  2771.         switch (this.servingMode) {
  2772.             case EBG.Adaptors.ServingMode.SCRIPT:
  2773.                 switch (a) {
  2774.                     case EBG.Adaptors.ServingMode.SCRIPT:
  2775.                         this.pageWin =
  2776.                             window;
  2777.                         break;
  2778.                     case EBG.Adaptors.ServingMode.FRIENDLY_IFRAME:
  2779.                         this.pageWin = top;
  2780.                         break;
  2781.                     case EBG.Adaptors.ServingMode.IFRAME:
  2782.                     case EBG.Adaptors.ServingMode.INNER_IFRAME:
  2783.                         this.pageWin = this.displayWin
  2784.                 }
  2785.                 break;
  2786.             case EBG.Adaptors.ServingMode.FRIENDLY_IFRAME:
  2787.                 this.pageWin = top;
  2788.                 break;
  2789.             case EBG.Adaptors.ServingMode.IFRAME:
  2790.             case EBG.Adaptors.ServingMode.TOPMOST_FRIENDLY_IFRAME:
  2791.             case EBG.Adaptors.ServingMode.INNER_IFRAME:
  2792.                 this.pageWin = this.displayWin
  2793.         }
  2794.     },
  2795.     setServingMode: function(a) {
  2796.         this.servingMode = a;
  2797.         var b = null;
  2798.         switch (a) {
  2799.             case EBG.Adaptors.ServingMode.TOPMOST_FRIENDLY_IFRAME:
  2800.                 b =
  2801.                     this._getTopFriendlyIframe();
  2802.                 break;
  2803.             case EBG.Adaptors.ServingMode.INNER_IFRAME:
  2804.                 b = top;
  2805.                 break;
  2806.             case EBG.Adaptors.ServingMode.FRIENDLY_IFRAME:
  2807.                 b = top;
  2808.                 break;
  2809.             case EBG.Adaptors.ServingMode.SCRIPT:
  2810.                 this.setDisplayWin(window);
  2811.                 this.setPageWin();
  2812.                 return
  2813.         }
  2814.         EBG.eventMgr.subscribeToEvent(new EBG.Events.EventSubscription(EBG.Events.EventNames.PAGE_UNLOAD, this._restorePlacementIframe, this));
  2815.         b && (EBG.isGlobalDef("gstrEbDisplayPos") && (b = eval("parent." + gstrEbDisplayPos)), this.setDisplayWin(b), this.setPageWin(), b !== window && this._findPlacementIframe())
  2816.     },
  2817.     isFIF: function(a) {
  2818.         if (this.noInDapIFFlag) return !1;
  2819.         var b = "inFIF" in a ? a.inFIF : !1;
  2820.         return ("inDapIF" in a ? a.inDapIF : !1) || b
  2821.     },
  2822.     detectServingMode: function(a) {
  2823.         try {
  2824.             for (var b = EBG.Adaptors.ServingMode.SCRIPT, c = window; c !== c.parent && c.self !== c.parent;) {
  2825.                 var d = null;
  2826.                 try {
  2827.                     d = EBG.adaptor.getHostName(c.parent)
  2828.                 } catch (e) {}
  2829.                 if (EBGInfra.isDefinedNotNull(d) && (EBG.adaptor.getHostName(c) === d || ebO.ffs.CFF_FriendlyEmptyHostName && "" === EBG.adaptor.getHostName(c)) || this.isFIF(c)) b = EBG.Adaptors.ServingMode.FRIENDLY_IFRAME, c = c.parent;
  2830.                 else {
  2831.                     b =
  2832.                         EBG.Adaptors.ServingMode.IFRAME;
  2833.                     break
  2834.                 }
  2835.             }
  2836.             if (a) return b;
  2837.             this.setServingMode(b)
  2838.         } catch (f) {}
  2839.     },
  2840.     detectServingEnvironment: function(a) {
  2841.         a = EBG.isDefinedNotNull(a) ? a : this.detectServingMode(!0);
  2842.         if (this.servingMode == EBG.Adaptors.ServingMode.INNER_IFRAME || this.servingMode == EBG.Adaptors.ServingMode.IFRAME && EBG.isDefinedNotNull(this.addinEyeRef)) a = EBG.Adaptors.ServingMode.INNER_IFRAME;
  2843.         var b = this._getTopFriendlyIframe(window);
  2844.         if (window != b && b != top) a = EBG.Adaptors.ServingMode.TOPMOST_FRIENDLY_IFRAME;
  2845.         return a
  2846.     },
  2847.     _getTopFriendlyIframe: function(a) {
  2848.         a =
  2849.             a ? a : window;
  2850.         if (EBG.adaptor.isSafeFrame()) return a;
  2851.         for (; a !== a.parent && a.self !== a.parent;) {
  2852.             var b = null;
  2853.             try {
  2854.                 b = EBG.adaptor.getHostName(a.parent)
  2855.             } catch (c) {}
  2856.             if (a.parent && (EBGInfra.isDefinedNotNull(b) && (EBG.adaptor.getHostName(a) === b || ebO.ffs.CFF_FriendlyEmptyHostName && "" === EBG.adaptor.getHostName(a)) || this.isFIF(a))) a = a.parent;
  2857.             else break
  2858.         }
  2859.         return a
  2860.     },
  2861.     _restorePlacementIframe: function() {
  2862.         this._placementIframeAttr && (EBGInfra.mergeObj(this._placementIframeAttr, this.placementIframe, !0), EBGInfra.mergeObj(this._placementIframeAttr.style,
  2863.             this.placementIframe.style, !0))
  2864.     },
  2865.     hidePlacementIframe: function() {
  2866.         var a = this.placementIframe;
  2867.         if (!this._placementIframeAttr) this._placementIframeAttr = {
  2868.             width: a.width,
  2869.             height: a.height
  2870.         }, this._placementIframeAttr.style = {
  2871.             width: EBG.adaptor.getCurrentStyleAttr(a, "width"),
  2872.             height: EBG.adaptor.getCurrentStyleAttr(a, "height"),
  2873.             visibility: EBG.adaptor.getCurrentStyleAttr(a, "visibility"),
  2874.             border: EBG.adaptor.getCurrentStyleAttr(a, "border")
  2875.         };
  2876.         a.style.visibility = "hidden";
  2877.         a.width = a.height = 0;
  2878.         a.style.width = a.style.height = a.style.border =
  2879.             "0px"
  2880.     },
  2881.     rehidePlacementIframe: function() {
  2882.         this._placementIframeAttr && this.hidePlacementIframe()
  2883.     },
  2884.     handleAieServing: function(a) {
  2885.         this.ebO = EBG.cloneObj(a);
  2886.         if (EBG.adaptor.browser.isIE() && 9 > EBG.adaptor.browser.getVersion()) try {
  2887.             delete this.ebO.ut, delete this.ebO.fru
  2888.         } catch (b) {
  2889.             this.ebO.ut = "", this.ebO.fru = ""
  2890.         }
  2891.         if (EBG.iframeLocation) this._handleAddInEyeServerResponse('{"iflExists":1,"iflCheck":0}');
  2892.         else if (a.aiE && EBG.isDefined(a.aiE.iflExists)) this._handleAddInEyeServerResponse(JSON.stringify(a.aiE));
  2893.         else {
  2894.             var c =
  2895.                 encodeURIComponent(document.referrer || document.location.href);
  2896.             c ? EBG.adaptor.getDataFromRemoteServer(ebPtcl + a.bs + this.aieServerRequestPrefix + c + this.aieServerRequestPrefixVersion, this._handleAddInEyeServerResponse, this, !0, !1) || this._handleAddInEyeServerResponse('{"iflExists":1,"iflCheck":0}') : this._handleAddInEyeServerResponse(null)
  2897.         }
  2898.     },
  2899.     _handleAddInEyeServerResponse: function(a, b) {
  2900.         var c;
  2901.         try {
  2902.             c = !b && a ? JSON.parse(a) : {
  2903.                 iflExists: 0,
  2904.                 iflCheck: 1
  2905.             }
  2906.         } catch (d) {
  2907.             c = {
  2908.                 iflExists: 0,
  2909.                 iflCheck: 1
  2910.             }
  2911.         }
  2912.         this.ebO.aiE = c;
  2913.         if (!this.ebO.dmn) this.ebO.dmn =
  2914.             c.Domain ? c.Domain : this._ebGetHostName(document.referrer);
  2915.         if (c && c.iflExists) this.insertInnerIframe(this.ebO.phid, c.iflCheck ? EBG.Adaptors.IframeMode.SERVEANDVERIFY : EBG.Adaptors.IframeMode.SERVE);
  2916.         else {
  2917.             this.ebO.ifrm = 0;
  2918.             this.ebO.adConfig.showAieDefaultImage = 1;
  2919.             var e = new EBG.Events.Event(EBG.Events.EventNames.AIE_LOADED);
  2920.             e.eventData = {
  2921.                 loadDefault: this.ebO.adConfig.showAieDefaultImage,
  2922.                 currentResponse: this.ebO
  2923.             };
  2924.             e.timing = EBG.Events.EventTiming.BEFORE;
  2925.             EBG.eventMgr.dispatchEvent(e);
  2926.             c.iflCheck && this.insertInnerIframe(this.ebO.phid,
  2927.                 EBG.Adaptors.IframeMode.VERIFY)
  2928.         }
  2929.     },
  2930.     insertInnerIframe: function(a, b) {
  2931.         this._supportPostMessage ? (this._initPmMessages(b), this.listenToMessages()) : this._startHashProtocol(b);
  2932.         var c = {
  2933.             tagName: EBG.Adaptors.TagNames.IFRAME,
  2934.             attributes: {
  2935.                 id: "addineyeIframe",
  2936.                 src: this._getAddineyeLocation(),
  2937.                 style: {
  2938.                     display: ebO.ffs.CFF_addineyeDispNone ? "none" : "block"
  2939.                 },
  2940.                 width: "0",
  2941.                 height: "0"
  2942.             }
  2943.         };
  2944.         EBG.adaptor.addInlineDOM(c, a);
  2945.         this.addinEyeRef = EBG.adaptor.getElementById("addineyeIframe");
  2946.         this._supportPostMessage || this._sendMessageHashProtocol()
  2947.     },
  2948.     _getAddineyeLocation: function() {
  2949.         var a = "eyeblaster/addineyeV2" + ("https://" == EBG.protocol ? "-secure" : "") + ".html";
  2950.         this._getTopFriendlyIframe();
  2951.         if (EBG.iframeLocation) a = EBG.iframeLocation;
  2952.         if ("http" != a.substr(0, 4)) {
  2953.             var b = this.ebO.dmn;
  2954.             if (!b) return "";
  2955.             a = EBG.protocol + b + "/" + a
  2956.         }
  2957.         return a
  2958.     },
  2959.     _buildSecretTagsObj: function() {
  2960.         return {
  2961.             gstrEbPreLoadScripts: EBG.isGlobalDef("gstrEbPreLoadScripts") ? gstrEbPreLoadScripts : void 0,
  2962.             gnEbLowBWLimit: EBG.isGlobalDef("gnEbLowBWLimit") ? gnEbLowBWLimit : void 0,
  2963.             gstrEbPreLoadScripts: EBG.isGlobalDef("gstrEbPreLoadScripts") ?
  2964.                 gstrEbPreLoadScripts : void 0,
  2965.             gfEbInlineBanner: EBG.isGlobalDef("gfEbInlineBanner") ? gfEbInlineBanner : void 0,
  2966.             gEbEyeDivRefElement: EBG.isGlobalDef("gEbEyeDivRefElement") ? gEbEyeDivRefElement : void 0,
  2967.             gstrEbDisplayPos: EBG.isGlobalDef("gstrEbDisplayPos") ? gstrEbDisplayPos : void 0,
  2968.             gnEbMinZIndex: EBG.isGlobalDef("gnEbMinZIndex") ? gnEbMinZIndex : void 0,
  2969.             gfEbForceStreaming: EBG.isGlobalDef("gfEbForceStreaming") ? gfEbForceStreaming : void 0,
  2970.             gfEbUseIntFlash: EBG.isGlobalDef("gfEbUseIntFlash") ? gfEbUseIntFlash : void 0,
  2971.             gEbfLoadAsAS2: EBG.isGlobalDef("gEbfLoadAsAS2") ?
  2972.                 gEbfLoadAsAS2 : void 0,
  2973.             gEbURLTokens: EBG.isGlobalDef("gEbURLTokens") ? gEbURLTokens : void 0
  2974.         }
  2975.     },
  2976.     _startHashProtocol: function(a) {
  2977.         this._hashMessages = [];
  2978.         if (a == EBG.Adaptors.IframeMode.VERIFY || a == EBG.Adaptors.IframeMode.SERVEANDVERIFY) this._hashMessages.push(this._buildHashMessages({
  2979.             ebProtocol: ebPtcl,
  2980.             ebBs: this.ebO.bs,
  2981.             addineyeDomain: this.ebO.dmn
  2982.         }, EBG.INNERIFRAMEMessage.VERIFY, a == EBG.Adaptors.IframeMode.VERIFY ? EBG.INNERIFRAMEMessage.LASTMSG : EBG.INNERIFRAMEMessage.NOT_LASTMSG));
  2983.         if (a == EBG.Adaptors.IframeMode.SERVE ||
  2984.             a == EBG.Adaptors.IframeMode.SERVEANDVERIFY) {
  2985.             var a = {
  2986.                     ebPtcl: ebPtcl,
  2987.                     ebBigS: ebBigS,
  2988.                     ebResourcePath: this.ebO && this.ebO.adConfig && this.ebO.adConfig.resourcePath ? this.ebO.adConfig.resourcePath : ebResourcePath,
  2989.                     ebRand: ebRand,
  2990.                     ebPli: ebPli,
  2991.                     ebAdID: ebAdID
  2992.                 },
  2993.                 b = {
  2994.                     ptcl: ebPtcl,
  2995.                     bs: ebO.bs,
  2996.                     adId: ebO.adConfig.adId
  2997.                 },
  2998.                 c = this._buildSecretTagsObj();
  2999.             this.ebO.adConfig = this.ebO.tn != EBG.adTypes.VisibilityAd ? null : {
  3000.                 tn: ebO.adConfig.tn,
  3001.                 rnd: ebO.adConfig.rnd,
  3002.                 adId: ebO.adConfig.adId,
  3003.                 uid: ebO.adConfig.adId + "_" + ebO.adConfig.rnd
  3004.             };
  3005.             this._hashMessages.push(this._buildHashMessages(b,
  3006.                 EBG.INNERIFRAMEMessage.ADCONFIG_REQUEST));
  3007.             this._hashMessages.push(this._buildHashMessages(this.ebO, EBG.INNERIFRAMEMessage.EBO));
  3008.             this._hashMessages.push(this._buildHashMessages(a, EBG.INNERIFRAMEMessage.GLOBALPARAMS, EBG.INNERIFRAMEMessage.NOT_LASTMSG));
  3009.             this._hashMessages.push(this._buildHashMessages(c, EBG.INNERIFRAMEMessage.SECRET_TAGS, EBG.INNERIFRAMEMessage.LASTMSG))
  3010.         }
  3011.         EBG.msgProtocol.postMessage("", window.location.href, window);
  3012.         EBG.msgProtocol.receiveMessages(this._handleMessagesHashProtocol, 10)
  3013.     },
  3014.     _buildHashMessages: function(a,
  3015.         b, c) {
  3016.         a.typeObj = b;
  3017.         a.lastMsg = c ? c : EBG.INNERIFRAMEMessage.NOT_LASTMSG;
  3018.         a.parentURL = document.location.href;
  3019.         return escape(JSON.stringify(a))
  3020.     },
  3021.     _sendMessageHashProtocol: function() {
  3022.         EBG.msgProtocol.postMessage(EBG.adaptor.serving._hashMessages[0], EBG.adaptor.serving.addinEyeRef.src, EBG.adaptor.serving.addinEyeRef);
  3023.         EBG.adaptor.serving._hashMessages.splice(0, 1);
  3024.         0 == EBG.adaptor.serving._hashMessages.length && EBG.msgProtocol.finishMessaging()
  3025.     },
  3026.     listenToMessages: function() {
  3027.         EBG.pm.bind(EBG.INNERIFRAMEMessage.LOADED,
  3028.             this._handlePostMessage, this)
  3029.     },
  3030.     _ebGetHostName: function(a) {
  3031.         var b = "",
  3032.             a = a.toLowerCase(),
  3033.             b = 7 <= a.length && "http://" == a.substr(0, 7) ? a.substr(7) : 8 <= a.length && "https://" == a.substr(0, 8) ? a.substr(8) : a,
  3034.             a = b.indexOf("/");
  3035.         0 < a && (b = b.substr(0, a));
  3036.         return b
  3037.     },
  3038.     _findPlacementIframe: function() {
  3039.         try {
  3040.             var a = this.displayWin,
  3041.                 b = window,
  3042.                 c = null,
  3043.                 d = -1;
  3044.             do {
  3045.                 var d = -1,
  3046.                     c = null,
  3047.                     e = b.parent.frames;
  3048.                 if (!EBG.isDefined(e.length))
  3049.                     for (var f = b.parent.document.getElementsByTagName(EBG.Adaptors.TagNames.IFRAME), e = [], g = 0; g < f.length; g++) e.push(f[g].contentWindow);
  3050.                 for (g = 0; g < e.length; g++) try {
  3051.                     if (e[g] == b) {
  3052.                         d = g;
  3053.                         c = b;
  3054.                         break
  3055.                     }
  3056.                 } catch (h) {}
  3057.                 b = b.parent
  3058.             } while (b != a);
  3059.             if (!(0 <= d)) throw new exception("ServingMgr._findPlacementIframe", "Could not find placement iframe!");
  3060.             b = null;
  3061.             try {
  3062.                 if ("undefined" != typeof c.frameElement) b = c.frameElement
  3063.             } catch (i) {}
  3064.             if (!b) {
  3065.                 for (var j = a.document.getElementsByTagName(EBG.Adaptors.TagNames.IFRAME), g = 0; g < j.length; g++) j[g].contentWindow == c && (d = g);
  3066.                 if (d >= j.length) throw new exception("ServingMgr._findPlacementIframe", EBG.format("frames List is too short ({0}). Needed frame is {1}",
  3067.                     j.length, d));
  3068.                 b = j[d]
  3069.             }
  3070.             this.placementIframe = b
  3071.         } catch (k) {}
  3072.     },
  3073.     _handleMessagesHashProtocol: function(a) {
  3074.         switch (a.data) {
  3075.             case EBG.INNERIFRAMEMessage.CONTINUE_SENDING:
  3076.                 EBG.adaptor.serving._sendMessageHashProtocol()
  3077.         }
  3078.     },
  3079.     _handlePostMessage: function(a) {
  3080.         a && a == EBG.INNERIFRAMEMessage.LOADED && EBG.adaptor.serving._sendInitToInnerIframe()
  3081.     },
  3082.     _sendInitToInnerIframe: function() {
  3083.         for (var a = 0; a < EBG.adaptor.serving._pmMessages.length; a++) EBG.pm({
  3084.             target: this.addinEyeRef.contentWindow,
  3085.             type: EBG.adaptor.serving._pmMessages[a].msgType,
  3086.             data: EBG.adaptor.serving._pmMessages[a].data
  3087.         });
  3088.         EBG.adaptor.serving._pmMessages = {}
  3089.     },
  3090.     _initPmMessages: function(a) {
  3091.         this._pmMessages = [];
  3092.         (a == EBG.Adaptors.IframeMode.VERIFY || a == EBG.Adaptors.IframeMode.SERVEANDVERIFY) && this._pmMessages.push({
  3093.             msgType: EBG.INNERIFRAMEMessage.VERIFY,
  3094.             data: {
  3095.                 ebProtocol: ebPtcl,
  3096.                 ebBs: this.ebO.bs,
  3097.                 addineyeDomain: this.ebO.dmn
  3098.             }
  3099.         });
  3100.         if ((a == EBG.Adaptors.IframeMode.SERVE || a == EBG.Adaptors.IframeMode.SERVEANDVERIFY) && EBG.adaptor.serving.ebO) a = {
  3101.             ebO: EBG.adaptor.serving.ebO,
  3102.             ebPtcl: ebPtcl,
  3103.             ebBigS: ebBigS,
  3104.             ebResourcePath: this.ebO && this.ebO.adConfig && this.ebO.adConfig.resourcePath ? this.ebO.adConfig.resourcePath : ebResourcePath,
  3105.             ebRand: ebRand,
  3106.             secretTagData: this._buildSecretTagsObj(),
  3107.             ebPli: ebPli,
  3108.             ebAdID: ebAdID
  3109.         }, this._pmMessages.push({
  3110.             msgType: EBG.INNERIFRAMEMessage.INIT,
  3111.             data: a
  3112.         })
  3113.     }
  3114. };
  3115. EBG.Adaptors.FlashDetector = function() {
  3116.     this._init();
  3117.     this._customScript = !!window.ebAdCS
  3118. };
  3119. EBG.Adaptors.FlashDetector.prototype = {
  3120.     version: 0,
  3121.     checkingBlock: !1,
  3122.     checkedBlock: !1,
  3123.     isBlocked: null,
  3124.     _flashPlayerVersion: null,
  3125.     _detectionPixelTimeout: null,
  3126.     _throttleTimeout: null,
  3127.     _detectionPixelTimeoutDuration: 2E3,
  3128.     _init: function() {
  3129.         var a = -1;
  3130.         try {
  3131.             a = (new ActiveXObject("Shockwaveflash.Shockwaveflash.7")).GetVariable("$version"), a = this._splitFlashMajorMinorVersions(a), a = Number(a)
  3132.         } catch (b) {}
  3133.         if (-1 == a) try {
  3134.             var c = 0,
  3135.                 d = 0,
  3136.                 e = 0;
  3137.             if (null != navigator.plugins && 0 < navigator.plugins.length) {
  3138.                 var f = navigator.mimeTypes;
  3139.                 if (f && f["application/x-shockwave-flash"] &&
  3140.                     f["application/x-shockwave-flash"].enabledPlugin && f["application/x-shockwave-flash"].enabledPlugin.description) {
  3141.                     var g = f["application/x-shockwave-flash"].enabledPlugin.description.split(" "),
  3142.                         h = g[2].split("."),
  3143.                         c = h[0],
  3144.                         d = h[1],
  3145.                         e = g[3];
  3146.                     "" == e && (e = g[4]);
  3147.                     isNaN(e[0]) && (e = e.substring(1));
  3148.                     0 < e.indexOf("d") && (e = e.substring(0, e.indexOf("d")))
  3149.                 }
  3150.                 a = Number(c + "." + d + e)
  3151.             }
  3152.         } catch (i) {}
  3153.         if (!isNaN(a)) this.version = a
  3154.     },
  3155.     _splitFlashMajorMinorVersions: function(a) {
  3156.         if (a) return a = a.split(" ")[1].split(","), EBG.format("{0}.{1}{2}", a[0],
  3157.             a[1], a[2])
  3158.     },
  3159.     _handlePixelMessage: function(a) {
  3160.         clearTimeout(this._detectionPixelTimeout);
  3161.         this._detectionPixelTimeout = null;
  3162.         this.flashPlayerVersion = a;
  3163.         this.isBlocked = !1;
  3164.         EBG.runTimed(this, this._dispatchFlashDetected, [], 10)
  3165.     },
  3166.     _handleDetectionPixelTimeout: function(a) {
  3167.         var b = EBG.adaptor.browser.isFF() || EBG.adaptor.isPageVisible(),
  3168.             c = EBG.adaptor.hasHiddenParent(EBG.adaptor.getElementById("ebFlashDetection"));
  3169.         if (b && a && !c) {
  3170.             this.checkedBlock = !0;
  3171.             this.checkingBlock = !1;
  3172.             a = EBG.adaptor.getDisplayWin();
  3173.             if (a.EBG && a.EBG !=
  3174.                 EBG && a.EBG.adaptor.flash && EBG.isDefinedNotNull(a.EBG.adaptor.flash.flashPlayerVersion)) this.flashPlayerVersion = a.EBG.adaptor.flash.flashPlayerVersion;
  3175.             this.isBlocked = !this.flashPlayerVersion;
  3176.             this._dispatchFlashDetected();
  3177.             clearTimeout(this._detectionPixelTimeout);
  3178.             this._detectionPixelTimeout = null
  3179.         } else clearTimeout(this._detectionPixelTimeout), this._detectionPixelTimeout = EBG.runTimed(this, this._handleDetectionPixelTimeout, [b], this._detectionPixelTimeoutDuration)
  3180.     },
  3181.     _dispatchFlashDetected: function() {
  3182.         this.checkedBlock = !0;
  3183.         this.checkingBlock = !1;
  3184.         var a = new EBG.Events.Event(EBG.Events.EventNames.FLASH_DETECTED);
  3185.         a.dispatcher = this;
  3186.         a.eventData = {
  3187.             isBlocked: this.isBlocked,
  3188.             versionStr: this.flashPlayerVersion,
  3189.             versionInt: this.version
  3190.         };
  3191.         EBG.eventMgr.dispatchEvent(a);
  3192.         EBG.adaptor.removeElement("ebFlashDetectionDiv")
  3193.     },
  3194.     _buildRenderPixelJson: function() {
  3195.         var a = {
  3196.             play: "true",
  3197.             resId: "ebFlashDetection",
  3198.             resPath: ebBigS + "/Res/Assets/Pixel" + EBG.flashPixelVer + "/pixel.swf",
  3199.             unique: 0,
  3200.             wmode: "opaque",
  3201.             tagName: EBG.Adaptors.TagNames.OBJECT,
  3202.             attributes: {
  3203.                 id: "ebFlashDetection",
  3204.                 dir: "ltr",
  3205.                 name: "ebFlashDetection",
  3206.                 style: {
  3207.                     position: "absolute",
  3208.                     textAlign: "left",
  3209.                     width: "1px",
  3210.                     height: "1px"
  3211.                 },
  3212.                 codebase: EBG.format("{0}download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#", EBG.protocol),
  3213.                 version: "9,0,0,0"
  3214.             },
  3215.             params: {
  3216.                 play: "true",
  3217.                 wmode: "opaque",
  3218.                 menu: "false",
  3219.                 flashVars: "id=ebFlashDetection",
  3220.                 allowScriptAccess: "always",
  3221.                 allowFullScreen: "true"
  3222.             }
  3223.         };
  3224.         this.isSupportShockwave() ? (a.attributes.type = "application/x-shockwave-flash", a.attributes.data = a.resPath) : (a.attributes.classid = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
  3225.             a.params.movie = a.resPath);
  3226.         return a
  3227.     },
  3228.     _createScriptTag: function() {
  3229.         var a = EBG.format("function {0}(args)", "DoFS_FlashDetectionPixel"),
  3230.             a = a + EBG.format("{ try{ if(!args||args=='null')args=''; return {0}(args);}catch(e){if(window.mmFSExceptionAlert)mmFSExceptionAlert('Command: '+command+'\\nargs: '+args.toString()+'\\n\\nexception in DoFS func:\\n'+e.message)}}", "EBG.adaptor.flash._handlePixelMessage");
  3231.         return {
  3232.             tagName: EBG.Adaptors.TagNames.SCRIPT,
  3233.             text: a
  3234.         }
  3235.     },
  3236.     _handleThrottleEvent: function(a) {
  3237.         a && a.state && (a.state ==
  3238.             EBG.ThrottleStates.THROTTLE || a.state == EBG.ThrottleStates.PAUSE ? this._setThrottleState(a) : a.state == EBG.ThrottleStates.RESUME ? (clearTimeout(this._throttleTimeout), this._setThrottleState(a)) : a.state == EBG.ThrottleStates.LOAD && a.elemId && a.id && this._verifyThrottleDetectLocation(a))
  3239.     },
  3240.     _verifyThrottleDetectLocation: function(a) {
  3241.         if (a.elemId && a.id) {
  3242.             var b = EBG.adaptor.getBoundingClientRect(EBG.adaptor.getElementById(a.elemId)),
  3243.                 c = EBG.adaptor.getElementById(a.id),
  3244.                 d = EBG.adaptor.getBoundingClientRect(c);
  3245.             if (b && d && EBG.isNumber(b.width) &&
  3246.                 EBG.isNumber(d.width))
  3247.                 if (0 == b.width || 0 == b.height) EBG.runTimed(this, this._verifyThrottleDetectLocation, [a], 30);
  3248.                 else {
  3249.                     if (EBG.serializeObject(b) != EBG.serializeObject(d)) {
  3250.                         var e = parseInt(c.style.marginTop, 10),
  3251.                             f = parseInt(c.style.marginLeft, 10);
  3252.                         c.style.marginTop = EBG.px(e - (d.top - b.top));
  3253.                         c.style.marginLeft = EBG.px(f - (d.left - b.left));
  3254.                         c.style.width = EBG.px(b.width);
  3255.                         c.style.height = EBG.px(b.height)
  3256.                     }
  3257.                     this._customScript && (b = (b = a.adUId && EBG.ads[a.adUId]) && b._CCs && b._CCs[a.elemId]) && EBG.RichFlashPanelCC && b instanceof
  3258.                     EBG.RichFlashPanelCC && EBG.runTimed(this, this._verifyThrottleDetectLocation, [a], 250)
  3259.                 }
  3260.         }
  3261.     },
  3262.     _setThrottleState: function(a) {
  3263.         if (a.adUId) {
  3264.             var b = new EBG.Events.Event(EBG.Events.EventNames.THROTTLED),
  3265.                 c = a.adUId.split("_")[1];
  3266.             b.dispatcher = {
  3267.                 _adConfig: {
  3268.                     rnd: c,
  3269.                     uid: a.adUId
  3270.                 }
  3271.             };
  3272.             b.eventData = a;
  3273.             EBG.eventMgr.dispatchEvent(b)
  3274.         }
  3275.     },
  3276.     removeThrottleDetectionSwf: function(a) {
  3277.         EBG.adaptor.removeElement("ebFlashThrottleDetection_" + a)
  3278.     },
  3279.     isSupportShockwave: function() {
  3280.         var a = !0;
  3281.         if (EBG.adaptor.browser.isIE() && 11 > EBG.adaptor.browser.getVersion() ||
  3282.             10 < EBG.adaptor.browser.getVersion() && 9 > EBG.adaptor.getDisplayWin().document.documentMode) a = !1;
  3283.         return a
  3284.     },
  3285.     doFlashBlockDetection: function(a) {
  3286.         this.checkingBlock = !0;
  3287.         var b = {
  3288.             tagName: EBG.Adaptors.TagNames.DIV,
  3289.             attributes: {
  3290.                 id: "ebFlashDetectionDiv",
  3291.                 style: {
  3292.                     width: "0px",
  3293.                     height: "0px"
  3294.                 }
  3295.             },
  3296.             children: [this._buildRenderPixelJson(), this._createScriptTag()]
  3297.         };
  3298.         EBG.adaptor.inInnerIframe() ? EBG.adaptor.inject(b, EBG.Adaptors.InjectionMethod.INSERT_BEFORE, EBG.adaptor.serving.placementIframe) : a && EBG.adaptor.getElementById(a) && EBG.adaptor.addInlineDOM(b,
  3299.             a);
  3300.         this._detectionPixelTimeout = EBG.runTimed(this, this._handleDetectionPixelTimeout, [], this._detectionPixelTimeoutDuration)
  3301.     },
  3302.     getFlashVersionForBlockingDetection: function() {
  3303.         var a = 0;
  3304.         try {
  3305.             if (!(document.documentMode || navigator.appName && "Opera" == navigator.appName)) {
  3306.                 var b = navigator.mimeTypes;
  3307.                 if (b && b["application/x-shockwave-flash"] && b["application/x-shockwave-flash"].enabledPlugin && b["application/x-shockwave-flash"].enabledPlugin.version) {
  3308.                     var c = b["application/x-shockwave-flash"].enabledPlugin.version,
  3309.                         d = c.split(".");
  3310.                     if (18 > d[0] || 18 == d[0] && 209 > d[3]) a = 20
  3311.                 } else if (b && b["application/x-shockwave-flash"] && b["application/x-shockwave-flash"].enabledPlugin && b["application/x-shockwave-flash"].enabledPlugin.filename && (c = b["application/x-shockwave-flash"].enabledPlugin.filename, d = c.split(".")[0].split("_"), 18 > d[1] || 18 == d[1] && 209 > d[4])) a = 21
  3312.             }
  3313.         } catch (e) {}
  3314.         return a
  3315.     }
  3316. };
  3317. EBG.Adaptors.Wallpaper = function() {
  3318.     this._currentBg = this._getCurrentBackground()
  3319. };
  3320. EBG.Adaptors.Wallpaper.prototype = {
  3321.     SetBackgroundImage: function(a) {
  3322.         var b = EBG.adaptor.getPageWin().document;
  3323.         if (a.imgSrc) {
  3324.             if (!a.color) a.color = this._currentBg.color ? this._currentBg.color : "transparent";
  3325.             var c = a.color,
  3326.                 c = c + (" url('" + a.imgSrc + "') ");
  3327.             a.tiling = "repeat" == a.tiling.toLowerCase() || "repeat-x" == a.tiling.toLowerCase() || "repeat-y" == a.tiling.toLowerCase() || "no-repeat" == a.tiling.toLowerCase() ? a.tiling.toLowerCase() : this._currentBg.tiling ? this._currentBg.tiling : "no-repeat";
  3328.             var c = c + (" " + a.tiling),
  3329.                 c = a.scrolling ?
  3330.                 c + " scroll" : c + " fixed",
  3331.                 d = "";
  3332.             "center" == a.positionX.toLowerCase() || "right" == a.positionX.toLowerCase() || "left" == a.positionX.toLowerCase() ? d = a.positionX.toLowerCase() : a.positionX = "";
  3333.             "center" == a.positionY.toLowerCase() || "top" == a.positionY.toLowerCase() || "bottom" == a.positionY.toLowerCase() ? d += " " + a.positionY.toLowerCase() : a.positionY = "";
  3334.             if (!a.positionX || !a.positionY) d = b.body.style.backgroundPosition ? b.body.style.backgroundPosition : "center top";
  3335.             b.body.style.background = c + (" " + d)
  3336.         }
  3337.     },
  3338.     RemoveBackgroundImage: function() {
  3339.         this._currentBg.imgSrc ?
  3340.             this.SetBackgroundImage(this._currentBg) : EBG.adaptor.getPageWin().document.body.style.background = ""
  3341.     },
  3342.     _getCurrentBackground: function() {
  3343.         var a = new EBG.Adaptors.Wallpaper.BgData,
  3344.             b = EBG.adaptor.getPageWin().document.body;
  3345.         if ("" != b.style.backgroundImage) a.imgSrc = b.style.backgroundImage.substr(4, b.style.backgroundImage.length - 5);
  3346.         if ("" != b.style.backgroundColor) a.color = b.style.backgroundColor;
  3347.         if ("" != b.style.backgroundRepeat) a.tiling = b.style.backgroundRepeat;
  3348.         if ("" != b.style.backgroundAttachment) a.scrolling = "fixed" ==
  3349.             b.style.backgroundAttachment ? !1 : !0;
  3350.         if ("" != b.style.backgroundPosition) posArr = b.style.backgroundPosition.split(" "), a.positionX = posArr[0], a.positionY = posArr[1];
  3351.         return a
  3352.     }
  3353. };
  3354. EBG.Adaptors.Wallpaper.BgData = function() {};
  3355. EBG.Adaptors.Wallpaper.BgData.prototype = {
  3356.     color: "",
  3357.     imgSrc: "",
  3358.     tiling: "",
  3359.     positionX: "",
  3360.     positionY: "",
  3361.     scrolling: !1,
  3362.     contentWidth: null
  3363. };
  3364. EBG.declareNamespace("Interactions");
  3365. EBG.Interactions.SystemInts = {
  3366.     CLICK: "_eyeblaster",
  3367.     AD_DURATION: "ebAdDuration",
  3368.     REPLAY: "ebReplay",
  3369.     CLOSE: "ebClose",
  3370.     CLOSE_REM: "ebRemClose",
  3371.     DEFAULT_CLICK: "ebDefaultClick",
  3372.     USER_INTERACTION: "ebUserInteraction",
  3373.     UNIQUE_VIDEO_STARTED: "ebUniqueVideoStarted",
  3374.     DWELL_TIME: "ebDwellTime",
  3375.     DWELL_UNIQUE: "ebUniqueDwell",
  3376.     RICH_FLASH_PLAYED: "ebRichFlashPlayed",
  3377.     INT_DURATION: "ebIntDuration",
  3378.     VISIBILITY_RECORDABLE: "VsR",
  3379.     VISIBILITY_AGENCY_RECORDABLE: "VsRAg",
  3380.     VISIBILITY_ADVERTISER_RECORDABLE: "VsRAd",
  3381.     VISIBILITY_ADVERTISER: "VsAd",
  3382.     VISIBILITY_AGENCY: "VsAg",
  3383.     VISIBILITY_IAB: "VsIAB",
  3384.     VISIBILITY_ADVERTISER_DURATION: "VsAdDu",
  3385.     VISIBILITY_AGENCY_DURATION: "VsAgDu",
  3386.     VISIBILITY_AVG_AD_SURFACE: "VsAvSu",
  3387.     VISIBILITY_AVG_SCREEN_SHARE: "VsAvSc",
  3388.     REM_DURATION: "ebRemDuration",
  3389.     INTRO_FULL_PLAY: "ebFullPlay",
  3390.     REM_FULL_PLAY: "ebRemFullPlay",
  3391.     SWIPE: "ebSwipe",
  3392.     AD_START: "AdStart",
  3393.     AD_STACKING: "AdStacking",
  3394.     MULTI_BURN: "MultiBurn",
  3395.     AD_COLLISION: "AdCollision",
  3396.     AD_CAROUSEL: "AdCarousel",
  3397.     AD_PARAMS: "AdParams",
  3398.     PLAYER_PARAMS: "plparams",
  3399.     VER_URL: "verURL"
  3400. };
  3401. if (!ebO.ffs.CFF_RemoveVideoInteractionOrder) EBG.Interactions.VideoInteractionOrder = [EBG.VideoInteraction.STARTED, EBG.VideoInteraction.PERCENT_25_PLAYED, EBG.VideoInteraction.PERCENT_50_PLAYED, EBG.VideoInteraction.PERCENT_75_PLAYED, EBG.VideoInteraction.FULLPLAY];
  3402. EBG.Interactions.Categories = {
  3403.     SYSTEM: 2,
  3404.     VIDEO: 1,
  3405.     CUSTOM: 0
  3406. };
  3407. EBG.Interactions.InitiationTypes = {
  3408.     AUTO: "auto",
  3409.     USER: "user"
  3410. };
  3411. EBG.Interactions.InteractionTypes = {
  3412.     COUNTER: "Counter",
  3413.     TIMER: "Timer"
  3414. };
  3415. EBG.Interactions.checkURL = function(a) {
  3416.     var b = a.toLowerCase(); - 1 == b.indexOf("http://") && -1 == b.indexOf("https://") && -1 == b.indexOf("ftp://") && -1 == b.indexOf("aim:") && -1 == b.indexOf("mailto:") && -1 == b.indexOf("fb://") && (a = 0 == b.indexOf("/") ? "http://" + EBG.adaptor.getHostName() + a : "http://" + a);
  3417.     return a
  3418. };
  3419. EBG.Interactions.RemoteServersData = function() {};
  3420. EBG.Interactions.RemoteServersData.prototype = {
  3421.     networkUrl: null,
  3422.     agencyUrl: null
  3423. };
  3424. EBG.declareClass(EBG.Interactions.RemoteServersData, null);
  3425. EBG.Interactions.InteractionData = function(a, b, c) {
  3426.     this.reportingName = a;
  3427.     this.adUId = b;
  3428.     this.category = c
  3429. };
  3430. EBG.Interactions.InteractionData.prototype = {
  3431.     initiationType: EBG.Interactions.InitiationTypes.AUTO,
  3432.     category: EBG.Interactions.Categories.SYSTEM,
  3433.     isPanel: !1
  3434. };
  3435. EBG.declareClass(EBG.Interactions.InteractionData, null);
  3436. EBG.Interactions.CounterInteractionData = function(a, b, c) {
  3437.     EBG.callSuperConstructor(EBG.Interactions.CounterInteractionData, this, [a, c, b]);
  3438.     this.remoteServers = new EBG.Interactions.RemoteServersData
  3439. };
  3440. EBG.Interactions.CounterInteractionData.prototype = {
  3441.     reportImmediately: !1,
  3442.     countAsClick: !1,
  3443.     remoteServers: null,
  3444.     clickURL: null,
  3445.     numLeftToReport: 10,
  3446.     state: null
  3447. };
  3448. EBG.declareClass(EBG.Interactions.CounterInteractionData, EBG.Interactions.InteractionData);
  3449. EBG.Interactions.TimerInteractionData = function(a, b, c) {
  3450.     this.reportingName = a;
  3451.     EBG.callSuperConstructor(EBG.Interactions.TimerInteractionData, this, [a, c, b])
  3452. };
  3453. EBG.Interactions.TimerInteractionData.prototype = {
  3454.     value: 0,
  3455.     startTime: 0,
  3456.     idleDuration: 0
  3457. };
  3458. EBG.declareClass(EBG.Interactions.TimerInteractionData, EBG.Interactions.InteractionData);
  3459. EBG.Interactions.AggregationInteractionData = function(a, b, c) {
  3460.     this.reportingName = a;
  3461.     EBG.callSuperConstructor(EBG.Interactions.AggregationInteractionData, this, [a, c, b])
  3462. };
  3463. EBG.Interactions.AggregationInteractionData.prototype = {
  3464.     value: 0,
  3465.     isPlaying: !1
  3466. };
  3467. EBG.declareClass(EBG.Interactions.AggregationInteractionData, EBG.Interactions.InteractionData);
  3468. EBG.declareNamespace("Utilities.InteractionUtil");
  3469. EBG.Utilities.InteractionUtil = function() {};
  3470. EBG.Utilities.InteractionUtil.prototype = {
  3471.     getBannerRedirectUrl: function(a) {
  3472.         if (!a || !a.adConfig) return "";
  3473.         var b = a.adConfig.protocol + EBG.combinePaths(a.adConfig.bsPath, EBG.format("{0}/adServer.bs?cn=brd&Page={1}&PluID={2}&Pos={3}&EyeblasterID={4}", a.adConfig.interactionServer, a.adConfig.page, a.adConfig.pluId, a.adConfig.rnd, a.adConfig.adId));
  3474.         EBGInfra.isDefinedNotNull(a.clickVal) && (b += "&clk=" + a.clickVal);
  3475.         !a.adConfig.isPreview && !a.isClickTag && (b += "&sct=1");
  3476.         if (a.adConfig.massVersioning) {
  3477.             if (a.adConfig.massVersioning.adVersions || a.adConfig.massVersioning.defaultAdVersion) a.sClickedVersion ?
  3478.                 b += "&vid=" + a.sClickedVersion + "&vcl=1" : a.versionToReport && (b += "&vid=" + a.versionToReport);
  3479.             a.adConfig.massVersioning.targetAudienceId && (b += "&ta=" + a.adConfig.massVersioning.targetAudienceId);
  3480.             a.adConfig.massVersioning.deliveryGroupId && (b += "&dg=" + a.adConfig.massVersioning.deliveryGroupId);
  3481.             a.adConfig.massVersioning.versionTargetAudienceId && (b += "&tav=" + a.adConfig.massVersioning.versionTargetAudienceId);
  3482.             a.adConfig.massVersioning.dgTargetAudienceId && (b += "&tadg=" + a.adConfig.massVersioning.dgTargetAudienceId);
  3483.             a.adConfig.massVersioning.originalDeliveryGroupId && (b += "&dgo=" + a.adConfig.massVersioning.originalDeliveryGroupId)
  3484.         }
  3485.         a.sJumpUrl && (b += "&rtu=" + encodeURIComponent(a.sJumpUrl));
  3486.         a.cvurl && (b += EBG.format("&cvurl={0}", encodeURIComponent('"' + a.cvurl.split("|").join('","') + '"')));
  3487.         a.fIsDefClick = EBG.isBool(a.fIsDefClick) ? a.fIsDefClick : !1;
  3488.         a.fIsDefClick || (b += "&di=0");
  3489.         EBGInfra.isDefinedNotNull(a.adConfig.sPublisherPlacementId) && (b += "&pc=" + a.adConfig.sPublisherPlacementId);
  3490.         EBGInfra.isDefinedNotNull(a.adConfig.sID) &&
  3491.             (b += "&sessionid=" + a.adConfig.sID);
  3492.         a.adConfig.usercookie && (b += "&usercookie=" + a.adConfig.usercookie);
  3493.         EBGInfra.isDefinedNotNull(a.adConfig.optOut) && (b += "&OptOut=" + a.adConfig.optOut);
  3494.         EBGInfra.isDefinedNotNull(a.adConfig.ncu) && (b += "&ncu=" + encodeURIComponent(a.adConfig.ncu));
  3495.         EBGInfra.isDefinedNotNull(a.adConfig.ebReferrer) && (b += "&ebReferrer=" + encodeURIComponent(a.adConfig.ebReferrer));
  3496.         EBGInfra.isDefinedNotNull(a.adConfig.lineId) && (b += "&lineid=" + encodeURIComponent(a.adConfig.lineId));
  3497.         EBGInfra.isDefinedNotNull(a.adConfig.diAppId) &&
  3498.             (b += "&diappid=" + a.adConfig.diAppId);
  3499.         return b
  3500.     }
  3501. };
  3502. EBG.declareClass(EBG.Utilities.InteractionUtil, null);
  3503. EBG.InteractionUtil = EBG.InteractionUtil || new EBG.Utilities.InteractionUtil;
  3504. EBG.Interactions.Interaction = function() {};
  3505. EBG.Interactions.Interaction.prototype = {
  3506.     unique: 1,
  3507.     _escapeInteractionName: function(a) {
  3508.         a = a.toString();
  3509.         a = a.replace(/\~/ig, "_");
  3510.         a = a.replace(/\^/ig, "_");
  3511.         a = a.replace(/\|/ig, "_");
  3512.         return escape(a)
  3513.     },
  3514.     _buildReportFormat: function(a, b, c, d) {
  3515.         d || (d = 0);
  3516.         return EBG.format("{0}{2}{1}{3}{1}{4}{1}{5}{6}{7}{8}{9}", EBG.Interactions.InteractionManager.charIntDelimeter, EBG.Interactions.InteractionManager.charAdFieldsDelimeter, this._escapeInteractionName(this.interactionData.reportingName), c, d, a, this.unique, b, this.interactionData.category,
  3517.             this.interactionData.isPanel ? 1 : 0)
  3518.     }
  3519. };
  3520. EBG.Interactions.CounterInteraction = function(a) {
  3521.     EBG.callSuperConstructor(EBG.Interactions.CounterInteraction, this);
  3522.     this.interactionData = a ? a : new EBG.Interactions.CounterInteractionData
  3523. };
  3524. EBG.Interactions.CounterInteraction.prototype = {
  3525.     type: EBG.Interactions.InteractionTypes.COUNTER,
  3526.     handle: function(a) {
  3527.         var b = this.interactionData,
  3528.             c = b.counterJumpUrlData,
  3529.             d = c && c.tmpData ? c.tmpData.isClick : !1,
  3530.             e = c && c.tmpData ? c.tmpData.isProductClick : !1,
  3531.             f = !1,
  3532.             g = !0,
  3533.             h = !1,
  3534.             h = "",
  3535.             i = (c && c.tmpData ? c.tmpData.clickUrl : null) || (c ? c.jumpUrl : ""),
  3536.             j = c && c.tmpData && c.tmpData.windowWasOpen ? !0 : !1,
  3537.             c = !j;
  3538.         this.interactionData.adConfig.ffs.CFF_openWindowParam && (c = c && this.interactionData.adConfig.openWindow);
  3539.         this.shouldReportInteraction() ?
  3540.             (this._handleRemoteServers(), b.counterJumpUrlData && (g = i && this._isEBClick() ? !1 : !0, f = i && (d || this._isEBClick()) ? !0 : !1, (h = d || this._isEBClick()) ? f ? c && this.handleBRDFlow() : (d || e) && this.reportThirdPartyUrls() : c && i && (i = EBG.Interactions.checkURL(i), this._openOrRedirect(i))), h = g ? this._getReportingData(a, f) : "") : !j && i && (i = EBG.Interactions.checkURL(i), this._openOrRedirect(i));
  3541.         return h
  3542.     },
  3543.     reportThirdPartyUrls: function() {
  3544.         var a = this.interactionData.reportingName.toLowerCase() == EBG.Interactions.SystemInts.DEFAULT_CLICK.toLowerCase(),
  3545.             b = this.interactionData.counterJumpUrlData,
  3546.             c = [];
  3547.         if (b && b.tmpData && b.tmpData.isClick && (c = this.interactionData.adConfig.clickTrackingUrls, a || this.interactionData.adConfig.showOnlyImage))
  3548.             for (a = 0; a < this.interactionData.adConfig.defaultClickTrackingUrls.length; a++) c[c.length] = this.interactionData.adConfig.defaultClickTrackingUrls[a];
  3549.         if (b && b.tmpData && b.tmpData.isProductClick && b.tmpData.clickedVerUrl) c[c.length] = b.tmpData.clickedVerUrl;
  3550.         for (a = 0; a < c.length; a++) EBG.adaptor.reportToRemoteServerUsingImage(c[a])
  3551.     },
  3552.     shouldReportInteraction: function() {
  3553.         var a = !0;
  3554.         0 == this.interactionData.numLeftToReport || EBG.isPreview || EBG.isInWorkshop ? a = !1 : this.interactionData.numLeftToReport--;
  3555.         return a
  3556.     },
  3557.     handleBRDFlow: function() {
  3558.         var a = this.interactionData,
  3559.             b = this.interactionData.counterJumpUrlData,
  3560.             c = EBGInfra.isDefinedNotNull(b) && b.tmpData ? b.tmpData.clickUrl : null,
  3561.             d = c || EBGInfra.isDefinedNotNull(b) && b.jumpUrl;
  3562.         this._isEBClick() && (c || (d = ""));
  3563.         a = a.reportingName.toLowerCase() == EBG.Interactions.SystemInts.DEFAULT_CLICK.toLowerCase();
  3564.         c = 0;
  3565.         b.tmpData.isClick ?
  3566.             c = 1 : b.tmpData.isProductClick && (c = 2);
  3567.         d = "" == d ? "" : EBG.Interactions.checkURL(d);
  3568.         d = this._getBannerRedirectUrl(d, c, a, b.tmpData.clickedVersion);
  3569.         d = EBG.Interactions.checkURL(d);
  3570.         this._openOrRedirect(d)
  3571.     },
  3572.     _openOrRedirect: function(a) {
  3573.         -1 == this.interactionData.counterJumpUrlData.target.indexOf(EBG.WindowTarget.BLANK) ? (this.interactionData.reportImmediately = !0, EBG.runTimed(this, this._openPage, [a, this.interactionData.counterJumpUrlData], 1E3)) : this._openPage(a, this.interactionData.counterJumpUrlData)
  3574.     },
  3575.     getClickTagUrl: function(a) {
  3576.         var b =
  3577.             "",
  3578.             a = EBG.isDefined(a) && "" != a ? EBG.Interactions.checkURL(a) : void 0;
  3579.         EBG.isPreview ? EBG.isInWorkshop ? b = EBG.format("ReportPage_{0}.html", HTMLPageVer) : (b = this.interactionData.counterJumpUrlData.jumpUrl, 4 <= b.length && "http" != b.substr(0, 4) && (b = EBG.format("{0}{1}", ebPtcl, b))) : (b = this._getBannerRedirectUrl(a, null, null, null, !0), b = EBG.format("{0}/ReportPage{1}.html?ebReportURL={2}$$ebImpressionID={3}", ebBigS, EBG.reportPageVer, escape(b), EBG.Ads.Ad.Fn.getRandFromAdUId(this.interactionData.adConfig.uid)), a = -1, EBG.adaptor.browser.isIE() &&
  3580.             (a = 9 <= EBG.adaptor.browser.getVersion() ? 4096 : 2048, a -= b.length), a = this._getReportPageTrackingUrls(a), b += a);
  3581.         return b
  3582.     },
  3583.     _getReportPageTrackingUrls: function(a) {
  3584.         var b = "$$ebTURLs=[";
  3585.         if (-1 != a) {
  3586.             if (b.length >= a) return "";
  3587.             a -= b.length
  3588.         }
  3589.         for (var c = this.interactionData.adConfig.clickTrackingUrls, d = 0; d < c.length; d++) {
  3590.             var e = EBG.format('{0}"{1}"', 0 != d ? "," : "", c[d]);
  3591.             if (-1 != a) {
  3592.                 if (e.length >= a) break;
  3593.                 a -= e.length
  3594.             }
  3595.             b += e
  3596.         }
  3597.         return b + "]"
  3598.     },
  3599.     _openPage: function(a, b) {
  3600.         var c = b.tmpData.clickedVerUrl ? encodeURIComponent('"' + b.tmpData.clickedVerUrl.split("|").join('","') +
  3601.                 '"') : "",
  3602.             d = b.tmpData.clickedVerUrl && !EBG.isPreview && !EBG.isInWorkshop ? a + "&cvurl=" + c : a;
  3603.         switch (EBG.adaptor.getRequestMethod(d)) {
  3604.             case "GET":
  3605.                 EBG.adaptor.openPage(d, b);
  3606.                 break;
  3607.             case "POST":
  3608.                 var e = b.target;
  3609.                 if (!(EBG.adaptor.browser.isIE() && 9 >= EBG.adaptor.browser.getVersion())) b.target = !b.target || b.target == EBG.WindowTarget.BLANK ? "ebReportPage" + parseInt(1E8 * Math.random()) : b.target, EBG.adaptor.openPage("", b);
  3610.                 EBG.runTimed(this, function() {
  3611.                     function c(a, b) {
  3612.                         var d = document.createElement("input");
  3613.                         d.setAttribute("type",
  3614.                             "hidden");
  3615.                         d.setAttribute("name", a);
  3616.                         d.setAttribute("value", b);
  3617.                         return d
  3618.                     }
  3619.                     var g = document.createElement("form");
  3620.                     g.setAttribute("method", "post");
  3621.                     g.setAttribute("action", a.substring(0, d.indexOf("?")) + "?cn=brd&ebReferrer=" + encodeURIComponent(this.interactionData.adConfig.ebReferrer));
  3622.                     g.setAttribute("target", b.target);
  3623.                     b.target = e;
  3624.                     var h = this._urlQueryStringToJSON(d),
  3625.                         i;
  3626.                     for (i in h) g.appendChild(c(i, unescape(h[i])));
  3627.                     EBG.adaptor.getDisplayWin().document.body.appendChild(g);
  3628.                     g.submit()
  3629.                 }, [], 25);
  3630.                 break;
  3631.             default:
  3632.                 EBG.adaptor.openPage(d,
  3633.                     b)
  3634.         }
  3635.     },
  3636.     _urlQueryStringToJSON: function(a) {
  3637.         var b = {},
  3638.             c = a.substring(a.indexOf("?") + 1);
  3639.         if (!c) return b;
  3640.         for (var a = [], d = 0, e = 0; e < c.length; e++) switch (c.charAt(e)) {
  3641.             case "&":
  3642.                 a.push(c.substring(d, e));
  3643.                 d = e + 1;
  3644.                 break;
  3645.             case "$":
  3646.                 if ("=" == c.charAt(e - 1) && "$" == c.charAt(e + 1))
  3647.                     for (e += 2; !("$" == c.charAt(e) && "$" == c.charAt(e - 1));) e++
  3648.         }
  3649.         a.push(c.substring(d));
  3650.         for (e = 0; e < a.length; e++) c = a[e], b[c.substring(0, c.indexOf("="))] = c.substring(c.indexOf("=") + 1);
  3651.         return b
  3652.     },
  3653.     _getReportScript: function(a, b) {
  3654.         return '<script type="text/javascript">var clkURLs = ["' +
  3655.            a.join('","') + '"];var reported = false;var cntr = 0; for (var i=0;i<' + a.length + ';i++){var img = document.createElement("img");img.onload = img.onerror = function(){cntr++; if (cntr==' + a.length + ' && !reported){reported = true; window.location.replace("' + b + '");}};try{img.src = clkURLs[i];}catch(e){cntr++; if (cntr==' + a.length + ' && !reported){reported = true; window.location.replace("' + b + '");}}}setTimeout(function(){if (!reported){reported=true;window.location.replace("' + b + '");}}, 1000);<\/script><body></body>'
  3656.    },
  3657.    _getReportingData: function(a, b) {
  3658.        var c = 0,
  3659.            d = 0;
  3660.        b || (c = this.interactionData.counterJumpUrlData && this.interactionData.counterJumpUrlData.tmpData.isClick ? 1 : 0, d = this.interactionData.initiationType == EBG.Interactions.InitiationTypes.USER ? 1 : 0);
  3661.        var e = this.interactionData.value ? this.interactionData.value : 0;
  3662.        if (EBG.isObj(e) && this.interactionData.useInteractionsStrPipe) {
  3663.            if (this.interactionData.reportingName == EBG.Interactions.SystemInts.AD_PARAMS) e.idx = this.interactionData.numToReport - this.interactionData.numLeftToReport;
  3664.            e = EBG.serializeObject(e)
  3665.        }
  3666.        c = this._buildReportFormat(c, d, e, a);
  3667.        this.unique = 0;
  3668.        return c
  3669.    },
  3670.    _getBannerRedirectUrl: function(a, b, c, d, e) {
  3671.        var f = this.interactionData.adConfig,
  3672.            g;
  3673.        if (f.massVersioning && (f.massVersioning.adVersions || f.massVersioning.defaultAdVersion)) g = d ? d : EBG.Ads.Ad.Fn.getVersionToReport(f.massVersioning.adVersions);
  3674.        return EBG.InteractionUtil.getBannerRedirectUrl({
  3675.            adConfig: f,
  3676.            sJumpUrl: a,
  3677.            clickVal: b,
  3678.            fIsDefClick: c,
  3679.            sClickedVersion: d,
  3680.            isClickTag: e,
  3681.            versionToReport: g
  3682.        })
  3683.    },
  3684.    _handleRemoteServers: function() {
  3685.        if (!EBG.isPreview &&
  3686.            this.interactionData.remoteServers) {
  3687.            var a = this.interactionData.remoteServers,
  3688.                b = new EBG.Events.Event(EBG.Events.EventNames.INTERACTION_REPORT_REMOTE_SERVERS);
  3689.            b.dispatcher = this;
  3690.            b.timing = EBG.Events.EventTiming.BEFORE;
  3691.            b.eventData = {
  3692.                remoteServers: a
  3693.            };
  3694.            EBG.eventMgr.dispatchEvent(b) || (a.networkUrl && (b = this._replaceRSTokens(a.networkUrl), EBG.adaptor.reportToRemoteServerUsingImage(b)), a.agencyUrl && (a = this._replaceRSTokens(a.agencyUrl), EBG.adaptor.reportToRemoteServerUsingImage(a)))
  3695.        }
  3696.    },
  3697.    _replaceRSTokens: function(a) {
  3698.        try {
  3699.            a =
  3700.                a.replace(/\[ebInteraction\]/ig, this.interactionData.reportingName), a = a.replace(/\[ebInteractionNum\]/ig, EBG.intMgr.adsData[this.interactionData.adConfig.uid].numOfInteractions)
  3701.        } catch (b) {}
  3702.        return a
  3703.    },
  3704.    _getReportingPage: function() {
  3705.        var a = this.interactionData.adConfig.page,
  3706.            a = a.replace(/\~/ig, "_"),
  3707.            a = a.replace(/\^/ig, "_"),
  3708.            a = a.replace(/\|/ig, "_");
  3709.        return escape(a)
  3710.    },
  3711.    _isEBClick: function() {
  3712.        return this.interactionData && (EBG.strEQ(this.interactionData.reportingName, EBG.Interactions.SystemInts.CLICK) || EBG.strEQ(this.interactionData.reportingName,
  3713.            EBG.Interactions.SystemInts.DEFAULT_CLICK))
  3714.    }
  3715. };
  3716. EBG.declareClass(EBG.Interactions.CounterInteraction, EBG.Interactions.Interaction);
  3717. EBG.Interactions.TimerInteraction = function(a) {
  3718.    EBG.callSuperConstructor(EBG.Interactions.TimerInteraction, this);
  3719.    this.interactionData = a ? a : new EBG.Interactions.TimerInteractionData
  3720. };
  3721. EBG.Interactions.TimerInteraction.prototype = {
  3722.    type: EBG.Interactions.InteractionTypes.TIMER,
  3723.    handle: function(a) {
  3724.        var b = this.interactionData.value;
  3725.        this.isRunning() && (this.stop(), this.start());
  3726.        var b = this.interactionData.value - b,
  3727.            b = 0 < b ? b : 0,
  3728.            c = this.interactionData.idleDuration / 1E3;
  3729.        this.interactionData.value -= c <= b ? c : b;
  3730.        this.interactionData.idleDuration = 0;
  3731.        b = EBG.Interactions.InteractionManager.MAX_AD_DURATION_SEC;
  3732.        this.interactionData.value = this.interactionData.value > b ? b : this.interactionData.value;
  3733.        this.interactionData.value =
  3734.            Math.floor(this.interactionData.value);
  3735.        return 0 >= this.interactionData.value ? !1 : this._buildReportFormat(0, 0, this.interactionData.value, a, 0)
  3736.    },
  3737.    start: function() {
  3738.        var a = new EBG.Events.Event(EBG.Events.EventNames.START_TIMER);
  3739.        a.dispatcher = this;
  3740.        a.timing = EBG.Events.EventTiming.BEFORE;
  3741.        a.eventData = {
  3742.            interaction: this
  3743.        };
  3744.        if (!EBG.eventMgr.dispatchEvent(a)) {
  3745.            if (!this.isRunning()) this.interactionData.startTime = (new Date).getTime(), a.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
  3746.            EBG.eventMgr.dispatchEvent(a)
  3747.        }
  3748.    },
  3749.    stop: function() {
  3750.        if (this.isRunning()) {
  3751.            var a =
  3752.                new EBG.Events.Event(EBG.Events.EventNames.STOP_TIMER);
  3753.            a.dispatcher = this;
  3754.            a.timing = EBG.Events.EventTiming.BEFORE;
  3755.            a.eventData = {
  3756.                interaction: this
  3757.            };
  3758.            if (!EBG.eventMgr.dispatchEvent(a)) this.interactionData.value += this.getElapsedTime() / 1E3, this.interactionData.startTime = 0, a.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER, EBG.eventMgr.dispatchEvent(a)
  3759.        }
  3760.    },
  3761.    getElapsedTime: function() {
  3762.        return (new Date).getTime() - this.interactionData.startTime
  3763.    },
  3764.    update: function(a) {
  3765.        var b = new EBG.Events.Event(EBG.Events.EventNames.UPDATE_TIMER);
  3766.        b.dispatcher = this;
  3767.        b.timing = EBG.Events.EventTiming.BEFORE;
  3768.        b.eventData = {
  3769.            interaction: this
  3770.        };
  3771.        if (!EBG.eventMgr.dispatchEvent(b)) this.interactionData.value += a, b.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER, EBG.eventMgr.dispatchEvent(b)
  3772.    },
  3773.    clear: function() {
  3774.        this.interactionData.value = 0;
  3775.        this.interactionData.startTime = 0
  3776.    },
  3777.    increaseIdleDuration: function(a) {
  3778.        this.interactionData.idleDuration += a
  3779.    },
  3780.    isRunning: function() {
  3781.        return 0 < this.interactionData.startTime
  3782.    },
  3783.    isFinished: function() {
  3784.        return 0 === this.interactionData.startTime &&
  3785.            0 < this.interactionData.value
  3786.    },
  3787.    getValue: function() {
  3788.        return this.interactionData.value
  3789.    },
  3790.    getType: function() {
  3791.        return EBG.DurationInteraction.TIMER
  3792.    }
  3793. };
  3794. EBG.declareClass(EBG.Interactions.TimerInteraction, EBG.Interactions.Interaction);
  3795. EBG.Interactions.IdleManager = function() {
  3796.    this.currentIdleDuration = 0;
  3797.    this._startTime = (new Date).getTime();
  3798.    this.intervalId = EBG.setInterval(this, this._checkIfIdle, [], EBG.Interactions.IdleManager.IDLE_INTERVAL)
  3799. };
  3800. EBG.Interactions.IdleManager.IDLE_INTERVAL = 5E3;
  3801. EBG.Interactions.IdleManager.prototype = {
  3802.    _totalIdleDuration: 0,
  3803.    _lastActiveTimeStamp: 0,
  3804.    updateIdleDuration: function() {
  3805.        this.currentIdleDuration = 0;
  3806.        var a = (new Date).getTime();
  3807.        if (0 !== this._lastActiveTimeStamp) this.currentIdleDuration = a - this._lastActiveTimeStamp, this.currentIdleDuration > EBG.Interactions.IdleManager.IDLE_INTERVAL + 2E3 && (this._totalIdleDuration += this.currentIdleDuration, EBG.intMgr.handleAllTimers(EBG.Interactions.InteractionManager.HandleAllTimersOptions.HANDLE_IDLE))
  3808.    },
  3809.    _checkIfIdle: function() {
  3810.        this.updateIdleDuration();
  3811.        if ((this._lastActiveTimeStamp = (new Date).getTime()) - this._startTime - this._totalIdleDuration > 1E3 * EBG.Interactions.InteractionManager.MAX_AD_DURATION_SEC) EBG.intMgr.unLoadHandler(EBG.Interactions.InteractionManager.HandleAllTimersOptions.REPORT, !1), EBG.eventMgr.dispatchEvent(new EBG.Events.Event(EBG.Events.EventNames.MAX_AD_DURATION)), EBG.clearInterval(this.intervalId)
  3812.    }
  3813. };
  3814. EBG.declareClass(EBG.Interactions.IdleManager, null);
  3815. EBG.Interactions.StdInteractionManager = function() {
  3816.    this.adsData = EBG.intMgr ? EBG.intMgr.adsData : {};
  3817.    this.adsIntQueues = EBG.intMgr ? EBG.intMgr.adsIntQueues : {}
  3818. };
  3819. EBG.Interactions.StdInteractionManager.prototype = {
  3820.    copy: function(a) {
  3821.        this.adsIntQueues = a.adsIntQueues;
  3822.        this.adsData = a.adsData
  3823.    },
  3824.    initAdData: function(a, b) {
  3825.        var c = a.uid;
  3826.        this.adsIntQueues[c] = this.adsIntQueues[c] ? this.adsIntQueues[c] : [];
  3827.        c = this.adsData[c] = {
  3828.            adConfig: a,
  3829.            isUserInteractionOccur: !1,
  3830.            isClickOccur: !1,
  3831.            isProductClicked: {},
  3832.            numOfInteractions: 0,
  3833.            delayIntReport: b,
  3834.            videoState: {},
  3835.            assetsTimers: {},
  3836.            clickReportScript: ""
  3837.        };
  3838.        c[EBG.Interactions.InteractionTypes.COUNTER] = {};
  3839.        c[EBG.Interactions.InteractionTypes.TIMER] = {};
  3840.        c.adConfig.isStdAd || this._addSystemInteractions(a)
  3841.    },
  3842.    allowInteractionReport: function(a) {
  3843.        if (this.adsData[a]) this.adsData[a].delayIntReport = !1
  3844.    },
  3845.    addInteraction: function(a, b) {
  3846.        var c = EBG.isDefinedNotNull(b) ? b.toLowerCase() : a.interactionData.reportingName.toLowerCase(),
  3847.            d = a.interactionData.adUId,
  3848.            e = new EBG.Events.Event(EBG.Events.EventNames.ADD_INTERACTION);
  3849.        e.eventData = a;
  3850.        e.dispatcher = {
  3851.            _adConfig: {
  3852.                rnd: this.adsData[d].adConfig.rnd
  3853.            }
  3854.        };
  3855.        e.timing = EBG.Events.EventTiming.BEFORE;
  3856.        var f = EBG.eventMgr.dispatchEvent(e),
  3857.            g =
  3858.            this.adsData[d];
  3859.        if (!f) {
  3860.            if (!g) return;
  3861.            g[a.type][c] = a;
  3862.            a.interactionData.adConfig = this.adsData[d].adConfig
  3863.        }
  3864.        e.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
  3865.        EBG.eventMgr.dispatchEvent(e)
  3866.    },
  3867.    getClickTag: function(a) {
  3868.        return (a = this._getCounterInteraction(EBG.Interactions.SystemInts.CLICK, a)) ? a.getClickTagUrl() : ""
  3869.    },
  3870.    getClickTarget: function(a) {
  3871.        var b = "_blank";
  3872.        if (!EBG.isPreview && EBG.isInWorkshop && (a = this._getCounterInteraction(EBG.Interactions.SystemInts.CLICK, a))) b = a.interactionData.counterJumpUrlData.target;
  3873.        return b
  3874.    },
  3875.    handleCloseAdParts: function(a, b) {
  3876.        if (a && 1 == a.fClose) {
  3877.            var c = new EBG.Events.Event(EBG.Events.EventNames.CLOSE_AD);
  3878.            c.dispatcher = {
  3879.                _adConfig: {
  3880.                    rnd: EBG.Ads.Ad.Fn.getRandFromAdUId(b)
  3881.                }
  3882.            };
  3883.            c.eventData = {
  3884.                closeDueToClickthrough: !0
  3885.            };
  3886.            EBG.eventMgr.dispatchEvent(c)
  3887.        }
  3888.    },
  3889.    handleCounterInteraction: function(a, b, c, d, e, f) {
  3890.        var g = this._getCounterInteraction(a, b),
  3891.            h = g ? g.interactionData : null,
  3892.            i = h ? h.counterJumpUrlData : null,
  3893.            j = this.adsData[b],
  3894.            k = j.adConfig.isStdAd,
  3895.            m = "",
  3896.            f = EBGInfra.isDefined(f) ? f : !0,
  3897.            c = c || 0;
  3898.        if (!k && h) h.initiationType = d ? EBG.Interactions.InitiationTypes.USER :
  3899.            h.initiationType, this._handleUserInteraction(b, h), this._handleSpecialInteractions(a, b, c);
  3900.        if (g && (a = new EBG.Events.Event(EBG.Events.EventNames.HANDLE_COUNTER_INTERACTION), a.dispatcher = {
  3901.                _adConfig: {
  3902.                    rnd: EBG.Ads.Ad.Fn.getRandFromAdUId(b)
  3903.                }
  3904.            }, a.timing = EBG.Events.EventTiming.BEFORE, a.eventData = {
  3905.                interaction: g
  3906.            }, !EBG.eventMgr.dispatchEvent(a))) {
  3907.            if (i) i.tmpData = e, i.tmpData.isClick = h.countAsClick && !j.isClickOccur, j.isClickOccur = i.tmpData.isClick ? !0 : j.isClickOccur, e = i.tmpData.clickedVersion, i.tmpData.isProductClick =
  3908.                h.countAsClick && i.tmpData.clickedVersion && e && !j.isProductClicked["V_" + e], i.tmpData.isProductClick && (j.isProductClicked["V_" + e] = !0);
  3909.            else if (e && e.value) g.interactionData.value = e.value;
  3910.            m = f ? g.handle(c) : "";
  3911.            j.numOfInteractions++;
  3912.            m && (this._handleReportData(b, h, m), this._isReportDataInQueue(b, m) || this.reportInteractionQueues());
  3913.            this.handleCloseAdParts(i, b);
  3914.            a.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
  3915.            EBG.eventMgr.dispatchEvent(a)
  3916.        }
  3917.    },
  3918.    isInteractionExist: function(a, b, c) {
  3919.        if (this.adsData[c] && this.adsData[c][b]) return this.adsData[c][b][a] ?
  3920.            !0 : !1
  3921.    },
  3922.    _getCounterInteraction: function(a, b) {
  3923.        a = a.toLowerCase();
  3924.        if (this.adsData[b] && this.adsData[b][EBG.Interactions.InteractionTypes.COUNTER] && this.adsData[b][EBG.Interactions.InteractionTypes.COUNTER][a]) return this.adsData[b][EBG.Interactions.InteractionTypes.COUNTER][a]
  3925.    },
  3926.    getRepScr: function(a) {
  3927.        if (this.adsData[a] && this.adsData[a].clickReportScript) return this.adsData[a].clickReportScript
  3928.    }
  3929. };
  3930. EBG.declareClass(EBG.Interactions.StdInteractionManager, null);
  3931. EBG.Interactions.InteractionManager = function(a) {
  3932.    EBG.callSuperConstructor(EBG.Interactions.InteractionManager, this);
  3933.    EBG.intMgr && EBG.intMgr.copy(this);
  3934.    if (!a.ffs.CFF_SupportMultiEnv) this._interactionServer = a.is || "BurstingPipe", this._interactionPipe = EBG.combinePaths(EBG.protocol + EBG.bs, this._interactionServer + "/adServer.bs?cn=int&iv=2&int="), this._interactionsStrPipe = EBG.combinePaths(EBG.protocol + EBG.bs, this._interactionServer + "/adServer.bs?cn=int&iv=2&interactionsStr=");
  3935.    this.idleManager = new EBG.Interactions.IdleManager;
  3936.    this._timedReport = EBG.isDefined(EBG.intReportTimeout) && null != EBG.intReportTimeout && 0 <= EBG.intReportTimeout ? EBG.intReportTimeout : this._timedReport;
  3937.    this._subscribeToEvents()
  3938. };
  3939. EBG.Interactions.InteractionManager.charAdFieldsDelimeter = "~";
  3940. EBG.Interactions.InteractionManager.charIntDelimeter = "^";
  3941. EBG.Interactions.InteractionManager.intStackLength = 7;
  3942. EBG.Interactions.InteractionManager.MAX_AD_DURATION_SEC = 900;
  3943. EBG.Interactions.InteractionManager.INTERACTION_THRESHOLD_SEC = 86400;
  3944. EBG.Interactions.InteractionManager.HandleAllTimersOptions = {
  3945.    REPORT: 0,
  3946.    PAUSE: 1,
  3947.    HANDLE_IDLE: 2
  3948. };
  3949. EBG.Interactions.InteractionManager.prototype = {
  3950.    _isUnloadHandled: !1,
  3951.    _pausedTimers: null,
  3952.    _masterOrdinalNumber: null,
  3953.    _seqTimersReportData: {
  3954.        index: -1,
  3955.        intervals: [5, 10, 20, 40, 60, 120, 240]
  3956.    },
  3957.    _timedReport: 1E4,
  3958.    _interactionPipe: null,
  3959.    _interactionServer: null,
  3960.    startAggregate: function(a, b, c) {
  3961.        if (null == this._masterOrdinalNumber) this._masterOrdinalNumber = c;
  3962.        this.startTimer(a, b, c)
  3963.    },
  3964.    startTimer: function(a, b, c) {
  3965.        var d = this._getTimerInteraction(a, b);
  3966.        if (d) {
  3967.            d.start();
  3968.            if (EBGInfra.isDefined(c) && EBGInfra.notNull(c)) switch (d = this.adsData[b],
  3969.                d = d.assetsTimers[c] ? d.assetsTimers[c] : d.assetsTimers[c] = {}, a) {
  3970.                case EBG.VideoInteraction.VIDEO_PLAY_DURATION:
  3971.                    this._startAssetTimer(d, EBG.VideoInteraction.VIDEO_ASSET_DURATION, b, c);
  3972.                    break;
  3973.                case EBG.VideoInteraction.FULLSCREEN_DURATION:
  3974.                    this._startAssetTimer(d, EBG.VideoInteraction.FULLSCREEN_ASSET_DURATION, b, c)
  3975.            }
  3976.            EBG.isGlobalDef("JSON")
  3977.        }
  3978.    },
  3979.    _handleVideoStarted: function(a, b) {
  3980.        var c = new EBG.Events.Event(EBG.Events.EventNames.DWELL_VIDEO_START);
  3981.        c.dispatcher = {
  3982.            _adConfig: {
  3983.                rnd: EBG.Ads.Ad.Fn.getRandFromAdUId(a)
  3984.            }
  3985.        };
  3986.        c.eventData = {
  3987.            assetId: b
  3988.        };
  3989.        EBG.eventMgr.dispatchEvent(c)
  3990.    },
  3991.    _startAssetTimer: function(a, b, c, d) {
  3992.        if (!a[b]) {
  3993.            var e;
  3994.            null != this._masterOrdinalNumber ? (e = new EBG.Interactions.AggregationInteractionData(b, EBG.Interactions.Categories.VIDEO, c), a[b] = new EBG.Interactions.AggregateInteraction(e)) : (e = new EBG.Interactions.TimerInteractionData(b, EBG.Interactions.Categories.VIDEO, c), a[b] = new EBG.Interactions.TimerInteraction(e))
  3995.        }
  3996.        a[b].start();
  3997.        this._handleVideoStarted(c, d)
  3998.    },
  3999.    updateAggregation: function(a, b, c, d) {
  4000.        if (null == this._masterOrdinalNumber) this._masterOrdinalNumber =
  4001.            d;
  4002.        var e = this._getTimerInteraction(a, b);
  4003.        if (e && (this._masterOrdinalNumber == d && e.update(c), EBGInfra.isDefined(d) && EBGInfra.notNull(d))) switch (e = this.adsData[b], e = e.assetsTimers[d] ? e.assetsTimers[d] : e.assetsTimers[d] = {}, a) {
  4004.            case EBG.VideoInteraction.VIDEO_PLAY_DURATION:
  4005.                this._updateAssetAggregation(e, EBG.VideoInteraction.VIDEO_ASSET_DURATION, b, c, d);
  4006.                break;
  4007.            case EBG.VideoInteraction.FULLSCREEN_DURATION:
  4008.                this._updateAssetAggregation(e, EBG.VideoInteraction.FULLSCREEN_ASSET_DURATION, b, c, d)
  4009.        }
  4010.    },
  4011.    _updateAssetAggregation: function(a,
  4012.        b, c, d) {
  4013.        a[b] || (c = new EBG.Interactions.AggregationInteractionData(b, EBG.Interactions.Categories.VIDEO, c), a[b] = new EBG.Interactions.AggregateInteraction(c));
  4014.        a[b].update(d)
  4015.    },
  4016.    stopAggregate: function(a, b, c) {
  4017.        this._masterOrdinalNumber = null;
  4018.        this.stopTimer(a, b, c)
  4019.    },
  4020.    stopTimer: function(a, b, c) {
  4021.        var d = this._getTimerInteraction(a, b),
  4022.            e = this.adsData[b].assetsTimers,
  4023.            f = !0;
  4024.        if (d) {
  4025.            if (EBGInfra.isDefined(c) && EBGInfra.notNull(c) && e[c]) switch (a) {
  4026.                case EBG.VideoInteraction.VIDEO_PLAY_DURATION:
  4027.                    e[c][EBG.VideoInteraction.VIDEO_ASSET_DURATION].stop();
  4028.                    f = !this._isRunningVideoAsset(b, !1);
  4029.                    break;
  4030.                case EBG.VideoInteraction.FULLSCREEN_DURATION:
  4031.                    e[c][EBG.VideoInteraction.FULLSCREEN_ASSET_DURATION].stop()
  4032.            }
  4033.            f && d.stop();
  4034.            if (EBGInfra.isDefined(c) && EBGInfra.notNull(c)) a = new EBG.Events.Event(EBG.Events.EventNames.DWELL_VIDEO_STOP), a.dispatcher = {
  4035.                _adConfig: {
  4036.                    rnd: EBG.Ads.Ad.Fn.getRandFromAdUId(b)
  4037.                }
  4038.            }, a.eventData = {
  4039.                assetId: c
  4040.            }, EBG.eventMgr.dispatchEvent(a)
  4041.        }
  4042.    },
  4043.    clearTimer: function(a, b) {
  4044.        var c = this._getTimerInteraction(a, b);
  4045.        c && c.clear()
  4046.    },
  4047.    _isRunningAnyVideoAsset: function(a) {
  4048.        return this._isRunningVideoAsset(a, !1) || this._isRunningVideoAsset(a, !0)
  4049.    },
  4050.    _isRunningVideoAsset: function(a, b) {
  4051.        var c = this.adsData[a].assetsTimers,
  4052.            d;
  4053.        for (d in c)
  4054.            if (c.hasOwnProperty(d)) {
  4055.                var e = b ? "ebFSVideoAssetDuration" : "ebVideoAssetDuration";
  4056.                if (c[d][e] && c[d][e].isRunning()) return !0
  4057.            }
  4058.        return !1
  4059.    },
  4060.    updateTimer: function(a, b, c, d) {
  4061.        if (a = this._getTimerInteraction(a, b)) a.update(c), EBGInfra.isDefined(d) && EBGInfra.notNull(d) && this.adsData[b].assetsTimers[d].update(c)
  4062.    },
  4063.    getTimerValue: function(a, b) {
  4064.        var c = this._getTimerInteraction(a, b);
  4065.        return c ? c.getValue() :
  4066.            0
  4067.    },
  4068.    isTimerRunning: function(a, b) {
  4069.        var c = this._getTimerInteraction(a, b);
  4070.        return c ? c.isRunning() : !1
  4071.    },
  4072.    _handleUserInteraction: function(a, b) {
  4073.        if (b.initiationType == EBG.Interactions.InitiationTypes.USER && !this.adsData[a].isUserInteractionOccur) {
  4074.            this.adsData[a].isUserInteractionOccur = !0;
  4075.            var c = new EBG.Events.Event(EBG.Events.EventNames.USER_INTERACTION);
  4076.            c.dispatcher = {
  4077.                _adConfig: {
  4078.                    rnd: EBG.Ads.Ad.Fn.getRandFromAdUId(a)
  4079.                }
  4080.            };
  4081.            EBG.eventMgr.dispatchEvent(c);
  4082.            this._reportUserInteraction(a)
  4083.        }
  4084.    },
  4085.    _handlePanelsViewed: function(a,
  4086.        b) {
  4087.        b.isPanel && b.initiationType == EBG.Interactions.InitiationTypes.USER && this.handleCounterInteraction(EBG.ExpBaseInteractions.PANELS_VIEWED, a)
  4088.    },
  4089.    _handleReportData: function(a, b, c) {
  4090.        b.useInteractionsStrPipe ? this._handleDataParams(a, b, c) : (this.adsIntQueues[a].push(c), a = this.adsIntQueues[a].length == EBG.Interactions.InteractionManager.intStackLength ? !0 : !1, (b && (b.reportImmediately || b.counterJumpUrlData && b.counterJumpUrlData.tmpData.isClick) || a) && this.reportInteractionQueues())
  4091.    },
  4092.    _handleDataParams: function(a,
  4093.        b, c) {
  4094.        b = this._getAdReportData(a);
  4095.        c = encodeURIComponent(c);
  4096.        a = this._getPipeParams(a, !1);
  4097.        this._reportServer(this._interactionsStrPipe + "$$" + b + c + "$$" + a, !0)
  4098.    },
  4099.    _handleSpecialInteractions: function(a, b, c) {
  4100.        var d = this._getCounterInteraction(a, b),
  4101.            a = d.interactionData;
  4102.        this._handleUserInteraction(b, a);
  4103.        switch (a.reportingName) {
  4104.            case EBG.VideoInteraction.STARTED:
  4105.                d.unique && this._reportUniqueVideoStarted(b);
  4106.                this.adsData[b].isUserInteractionOccur && this._reportUserInitatedVideo(b, c);
  4107.                break;
  4108.            case EBG.VideoInteraction.FULLSCREEN_START:
  4109.                if (this._isRunningVideoAsset(b, !1)) switch (d = this._getTimerInteraction(EBG.VideoInteraction.VIDEO_PLAY_DURATION, b), d = d.getType(), d) {
  4110.                    case EBG.DurationInteraction.TIMER:
  4111.                        this.startTimer(EBG.VideoInteraction.FULLSCREEN_DURATION, b, c);
  4112.                        this.stopTimer(EBG.VideoInteraction.VIDEO_PLAY_DURATION, b, c);
  4113.                        break;
  4114.                    case EBG.DurationInteraction.AGGREGATE:
  4115.                        this.startAggregate(EBG.VideoInteraction.FULLSCREEN_DURATION, b, c), this.stopAggregate(EBG.VideoInteraction.VIDEO_PLAY_DURATION, b, c)
  4116.                }
  4117.                break;
  4118.            case EBG.VideoInteraction.FULLSCREEN_END:
  4119.                if (this._isRunningVideoAsset(b, !0)) switch (d = this._getTimerInteraction(EBG.VideoInteraction.VIDEO_PLAY_DURATION, b), d = d.getType(), d) {
  4120.                    case EBG.DurationInteraction.TIMER:
  4121.                        this.startTimer(EBG.VideoInteraction.VIDEO_PLAY_DURATION, b, c);
  4122.                        this.stopTimer(EBG.VideoInteraction.FULLSCREEN_DURATION, b, c);
  4123.                        break;
  4124.                    case EBG.DurationInteraction.AGGREGATE:
  4125.                        this.startAggregate(EBG.VideoInteraction.VIDEO_PLAY_DURATION, b, c), this.stopAggregate(EBG.VideoInteraction.FULLSCREEN_DURATION, b, c)
  4126.                }
  4127.                break;
  4128.            case EBG.VideoInteraction.FULLPLAY:
  4129.                this.stopTimer(EBG.VideoInteraction.VIDEO_PLAY_DURATION,
  4130.                    b, c)
  4131.        }
  4132.        this._handlePanelsViewed(b, a)
  4133.    },
  4134.    handleVideoInteraction: function(a, b, c, d, e) {
  4135.        if (EBGInfra.isDefined(c) && EBGInfra.notNull(c)) {
  4136.            var f = this.adsData[b].videoState;
  4137.            f[c] || (f[c] = 0);
  4138.            var g = !0,
  4139.                h = ebO.ffs.CFF_RemoveVideoInteractionOrder ? EBG.indexOfArray(EBG.VideoQuartiles, a) : EBG.indexOfArray(EBG.Interactions.VideoInteractionOrder, a); - 1 != h && (h == f[c] ? f[c]++ : g = !1);
  4140.            g && this.handleCounterInteraction(a, b, c, d, e)
  4141.        }
  4142.    },
  4143.    handleAllTimers: function(a, b) {
  4144.        if (a == EBG.Interactions.InteractionManager.HandleAllTimersOptions.PAUSE) this._pausedTimers = [];
  4145.        var c = new EBG.Events.Event(EBG.Events.EventNames.COLLECT_TIMERS);
  4146.        c.dispatcher = this;
  4147.        c.timing = EBG.Events.EventTiming.BEFORE;
  4148.        EBG.eventMgr.dispatchEvent(c);
  4149.        for (var d in this.adsData)
  4150.            if (this.adsData.hasOwnProperty(d)) {
  4151.                var c = this.adsData[d],
  4152.                    e = c[EBG.Interactions.InteractionTypes.TIMER];
  4153.                e && this._handleTimers(e, a, d);
  4154.                if (c.assetsTimers)
  4155.                    for (var f in c.assetsTimers) c.assetsTimers.hasOwnProperty(f) && this._handleTimers(c.assetsTimers[f], a, d, f);
  4156.                c = new EBG.Events.Event(EBG.Events.EventNames.COLLECT_TIMERS);
  4157.                c.dispatcher =
  4158.                    this;
  4159.                c.timing = EBG.Events.EventTiming.ONTIME;
  4160.                EBG.eventMgr.dispatchEvent(c);
  4161.                a === EBG.Interactions.InteractionManager.HandleAllTimersOptions.REPORT && (c = 0 <= this._seqTimersReportData.index, b = EBG.isBool(b) ? b : !0, !b && this.adsData[d].adConfig && navigator && navigator.sendBeacon ? this.reportInteractionQueues(b, c, !0) : this.reportInteractionQueues(b, c))
  4162.            }
  4163.    },
  4164.    _handleTimers: function(a, b, c, d) {
  4165.        for (var e in a)
  4166.            if (a.hasOwnProperty(e)) {
  4167.                var f = a[e];
  4168.                if (f.isRunning() || f.isFinished()) switch (b) {
  4169.                    case EBG.Interactions.InteractionManager.HandleAllTimersOptions.REPORT:
  4170.                        var g =
  4171.                            new EBG.Events.Event(EBG.Events.EventNames.HANDLE_TIMER_INTERACTION);
  4172.                        g.dispatcher = {
  4173.                            _adConfig: {
  4174.                                rnd: EBG.Ads.Ad.Fn.getRandFromAdUId(c)
  4175.                            }
  4176.                        };
  4177.                        g.timing = EBG.Events.EventTiming.BEFORE;
  4178.                        g.eventData = {
  4179.                            interaction: f
  4180.                        };
  4181.                        if (EBG.eventMgr.dispatchEvent(g)) return;
  4182.                        (f = f.handle(d)) && this.adsIntQueues[c].push(f);
  4183.                        g.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
  4184.                        EBG.eventMgr.dispatchEvent(g);
  4185.                        break;
  4186.                    case EBG.Interactions.InteractionManager.HandleAllTimersOptions.PAUSE:
  4187.                        f.stop();
  4188.                        this._pausedTimers.push(f);
  4189.                        break;
  4190.                    case EBG.Interactions.InteractionManager.HandleAllTimersOptions.HANDLE_IDLE:
  4191.                        f.increaseIdleDuration(this.idleManager.currentIdleDuration)
  4192.                }
  4193.            }
  4194.    },
  4195.    pauseAllTimers: function() {
  4196.        return this.handleAllTimers(EBG.Interactions.InteractionManager.HandleAllTimersOptions.PAUSE, !0)
  4197.    },
  4198.    resumeAllTimers: function() {
  4199.        if (null != this._pausedTimers) {
  4200.            for (var a = 0; a < this._pausedTimers.length; a++) this._pausedTimers[a].start();
  4201.            this._pausedTimers = null
  4202.        }
  4203.    },
  4204.    reportInteractionQueues: function(a, b, c) {
  4205.        if (!(EBG.getTime() > EBG.Interactions.InteractionManager.INTERACTION_THRESHOLD_SEC)) {
  4206.            var a = EBG.isBool(a) ? a : !0,
  4207.                b = EBG.isBool(b) ? b : !1,
  4208.                d = "",
  4209.                e = this._interactionPipe,
  4210.                f;
  4211.            for (f in this.adsData)
  4212.                if (this.adsData.hasOwnProperty(f)) {
  4213.                    var g =
  4214.                        this.adsIntQueues[f];
  4215.                    if (!this.adsData[f].delayIntReport)
  4216.                        for (; g.length;) {
  4217.                            for (var h = this._getAdReportData(f), i = 0, j = this._isUnloadHandled ? g.length : EBG.Interactions.InteractionManager.intStackLength, k = 0; k < g.length && k < j; k++) h += g[k], i++;
  4218.                            for (k = 0; k < i; k++) g.shift();
  4219.                            this._isUnloadHandled ? ("" != d && (d += "|"), d += h) : this._reportServer(e + h + this._getPipeParams(f, b), a, c)
  4220.                        }
  4221.                }
  4222.            if (this._isUnloadHandled && "" != d) {
  4223.                for (f in this.adsData)
  4224.                    if (this.adsData.hasOwnProperty(f)) {
  4225.                        d = e + d + this._getPipeParams(f, b);
  4226.                        break
  4227.                    }
  4228.                this._reportServer(d,
  4229.                    a, c)
  4230.            }
  4231.        }
  4232.    },
  4233.    _reportServer: function(a, b, c) {
  4234.        if (!EBG.isPreview || EBG.isGlobalDef("gfEbForceReportInt")) c ? EBG.adaptor.reportBeacon(a) : EBG.adaptor.reportToRemoteServer(a, b)
  4235.    },
  4236.    _isReportDataInQueue: function(a, b) {
  4237.        for (var c = !1, d = this.adsIntQueues[a], e = 0; e < d.length; e++)
  4238.            if (d[e] === b) {
  4239.                c = !0;
  4240.                break
  4241.            }
  4242.        return c
  4243.    },
  4244.    _getPipeParams: function(a, b) {
  4245.        var c = "",
  4246.            d = this.adsData[a].adConfig.usercookie;
  4247.        d && (c += EBG.format("&usercookie={0}", d));
  4248.        (d = this.adsData[a].adConfig.optOut) && (c += EBG.format("&OptOut={0}", d));
  4249.        b && (c += EBG.format("&iseq={0}",
  4250.            this._seqTimersReportData.index));
  4251.        EBG.isGlobalDef("gfEbForceReportInt") && (c += "&pr=1");
  4252.        c += EBG.format("&rnd={0}", Math.random());
  4253.        EBG.adaptor.flash && (c += EBG.format("&flv={0}", EBG.adaptor.flash.version));
  4254.        EBG.isDefined(EBG.adaptor.getResolution) && (c += EBG.format("&res={0}", EBG.adaptor.getResolution()));
  4255.        EBGInfra.isDefinedNotNull(this.adsData[a].adConfig.diAppId) && (c += "&diappid=" + this.adsData[a].adConfig.diAppId);
  4256.        return c
  4257.    },
  4258.    _getAdReportData: function(a) {
  4259.        var b = this.adsData[a].adConfig,
  4260.            c = EBG.Interactions.InteractionManager.charAdFieldsDelimeter;
  4261.        return EBG.format("{0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11}{12}", EBG.Ads.Ad.Fn.getAdIdFromAdUId(a), c, b.page, c, b.pluId, c, b.massVersioning.targetAudienceId, c, b.massVersioning.deliveryGroupId, c, EBG.Ads.Ad.Fn.getVersionToReport(b.massVersioning.adVersions), c, this.adsData[a].adConfig.sID)
  4262.    },
  4263.    _addSystemInteractions: function(a) {
  4264.        var a = a.uid,
  4265.            b = new EBG.Interactions.CounterInteractionData(EBG.Interactions.SystemInts.USER_INTERACTION, EBG.Interactions.Categories.SYSTEM, a);
  4266.        b.numLeftToReport = 1;
  4267.        this.addInteraction(new EBG.Interactions.CounterInteraction(b));
  4268.        b = new EBG.Interactions.CounterInteractionData(EBG.Interactions.SystemInts.UNIQUE_VIDEO_STARTED, EBG.Interactions.Categories.VIDEO, a);
  4269.        b.numLeftToReport = 1;
  4270.        this.addInteraction(new EBG.Interactions.CounterInteraction(b));
  4271.        b = new EBG.Interactions.CounterInteractionData(EBG.Interactions.SystemInts.DWELL_UNIQUE, EBG.Interactions.Categories.SYSTEM, a);
  4272.        b.reportImmediately = !0;
  4273.        b.numLeftToReport = 1;
  4274.        this.addInteraction(new EBG.Interactions.CounterInteraction(b));
  4275.        b = new EBG.Interactions.CounterInteractionData(EBG.Interactions.SystemInts.REPLAY,
  4276.            EBG.Interactions.Categories.SYSTEM, a);
  4277.        this.addInteraction(new EBG.Interactions.CounterInteraction(b));
  4278.        a = new EBG.Interactions.CounterInteractionData(EBG.Interactions.SystemInts.RICH_FLASH_PLAYED, EBG.Interactions.Categories.SYSTEM, a);
  4279.        a.numLeftToReport = 1;
  4280.        this.addInteraction(new EBG.Interactions.CounterInteraction(a))
  4281.    },
  4282.    _reportUserInitatedVideo: function(a, b) {
  4283.        this.handleVideoInteraction(EBG.VideoInteraction.USER_INITIATED_VIDEO, a, b)
  4284.    },
  4285.    _reportUserInteraction: function(a) {
  4286.        this.handleCounterInteraction(EBG.Interactions.SystemInts.USER_INTERACTION,
  4287.            a)
  4288.    },
  4289.    _reportUniqueVideoStarted: function(a) {
  4290.        this.handleCounterInteraction(EBG.Interactions.SystemInts.UNIQUE_VIDEO_STARTED, a)
  4291.    },
  4292.    reportDwellUnique: function(a, b) {
  4293.        b && this.handleCounterInteraction(EBG.Interactions.SystemInts.DWELL_UNIQUE, a, null, !1)
  4294.    },
  4295.    reportRichFlashPlayed: function(a) {
  4296.        this.handleCounterInteraction(EBG.Interactions.SystemInts.RICH_FLASH_PLAYED, a)
  4297.    },
  4298.    reportReplay: function(a) {
  4299.        this.handleCounterInteraction(EBG.Interactions.SystemInts.REPLAY, a, 0, EBG.ActionType.USER)
  4300.    },
  4301.    _getTimerInteraction: function(a,
  4302.        b) {
  4303.        a = a.toLowerCase();
  4304.        if (this.adsData[b] && this.adsData[b][EBG.Interactions.InteractionTypes.TIMER] && this.adsData[b][EBG.Interactions.InteractionTypes.TIMER][a]) return this.adsData[b][EBG.Interactions.InteractionTypes.TIMER][a]
  4305.    },
  4306.    _subscribeToEvents: function() {
  4307.        EBG.adaptor.supportsPageLoadEvents() ? (EBG.eventMgr.subscribeToEvent(new EBG.Events.EventSubscription(EBG.Events.EventNames.PAGE_BEFORE_UNLOAD, this.unLoadHandler, this)), EBG.eventMgr.subscribeToEvent(new EBG.Events.EventSubscription(EBG.Events.EventNames.PAGE_UNLOAD,
  4308.            this.unLoadHandler, this)), EBG.eventMgr.subscribeToEvent(new EBG.Events.EventSubscription(EBG.Events.EventNames.PAGE_HIDE, this.unLoadHandler, this)), EBG.setInterval(this, this.reportInteractionQueues, [], this._timedReport)) : this._setNextTimerSeq(!0)
  4309.    },
  4310.    _handleAllTimersSeq: function() {
  4311.        var a = EBG.adaptor.browser.isMobile();
  4312.        EBG.adaptor.supportsPageLoadEvents();
  4313.        this.reportInteractionQueues(!a);
  4314.        this._pausedTimers || (this.handleAllTimers(EBG.Interactions.InteractionManager.HandleAllTimersOptions.REPORT, !a), this.resumeAllTimers());
  4315.        this._setNextTimerSeq(!1)
  4316.    },
  4317.    _setNextTimerSeq: function(a) {
  4318.        a = "undefined" != typeof a && a ? this._seqTimersReportData.index = 0 : ++this._seqTimersReportData.index;
  4319.        a < this._seqTimersReportData.intervals.length && EBG.runTimed(this, this._handleAllTimersSeq, [], 1E3 * this._seqTimersReportData.intervals[a])
  4320.    },
  4321.    unLoadHandler: function() {
  4322.        if (!this._isUnloadHandled) this._isUnloadHandled = !0, this.handleAllTimers(EBG.Interactions.InteractionManager.HandleAllTimersOptions.REPORT, !1)
  4323.    },
  4324.    getAdDuration: function(a) {
  4325.        var b = 0;
  4326.        (a = this._getTimerInteraction(EBG.Interactions.SystemInts.AD_DURATION,
  4327.            a)) && (b = a.getElapsedTime());
  4328.        return b
  4329.    }
  4330. };
  4331. EBG.declareClass(EBG.Interactions.InteractionManager, EBG.Interactions.StdInteractionManager);
  4332. EBG.DataProfile = {
  4333.    GENERAL: "general",
  4334.    SERVING: "serving",
  4335.    USERINFO: "userInfo",
  4336.    PLATFORM: "platform",
  4337.    FRAUD: "fraud",
  4338.    VISIBILITY: "visibility",
  4339.    ERROR: "error"
  4340. };
  4341. EBG.DataPipe = function(a, b) {
  4342.    this._profile = this._buildProfile(b || this._defaultProfile);
  4343.    this._duration = 0;
  4344.    this._firstTickDelay = 5E3;
  4345.    this._serverPipeUrl = a;
  4346.    EBG.setInterval(this, function() {
  4347.        this._duration++
  4348.    }, [], 1E3);
  4349.    EBG.setInterval(this, function() {
  4350.        this._observedHandler()
  4351.    }, [], 100);
  4352.    b && b.length && EBG.runTimed(this, this._tick, [], this._firstTickDelay)
  4353. };
  4354. EBG.DataPipe.prototype = {
  4355.    _data: {
  4356.        general: {}
  4357.    },
  4358.    _observedObjects: [],
  4359.    _tickCount: 0,
  4360.    _tickDelay: 1,
  4361.    _maxTicks: 1,
  4362.    _completeProfile: {
  4363.        general: {
  4364.            sid: !0,
  4365.            dur: !0,
  4366.            time: !1,
  4367.            adid: !1,
  4368.            frmt: !1,
  4369.            cs: !1
  4370.        },
  4371.        serving: {
  4372.            prtcl: !1,
  4373.            dmn: !1,
  4374.            url: !1,
  4375.            vurl: !1,
  4376.            srvmd: !1,
  4377.            aie: !1,
  4378.            imapp: !1
  4379.        },
  4380.        userInfo: {
  4381.            geo: !1,
  4382.            ip: !1
  4383.        },
  4384.        platform: {
  4385.            os: !1,
  4386.            osv: !1,
  4387.            ua: !1,
  4388.            brsrc: !1,
  4389.            brsrv: !1,
  4390.            brsrt: !1,
  4391.            flsv: !1,
  4392.            scrw: !1,
  4393.            scrh: !1,
  4394.            scrl: !1,
  4395.            fh: !1,
  4396.            fw: !1,
  4397.            env: !1,
  4398.            mraid: !1,
  4399.            mraidw: !1
  4400.        },
  4401.        fraud: {
  4402.            bot: !1,
  4403.            injct: !1,
  4404.            stack: !1
  4405.        },
  4406.        visibility: {
  4407.            vsbp: !1,
  4408.            pct: !1,
  4409.            scrsr: !1,
  4410.            loc: !1,
  4411.            vsr: !1,
  4412.            vsri: !1,
  4413.            uvsr: !1,
  4414.            vsiab: !1,
  4415.            uvsiab: !1
  4416.        },
  4417.        error: {
  4418.            errnum: !1,
  4419.            errmsg: !1,
  4420.            errfunc: !1,
  4421.            errpos: !1
  4422.        }
  4423.    },
  4424.    _defaultProfile: {
  4425.        general: {
  4426.            adid: !1,
  4427.            sid: !0,
  4428.            dur: !0
  4429.        }
  4430.    },
  4431.    _buildProfile: function(a) {
  4432.        for (var b = {}, c = 0; c < a.length; c++) b[a[c]] = EBG.cloneObj(this._completeProfile[a[c]]);
  4433.        EBG.mergeObj(this._defaultProfile, b, !1);
  4434.        return b
  4435.    },
  4436.    _clear: function() {
  4437.        for (var a in this._profile) {
  4438.            var b = this._profile[a],
  4439.                c = void 0;
  4440.            for (c in b) !this._profile[a][c] && this._data[a] && (this._data[a][c] = null, delete this._data[a][c])
  4441.        }
  4442.    },
  4443.    _post: function() {
  4444.        var a = {
  4445.            x: function() {
  4446.                if ("undefined" !== typeof XMLHttpRequest) return new XMLHttpRequest;
  4447.                for (var a = ["MSXML2.XmlHttp.5.0", "MSXML2.XmlHttp.4.0", "MSXML2.XmlHttp.3.0", "MSXML2.XmlHttp.2.0", "Microsoft.XmlHttp"], c, d = 0; d < a.length; d++) try {
  4448.                    c = new ActiveXObject(a[d]);
  4449.                    break
  4450.                } catch (e) {}
  4451.                return c
  4452.            },
  4453.            post: function(b, c, d, e) {
  4454.                try {
  4455.                    var f = a.x();
  4456.                    f.open("POST", b, e);
  4457.                    f.onreadystatechange = function() {
  4458.                        4 == f.readyState && d && d(f.responseText)
  4459.                    };
  4460.                    f.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  4461.                    f.send(JSON.stringify(c))
  4462.                } catch (g) {}
  4463.            }
  4464.        };
  4465.        return a.post
  4466.    }(),
  4467.    _tick: function() {
  4468.        ++this._tickCount;
  4469.        this.flush();
  4470.        this._tickCount <
  4471.            this._maxTicks && (EBG.runTimed(this, this._tick, [], 1E3 * Math.pow(2, this._tickDelay)), this._tickDelay++)
  4472.    },
  4473.    send: function(a, b, c) {
  4474.        c = c || {};
  4475.        if (this._profile[a]) {
  4476.            this._data[a] = this._data[a] || {};
  4477.            for (var d in b) d in this._profile[a] && (this._data[a][d] = encodeURIComponent(b[d]));
  4478.            if (c.constant)
  4479.                for (d in this._data[a]) this._profile[a][d] = !0;
  4480.            c.flush && this.flush()
  4481.        }
  4482.    },
  4483.    flush: function() {
  4484.        this._data.general.dur = this._duration;
  4485.        var a = {},
  4486.            b;
  4487.        for (b in this._data)
  4488.            for (var c in this._data[b]) a[c] = this._data[b][c];
  4489.        this._post(this._serverPipeUrl,
  4490.            a);
  4491.        this._clear()
  4492.    },
  4493.    watch: function(a, b, c, d, e) {
  4494.        if (this._profile[a] && c) {
  4495.            var f = this;
  4496.            Object.observe ? Object.observe(c, function(g) {
  4497.                for (var h = 0; h < g.length; h++)
  4498.                    if (g[h].name === d) {
  4499.                        var i = {};
  4500.                        i[b] = c[d].toString();
  4501.                        f.send(a, i, e)
  4502.                    }
  4503.            }) : this._observedObjects.push({
  4504.                ns: a,
  4505.                key: b,
  4506.                value: c[d],
  4507.                obj: c,
  4508.                prop: d,
  4509.                options: e
  4510.            })
  4511.        }
  4512.    },
  4513.    _observedHandler: function() {
  4514.        for (var a = 0; a < this._observedObjects.length; a++) {
  4515.            var b = this._observedObjects[a];
  4516.            if (b.obj[b.prop] !== b.value) {
  4517.                b.value = b.obj[b.prop];
  4518.                var c = {};
  4519.                c[key] = b.obj[b.prop].toString();
  4520.                this.send(ns,
  4521.                    c, b.options)
  4522.            }
  4523.        }
  4524.    }
  4525. };
  4526. EBG.DataPipeManager = function(a, b) {
  4527.    this._default = b;
  4528.    this._dpUrl = a
  4529. };
  4530. EBG.DataPipeManager.prototype = {
  4531.    _pipes: {},
  4532.    createPipe: function(a, b) {
  4533.        var c = new EBG.DataPipe(this._dpUrl, b || this._default);
  4534.        c.send(EBG.DataProfile.GENERAL, {
  4535.            sid: a
  4536.        });
  4537.        this._pipes[a] = c
  4538.    },
  4539.    getPipe: function(a) {
  4540.        this._pipes[a] || this.createPipe(a);
  4541.        return this._pipes[a]
  4542.    },
  4543.    send: function(a, b, c, d) {
  4544.        (a = this._pipes[a]) && a.send(b, c, d)
  4545.    }
  4546. };
  4547. EBG.declareNamespace("Positioning");
  4548. EBG.Positioning.PositionManager = function() {};
  4549. EBG.Positioning.PositionManager.prototype = {
  4550.    isVisibile: function(a, b, c) {
  4551.        try {
  4552.            return 0 < this.calculateVisibilityPercentage(a, b, c) ? !0 : !1
  4553.        } catch (d) {}
  4554.    },
  4555.    calculateVisibilityPercentage: function(a, b, c, d, e, f, g) {
  4556.        try {
  4557.            var h = 0,
  4558.                i = 0,
  4559.                j = 0,
  4560.                k = !(EBG.adaptor.getDisplayWin() != top && g == EBG.Adaptors.ServingMode.FRIENDLY_IFRAME),
  4561.                m = EBG.adaptor.getScrollLeftTop(k, g),
  4562.                l = EBG.adaptor.getViewPortMetrics(k, f, g),
  4563.                p = this.calculateRightBottowCoordinate(m, l.Width, l.Height),
  4564.                n = EBG.adaptor.getPositioningById(a, !k, g);
  4565.            if (null != n) {
  4566.                a = {
  4567.                    X: 0,
  4568.                    Y: 0
  4569.                };
  4570.                try {
  4571.                    !k &&
  4572.                        window.frameElement && (a = EBG.adaptor.getPositioningByElement(window.frameElement, !1, g))
  4573.                } catch (r) {
  4574.                    a = {
  4575.                        X: 0,
  4576.                        Y: 0
  4577.                    }
  4578.                }
  4579.                n.X += a.X;
  4580.                n.Y += a.Y;
  4581.                "undefined" != typeof d && (n.X += d);
  4582.                "undefined" != typeof e && (n.Y += e);
  4583.                var q = this.calculateRightBottowCoordinate(n, b, c),
  4584.                    j = b * c,
  4585.                    i = this.calculateVisibleArea(m, p, n, q),
  4586.                    h = j ? i / j : 0
  4587.            }
  4588.            return h
  4589.        } catch (o) {}
  4590.    },
  4591.    calculateRightBottowCoordinate: function(a, b, c) {
  4592.        var d = {
  4593.            X: 0,
  4594.            Y: 0
  4595.        };
  4596.        d.X = a.X + b;
  4597.        d.Y = a.Y + c;
  4598.        return d
  4599.    },
  4600.    calculateVisibleArea: function(a, b, c, d) {
  4601.        try {
  4602.            var e = 0,
  4603.                f = 0;
  4604.            if (c.Y == d.Y && c.X == d.X || b.X <= a.X || b.Y <= a.Y) return 0;
  4605.            c.X <= a.X && a.X <= d.X ? e = b.X <= d.X ? b.X - a.X : d.X - a.X : a.X <= c.X && c.X <= b.X && (e = d.X >= b.X ? b.X - c.X : d.X - c.X);
  4606.            c.Y <= a.Y && a.Y <= d.Y ? f = b.Y <= d.Y ? b.Y - a.Y : d.Y - a.Y : a.Y <= c.Y && c.Y <= b.Y && (f = d.Y >= b.Y ? b.Y - c.Y : d.Y - c.Y);
  4607.            return e * f
  4608.        } catch (g) {}
  4609.    },
  4610.    getFullRectWithClip: function(a, b) {
  4611.        var c = null,
  4612.            c = EBG.adaptor.getDisplayWin() === EBG.adaptor.getPageWin(),
  4613.            d = null;
  4614.        if (a) {
  4615.            var c = EBG.adaptor.getPositioningByElement(a, !c, b),
  4616.                d = {
  4617.                    width: a.offsetWidth,
  4618.                    height: a.offsetHeight
  4619.                },
  4620.                e = a.style.clip,
  4621.                f = 0,
  4622.                g = 0,
  4623.                h = d.height,
  4624.                i = d.width;
  4625.            "" != e && (e = e.substring(e.indexOf("(") +
  4626.                1).replace(/,/g, "").replace(/ /g, ""), e = e.split("px"), g = parseInt(e[0]), i = parseInt(e[1]), h = parseInt(e[2]), f = parseInt(e[3]));
  4627.            d.left = c.X + f;
  4628.            d.top = c.Y + g;
  4629.            d.width -= d.width - i;
  4630.            d.width -= f;
  4631.            d.height -= d.height - h;
  4632.            d.height -= g;
  4633.            d.right = d.left + d.width;
  4634.            d.bottom = d.top + d.height
  4635.        }
  4636.        return d
  4637.    },
  4638.    isOverlapping: function(a, b, c) {
  4639.        if (!a || 0 == a.offsetWidth && 0 == a.offsetHeight || !b || 0 == b.offsetWidth && 0 == b.offsetHeight) return !1;
  4640.        a = EBG.posHelper.getFullRectWithClip(a, c);
  4641.        b = EBG.posHelper.getFullRectWithClip(b, c);
  4642.        return !a || !b || a.bottom < b.top ||
  4643.            a.top > b.bottom || a.right < b.left || a.left > b.right ? !1 : !0
  4644.    }
  4645. };
  4646. EBG.declareClass(EBG.Positioning.PositionManager, null);
  4647. EBG.declareNamespace("RichModules");
  4648. EBG.RichModules.BasicVisibilityProvider = function(a, b, c) {
  4649.    this._resObjId = a;
  4650.    this._res = EBG.adaptor.getElementById(a);
  4651.    this._adConfig = this.adConfig = b;
  4652.    this._options = c || {};
  4653.    this._subscribeToEvents();
  4654.    this._trackElementLocation()
  4655. };
  4656. EBG.RichModules.BasicVisibilityProvider._isAvailable = function() {
  4657.    return !1
  4658. };
  4659. EBG.RichModules.BasicVisibilityProvider.prototype = {
  4660.    name: "Basic",
  4661.    _isStarted: !1,
  4662.    _calculateVisibilityPercentage: function() {
  4663.        return 0
  4664.    },
  4665.    _getViewPortMetrics: function() {
  4666.        return null
  4667.    },
  4668.    _dispatchCheckVisibility: function(a) {
  4669.        if (this._isStarted) {
  4670.            var b = new EBG.Events.Event(EBG.Events.EventNames.VISIBILITY_CHECK);
  4671.            b.dispatcher = this;
  4672.            b.eventData = a;
  4673.            if (EBG.isObj(this._options.customData)) b.eventData.customData = this._options.customData;
  4674.            b.timing = EBG.Events.EventTiming.ONTIME;
  4675.            EBG.eventMgr.dispatchEvent(b)
  4676.        }
  4677.    },
  4678.    _dispatchVisibilityHidden: function() {
  4679.        var a =
  4680.            new EBG.Events.Event(EBG.Events.EventNames.VISIBILITY_HIDDEN);
  4681.        a.dispatcher = this;
  4682.        a.timing = EBG.Events.EventTiming.ONTIME;
  4683.        EBG.eventMgr.dispatchEvent(a)
  4684.    },
  4685.    _subscribeToEvents: function() {
  4686.        var a = new EBG.Events.EventSubscription(EBG.Events.EventNames.EXPAND, function(a) {
  4687.            a.eventData.props && a.eventData.props.asset.id == this._resObjId && this._trackElementLocation()
  4688.        }, this);
  4689.        a.timing = EBG.Events.EventTiming.ONTIME;
  4690.        a.dispatcherFilters = {
  4691.            "_adConfig.rnd": this.adConfig.rnd
  4692.        };
  4693.        EBG.eventMgr.subscribeToEvent(a)
  4694.    },
  4695.    updateResourceObjId: function(a) {
  4696.        this._resObjId =
  4697.            a;
  4698.        this._res = EBG.adaptor.getElementById(a);
  4699.        this._trackElementLocation()
  4700.    },
  4701.    _isVisible: function() {
  4702.        return !1
  4703.    },
  4704.    _calculateVisibilityResult: function() {
  4705.        var a = {};
  4706.        try {
  4707.            a.assetId = this._resObjId, a.percentage = this._calculateVisibilityPercentage(), a.viewPort = this._getViewPortMetrics()
  4708.        } catch (b) {}
  4709.        return a
  4710.    },
  4711.    start: function() {
  4712.        this._isStarted = !0
  4713.    },
  4714.    _trackElementLocation: function() {
  4715.        if (this._intervalHandler) clearInterval(this._intervalHandler), this._intervalHandler = null;
  4716.        if (this._res = EBG.adaptor.getElementById(this._resObjId)) {
  4717.            var a =
  4718.                this,
  4719.                b = EBG.adaptor.getBoundingClientRect(this._res, {
  4720.                    clip: !0
  4721.                });
  4722.            if (b) this._intervalHandler = EBG.setInterval(this, function() {
  4723.                var c = EBG.adaptor.getBoundingClientRect(a._res, {
  4724.                    clip: !0
  4725.                });
  4726.                if (b && !c) a.onElementMoved(), a._trackElementLocation();
  4727.                else
  4728.                    for (var d in c)
  4729.                        if (c[d] != b[d]) {
  4730.                            b = c;
  4731.                            a.onElementMoved();
  4732.                            break
  4733.                        }
  4734.            }, [], 200)
  4735.        } else EBG.runTimed(this, this._trackElementLocation, [], 500)
  4736.    },
  4737.    _triggerVisibilityCheck: function() {
  4738.        this._dispatchCheckVisibility(this._calculateVisibilityResult())
  4739.    },
  4740.    onElementMoved: function() {}
  4741. };
  4742. EBG.declareClass(EBG.RichModules.BasicVisibilityProvider, null);
  4743. EBG.declareNamespace("RichModules");
  4744. EBG.RichModules.GeometricVisibilityProvider = function(a, b, c) {
  4745.    EBG.callSuperConstructor(EBG.RichModules.GeometricVisibilityProvider, this, [a, b, c])
  4746. };
  4747. EBG.RichModules.GeometricVisibilityProvider.prototype = {
  4748.    name: "Geometric",
  4749.    _focusOnResourceElem: null,
  4750.    _justReceivedFocusOnPage: null,
  4751.    _reachedMaxAdDuration: !1,
  4752.    _calculateVisibilityPercentage: function(a) {
  4753.        try {
  4754.            if (!EBG.adaptor.isPageVisible(this.adConfig.isInstream)) return 0;
  4755.            var a = a || {},
  4756.                b = this._getAssetRect(a.resourceObjId || this._resObjId),
  4757.                c = this._getViewPortRect();
  4758.            b.top += ~~a.offsetY;
  4759.            b.bottom += ~~a.offsetY;
  4760.            b.left += ~~a.offsetX;
  4761.            b.right += ~~a.offsetX;
  4762.            if (EBG.isDefined(a.width)) b.width = a.width, b.right = b.left + a.width;
  4763.            if (EBG.isDefined(a.height)) b.height = a.height, b.bottom = b.top + a.height;
  4764.            if (this._intersect(b, c)) {
  4765.                var d = this._overlap(c, b);
  4766.                this._visibleRect = d;
  4767.                return ~~(100 * (d.width * d.height / (b.width * b.height)))
  4768.            }
  4769.            return 0
  4770.        } catch (e) {
  4771.            return 0
  4772.        }
  4773.    },
  4774.    _getAssetRect: function(a) {
  4775.        a = EBG.adaptor.isElementOrNode(a) ? a : EBG.adaptor.getElementById(a);
  4776.        (a = EBG.adaptor.getBoundingClientRect(a, {
  4777.            clip: !0,
  4778.            relativeToTop: !0
  4779.        })) || (a = {
  4780.            top: 0,
  4781.            bottom: 0,
  4782.            left: 0,
  4783.            right: 0,
  4784.            width: 0,
  4785.            height: 0
  4786.        });
  4787.        return a
  4788.    },
  4789.    _getViewPortMetrics: function() {
  4790.        var a = EBG.adaptor._getCurrentWindow(void 0,
  4791.                this.adConfig.actualServingMode),
  4792.            b = EBG.adaptor.getWindowViewPortMetrics(a);
  4793.        if (EBG.adaptor.browser.isFF() && "undefined" != typeof a.outerWidth && EBG.adaptor.serving.detectServingMode(!0) == EBG.Adaptors.ServingMode.IFRAME && ("undefined" == typeof this.adConfig || !EBG.isDefined(this.adConfig.UiVz) || !this.adConfig.UiVz) && !EBG.iframeLocation && "undefined" != typeof this.adConfig && this.adConfig.aiE && !this.adConfig.aiE.iflExists) b.Width = a.outerWidth, b.Height = a.outerHeighth, EBG.isDefined(a.scrollMaxX) && 0 < a.scrollMaxX &&
  4794.            EBG.isDefined(EBG.adaptor.scrollBarWidth) && 0 < EBG.adaptor.scrollBarWidth && (b.Height -= EBG.adaptor.scrollBarWidth), EBG.isDefined(a.scrollMaxY) && 0 < a.scrollMaxY && EBG.isDefined(EBG.adaptor.scrollBarHeight) && 0 < EBG.adaptor.scrollBarHeight && (b.Width -= EBG.adaptor.scrollBarHeight);
  4795.        return b
  4796.    },
  4797.    _getViewPortRect: function() {
  4798.        var a = this._getViewPortMetrics();
  4799.        return {
  4800.            top: 0,
  4801.            left: 0,
  4802.            right: a.Width,
  4803.            bottom: a.Height
  4804.        }
  4805.    },
  4806.    _overlap: function(a, b) {
  4807.        var c = {
  4808.            top: -1,
  4809.            right: -1,
  4810.            bottom: -1,
  4811.            left: -1
  4812.        };
  4813.        if (!this._intersect(a, b)) return c;
  4814.        c.top = Math.max(a.top,
  4815.            b.top);
  4816.        c.left = Math.max(a.left, b.left);
  4817.        c.right = Math.min(a.right, b.right);
  4818.        c.bottom = Math.min(a.bottom, b.bottom);
  4819.        c.width = c.right - c.left;
  4820.        c.height = c.bottom - c.top;
  4821.        return c
  4822.    },
  4823.    _intersect: function(a, b) {
  4824.        return !(b.left > a.right || b.right < a.left || b.top > a.bottom || b.bottom < a.top)
  4825.    },
  4826.    _isVisible: function(a) {
  4827.        var a = a || {},
  4828.            b = EBG.adaptor.getBoundingClientRect(this._res, {
  4829.                clip: !0
  4830.            });
  4831.        return !!this._calculateVisibilityPercentage({
  4832.            resourceObjId: a.resourceObjId || this._resObjId,
  4833.            width: a.width || b.width,
  4834.            height: a.height || b.height,
  4835.            offsetX: a.offsetX ||
  4836.                this.adConfig.offsetX,
  4837.            offsetY: a.offsetY || this.adConfig.offsetY,
  4838.            isUIVZ: a.isUIVZ || this.adConfig.UiVz,
  4839.            actualServingMode: a.actualServingMode || this.adConfig.actualServingMode
  4840.        })
  4841.    },
  4842.    _subscribeToEvents: function() {
  4843.        try {
  4844.            EBG.callSuperFunction(EBG.RichModules.GeometricVisibilityProvider, this, "_subscribeToEvents");
  4845.            EBG.eventMgr.subscribeToEvent(new EBG.Events.EventSubscription(EBG.Events.EventNames.PAGE_RESIZE, this._pageResizeHandler, this));
  4846.            EBG.eventMgr.subscribeToEvent(new EBG.Events.EventSubscription(EBG.Events.EventNames.PAGE_SCROLL,
  4847.                this._pageScrollHandler, this));
  4848.            if (!EBG.adaptor._getVisibilityEventName() || EBG.adaptor.browser.isAndroidNative() && 4.4 > EBG.adaptor.browser.getVersion()) EBG.eventMgr.subscribeToEvent(new EBG.Events.EventSubscription(EBG.Events.EventNames.PAGE_FOCUS, this._pageFocusHandler, this)), EBG.eventMgr.subscribeToEvent(new EBG.Events.EventSubscription(EBG.Events.EventNames.PAGE_BLUR, this._pageBlurHandler, this)), this._subscribeToElementEvents();
  4849.            var a = new EBG.Events.EventSubscription(EBG.Events.EventNames.PAGE_HIDDEN,
  4850.                this._pageHiddenHandler, this);
  4851.            a.isDocumentEvent = !0;
  4852.            EBG.eventMgr.subscribeToEvent(a);
  4853.            a = new EBG.Events.EventSubscription(EBG.Events.EventNames.PAGE_VISIBLE, this._pageVisibleHandler, this);
  4854.            a.isDocumentEvent = !0;
  4855.            EBG.eventMgr.subscribeToEvent(a);
  4856.            EBG.eventMgr.subscribeToEvent(new EBG.Events.EventSubscription(EBG.Events.EventNames.RICH_FLASH_PLAYED, this.onChange, this))
  4857.        } catch (b) {}
  4858.    },
  4859.    _subscribeToElementEvents: function() {
  4860.        var a = this,
  4861.            b = function() {
  4862.                a._resourceBlurHandler()
  4863.            },
  4864.            c = new EBG.Events.EventSubscription("focus",
  4865.                function() {
  4866.                    a._resourceFocusHandler()
  4867.                }, this);
  4868.        c.isElementEvent = !0;
  4869.        c.elementId = this._resObjId;
  4870.        EBG.eventMgr.subscribeToEvent(c);
  4871.        if (EBG.adaptor.browser.isIE() && this.actualServingMode != EBG.Adaptors.ServingMode.SCRIPT) c = new EBG.Events.EventSubscription("blur", b, this), c.isElementEvent = !0, c.elementId = this._resObjId, EBG.eventMgr.subscribeToEvent(c)
  4872.    },
  4873.    updateResourceObjId: function(a) {
  4874.        EBG.callSuperFunction(EBG.RichModules.GeometricVisibilityProvider, this, "updateResourceObjId", [a]);
  4875.        EBG.adaptor._getVisibilityEventName() ||
  4876.            this._subscribeToElementEvents()
  4877.    },
  4878.    _pageVisibleHandler: function() {
  4879.        this._triggerVisibilityCheck()
  4880.    },
  4881.    _pageHiddenHandler: function() {
  4882.        this._dispatchVisibilityHidden();
  4883.        this.adConfig.visibility.mode == EBG.VisibilityMode.ENHANCED_MODE && this._dispatchCheckVisibility({
  4884.            percentage: 0,
  4885.            viewPort: this._getViewPortMetrics()
  4886.        })
  4887.    },
  4888.    _resourceFocusHandler: function() {
  4889.        this._focusOnResourceElem = !0;
  4890.        EBG.runTimed(this, function() {
  4891.            this._focusOnResourceElem = !1
  4892.        }, [], 60);
  4893.        this._pageFocusHandler()
  4894.    },
  4895.    _resourceBlurHandler: function() {
  4896.        EBG.runTimed(this,
  4897.            function() {
  4898.                !this._justReceivedFocusOnPage && !this._focusOnResourceElem && this._pageBlurHandler()
  4899.            }, [], 30)
  4900.    },
  4901.    _pageFocusHandler: function() {
  4902.        this._justReceivedFocusOnPage = !0;
  4903.        EBG.runTimed(this, function() {
  4904.            this._justReceivedFocusOnPage = !1
  4905.        }, [], 60);
  4906.        this._triggerVisibilityCheck()
  4907.    },
  4908.    _pageBlurHandler: function() {
  4909.        EBG.runTimed(this, function() {
  4910.            !this._justReceivedFocusOnPage && !this._getAdHasFocus() && this._pageHiddenHandler()
  4911.        }, [], 30)
  4912.    },
  4913.    _getAdHasFocus: function() {
  4914.        for (var a = this._getAllAdVisibilityProviders(), b = 0; b < a.length; b++)
  4915.            if (a[b]._focusOnResourceElem) return !0;
  4916.        return !1
  4917.    },
  4918.    _getAllAdVisibilityProviders: function() {
  4919.        var a = [],
  4920.            b = EBG.ads[this._adConfig.uid],
  4921.            c;
  4922.        for (c in b) b.hasOwnProperty(c) && b[c] instanceof EBG.RichModules.VisibilityManager && b[c]._visibilityProvider && a.push(b[c]._visibilityProvider);
  4923.        return a
  4924.    },
  4925.    _pageScrollHandler: function() {
  4926.        this._triggerVisibilityCheck()
  4927.    },
  4928.    _pageResizeHandler: function() {
  4929.        if (!this._resizeTimeOut) {
  4930.            var a = this;
  4931.            this._resizeTimeOut = setTimeout(function() {
  4932.                a._resizeTimeOut = null;
  4933.                a._triggerVisibilityCheck()
  4934.            }, 100)
  4935.        }
  4936.    },
  4937.    _maxAdDurationHandler: function() {
  4938.        this._reachedMaxAdDuration = !0
  4939.    },
  4940.    start: function() {
  4941.        EBG.callSuperFunction(EBG.RichModules.GeometricVisibilityProvider, this, "start");
  4942.        var a = 3;
  4943.        (function() {
  4944.            a-- && (this._triggerVisibilityCheck(), EBG.runTimed(this, arguments.callee, [], 1E3))
  4945.        }).apply(this)
  4946.    },
  4947.    onElementMoved: function() {
  4948.        EBG.callSuperFunction(EBG.RichModules.GeometricVisibilityProvider, this, "onElementMoved");
  4949.        this._triggerVisibilityCheck()
  4950.    },
  4951.    onChange: function() {
  4952.        this._triggerVisibilityCheck()
  4953.    },
  4954.    _calculateVisibilityResult: function() {
  4955.        var a = EBG.callSuperFunction(EBG.RichModules.GeometricVisibilityProvider,
  4956.            this, "_calculateVisibilityResult");
  4957.        a.visibleRect = this._visibleRect;
  4958.        return a
  4959.    }
  4960. };
  4961. EBG.declareClass(EBG.RichModules.GeometricVisibilityProvider, EBG.RichModules.BasicVisibilityProvider);
  4962. EBG.RichModules.MouseVisibilityProvider = function(a, b, c) {
  4963.    EBG.callSuperConstructor(EBG.RichModules.MouseVisibilityProvider, this, [a, b, c]);
  4964.    try {
  4965.        this._subscribeToEvents();
  4966.        this._scrollWidth = EBG.adaptor.getScrollerWidth();
  4967.        var d = this.adConfig.displayWin || EBG.adaptor.getDisplayWin();
  4968.        this._screenResolution = {
  4969.            width: d.screen.availWidth,
  4970.            height: d.screen.availHeight
  4971.        };
  4972.        this._screenOriginalResolution = {
  4973.            width: d.screen.availWidth,
  4974.            height: d.screen.availHeight
  4975.        };
  4976.        if (!this._browserStateSupported()) this._resolutionBaseScreenSize =
  4977.            this._resolutionToScreenSize(this._screenResolution), this._resourceInitialPosition = {
  4978.                top: d.screenTop,
  4979.                left: d.screenLeft
  4980.            };
  4981.        this._resourceFullSize = this.adConfig.width * this.adConfig.height;
  4982.        this._mouseMoveEventInvoker()
  4983.    } catch (e) {}
  4984. };
  4985. EBG.RichModules.MouseVisibilityProvider.prototype = {
  4986.    name: "Mouse",
  4987.    _isStarted: !1,
  4988.    _resObj: null,
  4989.    _lastViewPort: null,
  4990.    _resourceRect: null,
  4991.    _resourceFullSize: null,
  4992.    _screenResolution: null,
  4993.    _screenOriginalResolution: null,
  4994.    _screenInitialPosition: {
  4995.        top: 0,
  4996.        left: 0
  4997.    },
  4998.    _resolutionBaseScreenSize: null,
  4999.    _intervalId: null,
  5000.    _calculateVisibilityPercentage: function() {
  5001.        if (!this._isReady) return -1;
  5002.        var a = this._getViewPortRect(),
  5003.            b = this._resourceRect;
  5004.        if (!a || !b) return -1;
  5005.        var c = 0;
  5006.        EBG.adaptor.isPageVisible() && (c = 100 * (EBG.posHelper.calculateVisibleArea({
  5007.            X: a.left,
  5008.            Y: a.top
  5009.        }, {
  5010.            X: a.right,
  5011.            Y: a.bottom
  5012.        }, {
  5013.            X: b.left,
  5014.            Y: b.top
  5015.        }, {
  5016.            X: b.right,
  5017.            Y: b.bottom
  5018.        }) / this._resourceFullSize));
  5019.        return c
  5020.    },
  5021.    _calcResourceRect: function(a) {
  5022.        var b;
  5023.        if (8 == EBG.adaptor.browser._browserVer && 8 == EBG.adaptor.browser.getDocumentMode()) {
  5024.            var c = (b = EBG.adaptor.getElementById(this._resObjId)) && b.getBoundingClientRect ? b.getBoundingClientRect() : {
  5025.                top: 0,
  5026.                left: 0
  5027.            };
  5028.            b = a.screenY - (a.clientY - c.top);
  5029.            a = a.screenX - (a.clientX - c.left)
  5030.        } else b = a.screenY - a.offsetY, a = a.screenX - a.offsetX;
  5031.        return {
  5032.            top: b,
  5033.            left: a,
  5034.            bottom: b + this.adConfig.height,
  5035.            right: a + this.adConfig.width
  5036.        }
  5037.    },
  5038.    _getViewPortRect: function() {
  5039.        var a = null,
  5040.            b = this._getWindowRect();
  5041.        b && (a = {
  5042.            top: 0 > b.top ? 0 : b.top,
  5043.            left: 0 > b.left ? 0 : b.left,
  5044.            bottom: b.bottom > this._screenResolution.height ? this._screenResolution.height : b.bottom,
  5045.            right: b.right > this._screenResolution.width ? this._screenResolution.width : b.right
  5046.        });
  5047.        return a
  5048.    },
  5049.    _getWindowRect: function() {
  5050.        var a = null,
  5051.            b = this.adConfig.displayWin || EBG.adaptor.getDisplayWin();
  5052.        if (this._browserStateSupported()) var a = this._isFullScreen(b),
  5053.            c = !a ? 6 : 0,
  5054.            d = b.screenX + c,
  5055.            e = b.screenY +
  5056.            70,
  5057.            a = {
  5058.                top: e,
  5059.                left: d,
  5060.                bottom: e + b.outerHeight - this._scrollWidth - (!a ? 70 : 0),
  5061.                right: d + b.outerWidth - this._scrollWidth + c
  5062.            };
  5063.        else this._resolutionBaseScreenSize && (b = this._getUnsupportedWindowTopLeft(b), a = {
  5064.            top: b.top,
  5065.            left: b.left,
  5066.            bottom: b.top + this._resolutionBaseScreenSize.height,
  5067.            right: b.left + this._resolutionBaseScreenSize.width
  5068.        });
  5069.        return a
  5070.    },
  5071.    _getUnsupportedWindowTopLeft: function(a) {
  5072.        var b = {
  5073.                top: this._screenInitialPosition.top,
  5074.                left: this._screenInitialPosition.left
  5075.            },
  5076.            c = 0 < a.screenLeft ? a.screenLeft : 0,
  5077.            d = c - this._resourceInitialPosition.left,
  5078.            e = (0 < d ? this._screenOriginalResolution.width - this._resourceInitialPosition.left % this._screenOriginalResolution.width : this._resourceInitialPosition.left % this._screenOriginalResolution.width) + 1,
  5079.            f = 0;
  5080.        if (Math.abs(d) > e && 0 <= c && c < this._screenResolution.width) f = (1 + Math.floor(Math.abs(Math.abs(d) - e) / this._screenOriginalResolution.width)) * this._screenOriginalResolution.width, b.left = 0 > d ? b.left - f : b.left + f;
  5081.        a = 0 < a.screenTop ? a.screenTop : 0;
  5082.        d = a - this._resourceInitialPosition.top;
  5083.        e = (0 < d ? this._screenOriginalResolution.height -
  5084.            this._resourceInitialPosition.top % this._screenOriginalResolution.height : this._resourceInitialPosition.top % this._screenOriginalResolution.height) + 1;
  5085.        if (Math.abs(d) > e && 0 <= a && a < this._screenResolution.height) f = (1 + Math.floor(Math.abs(Math.abs(d) - e) / this._screenOriginalResolution.height)) * this._screenOriginalResolution.height, b.top = 0 > d ? b.top - f : b.top + f;
  5086.        return b
  5087.    },
  5088.    _isFullScreen: function(a) {
  5089.        return !this._browserStateSupported() ? !0 : a.screenX + a.outerWidth == this._screenOriginalResolution.width
  5090.    },
  5091.    _getViewPortMetrics: function() {
  5092.        var a =
  5093.            this._getViewPortRect();
  5094.        return a ? {
  5095.            Width: a.right - a.left,
  5096.            Height: a.bottom - a.top
  5097.        } : null
  5098.    },
  5099.    _isVisible: function() {
  5100.        return !!this._calculateVisibilityPercentage()
  5101.    },
  5102.    _mouseMoveEventInvoker: function() {
  5103.        if ((this._resObj = this._resObj ? this._resObj : EBG.adaptor.getElementById(this._resObjId)) && this._resObj.parentNode && this._resObj.parentNode.fireEvent) {
  5104.            var a = this;
  5105.            this._resObj.parentNode.attachEvent("onmousemove", function(b) {
  5106.                var c = a._calcResourceRect(b),
  5107.                    d = a._getViewPortRect();
  5108.                if (!a._resourceRect) a._screenInitialPosition.left =
  5109.                    Math.floor(b.screenX / a._screenOriginalResolution.width) * a._screenOriginalResolution.width, a._screenInitialPosition.top = Math.floor((50 < b.screenY ? b.screenY - 50 : 0) / a._screenOriginalResolution.height) * a._screenOriginalResolution.height;
  5110.                a._handleMultipleScreen(b);
  5111.                a._handleRecievedData(c, d)
  5112.            });
  5113.            this._intervalId = EBG.setInterval(this._resObj.parentNode, function() {
  5114.                this.fireEvent("onmousemove")
  5115.            }, [], 200)
  5116.        } else EBG.runTimed(this, this._mouseMoveEventInvoker, [], 100)
  5117.    },
  5118.    _handleMultipleScreen: function(a) {
  5119.        var b = this._getWindowRect();
  5120.        if (b) {
  5121.            if (a.screenY > this._screenOriginalResolution.height) {
  5122.                var c = b.bottom > a.screenY ? b.bottom : a.screenY;
  5123.                if (this._screenResolution.height < c) this._screenResolution.height = c
  5124.            }
  5125.            if (a.screenX > this._screenOriginalResolution.width && (a = b.right > a.screenX ? b.right : a.screenX, this._screenResolution.width < a)) this._screenResolution.width = a
  5126.        }
  5127.    },
  5128.    _handleRecievedData: function(a, b) {
  5129.        if (!this._resourceRect || this._checkRectanglesDifferent(this._resourceRect, a, 1) || this._checkRectanglesDifferent(this._lastViewPort, b, 1)) this._resourceRect =
  5130.            a, this._lastViewPort = b, this._triggerCalculation()
  5131.    },
  5132.    _checkRectanglesDifferent: function(a, b, c) {
  5133.        for (var d in a)
  5134.            if (a.hasOwnProperty(d) && Math.abs(a[d] - b[d]) > c) return !0;
  5135.        return !1
  5136.    },
  5137.    _subscribeToEvents: function() {
  5138.        EBG.callSuperFunction(EBG.RichModules.BasicVisibilityProvider, this, "_subscribeToEvents")
  5139.    },
  5140.    _resolutionToScreenSize: function(a) {
  5141.        var b = {
  5142.            width: a.width,
  5143.            height: a.height
  5144.        };
  5145.        1680 == a.width && 1050 == a.height ? b = {
  5146.                width: 1444,
  5147.                height: 806
  5148.            } : 1366 == a.width && 768 == a.height ? b = {
  5149.                width: 1173,
  5150.                height: 562
  5151.            } : 1360 == a.width && 768 == a.height ?
  5152.            b = {
  5153.                width: 1167,
  5154.                height: 562
  5155.            } : 1280 == a.width && 1024 == a.height ? b = {
  5156.                width: 1097,
  5157.                height: 785
  5158.            } : 1280 == a.width && 960 == a.height ? b = {
  5159.                width: 1097,
  5160.                height: 730
  5161.            } : 1152 == a.width && 864 == a.height ? b = {
  5162.                width: 985,
  5163.                height: 645
  5164.            } : 1024 == a.width && 768 == a.height ? b = {
  5165.                width: 875,
  5166.                height: 562
  5167.            } : 800 == a.width && 600 == a.height && (b = {
  5168.                width: 680,
  5169.                height: 416
  5170.            });
  5171.        return b
  5172.    },
  5173.    _triggerCalculation: function() {
  5174.        if (this._isReady || this._isStarted && this._resourceRect) this._isReady = !0, this._dispatchCheckVisibility(this._calculateVisibilityResult())
  5175.    },
  5176.    _browserStateSupported: function() {
  5177.        return 9 <=
  5178.            EBG.adaptor.browser._browserVer && 9 <= EBG.adaptor.browser.getDocumentMode()
  5179.    },
  5180.    updateResourceObjId: function(a) {
  5181.        this._resObj = null;
  5182.        this._intervalId && EBG.clearInterval(this._intervalId);
  5183.        EBG.callSuperFunction(EBG.RichModules.MouseVisibilityProvider, this, "updateResourceObjId", [a]);
  5184.        this._mouseMoveEventInvoker()
  5185.    },
  5186.    start: function() {
  5187.        EBG.callSuperFunction(EBG.RichModules.MouseVisibilityProvider, this, "start");
  5188.        this._isStarted = !0;
  5189.        this._triggerCalculation()
  5190.    }
  5191. };
  5192. EBG.declareClass(EBG.RichModules.MouseVisibilityProvider, EBG.RichModules.BasicVisibilityProvider);
  5193. EBG.declareNamespace("RichModules");
  5194. EBG.RichModules.VisibilityManager = function(a, b, c) {
  5195.    this._adConfig = this.adConfig = a;
  5196.    this._resObjId = b;
  5197.    this._res = EBG.adaptor.getElementById(b);
  5198.    this.actualServingMode = this.adConfig.actualServingMode;
  5199.    this._averageLastCalcTime = (new Date).getTime();
  5200.    this._options = c || {};
  5201.    this._isPanel = this._options.isPanel;
  5202.    this._createIntMgrWrapper();
  5203.    this._dpm = EBG.dataPipeMgr.getPipe(this.adConfig.sID);
  5204.    if (this._shouldInitialize())(this._visibilityProviderName = this._getVisibilityProvider(this._resObjId, this.adConfig)) ? (this._adConfig.visibility.isAvailable = !0, EBG.RichModules[this._visibilityProviderName] ? this._init() : EBG.adaptor.loadModule(this._visibilityProviderName, a, this._init, this)) : (this._adConfig.visibility.isAvailable = !1, this._dpm.send(EBG.DataProfile.VISIBILITY, {
  5205.        uvsr: 3,
  5206.        vsbp: 0
  5207.    }))
  5208. };
  5209. EBG.RichModules.VisibilityManager.ThreholdType = {
  5210.    IAB: 0,
  5211.    Agency: 1,
  5212.    Advertiser: 2
  5213. };
  5214. EBG.RichModules.VisibilityManager.VisibilityPollingTimer = 1E3;
  5215. EBG.RichModules.VisibilityManager.VisibilityCheckInterval = 200;
  5216. EBG.RichModules.VisibilityManager.prototype = {
  5217.    adConfig: null,
  5218.    _resObjId: null,
  5219.    _visibilityData: null,
  5220.    _visRecordable: !1,
  5221.    _lastVisPercentage: 0,
  5222.    _lastVisViewPort: null,
  5223.    _averageVisibility: 0,
  5224.    _averageScreenShare: 0,
  5225.    _averageAdDuration: 0,
  5226.    _averageLastCalcTime: null,
  5227.    _adCoveragePercentage: 0,
  5228.    actualServingMode: EBG.Adaptors.ServingMode.SCRIPT,
  5229.    _visibilityProvider: null,
  5230.    _availableVisibilityProviders: "GeometricVisibilityProvider,SafeFrameVisibilityProvider,MouseVisibilityProvider,GridVisibilityProvider,FlashVisibilityProvider,FFVisibilityProvider,MraidVisibilityProvider".split(","),
  5231.    _visibilityProviderName: null,
  5232.    _providersAvailability: {
  5233.        GeometricVisibilityProvider: function(a) {
  5234.            var b = !0,
  5235.                c = a.actualServingMode == EBG.Adaptors.ServingMode.IFRAME,
  5236.                d = EBG.Initializer._getAdClass({
  5237.                    tn: a.templateName
  5238.                }),
  5239.                e = !d.requiresIframeBust && !a.UiVz,
  5240.                d = d.requiresIframeBust && !EBG.iframeLocation && a.aiE && !a.aiE.iflExists;
  5241.            if (c && (e || d) || a.ffs.CFF_MRAIDVis && EBG.adaptor.isInApp()) b = !1;
  5242.            return b
  5243.        },
  5244.        FlashVisibilityProvider: function(a) {
  5245.            if (EBG.adaptor.flash && 9 <= EBG.adaptor.flash.version) {
  5246.                if (EBG.adaptor.browser.isChrome()) return a.ffs.CFF_EnableFlashProvider;
  5247.                if (EBG.adaptor.browser.isEdge() && !a.isInstream) return !0
  5248.            }
  5249.            return !1
  5250.        },
  5251.        FFVisibilityProvider: function(a) {
  5252.            return a.actualServingMode == EBG.Adaptors.ServingMode.IFRAME && EBG.isDefined(window.mozInnerScreenY) && EBG.isDefined(window.mozInnerScreenX)
  5253.        },
  5254.        GridVisibilityProvider: function() {
  5255.            var a = !1,
  5256.                b = EBG.adaptor.browser.getDocumentMode() || 5;
  5257.            EBG.adaptor.browser.isIE() && 10 < b && (a = !0);
  5258.            return a
  5259.        },
  5260.        MouseVisibilityProvider: function() {
  5261.            var a = !1,
  5262.                b = EBG.adaptor.browser.getDocumentMode() || 5;
  5263.            EBG.adaptor.browser.isIE() && 11 > b && 11 > EBG.adaptor.browser._browserVer &&
  5264.                (a = !0);
  5265.            return a
  5266.        },
  5267.        SafeFrameVisibilityProvider: function() {
  5268.            return !!EBG.adaptor.isSafeFrame()
  5269.        },
  5270.        MraidVisibilityProvider: function(a) {
  5271.            var b = a.actualServingMode == EBG.Adaptors.ServingMode.IFRAME;
  5272.            return a.ffs.CFF_MRAIDVis && EBG.adaptor.isInApp() && !b ? (a.UiVz = !1, !0) : !1
  5273.        }
  5274.    },
  5275.    _init: function() {
  5276.        this._visibilityProvider = new EBG.RichModules[this._visibilityProviderName](this._resObjId, this._adConfig, this._options);
  5277.        this._dpm.send(EBG.DataProfile.VISIBILITY, {
  5278.            vsr: 1,
  5279.            vsbp: this.getVisibilityProviderNum()
  5280.        });
  5281.        this._initializeVisibilityData();
  5282.        this._subscribeToEvents();
  5283.        this._visRecordable = !0;
  5284.        this._adConfig.ffs.VisInstantReportRec && this._reportVisibilityRecordable();
  5285.        var a = function() {
  5286.            this._adConfig.ffs.VisInstantReportRec || this._reportVisibilityRecordable();
  5287.            this._visibilityProvider.start()
  5288.        };
  5289.        this.adConfig.adStarted ? a.apply(this) : (a = new EBG.Events.EventSubscription(EBG.Events.EventNames.AD_START, a, this), a.timing = EBG.Events.EventTiming.ONTIME, EBG.eventMgr.subscribeToEvent(a))
  5290.    },
  5291.    _createIntMgrWrapper: function() {
  5292.        var a = function() {};
  5293.        this._intMgrWrapper = {};
  5294.        for (var b = ["handleCounterInteraction", "updateTimer", "startTimer", "stopTimer", "clearTimer"], c = 0; c < b.length; c++) this._intMgrWrapper[b[c]] = this._options.muteInteractions ? a : EBG.intMgr[b[c]].bind(EBG.intMgr)
  5295.    },
  5296.    checkVisibility: function(a) {
  5297.        a = a ? EBG.cloneObj(a) : {};
  5298.        if (!EBG.isDefined(a.percentage) || !EBG.isNumber(a.percentage)) a.percentage = this.calculateVisibilityPercentage();
  5299.        if (EBG.isDefinedNotNull(a.percentage) && 0 <= a.percentage) {
  5300.            if (!("viewPort" in a)) a.viewPort = this.getViewPortMetrics();
  5301.            if (this._adCoveragePercentage) a.percentage =
  5302.                Math.max(a.percentage - this._adCoveragePercentage, 0);
  5303.            this._res = EBG.adaptor.getElementById(this._resObjId);
  5304.            this.adConfig.visibility.mode == EBG.VisibilityMode.ENHANCED_MODE && this._calculateAverages(a);
  5305.            for (var b in EBG.RichModules.VisibilityManager.ThreholdType) EBG.RichModules.VisibilityManager.ThreholdType.hasOwnProperty(b) && this._visibilityData[EBG.RichModules.VisibilityManager.ThreholdType[b]] && this._visibilityData[EBG.RichModules.VisibilityManager.ThreholdType[b]].isActive && this._execCheckVisibility(a.percentage,
  5306.                EBG.RichModules.VisibilityManager.ThreholdType[b])
  5307.        }
  5308.    },
  5309.    updateResourceObjId: function(a) {
  5310.        if (this._visibilityProvider && a) this._collectTimersHandler(), this._resObjId = a, this._res = EBG.adaptor.getElementById(a), this._visibilityProvider.updateResourceObjId(a)
  5311.    },
  5312.    _shouldInitialize: function() {
  5313.        var a = EBG.Initializer._getAdClass({
  5314.            tn: this.adConfig.templateName
  5315.        });
  5316.        return this.adConfig.actualServingMode == EBG.Adaptors.ServingMode.IFRAME && !a.requiresIframeBust && this.adConfig.UiVz && (!this.adConfig.ffs.CFF_MRAIDVis || !EBG.adaptor.isInApp()) ?
  5317.            (this.adConfig.visibility.mode == EBG.VisibilityMode.DEFAULT_MODE ? this._dpm.send(EBG.DataProfile.VISIBILITY, {
  5318.                uvsr: 1
  5319.            }) : this._dpm.send(EBG.DataProfile.VISIBILITY, {
  5320.                uvsr: 2
  5321.            }), !1) : !0
  5322.    },
  5323.    _getVisibilityProvider: function(a, b) {
  5324.        for (var c = 0; c < this._availableVisibilityProviders.length; c++) {
  5325.            var d = this._availableVisibilityProviders[c];
  5326.            if (this._providersAvailability[d] && this._providersAvailability[d](b)) return d
  5327.        }
  5328.        return null
  5329.    },
  5330.    calculateVisibilityPercentage: function(a, b, c, d, e, f, g) {
  5331.        var h = 0;
  5332.        EBG.adaptor.isPageVisible(this.adConfig.isInstream) ?
  5333.            this._visibilityProvider && (h = this._visibilityProvider._calculateVisibilityPercentage({
  5334.                resourceObjId: a,
  5335.                width: b,
  5336.                height: c,
  5337.                offsetX: d,
  5338.                offsetY: e,
  5339.                isUIVZ: f,
  5340.                actualServingMode: g
  5341.            })) : h = 0;
  5342.        return h
  5343.    },
  5344.    isVisibile: function(a, b, c) {
  5345.        var d = !1;
  5346.        if (EBG.adaptor.isPageVisible(this.adConfig.isInstream) && this._visibilityProvider) try {
  5347.            d = !!this._visibilityProvider._isVisible({
  5348.                resourceObjId: a,
  5349.                width: b,
  5350.                height: c
  5351.            })
  5352.        } catch (e) {}
  5353.        return d
  5354.    },
  5355.    getViewPortMetrics: function() {
  5356.        var a = null;
  5357.        this._visibilityProvider && (a = this._visibilityProvider._getViewPortMetrics());
  5358.        return a
  5359.    },
  5360.    _subscribeToEvents: function() {
  5361.        try {
  5362.            var a = new EBG.Events.EventSubscription(EBG.Events.EventNames.VISIBILITY_CHECK, this._visibilityCheckHandler, this);
  5363.            a.dispatcherFilters = {
  5364.                "adConfig.rnd": this.adConfig.rnd
  5365.            };
  5366.            a.timing = EBG.Events.EventTiming.ONTIME;
  5367.            EBG.eventMgr.subscribeToEvent(a);
  5368.            if (this.adConfig.visibility.mode == EBG.VisibilityMode.ENHANCED_MODE) a = new EBG.Events.EventSubscription(EBG.Events.EventNames.COLLECT_TIMERS, this._collectTimersHandler, this), a.timing = EBG.Events.EventTiming.BEFORE, EBG.eventMgr.subscribeToEvent(a);
  5369.            var b = new EBG.Events.EventSubscription(EBG.Events.EventNames.PAGE_HIDDEN, this._stopTimersHandler, this);
  5370.            b.isDocumentEvent = !0;
  5371.            EBG.eventMgr.subscribeToEvent(b);
  5372.            b = new EBG.Events.EventSubscription(EBG.Events.EventNames.VISIBILITY_HIDDEN, this._stopTimersHandler, this);
  5373.            EBG.eventMgr.subscribeToEvent(b);
  5374.            b = new EBG.Events.EventSubscription(this._isPanel ? "P" : "" + EBG.Events.EventNames.AD_STACKING, this._adStackingHandler, this);
  5375.            b.dispatcherFilters = {
  5376.                "_adConfig.rnd": this.adConfig.rnd
  5377.            };
  5378.            EBG.eventMgr.subscribeToEvent(b);
  5379.            b = new EBG.Events.EventSubscription(EBG.Events.EventNames.EXPAND, function(a) {
  5380.                (a.eventData == this.adConfig.panelName || a.eventData.props && a.eventData.props.asset.id == this._resObjId || a.eventData.props && a.eventData.props.panel.id == this._resObjId) && this.checkVisibility()
  5381.            }, this);
  5382.            b.dispatcherFilters = {
  5383.                "_adConfig.rnd": this.adConfig.rnd
  5384.            };
  5385.            b.timing = EBG.Events.EventTiming.AFTER;
  5386.            EBG.eventMgr.subscribeToEvent(b);
  5387.            b.timing = EBG.Events.EventTiming.BEFORE;
  5388.            EBG.eventMgr.subscribeToEvent(b);
  5389.            b = new EBG.Events.EventSubscription(EBG.Events.EventNames.COLLAPSE,
  5390.                function(a) {
  5391.                    (a.eventData == this.adConfig.panelName || a.eventData.props && a.eventData.props.asset.id == this._resObjId || a.eventData.props && a.eventData.props.panel.id == this._resObjId) && this.stopMeasureVisibility()
  5392.                }, this);
  5393.            b.timing = EBG.Events.EventTiming.BEFORE;
  5394.            b.dispatcherFilters = {
  5395.                "_adConfig.rnd": this.adConfig.rnd
  5396.            };
  5397.            EBG.eventMgr.subscribeToEvent(b)
  5398.        } catch (c) {}
  5399.    },
  5400.    _adStackingHandler: function(a) {
  5401.        this._adCoveragePercentage = a.eventData.percentage;
  5402.        this.checkVisibility()
  5403.    },
  5404.    _visibilityCheckHandler: function(a) {
  5405.        EBG.isDefined(a) &&
  5406.            EBG.isDefined(a.eventData) && a.dispatcher === this._visibilityProvider && this.checkVisibility(a.eventData)
  5407.    },
  5408.    _initializeVisibilityData: function() {
  5409.        this._visibilityData = [];
  5410.        this._visibilityData[EBG.RichModules.VisibilityManager.ThreholdType.IAB] = {
  5411.            minSurface: this.adConfig.visibility.iabMinSurface,
  5412.            minDuration: this.adConfig.visibility.iabMinDuration,
  5413.            minLargeSurface: this.adConfig.visibility.iabMinLargeSurface,
  5414.            minLargeDuration: this.adConfig.visibility.iabMinLargeDuration,
  5415.            visibilityInteraction: this._adjustPanelIntName(EBG.Interactions.SystemInts.VISIBILITY_IAB),
  5416.            durationInteraction: null,
  5417.            isActive: this.adConfig.visibility.mode != EBG.VisibilityMode.DEFAULT_MODE,
  5418.            durationNeeded: !1,
  5419.            timeOutFlag: null,
  5420.            reported: !1
  5421.        };
  5422.        this._visibilityData[EBG.RichModules.VisibilityManager.ThreholdType.Agency] = {
  5423.            minSurface: this.adConfig.visibility.agencyMinSurface,
  5424.            minDuration: this.adConfig.visibility.agencyMinDuration,
  5425.            visibilityInteraction: this._adjustPanelIntName(EBG.Interactions.SystemInts.VISIBILITY_AGENCY),
  5426.            durationInteraction: this._adjustPanelIntName(EBG.Interactions.SystemInts.VISIBILITY_AGENCY_DURATION),
  5427.            isActive: this.adConfig.visibility.mode != EBG.VisibilityMode.DEFAULT_MODE && !!this.adConfig.visibility.agencyMinDuration,
  5428.            durationNeeded: this.adConfig.visibility.mode == EBG.VisibilityMode.ENHANCED_MODE && !!this.adConfig.visibility.agencyMinDuration,
  5429.            timeOutFlag: null,
  5430.            reported: !1
  5431.        };
  5432.        this._visibilityData[EBG.RichModules.VisibilityManager.ThreholdType.Advertiser] = {
  5433.            minSurface: this.adConfig.visibility.advertiserMinSurface,
  5434.            minDuration: this.adConfig.visibility.advertiserMinDuration,
  5435.            visibilityInteraction: this._adjustPanelIntName(EBG.Interactions.SystemInts.VISIBILITY_ADVERTISER),
  5436.            durationInteraction: this._adjustPanelIntName(EBG.Interactions.SystemInts.VISIBILITY_ADVERTISER_DURATION),
  5437.            isActive: this.adConfig.visibility.mode == EBG.VisibilityMode.ENHANCED_MODE && !this._isPanel && !!this.adConfig.visibility.advertiserMinDuration,
  5438.            durationNeeded: this.adConfig.visibility.mode == EBG.VisibilityMode.ENHANCED_MODE && !!this.adConfig.visibility.advertiserMinDuration,
  5439.            timeOutFlag: null,
  5440.            reported: !1
  5441.        }
  5442.    },
  5443.    _adjustPanelIntName: function(a) {
  5444.        return this._isPanel ? "P" + a : a
  5445.    },
  5446.    _isLargeBanner: function() {
  5447.        var a = EBG.adaptor.getBoundingClientRect(this._res, {
  5448.            clip: !0
  5449.        });
  5450.        return 242500 <= a.width * a.height
  5451.    },
  5452.    _execCheckVisibility: function(a, b) {
  5453.        try {
  5454.            var c, d, e = this._visibilityData[b];
  5455.            e.minLargeSurface && this._isLargeBanner() ? (c = e.minLargeSurface, d = e.minLargeDuration) : (c = e.minSurface, d = e.minDuration);
  5456.            a >= c ? !e.reported && !e.timeOutFlag ? e.timeOutFlag = EBG.runTimed(this, function() {
  5457.                e.timeOutFlag = null;
  5458.                this._dpm.send(EBG.DataProfile.VISIBILITY, {
  5459.                    vsiab: 1
  5460.                });
  5461.                this._intMgrWrapper.handleCounterInteraction(e.visibilityInteraction, this.adConfig.uid);
  5462.                e.durationNeeded && e.durationInteraction &&
  5463.                    (this._intMgrWrapper.updateTimer(e.durationInteraction, this.adConfig.uid, d), this._intMgrWrapper.startTimer(e.durationInteraction, this.adConfig.uid));
  5464.                e.reported = !0
  5465.            }, [], 1E3 * d) : e.reported && e.durationNeeded && e.durationInteraction && this._intMgrWrapper.startTimer(e.durationInteraction, this.adConfig.uid) : (this._dpm.send(EBG.DataProfile.VISIBILITY, {
  5466.                uvsiab: 1
  5467.            }), this._stopDurationTimeout(b), e.durationInteraction && this._stopDurationCounting(b))
  5468.        } catch (f) {}
  5469.    },
  5470.    _stopDurationTimeout: function(a) {
  5471.        if (this._visibilityData[a].timeOutFlag) clearTimeout(this._visibilityData[a].timeOutFlag),
  5472.            this._visibilityData[a].timeOutFlag = null
  5473.    },
  5474.    _stopDurationCounting: function(a) {
  5475.        this._visibilityData[a].durationNeeded && this._visibilityData[a].durationInteraction && this._intMgrWrapper.stopTimer(this._visibilityData[a].durationInteraction, this.adConfig.uid)
  5476.    },
  5477.    _reportVisibilityRecordable: function() {
  5478.        var a = this.adConfig.visibility.mode == EBG.VisibilityMode.BASIC_MODE || this.adConfig.visibility.mode == EBG.VisibilityMode.ENHANCED_MODE;
  5479.        a && this.adConfig.visibility.iabMinDuration && (this._intMgrWrapper.handleCounterInteraction(this._adjustPanelIntName(EBG.Interactions.SystemInts.VISIBILITY_RECORDABLE),
  5480.            this.adConfig.uid), this._dpm.send(EBG.DataProfile.VISIBILITY, {
  5481.            vsri: 1
  5482.        }));
  5483.        a && this.adConfig.visibility.agencyMinDuration && this._intMgrWrapper.handleCounterInteraction(this._adjustPanelIntName(EBG.Interactions.SystemInts.VISIBILITY_AGENCY_RECORDABLE), this.adConfig.uid);
  5484.        this.adConfig.visibility.mode == EBG.VisibilityMode.ENHANCED_MODE && !this._isPanel && this.adConfig.visibility.advertiserMinDuration && this._intMgrWrapper.handleCounterInteraction(this._adjustPanelIntName(EBG.Interactions.SystemInts.VISIBILITY_ADVERTISER_RECORDABLE),
  5485.            this.adConfig.uid)
  5486.    },
  5487.    _collectTimersHandler: function() {
  5488.        this._intMgrWrapper.clearTimer(this._adjustPanelIntName(EBG.Interactions.SystemInts.VISIBILITY_AVG_AD_SURFACE), this.adConfig.uid);
  5489.        this._intMgrWrapper.clearTimer(this._adjustPanelIntName(EBG.Interactions.SystemInts.VISIBILITY_AVG_SCREEN_SHARE), this.adConfig.uid);
  5490.        this._calculateAverages({
  5491.            percentage: this._lastVisPercentage,
  5492.            viewPort: this._visibilityProvider._getViewPortMetrics()
  5493.        });
  5494.        this._intMgrWrapper.updateTimer(this._adjustPanelIntName(EBG.Interactions.SystemInts.VISIBILITY_AVG_AD_SURFACE),
  5495.            this.adConfig.uid, this._averageVisibility);
  5496.        this._intMgrWrapper.updateTimer(this._adjustPanelIntName(EBG.Interactions.SystemInts.VISIBILITY_AVG_SCREEN_SHARE), this.adConfig.uid, this._averageScreenShare)
  5497.    },
  5498.    _stopTimersHandler: function() {
  5499.        for (var a in EBG.RichModules.VisibilityManager.ThreholdType) EBG.RichModules.VisibilityManager.ThreholdType.hasOwnProperty(a) && this._visibilityData[EBG.RichModules.VisibilityManager.ThreholdType[a]] && this._visibilityData[EBG.RichModules.VisibilityManager.ThreholdType[a]].isActive &&
  5500.            (this._stopDurationTimeout(EBG.RichModules.VisibilityManager.ThreholdType[a]), this._stopDurationCounting(EBG.RichModules.VisibilityManager.ThreholdType[a]))
  5501.    },
  5502.    stopMeasureVisibility: function() {
  5503.        this._collectTimersHandler();
  5504.        if (this._adConfig.ffs.CFF_PanelVisResetOnCollapse) this._lastVisPercentage = 0;
  5505.        this._stopTimersHandler()
  5506.    },
  5507.    getVisibilityProviderNum: function() {
  5508.        var a = {
  5509.            None: 0,
  5510.            Geometric: 1,
  5511.            SafeFrame: 2,
  5512.            Mouse: 3,
  5513.            Grid: 4,
  5514.            Flash: 5,
  5515.            FF: 6,
  5516.            Mraid: 7,
  5517.            AddingEye: 8,
  5518.            Basic: 9
  5519.        };
  5520.        return this._visibilityProvider ? a[this._visibilityProvider.name] ||
  5521.            -1 : a.None
  5522.    },
  5523.    _calculateAverages: function(a) {
  5524.        var b = (new Date).getTime() - this._averageLastCalcTime;
  5525.        if (1E3 < b && 0 < this._lastVisPercentage) {
  5526.            this._averageVisibility = (this._averageVisibility * this._averageAdDuration + this._lastVisPercentage * b) / (this._averageAdDuration + b);
  5527.            if (this._lastVisViewPort && this._lastVisViewPort.Width && this._lastVisViewPort.Height) {
  5528.                var c = this._lastVisViewPort.Width * this._lastVisViewPort.Height,
  5529.                    d = EBG.adaptor.getBoundingClientRect(this._res, {
  5530.                        clip: !0
  5531.                    }) || {
  5532.                        width: 0,
  5533.                        height: 0
  5534.                    };
  5535.                this._averageScreenShare =
  5536.                    (this._averageScreenShare * this._averageAdDuration + 100 * (this._lastVisPercentage * (d ? d.width * d.height : 0) / 100 / c) * b) / (this._averageAdDuration + b)
  5537.            }
  5538.            this._averageAdDuration += b
  5539.        }
  5540.        this._lastVisPercentage = a.percentage;
  5541.        this._lastVisViewPort = a.viewPort;
  5542.        this._averageLastCalcTime = (new Date).getTime()
  5543.    }
  5544. };
  5545. EBG.declareClass(EBG.RichModules.VisibilityManager, null);
  5546. EBG.declareNamespace("RichModules");
  5547. EBG.RichModules.Animator = function(a) {
  5548.    this._adConfig = a
  5549. };
  5550. EBG.RichModules.Animator = function() {
  5551.    EBG.setInterval(this, this._watchElementPolling, [], 100)
  5552. };
  5553. EBG.RichModules.Animator.prototype = {
  5554.    _adaptiveProperties: "top,left,bottom,right,width,height,clip,opacity".split(","),
  5555.    _clipRegex: /rect\((.*?)px(.*?)px(.*?)px(.*?)px\)/g,
  5556.    _animatingElements: {},
  5557.    _watchedElementsList: [],
  5558.    EasingFunctions: {
  5559.        linear: function(a) {
  5560.            return a
  5561.        },
  5562.        easeInQuad: function(a) {
  5563.            return a * a
  5564.        },
  5565.        easeOutQuad: function(a) {
  5566.            return a * (2 - a)
  5567.        },
  5568.        easeInOutQuad: function(a) {
  5569.            return 0.5 > a ? 2 * a * a : -1 + (4 - 2 * a) * a
  5570.        },
  5571.        easeInCubic: function(a) {
  5572.            return a * a * a
  5573.        },
  5574.        easeOutCubic: function(a) {
  5575.            return --a * a * a + 1
  5576.        },
  5577.        easeInOutCubic: function(a) {
  5578.            return 0.5 >
  5579.                a ? 4 * a * a * a : (a - 1) * (2 * a - 2) * (2 * a - 2) + 1
  5580.        },
  5581.        easeInQuart: function(a) {
  5582.            return a * a * a * a
  5583.        },
  5584.        easeOutQuart: function(a) {
  5585.            return 1 - --a * a * a * a
  5586.        },
  5587.        easeInOutQuart: function(a) {
  5588.            return 0.5 > a ? 8 * a * a * a * a : 1 - 8 * --a * a * a * a
  5589.        },
  5590.        easeInQuint: function(a) {
  5591.            return a * a * a * a * a
  5592.        },
  5593.        easeOutQuint: function(a) {
  5594.            return 1 + --a * a * a * a * a
  5595.        },
  5596.        easeInOutQuint: function(a) {
  5597.            return 0.5 > a ? 16 * a * a * a * a * a : 1 + 16 * --a * a * a * a * a
  5598.        }
  5599.    },
  5600.    TransitionEasing: {
  5601.        ease: "ease",
  5602.        linear: "linear",
  5603.        easeIn: "ease-in",
  5604.        easeOut: "ease-out",
  5605.        easeInOut: "ease-in-out"
  5606.    },
  5607.    animate: function(a, b, c, d) {
  5608.        if (a && b) {
  5609.            if (EBG.isDefined(b.delay)) {
  5610.                var e =
  5611.                    b.delay,
  5612.                    b = EBG.cloneObj(b);
  5613.                delete b.delay;
  5614.                b.animationId = b.animationId || Date.now();
  5615.                EBG.runTimed(this, this.animate, [a, b, c, d], e);
  5616.                return b.animationId
  5617.            }
  5618.            if (EBG.isArray(a)) {
  5619.                for (var f = [], e = 0; e < a.length; e++) f.push(this.animate(a[e], b, c, d));
  5620.                return f
  5621.            }
  5622.            a.id && this._animatingElements[a.id] && b.abortPrevious && this.abortAllElementAnimations(a.id);
  5623.            var f = this._getOriginalValues(a),
  5624.                g = b.animationId || Date.now();
  5625.            if (b.init && EBG.isObj(b.init)) {
  5626.                var e = this._adaptProperties(f, b.init),
  5627.                    h;
  5628.                for (h in e) f[h] = this._recalculateProperyValue(h,
  5629.                    e[h], f, 1)
  5630.            }
  5631.            if (b.reverse)
  5632.                for (var i = EBG.cloneObj(f), j = this._adaptProperties(i, b), e = 0; e < this._adaptiveProperties.length; e++) {
  5633.                    h = this._adaptiveProperties[e];
  5634.                    var k = j[h];
  5635.                    EBG.isDefined(k) && (f[h] = this._recalculateProperyValue(h, k, i, 1), b[h] = i[h])
  5636.                }
  5637.            if (EBG.isObj(f))
  5638.                for (h in f)
  5639.                    if (EBG.isDefined(b[h]) || b.init && EBG.isDefined(b.init[h])) a.style[h] = this._adjustStyle(h, f[h]);
  5640.            this._shouldUseTransitionAnimation(a, f, b) ? this._CSSAnimate(g, a, f, b, c, d) : this._JSAnimate(g, a, f, b, c, d);
  5641.            return g
  5642.        }
  5643.    },
  5644.    _JSAnimate: function(a, b, c, d, e, f) {
  5645.        var g =
  5646.            this._createAnimationRecord(b.id, a, d),
  5647.            h, i, j = new EBG.Events.Event(EBG.Events.EventNames.ANIMATION);
  5648.        j.dispatcher = {
  5649.            animationId: a,
  5650.            module: this
  5651.        };
  5652.        j.eventData = {
  5653.            customData: d.customData || {},
  5654.            element: b,
  5655.            elementId: b.id,
  5656.            style: EBG.cloneObj(c),
  5657.            finished: !1,
  5658.            aborted: !1,
  5659.            time: 0,
  5660.            animationId: a,
  5661.            loop: !!d.loop
  5662.        };
  5663.        j.timing = EBG.Events.EventTiming.BEFORE;
  5664.        if (EBG.eventMgr.dispatchEvent(j)) this.abort(a, b.id);
  5665.        else {
  5666.            d.alignToElement && this._watchElement(d.alignToElement, g, function(a, e, f) {
  5667.                c.left += f.left - e.left;
  5668.                c.top += f.top - e.top;
  5669.                for (var e = ["top", "left"], f = {}, g = 0; g < e.length; g++) {
  5670.                    var i = e[g];
  5671.                    EBG.isDefined(d[i]) ? (f[i] = this._recalculateProperyValue(i, d[i], c, l(h)), b.style[i] = this._adjustStyle(i, f[i])) : b.style[i] = this._adjustStyle(i, c[i])
  5672.                }
  5673.                a.styleChange = f
  5674.            }, this);
  5675.            g.isRunning = !0;
  5676.            var k = Date.now(),
  5677.                m = EBG.isDefined(d.duration) ? d.duration : 1E3,
  5678.                l = d.easing ? EBG.isFunc(d.easing) ? d.easing : this.EasingFunctions[d.easing] || this.EasingFunctions[this._transitionToJSEasing(d.easing)] || this.EasingFunctions.linear : this.EasingFunctions.linear,
  5679.                p = this,
  5680.                n = !!d.loop,
  5681.                r = 1E3 / (d.fps || 48),
  5682.                q = d.alignToElement,
  5683.                d = this._adaptProperties(c, d);
  5684.            g.styleProps = d;
  5685.            g.origin = c;
  5686.            (function() {
  5687.                i = Date.now() - k;
  5688.                h = i / (m || 1);
  5689.                var o = {};
  5690.                h = Math.min(h, 1);
  5691.                for (var s in d) o[s] = p._recalculateProperyValue(s, d[s], c, l(h)), b.style[s] = p._adjustStyle(s, o[s]);
  5692.                EBG.mergeObj(c, o, !1);
  5693.                j.eventData = {
  5694.                    customData: d.customData || {},
  5695.                    element: b,
  5696.                    elementId: b.id,
  5697.                    style: EBG.cloneObj(o),
  5698.                    finished: 1 === h,
  5699.                    aborted: !!g.abort,
  5700.                    time: i,
  5701.                    animationId: a,
  5702.                    loop: !!d.loop,
  5703.                    alignedStyle: g.alignedStyle
  5704.                };
  5705.                j.timing = EBG.Events.EventTiming.ONTIME;
  5706.                EBG.eventMgr.dispatchEvent(j) &&
  5707.                    p.abort(a, b.id);
  5708.                1 > h && !g.abort ? setTimeout(arguments.callee, r) : (j.timing = EBG.Events.EventTiming.AFTER, j.eventData.aborted = g.abort, EBG.eventMgr.dispatchEvent(j), q && p._unwatchElement(q), n && !g.abort ? (k = Date.now(), setTimeout(arguments.callee, r)) : (g.isRunning = !1, e && setTimeout(function() {
  5709.                    e.apply(f || p, [b, o])
  5710.                }, 1)))
  5711.            })()
  5712.        }
  5713.    },
  5714.    _CSSAnimate: function(a, b, c, d, e, f) {
  5715.        var g = this._createAnimationRecord(b.id, a, d);
  5716.        g.isCSSAnimation = !0;
  5717.        var h = new EBG.Events.Event(EBG.Events.EventNames.ANIMATION);
  5718.        h.dispatcher = {
  5719.            animationId: a,
  5720.            module: this
  5721.        };
  5722.        h.eventData = {
  5723.            customData: d.customData || {},
  5724.            element: b,
  5725.            elementId: b.id,
  5726.            style: EBG.cloneObj(c),
  5727.            finished: !1,
  5728.            aborted: !1,
  5729.            time: 0,
  5730.            animationId: a,
  5731.            loop: !!d.loop
  5732.        };
  5733.        h.timing = EBG.Events.EventTiming.BEFORE;
  5734.        if (EBG.eventMgr.dispatchEvent(h)) this.abort(a, b.id);
  5735.        else {
  5736.            var i, j, k;
  5737.            d.alignToElement && this._watchElement(d.alignToElement, g, function(a, e, f) {
  5738.                b.style[this._getTransitionPropertyName()] = "";
  5739.                this.a = b.offsetHeight;
  5740.                c.left += f.left - e.left;
  5741.                c.top += f.top - e.top;
  5742.                k = this._adaptProperties(c, d);
  5743.                a.styleProps = k;
  5744.                for (var g in f) ~"topleftbottomright".indexOf(g) &&
  5745.                    (~EBG.indexOfArray(k, g) || (b.style[g] = this._adjustStyle(g, parseInt(b.style[g] || "0", 10) + Math.round(f[g]) - Math.round(e[g]))));
  5746.                a = "";
  5747.                for (e = 0; e < l.length; e++) a += (e ? ", " : "") + l[e] + " " + (m - j) + "ms " + q;
  5748.                b.style[p] = a;
  5749.                this._setElementEndStyle(b, c, k)
  5750.            }, this);
  5751.            g.isRunning = !0;
  5752.            var m = EBG.isDefined(d.duration) ? d.duration : 1E3,
  5753.                l = EBG.filterArray(this._adaptiveProperties, function(a) {
  5754.                    return EBG.isDefined(d[a])
  5755.                }),
  5756.                p = this._getTransitionPropertyName(),
  5757.                n = this,
  5758.                r = !!d.loop,
  5759.                q = d.easing ? this.TransitionEasing[d.easing] : this.TransitionEasing.ease,
  5760.                o = 1E3 / (d.fps || 48);
  5761.            this.a = b.offsetHeight;
  5762.            for (var s = "", t = 0; t < l.length; t++) s += (t ? ", " : "") + l[t] + " " + m + "ms " + q;
  5763.            b.style[p] = s;
  5764.            k = this._adaptProperties(c, d);
  5765.            g.styleProps = k;
  5766.            g.origin = c;
  5767.            this._setElementEndStyle(b, c, k);
  5768.            var u = Date.now();
  5769.            (function() {
  5770.                j = Date.now() - u;
  5771.                i = j / (m || 1);
  5772.                i = Math.min(i, 1);
  5773.                for (var k = {}, l = EBG.adaptor.getComputedStyle(b), p = 0; p < n._adaptiveProperties.length; p++) {
  5774.                    var q = n._adaptiveProperties[p];
  5775.                    k[q] = "clip" == q ? l[q] : 1 * l[q].replace(/[^\d\.\-]/g, "")
  5776.                }
  5777.                EBG.mergeObj(c, k, !1);
  5778.                h.eventData = {
  5779.                    customData: d.customData || {},
  5780.                    element: b,
  5781.                    elementId: b.id,
  5782.                    style: EBG.cloneObj(k),
  5783.                    finished: 1 === i,
  5784.                    aborted: !!g.abort,
  5785.                    time: j,
  5786.                    animationId: a,
  5787.                    loop: r,
  5788.                    alignedStyle: g.alignedStyle
  5789.                };
  5790.                h.timing = EBG.Events.EventTiming.ONTIME;
  5791.                EBG.eventMgr.dispatchEvent(h) && n.abort(a, b.id);
  5792.                if (1 > i && !g.abort) setTimeout(arguments.callee, o);
  5793.                else if (h.timing = EBG.Events.EventTiming.AFTER, h.eventData.aborted = g.abort, EBG.eventMgr.dispatchEvent(h), d.alignToElement && n._unwatchElement(d.alignToElement), b.style[n._getTransitionPropertyName()] = "", g.isRunning = !1, e && setTimeout(function() {
  5794.                        e.apply(f ||
  5795.                            n, [b, k])
  5796.                    }, 1), r && !g.abort) {
  5797.                    n.a = b.offsetHeight;
  5798.                    for (q in c) q in d && (b.style[q] = n._adjustStyle(q, c[q]));
  5799.                    EBG.runTimed(n, n._CSSAnimate, [a, b, c, d], 0)
  5800.                }
  5801.            })()
  5802.        }
  5803.    },
  5804.    _setElementEndStyle: function(a, b, c) {
  5805.        for (var d in c) a.style[d] = this._adjustStyle(d, this._recalculateProperyValue(d, c[d], b, 1))
  5806.    },
  5807.    _shouldUseTransitionAnimation: function(a, b, c) {
  5808.        a = this.supportsCSSTransitions();
  5809.        c = !c.easing || !EBG.isFunc(c.easing) && (c.easing in EBG.Animation.TransitionEasing || /cubic-bezier\(.*?,.*?,.*?,.*?\)/g.test(c.easing));
  5810.        return a && c
  5811.    },
  5812.    _transitionToJSEasing: function(a) {
  5813.        return {
  5814.            ease: EBG.Animation.Easing.easeInOutQuint,
  5815.            linear: EBG.Animation.Easing.linear,
  5816.            easeIn: EBG.Animation.Easing.easeInCubic,
  5817.            easeOut: EBG.Animation.Easing.easeInOutCubic,
  5818.            easeInOut: EBG.Animation.Easing.easeInOutCubic
  5819.        }[a]
  5820.    },
  5821.    _adjustStyle: function(a, b) {
  5822.        return -1 !== "topleftbottomrightwidthheight".indexOf(a) ? b + "px" : b
  5823.    },
  5824.    _isRectCSS: function(a) {
  5825.        this._clipRegex.lastIndex = 0;
  5826.        return this._clipRegex.test(a)
  5827.    },
  5828.    _getRectCSSValues: function(a) {
  5829.        this._clipRegex.lastIndex = 0;
  5830.        return this._clipRegex.exec(a)
  5831.    },
  5832.    _getOriginalValues: function(a) {
  5833.        var b = EBG.adaptor.getBoundingClientRect(a, {
  5834.                clip: !1,
  5835.                relativeToWindow: !0
  5836.            }),
  5837.            a = EBG.adaptor.getComputedStyle(a),
  5838.            c = window.scrollY || document.documentElement && document.documentElement.scrollTop || document.body && document.body.scrollTop || 0,
  5839.            d = window.scrollX || document.documentElement && document.documentElement.scrollLeft || document.body && document.body.scrollLeft || 0;
  5840.        b.top = c + b.top;
  5841.        b.left = d + b.left;
  5842.        b.bottom = c + b.bottom;
  5843.        b.right = d + b.right;
  5844.        b.clip = a.getPropertyValue("clip");
  5845.        b.opacity = 1 * (a.getPropertyValue("opacity") || 1);
  5846.        return b
  5847.    },
  5848.    _recalculateProperyValue: function(a,
  5849.        b, c, d) {
  5850.        switch (a) {
  5851.            case "clip":
  5852.                var e = function(a) {
  5853.                    return 1 * a.trim().replace(",", "")
  5854.                };
  5855.                orignalClip = this._isRectCSS(c[a]) ? this._getRectCSSValues(c[a]) : this._getRectCSSValues("rect(0px," + c.width + "px," + c.height + "px,0px)");
  5856.                clip = this._getRectCSSValues(b);
  5857.                return "rect(" + (e(orignalClip[1]) + e(clip[1]) * d) + "px," + ("" + (e(orignalClip[2]) + e(clip[2]) * d)) + "px," + ("" + (e(orignalClip[3]) + e(clip[3]) * d)) + "px," + ("" + (e(orignalClip[4]) + e(clip[4]) * d)) + "px)";
  5858.            default:
  5859.                return c[a] + b * d
  5860.        }
  5861.    },
  5862.    _adaptProperties: function(a, b) {
  5863.        res = {};
  5864.        for (var c =
  5865.                EBG.filterArray(this._adaptiveProperties, function(a) {
  5866.                    return EBG.isDefined(b[a])
  5867.                }), d = 0; d < c.length; d++) {
  5868.            var e = c[d],
  5869.                f = b[e];
  5870.            if ("clip" === e) {
  5871.                var g = function(a) {
  5872.                        return 1 * a.trim().replace(",", "")
  5873.                    },
  5874.                    h = this._isRectCSS(a[e]) ? this._getRectCSSValues(a[e]) : this._getRectCSSValues("rect(0px," + a.width + "px," + a.height + "px,0px)"),
  5875.                    f = this._isRectCSS(f) ? this._getRectCSSValues(f) : h;
  5876.                res[e] = "rect(" + (g(f[1]) - g(h[1])) + "px," + ("" + (g(f[2]) - g(h[2]))) + "px," + ("" + (g(f[3]) - g(h[3]))) + "px," + ("" + (g(f[4]) - g(h[4]))) + "px)"
  5877.            } else "string" === EBG.typeOf(f) ?
  5878.                1 < f.length && "=" == f.charAt(1) ? res[e] = f.substr(2).replace(/[^\d\.\-]/g, "") * ("+" === f.charAt(0) ? 1 : -1) : (f = 1 * f.replace(/[^\d\.\-]/g, ""), res[e] = f - a[e]) : res[e] = f - a[e]
  5879.        }
  5880.        return res
  5881.    },
  5882.    isAnimating: function(a) {
  5883.        if (a = this._animatingElements[a])
  5884.            for (var b in a)
  5885.                if (a[b].isRunning) return !0;
  5886.        return !1
  5887.    },
  5888.    abortAllElementAnimations: function(a) {
  5889.        var b = this._animatingElements[a];
  5890.        if (b)
  5891.            for (var c in b) this.abort(c, a)
  5892.    },
  5893.    getAnimationRecord: function(a, b) {
  5894.        if (!b)
  5895.            for (b in this._animatingElements)
  5896.                if (this._animatingElements[b][a]) break;
  5897.        return b ?
  5898.            this._animatingElements[b][a] : null
  5899.    },
  5900.    abort: function(a, b, c) {
  5901.        c = c || {};
  5902.        if (record = this.getAnimationRecord(a, b)) {
  5903.            record.abort = !0;
  5904.            if (a = EBG.adaptor.getElementById(record.elementId))
  5905.                if (record.isCSSAnimation) {
  5906.                    if (b = this._getOriginalValues(a), a.style[this._getTransitionPropertyName()] = "", this.a = a.offsetHeight, !c.jumpToEndOnAbort && !record.properties.jumpToEndOnAbort)
  5907.                        for (var d in b) EBG.isDefined(record.styleProps[d]) && (a.style[d] = this._adjustStyle(d, b[d]))
  5908.                } else(c.jumpToEndOnAbort || record.properties.jumpToEndOnAbort) &&
  5909.                    this._setElementEndStyle(a, record.origin, record.styleProps);
  5910.            return !0
  5911.        }
  5912.        return !1
  5913.    },
  5914.    _createAnimationRecord: function(a, b, c) {
  5915.        this._animatingElements[a] = this._animatingElements[a] || {};
  5916.        var d = this._animatingElements[a];
  5917.        d[b] = {};
  5918.        d[b].properties = EBG.cloneObj(c);
  5919.        d[b].elementId = a;
  5920.        return d[b]
  5921.    },
  5922.    supportsCSSTransitions: function() {
  5923.        var a = document.createElement("p").style;
  5924.        return "transition" in a || "WebkitTransition" in a || "MozTransition" in a || "msTransition" in a || "OTransition" in a
  5925.    },
  5926.    _getTransitionPropertyName: function() {
  5927.        for (var a =
  5928.                document.createElement("div").style, b = ["webkitTransition", "transition"], c = 0; c < b.length; c++)
  5929.            if (b[c] in a) return b[c]
  5930.    },
  5931.    _watchElementPolling: function() {
  5932.        for (var a = 0; a < this._watchedElementsList.length; a++) {
  5933.            var b = this._watchedElementsList[a],
  5934.                c = EBG.adaptor.getBoundingClientRect(b.element, {
  5935.                    clip: !0,
  5936.                    relativeToWindow: !0
  5937.                });
  5938.            b.record.alignedStyle = c;
  5939.            if (c.left !== b.previousRect.left || c.top !== b.previousRect.top) b.callback && b.callback.apply(b.binding || window, [b.record, b.previousRect, c]), b.previousRect = c
  5940.        }
  5941.    },
  5942.    _watchElement: function(a,
  5943.        b, c, d) {
  5944.        c && this._watchedElementsList.push({
  5945.            element: a,
  5946.            record: b,
  5947.            previousRect: EBG.adaptor.getBoundingClientRect(a, {
  5948.                clip: !0,
  5949.                relativeToWindow: !0
  5950.            }),
  5951.            callback: c,
  5952.            binding: d
  5953.        })
  5954.    },
  5955.    _unwatchElement: function(a) {
  5956.        for (var b = 0; b < this._watchedElementsList.length; b++)
  5957.            if (this._watchedElementsList[b].element == a) {
  5958.                this._watchedElementsList.splice(b, 1);
  5959.                break
  5960.            }
  5961.    }
  5962. };
  5963. EBG.declareNamespace("RichModules");
  5964. EBG.RichModules.AdStackingDetector = function(a, b) {
  5965.    this._adConfig = a;
  5966.    this._isFriendlyIframe = this._adConfig.actualServingMode == EBG.Adaptors.ServingMode.FRIENDLY_IFRAME || this._adConfig.actualServingMode == EBG.Adaptors.ServingMode.TOPMOST_FRIENDLY_IFRAME && window.frameElement;
  5967.    this._isPanel = b;
  5968.    this._elementsIds = [];
  5969.    this._validElementParents = [];
  5970.    this._visibilityEvent = {};
  5971.    if (this._shouldInitialize()) {
  5972.        this._validElementParents.push(a.placeHolderId);
  5973.        EBG.Const.OUTER_DIV && this._validElementParents.push(EBG.Const.OUTER_DIV);
  5974.        var c = new EBG.Events.EventSubscription(EBG.Events.EventNames.VISIBILITY_CHECK, this._handleVisibilityEvent, this);
  5975.        c.dispatcherFilters = {
  5976.            "adConfig.rnd": this._adConfig.rnd
  5977.        };
  5978.        c.timing = EBG.Events.EventTiming.ONTIME;
  5979.        EBG.eventMgr.subscribeToEvent(c);
  5980.        this._adConfig.adStarted ? this._start() : (c = new EBG.Events.EventSubscription(EBG.Events.EventNames.AD_START, function() {
  5981.            this._start()
  5982.        }, this), c.timing = EBG.Events.EventTiming.ONTIME, EBG.eventMgr.subscribeToEvent(c))
  5983.    }
  5984. };
  5985. EBG.RichModules.AdStackingDetector.prototype = {
  5986.    _interactionThreshold: 100,
  5987.    _analyzeInterval: 200,
  5988.    _densityFactor: 5,
  5989.    _prevPercentage: 0,
  5990.    _minThresholdForAdStacking: 50,
  5991.    _generatePointsGrid: function(a) {
  5992.        for (var b = [], c = (a.height - 2) / this._densityFactor, a = (a.width - 2) / this._densityFactor, d = 0; d <= this._densityFactor; d++)
  5993.            for (var e = 0; e <= this._densityFactor; e++) b.push({
  5994.                x: Math.round(a * d),
  5995.                y: Math.round(c * e)
  5996.            });
  5997.        return b
  5998.    },
  5999.    _handleVisibilityEvent: function(a) {
  6000.        if (~EBGInfra.indexOfArray(this._elementsIds, a.dispatcher._resObjId)) this._visibilityEvent =
  6001.            EBG.cloneObj(a.eventData)
  6002.    },
  6003.    _shouldInitialize: function() {
  6004.        if (this._adConfig.visibility.mode == EBG.VisibilityMode.ENHANCED_MODE && this._adConfig.actualServingMode != EBG.Adaptors.ServingMode.IFRAME) return this._adConfig.actualServingMode == EBG.Adaptors.ServingMode.FRIENDLY_IFRAME && window.parent !== top ? !1 : !0
  6005.    },
  6006.    _start: function() {
  6007.        EBG.setInterval(this, this._analyze, [], this._analyzeInterval)
  6008.    },
  6009.    _analyze: function() {
  6010.        var a = this._calculateConcealmentPercentage();
  6011.        if (!this._adStackingReported && a.visible >= this._interactionThreshold &&
  6012.            this._visibilityEvent.percentage >= this._minThresholdForAdStacking) EBG.intMgr.handleCounterInteraction((this._isPanel ? "P" : "") + EBG.Interactions.SystemInts.AD_STACKING, this._adConfig.uid), this._adStackingReported = !0;
  6013.        if (a.full != this._prevPercentage) {
  6014.            this._prevPercentage = a.full;
  6015.            var b = new EBG.Events.Event(this._isPanel ? "P" : "" + EBG.Events.EventNames.AD_STACKING);
  6016.            b.eventData = {
  6017.                intName: (this._isPanel ? "P" : "") + EBG.Interactions.SystemInts.AD_STACKING,
  6018.                percentage: a.full
  6019.            };
  6020.            b.dispatcher = this;
  6021.            b.timing = EBG.Events.EventTiming.BEFORE;
  6022.            if (!EBG.eventMgr.dispatchEvent(b)) b.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER, EBG.eventMgr.dispatchEvent(b)
  6023.        }
  6024.    },
  6025.    _calculateConcealmentPercentage: function() {
  6026.        var a = {
  6027.            full: 0,
  6028.            visible: 0
  6029.        };
  6030.        try {
  6031.            if (!this._elementsIds.length) return a;
  6032.            var b = EBG.adaptor.serving._getTopFriendlyIframe(this._adConfig.displayWin || EBG.adaptor.getDisplayWin()),
  6033.                c = EBG.adaptor.getElementById(this._assetId),
  6034.                d = EBG.adaptor.getBoundingClientRect(c, {
  6035.                    clip: !0,
  6036.                    relativeToTop: !0
  6037.                });
  6038.            if (!c || !c.offsetWidth || !c.offsetHeight || EBG.isDefined(this._visibilityEvent.assetId) &&
  6039.                this._visibilityEvent.assetId != this._assetId) return a;
  6040.            var e = this._visibilityEvent.visibleRect,
  6041.                c = e || d;
  6042.            if (!c || 0 == c.width || 0 == c.height) return a;
  6043.            this._grid = this._generatePointsGrid(c);
  6044.            for (var f = 0, g = 0; g < this._grid.length; g++) {
  6045.                var h = this._grid[g];
  6046.                h.x += Math.floor(c.left) + 1;
  6047.                h.y += Math.floor(c.top) + 1;
  6048.                var i = b.document.elementFromPoint(h.x, h.y);
  6049.                if (i && (!i.id || -1 == EBG.indexOfArray(this._elementsIds, i.id)))(!this._isFriendlyIframe || i != window.frameElement) && !this._hasValidParent(i) && !this._isElementTransparent(i) &&
  6050.                    f++
  6051.            }
  6052.            var j = e ? e.width * e.height / (d.width * d.height) : 1,
  6053.                k = Math.round(100 * (f / this._grid.length));
  6054.            return {
  6055.                full: Math.ceil(k * j),
  6056.                visible: k
  6057.            }
  6058.        } catch (m) {
  6059.            return a
  6060.        }
  6061.    },
  6062.    addElementId: function(a, b) {
  6063.        if (-1 == EBGInfra.indexOfArray(this._elementsIds, a) && (this._elementsIds.push(a), b)) this._assetId = a, this._visibilityEvent = {}
  6064.    },
  6065.    _invisibleProperties: {
  6066.        visibility: "hidden",
  6067.        display: "none",
  6068.        opacity: function(a) {
  6069.            return 0 == 1 * a
  6070.        },
  6071.        "-moz-opacity": function(a) {
  6072.            return EBG.adaptor.browser.isFF() && 0 == 1 * a
  6073.        },
  6074.        "-khtml-opacity": function(a) {
  6075.            return EBG.adaptor.browser.isSafari() &&
  6076.                0 == 1 * a
  6077.        },
  6078.        filter: function(a) {
  6079.            return EBG.adaptor.browser.isIE() && 10 > EBG.adaptor.browser.getVersion() && -1 != EBG.indexOfArray(["alpha(opacity=0)", "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"], a)
  6080.        },
  6081.        "background-color": function(a, b, c) {
  6082.            var d = function(a) {
  6083.                    var b = a.replace(/^\s+|\s+$/g, "").match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);
  6084.                    return b && 0 == 1 * b[4] || "transparent" == a
  6085.                },
  6086.                e = b.innerText || b.textContent,
  6087.                f = EBG.adaptor.browser.isIE() && 9 > EBG.adaptor.browser.getVersion(),
  6088.                c = c.getPropertyValue("color");
  6089.            return d(a) && -1 == EBG.indexOfArray("object,canvas,video,source,track,iframe,embed,img".split(","), b.tagName.toLowerCase()) && (!e || !f && d(c))
  6090.        }
  6091.    },
  6092.    _isElementTransparent: function(a) {
  6093.        var b = EBG.adaptor.getComputedStyle(a),
  6094.            c = this._invisibleProperties,
  6095.            d, e;
  6096.        for (e in c) {
  6097.            var f = b.getPropertyValue(e);
  6098.            if (f)
  6099.                for (var g = EBG.isArray(c[e]) ? c[e] : [c[e]], h = 0; h < g.length; h++)
  6100.                    if (d = EBG.isFunc(g[h]) ? g[h](f, a, b) : f == g[h]) return !0
  6101.        }
  6102.        return !1
  6103.    },
  6104.    _hasValidParent: function(a) {
  6105.        if (!a) return !1;
  6106.        for (var b = a.id; a.parentElement;) {
  6107.            if (a.parentElement.id &&
  6108.                -1 != EBG.indexOfArray(this._validElementParents, a.parentElement.id)) return this.addElementId(b, !1), !0;
  6109.            a = a.parentElement
  6110.        }
  6111.        return !1
  6112.    }
  6113. };
  6114. EBG.declareClass(EBG.RichModules.AdStackingDetector, null);
  6115. EBG.Interactions.DwellTimeManager = function(a) {
  6116.    this._adConfig = a;
  6117.    this._defaultPanelName = this._adConfig.panelName
  6118. };
  6119. EBG.Interactions.DwellTimeManager.prototype = {
  6120.    _state: {
  6121.        idle: 0,
  6122.        start: 1,
  6123.        stop: 2,
  6124.        panelOpenMouseOver: 3,
  6125.        videoPlay: 4,
  6126.        videoPlayMouseOut: 5,
  6127.        panelOpenMouseOut: 6,
  6128.        idlePanelOpen: 7,
  6129.        idleVideoPlay: 8
  6130.    },
  6131.    _idleTimeLimit: 700,
  6132.    _curState: 0,
  6133.    _numOfOpenPanels: 0,
  6134.    _isMouseOverAd: !1,
  6135.    _wasMouseOverAd: !1,
  6136.    _isUserInteractionOccur: !1,
  6137.    _isVideoPlay: !1,
  6138.    _isVideoAutoReplay: !1,
  6139.    _mouseTimeoutId: 0,
  6140.    _autoShownPanels: [],
  6141.    _videosToTrack: [],
  6142.    _defaultMovieNum: 1,
  6143.    _dwellUniqueNeedsToBeReported: !0,
  6144.    init: function() {
  6145.        this._subscribeToEvents()
  6146.    },
  6147.    _subscribeToAdEvent: function(a,
  6148.        b, c) {
  6149.        a = new EBG.Events.EventSubscription(a, b, this);
  6150.        if (c) a.dispatcherFilters = {
  6151.            "_adConfig.rnd": this._adConfig.rnd
  6152.        };
  6153.        EBG.eventMgr.subscribeToEvent(a)
  6154.    },
  6155.    _subscribeToEvents: function() {
  6156.        this._subscribeToAdEvent(EBG.Events.EventNames.MOUSE_OVER, this._handleMouseOverAd, !0);
  6157.        this._subscribeToAdEvent(EBG.Events.EventNames.MOUSE_OUT, this._handleMouseOutOfAd, !0);
  6158.        this._subscribeToAdEvent(EBG.Events.EventNames.DWELL_VIDEO_START, this._handleVideoPlay, !0);
  6159.        this._subscribeToAdEvent(EBG.Events.EventNames.DWELL_VIDEO_STOP,
  6160.            this._handleVideoStop, !0);
  6161.        this._subscribeToAdEvent(EBG.Events.EventNames.USER_INTERACTION, this._handleUserInteraction, !0);
  6162.        this._subscribeToAdEvent(EBG.Events.EventNames.EXPAND, this._handlePanelOpen, !0);
  6163.        this._subscribeToAdEvent(EBG.Events.EventNames.COLLAPSE, this._handlePanelClose, !0);
  6164.        this._subscribeToAdEvent(EBG.Events.EventNames.FULL_SCREEN_START, this._handlePanelOpen, !0);
  6165.        this._subscribeToAdEvent(EBG.Events.EventNames.FULL_SCREEN_END, this._handlePanelClose, !0)
  6166.    },
  6167.    _handleMouseThreshold: function() {
  6168.        this._mouseTimeoutId =
  6169.            null;
  6170.        EBG.intMgr.updateTimer(EBG.Interactions.SystemInts.DWELL_TIME, this._adConfig.uid, this._idleTimeLimit / 1E3);
  6171.        switch (this._curState) {
  6172.            case this._state.idle:
  6173.                this._isMouseOverAd ? this._start() : this._stop();
  6174.                break;
  6175.            case this._state.idleVideoPlay:
  6176.                this._isMouseOverAd ? this._videoPlay() : this._videoPlayMouseOut();
  6177.                break;
  6178.            case this._state.idlePanelOpen:
  6179.                this._isMouseOverAd ? this._panelOpenMouseOver() : this._panelOpenMouseOut()
  6180.        }
  6181.    },
  6182.    _handleUserInteraction: function() {
  6183.        if (this._wasMouseOverAd) switch (this._isUserInteractionOccur = !0, this._curState) {
  6184.            case this._state.idle:
  6185.                this._start();
  6186.                break;
  6187.            case this._state.idleVideoPlay:
  6188.                this._videoPlay();
  6189.                break;
  6190.            case this._state.idlePanelOpen:
  6191.                this._panelOpenMouseOver()
  6192.        }
  6193.    },
  6194.    _handleVideoPlay: function(a) {
  6195.        a = a.eventData.assetId || this._defaultMovieNum;
  6196.        if (this._isMouseOverAd) switch (this._videosToTrack.push(a), this._isVideoPlay = !0, this._reportUserInitatedVideo(a), this._curState) {
  6197.            case this._state.idle:
  6198.                this._idleVideoPlay();
  6199.                break;
  6200.            case this._state.idlePanelOpen:
  6201.                break;
  6202.            case this._state.idleVideoPlay:
  6203.                break;
  6204.            case this._state.start:
  6205.                this._videoPlay();
  6206.                this._reportUserInitatedVideo(a);
  6207.                break;
  6208.            case this._state.stop:
  6209.                this._isVideoAutoReplay || (this._videoPlayMouseOut(), this._reportUserInitatedVideo(a));
  6210.                break;
  6211.            case this._state.videoPlayMouseOut:
  6212.                this._stop();
  6213.                this._isVideoAutoReplay = !0;
  6214.                break;
  6215.            default:
  6216.                this._isVideoAutoReplay || this._reportUserInitatedVideo(a)
  6217.        }
  6218.    },
  6219.    _handleVideoStop: function(a) {
  6220.        a = EBGInfra.indexOfArray(this._videosToTrack, a.eventData.assetId);
  6221.        if (-1 !== a && (this._videosToTrack.splice(a, 1), !(0 < this._videosToTrack.length))) switch (this._isVideoPlay =
  6222.            this._isVideoAutoReplay = !1, this._curState) {
  6223.            case this._state.videoPlay:
  6224.                this._isMouseOverAd ? 0 < this._numOfOpenPanels ? this._panelOpenMouseOver() : this._start() : 0 < this._numOfOpenPanels ? this._panelOpenMouseOut() : this._stop();
  6225.                break;
  6226.            case this._state.videoPlayMouseOut:
  6227.                0 < this._numOfOpenPanels ? this._panelOpenMouseOut() : this._stop();
  6228.                break;
  6229.            case this._state.idleVideoPlay:
  6230.                this._idle()
  6231.        }
  6232.    },
  6233.    _handleMouseOverAd: function() {
  6234.        this._wasMouseOverAd = this._isMouseOverAd = !0;
  6235.        this._isVideoAutoReplay = !1;
  6236.        this._checkRecentAutoPanelOpen();
  6237.        switch (this._curState) {
  6238.            case this._state.idle:
  6239.            case this._state.idlePanelOpen:
  6240.            case this._state.idleVideoPlay:
  6241.                this._startMouseTimer();
  6242.                break;
  6243.            case this._state.stop:
  6244.                this._isVideoPlay ? this._videoPlay() : this._start();
  6245.                break;
  6246.            case this._state.panelOpenMouseOut:
  6247.                this._panelOpenMouseOver();
  6248.                break;
  6249.            case this._state.videoPlayMouseOut:
  6250.                this._videoPlay()
  6251.        }
  6252.    },
  6253.    _checkRecentAutoPanelOpen: function() {
  6254.        if (this._curState == this._state.idle)
  6255.            for (var a = (new Date).getTime(), b = this._autoShownPanels.length - 1; 0 <= b; b--) {
  6256.                var c = this._autoShownPanels[b];
  6257.                300 >= a - c.showtime && (this._autoShownPanels.splice(b, 1), this.handlePanelOpen(c.name))
  6258.            }
  6259.    },
  6260.    _handleMouseOutOfAd: function() {
  6261.        this._isMouseOverAd = !1;
  6262.        switch (this._curState) {
  6263.            case this._state.idle:
  6264.            case this._state.idleVideoPlay:
  6265.            case this._state.idlePanelOpen:
  6266.                this._clearMouseTimer();
  6267.                break;
  6268.            case this._state.start:
  6269.                this._stop();
  6270.                break;
  6271.            case this._state.videoPlay:
  6272.                this._videoPlayMouseOut();
  6273.                break;
  6274.            case this._state.panelOpenMouseOver:
  6275.                this._panelOpenMouseOut()
  6276.        }
  6277.    },
  6278.    _handlePanelOpen: function(a) {
  6279.        var b = a.eventData.props && a.eventData.props.panel.name ||
  6280.            this._defaultPanelName;
  6281.        if (!this._wasMouseOverAd || a.dispatcher.expandedBy == EBG.ActionType.AUTO) this._onAutoShowPanel(b);
  6282.        else switch (this._numOfOpenPanels++, this._curState) {
  6283.            case this._state.start:
  6284.                this._panelOpenMouseOver();
  6285.                break;
  6286.            case this._state.stop:
  6287.                this._panelOpenMouseOut();
  6288.                break;
  6289.            case this._state.idle:
  6290.                this._idlePanelOpen();
  6291.                break;
  6292.            case this._state.videoPlay:
  6293.                this._panelOpenMouseOver()
  6294.        }
  6295.    },
  6296.    _onAutoShowPanel: function(a) {
  6297.        this._addAutoShownPanel({
  6298.            name: a || this._defaultPanelName,
  6299.            showtime: (new Date).getTime()
  6300.        })
  6301.    },
  6302.    _addAutoShownPanel: function(a) {
  6303.        0 <= this._getAutoShownPanelIdx(a.name) || (this._autoShownPanels[this._autoShownPanels.length] = a)
  6304.    },
  6305.    _getAutoShownPanelIdx: function(a) {
  6306.        for (var a = a || this._defaultPanelName, b = -1, c = 0; c < this._autoShownPanels.length; c++)
  6307.            if (this._autoShownPanels[c].name == a) {
  6308.                b = c;
  6309.                break
  6310.            }
  6311.        return b
  6312.    },
  6313.    _handlePanelClose: function(a) {
  6314.        var b = "",
  6315.            b = "FullScreen" == a.eventData ? a.eventData : a.eventData.props && a.eventData.props.panel ? a.eventData.props.panel.name : this._defaultPanelName,
  6316.            a = this._getAutoShownPanelIdx(b);
  6317.        if (0 <= a) this._autoShownPanels.splice(a, 1);
  6318.        else {
  6319.            this._numOfOpenPanels--;
  6320.            if (0 > this._numOfOpenPanels) this._numOfOpenPanels = 0;
  6321.            if (0 == this._numOfOpenPanels) switch (this._curState) {
  6322.                case this._state.panelOpenMouseOver:
  6323.                    this._isVideoPlay ? this._videoPlay() : this._start();
  6324.                    break;
  6325.                case this._state.panelOpenMouseOut:
  6326.                    this._isVideoPlay ? this._videoPlayMouseOut() : this._stop();
  6327.                    break;
  6328.                case this._state.idlePanelOpen:
  6329.                    this._idle()
  6330.            }
  6331.        }
  6332.    },
  6333.    _startMouseTimer: function() {
  6334.        if (!this._mouseTimeoutId) {
  6335.            var a = this;
  6336.            this._mouseTimeoutId = setTimeout(function() {
  6337.                    a._handleMouseThreshold()
  6338.                },
  6339.                this._idleTimeLimit)
  6340.        }
  6341.    },
  6342.    _clearMouseTimer: function() {
  6343.        clearTimeout(this._mouseTimeoutId);
  6344.        this._mouseTimeoutId = null
  6345.    },
  6346.    _isIdleMode: function() {
  6347.        return this._curState == this._state.idle || this._curState == this._state.idlePanelOpen || this._curState == this._state.idleVideoPlay
  6348.    },
  6349.    _idle: function() {
  6350.        if (this._isIdleMode()) this._curState = this._state.idle
  6351.    },
  6352.    _start: function() {
  6353.        this._curState = this._state.start;
  6354.        this._startTimer()
  6355.    },
  6356.    _stop: function() {
  6357.        this._curState = this._state.stop;
  6358.        this._endTimer()
  6359.    },
  6360.    _idlePanelOpen: function() {
  6361.        if (this._isIdleMode()) this._curState =
  6362.            this._state.idlePanelOpen
  6363.    },
  6364.    _panelOpenMouseOver: function() {
  6365.        this._curState = this._state.panelOpenMouseOver;
  6366.        this._startTimer()
  6367.    },
  6368.    _videoPlay: function() {
  6369.        this._curState = this._state.videoPlay;
  6370.        this._startTimer()
  6371.    },
  6372.    _videoPlayMouseOut: function() {
  6373.        this._curState = this._state.videoPlayMouseOut;
  6374.        this._startTimer()
  6375.    },
  6376.    _panelOpenMouseOut: function() {
  6377.        this._curState = this._state.panelOpenMouseOut;
  6378.        this._startTimer()
  6379.    },
  6380.    _idleVideoPlay: function() {
  6381.        if (this._isIdleMode()) this._curState = this._state.idleVideoPlay
  6382.    },
  6383.    _reportUserInitatedVideo: function(a) {
  6384.        var b =
  6385.            new EBG.Events.Event(EBG.Events.EventNames.USER_INITIATED_VIDEO);
  6386.        b.dispatcher = this;
  6387.        b.eventData = {
  6388.            assetId: a
  6389.        };
  6390.        EBG.eventMgr.dispatchEvent(b)
  6391.    },
  6392.    _isTimeOverLimit: function() {
  6393.        return this._isTimerStarted() ? (this._endTimer(), EBG.intMgr.getTimerValue(EBG.Interactions.SystemInts.DWELL_TIME, this._adConfig.uid) > this._idleTimeLimit / 1E3) : !1
  6394.    },
  6395.    _isTimerStarted: function() {
  6396.        return EBG.intMgr.isTimerRunning(EBG.Interactions.SystemInts.DWELL_TIME, this._adConfig.uid)
  6397.    },
  6398.    _resetTimer: function() {
  6399.        EBG.intMgr.updateTimer(EBG.Interactions.SystemInts.DWELL_TIME,
  6400.            this._adConfig.uid, 0)
  6401.    },
  6402.    _startTimer: function() {
  6403.        var a = new EBG.Events.Event(EBG.Events.EventNames.DWELL_UNIQUE);
  6404.        a.dispatcher = this;
  6405.        a.eventData = {
  6406.            firstTime: this._dwellUniqueNeedsToBeReported,
  6407.            adUId: this._adConfig.uid
  6408.        };
  6409.        EBG.eventMgr.dispatchEvent(a);
  6410.        this._dwellUniqueNeedsToBeReported = !1;
  6411.        EBG.intMgr.startTimer(EBG.Interactions.SystemInts.DWELL_TIME, this._adConfig.uid)
  6412.    },
  6413.    _endTimer: function() {
  6414.        EBG.intMgr.stopTimer(EBG.Interactions.SystemInts.DWELL_TIME, this._adConfig.uid)
  6415.    }
  6416. };
  6417. EBG.declareNamespace("RichModules");
  6418. EBG.RichModules.PanelFrequencyManager = function() {};
  6419. EBG.RichModules.PanelFrequencyManager.prototype = {
  6420.    _cookieName: "",
  6421.    _adsInfo: [],
  6422.    _adInfoIdx: -1,
  6423.    _frequencyTimes: -1,
  6424.    _frequencyPeriod: -1,
  6425.    _adId: -1,
  6426.    _maxLen: -1,
  6427.    _optOut: 0,
  6428.    _cff: {},
  6429.    init: function(a, b, c, d, e, f) {
  6430.        this.initialize({
  6431.            frequencyTimes: a,
  6432.            frequencyPeriod: b,
  6433.            adId: c,
  6434.            histLen: d,
  6435.            optOut: e,
  6436.            disableAutoExpand: f,
  6437.            isGeoStrict: 1
  6438.        })
  6439.    },
  6440.    initialize: function(a) {
  6441.        try {
  6442.            if (this._frequencyTimes = EBG.isDefinedNotNull(a.frequencyTimes) ? a.frequencyTimes : 6, this._frequencyPeriod = EBG.isDefinedNotNull(a.frequencyPeriod) ? a.frequencyPeriod : 4, this._adId =
  6443.                a.adId, this._maxLen = EBG.isDefinedNotNull(a.histLen) ? a.histLen : 30, this._optOut = a.optOut && a.isGeoStrict, this._disableAutoExpand = "undefined" != typeof a.disableAutoExpand ? a.disableAutoExpand : 1, this._cookieName = 1 == this._frequencyPeriod ? "ebPanelFrequencyPerSession" : "ebPanelFrequency", this._ffs = a.ffs || this._ffs, !this._optOut) {
  6444.                a = "";
  6445.                (this._isStorageSupported = this.isStorageSupported()) && (a = this._readStorage(this._cookieName));
  6446.                if ("" != a) this._adsInfo = a.split("&");
  6447.                if (0 < this._adsInfo.length) {
  6448.                    for (a = 0; a < this._adsInfo.length; a++) {
  6449.                        this._adsInfo[a] =
  6450.                            this._adsInfo[a].split(":");
  6451.                        for (var b = this._adsInfo[a], c = 0; c < b.length; c++) b[c] = parseInt(b[c]);
  6452.                        if (b[0] == this._adId) this._adInfoIdx = a
  6453.                    }
  6454.                    this._deleteOldItems();
  6455.                    6 == this._frequencyTimes ? -1 != this._adInfoIdx && (this._deleteItem(this._adInfoIdx), this._updateCookie()) : this._adjustFreqPeriod()
  6456.                }
  6457.            }
  6458.        } catch (d) {
  6459.            this._adInfoIdx = -1
  6460.        }
  6461.    },
  6462.    shouldExpand: function() {
  6463.        var a = !0;
  6464.        this._optOut || !this._isStorageSupported ? a = !this._disableAutoExpand : -1 != this._adInfoIdx && this._adsInfo[this._adInfoIdx][2] >= this._frequencyTimes && (a = !1);
  6465.        return a
  6466.    },
  6467.    onExpand: function() {
  6468.        if (!this.onExpandCalled && (this.onExpandCalled = !0, !(6 == this._frequencyTimes || 0 == this._maxLen))) {
  6469.            if (-1 != this._adInfoIdx) {
  6470.                var a = this._adsInfo[this._adInfoIdx];
  6471.                a[2]++;
  6472.                4 == this._frequencyPeriod && (a[3] = (new Date).getTime(), this._deleteItem(this._adInfoIdx), this._insertItem(a))
  6473.            } else this._adsInfo.length >= this._maxLen && this._deleteItem(0), this._insertNewItem();
  6474.            this._updateCookie()
  6475.        }
  6476.    },
  6477.    _adjustFreqPeriod: function() {
  6478.        if (!(-1 == this._adInfoIdx || 1 == this._frequencyPeriod)) {
  6479.            var a = this._adsInfo[this._adInfoIdx];
  6480.            if (this._frequencyPeriod > a[1]) {
  6481.                a[1] = this._frequencyPeriod;
  6482.                var b = new Date,
  6483.                    c = a[3];
  6484.                3 == this._frequencyPeriod ? (c = 0 == b.getDay() ? 0 : 7 - b.getDay(), c = b.getTime() + 864E5 * c, b = new Date(c), b.setHours(23, 59, 59), c = b.getTime()) : 4 == this._frequencyPeriod && (c = b.getTime());
  6485.                a[3] = c;
  6486.                this._deleteItem(this._adInfoIdx);
  6487.                this._insertItem(a);
  6488.                this._updateCookie()
  6489.            } else this._frequencyPeriod < a[1] && this._deleteItem(this._adInfoIdx)
  6490.        }
  6491.    },
  6492.    _deleteOldItems: function() {
  6493.        if (1 != this._frequencyPeriod) {
  6494.            for (var a = [], b = 0; b < this._adsInfo.length; b++) {
  6495.                var c =
  6496.                    this._adsInfo[b];
  6497.                if (c[3] >= (new Date).getTime()) break;
  6498.                else 4 != c[1] && a.push(b)
  6499.            }
  6500.            for (b = a.length - 1; 0 <= b; b--) this._deleteItem(a[b])
  6501.        }
  6502.    },
  6503.    _insertNewItem: function() {
  6504.        var a = [];
  6505.        a[0] = this._adId;
  6506.        a[1] = this._frequencyPeriod;
  6507.        a[2] = 1;
  6508.        var b = new Date;
  6509.        switch (this._frequencyPeriod) {
  6510.            case 2:
  6511.                a[3] = b.getTime() + 864E5;
  6512.                break;
  6513.            case 3:
  6514.                var c = 0 == b.getDay() ? 0 : 7 - b.getDay(),
  6515.                    b = b.getTime() + 864E5 * c,
  6516.                    b = new Date(b);
  6517.                b.setHours(23, 59, 59);
  6518.                a[3] = b.getTime();
  6519.                break;
  6520.            case 4:
  6521.                a[3] = b.getTime()
  6522.        }
  6523.        this._insertItem(a)
  6524.    },
  6525.    _insertItem: function(a) {
  6526.        var b = 0;
  6527.        if (1 == this._frequencyPeriod) b =
  6528.            this._adsInfo.length;
  6529.        else if (0 != this._adsInfo.length) {
  6530.            for (; b < this._adsInfo.length && this._adsInfo[b][3] <= a[3];) b++;
  6531.            for (var c = this._adsInfo.length; c > b; c--) this._adsInfo[c] = this._adsInfo[c - 1]
  6532.        }
  6533.        this._adsInfo[b] = a;
  6534.        this._adInfoIdx = b
  6535.    },
  6536.    _deleteItem: function(a) {
  6537.        this._adsInfo.splice(a, 1);
  6538.        a == this._adInfoIdx ? this._adInfoIdx = -1 : this._adInfoIdx > a && this._adInfoIdx--
  6539.    },
  6540.    _updateCookie: function() {
  6541.        for (var a = [], b = 0; b < this._adsInfo.length; b++) a[b] = this._adsInfo[b].join(":");
  6542.        a = a.join("&");
  6543.        !this._optOut && this._isStorageSupported &&
  6544.            6 > this._frequencyTimes && this._setStorage(this._cookieName, a)
  6545.    },
  6546.    isStorageSupported: function() {
  6547.        retval = !1;
  6548.        try {
  6549.            this._storageName = 1 == this._frequencyPeriod ? sessionStorage : localStorage, EBG.isDefinedNotNull(this._storageName) && (this._storageName.setItem("mmtest1", "mmtest2"), this._storageName.removeItem("mmtest1"), retval = !0)
  6550.        } catch (a) {}
  6551.        return retval
  6552.    },
  6553.    _readStorage: function(a) {
  6554.        a = this._storageName.getItem(a);
  6555.        return a = EBG.isDefinedNotNull(a) ? unescape(a) : ""
  6556.    },
  6557.    _setStorage: function(a, b) {
  6558.        var c = escape(b);
  6559.        this._storageName.setItem(a,
  6560.            c)
  6561.    }
  6562. };
  6563. EBG.declareNamespace("AdaptiveUtils");
  6564. EBG.AdaptiveUtils = function(a) {
  6565.    this._adConfig = a;
  6566.    if (EBG.Algorithms.MaxWidthSelector) this._selector = new EBG.Algorithms.MaxWidthSelector;
  6567.    for (var b in this._adConfig.adHtmlOptions)
  6568.        if (this._adConfig.adHtmlOptions[b].path == this._adConfig.adHtmlPath && this._adConfig.adHtmlOptions[b].defaultImagePath == this._adConfig.defaultImagePath) {
  6569.            this._adConfig.defaultWidth = this._adConfig.defaultWidth ? this._adConfig.defaultWidth : this._adConfig.adHtmlOptions[b].width;
  6570.            this._adConfig.defaultHeight = this._adConfig.defaultHeight ?
  6571.                this._adConfig.defaultHeight : this._adConfig.adHtmlOptions[b].height;
  6572.            this._adConfig.adHtmlOptions[b].interaction = this._adConfig.adHtmlOptions[b].name = b;
  6573.            this._defaultAsset = EBG.cloneObj(this._adConfig.adHtmlOptions[b]);
  6574.            break
  6575.        }
  6576. };
  6577. EBG.AdaptiveUtils.prototype = {
  6578.    _adConfig: null,
  6579.    _shouldFireInteraction: !0,
  6580.    _selector: null,
  6581.    _chosenAsset: null,
  6582.    _defaultAsset: null,
  6583.    _preloadImageAsset: null,
  6584.    _bannerAsset: null,
  6585.    getAsset: function() {
  6586.        return this._chosenAsset
  6587.    },
  6588.    updateAdConfig: function() {
  6589.        if (!this._chosenAsset && this._defaultAsset) this._chosenAsset = this._defaultAsset;
  6590.        if (this._chosenAsset) this._adConfig.defaultImagePath = this._chosenAsset.defaultImagePath, this._adConfig.adHtmlPath = this._chosenAsset.path, this._adConfig.expansionParams = this._chosenAsset.expansionParams,
  6591.            this._adConfig.chosenWidth = this._chosenAsset.width, this._adConfig.chosenHeight = this._chosenAsset.height
  6592.    },
  6593.    subscribeToEvents: function() {
  6594.        this._subscribeToAdEvent(EBG.Events.EventNames.PAGE_RESIZE, this._handlePageResize);
  6595.        this._subscribeToAdEvent(EBG.Events.EventNames.SCREEN_ORIENTATION, this._handlePageResize);
  6596.        this._subscribeToAdEvent(EBG.Events.EventNames.SHOW_AD, this._handlePageResize, EBG.Events.EventTiming.BEFORE);
  6597.        this._subscribeToAdEvent(EBG.Events.EventNames.SHOW_AD, this._handlePageResize, EBG.Events.EventTiming.AFTER);
  6598.        this._subscribeToAdEvent(EBG.Events.EventNames.ADD_CREATIVES, this._handleCreative, EBG.Events.EventTiming.BEFORE)
  6599.    },
  6600.    _showAsset: function(a, b) {
  6601.        a._defaultImgResId && EBG.adaptor.getElementById(a._defaultImgResId) ? (EBG.adaptor.removeElement(a._defaultImgResId), a.showDefaultImage()) : a._preloadImgResId && EBG.adaptor.getElementById(a._preloadImgResId) ? (EBG.adaptor.removeElement(a._preloadImgResId), a._addCreatives()) : a._banner && a._banner.divId && EBG.adaptor.getElementById(a._banner.divId) ? (EBG.adaptor.removeElement(a._banner.divId),
  6602.            a._addCreatives()) : (b--, 0 < b && EBG.runTimed(this, this._showAsset, [a, b], 25))
  6603.    },
  6604.    _handlePageResize: function() {
  6605.        var a = EBG.ads[this._adConfig.uid],
  6606.            b = this._selector.selectAsset(this._adConfig.adHtmlOptions, this._adConfig);
  6607.        if (!b && this._defaultAsset) b = this._defaultAsset;
  6608.        if (b != this._chosenAsset) EBG.isFunc(a._hideAllPanels) && a._hideAllPanels(), this._chosenAsset = b, this.updateAdConfig(), this._showAsset(a, 3)
  6609.    },
  6610.    _handleCreative: function(a) {
  6611.        if (a.eventData.creativeType == EBG.Events.EventNames.ADD_HTML5_MAIN_CREATIVE && this._shouldFireInteraction) EBG.intMgr.handleCounterInteraction(this.getBannerInteraction(),
  6612.            this._adConfig.adId + "_" + this._adConfig.rnd, null, !1, {}), this._shouldFireInteraction = !1;
  6613.        else if (a.eventData.creativeType == EBG.Events.EventNames.ADD_BANNER_DEFAULT_IMAGE_CREATIVE) {
  6614.            var b = EBG.adaptor.getElementById(this._adConfig.placeHolderId);
  6615.            b || EBG.adaptor.setElemStyle(b, "position", "relative");
  6616.            a.eventData.tagsObj.attributes.style.position = "absolute";
  6617.            a.eventData.tagsObj.attributes.style.margin = "auto";
  6618.            a.eventData.tagsObj.attributes.style.top = "0";
  6619.            a.eventData.tagsObj.attributes.style.left = "0";
  6620.            a.eventData.tagsObj.attributes.style.right =
  6621.                "0";
  6622.            a.eventData.tagsObj.attributes.style.bottom = "0"
  6623.        }
  6624.    },
  6625.    _subscribeToAdEvent: function(a, b, c) {
  6626.        a = new EBG.Events.EventSubscription(a, b, this);
  6627.        a.dispatcherFilters = {
  6628.            "_adConfig.rnd": this._adConfig.rnd
  6629.        };
  6630.        if (c) a.timing = c;
  6631.        EBG.eventMgr.subscribeToEvent(a)
  6632.    },
  6633.    getBannerInteraction: function() {
  6634.        return this._chosenAsset.interaction
  6635.    }
  6636. };
  6637. EBG.declareClass(EBG.AdaptiveUtils, null);
  6638. EBG.declareNamespace("Algorithms");
  6639. EBG.Algorithms.BaseSelector = function() {};
  6640. EBG.Algorithms.BaseSelector.prototype = {
  6641.    selectAsset: function() {
  6642.        return null
  6643.    }
  6644. };
  6645. EBG.declareClass(EBG.Algorithms.BaseSelector, null);
  6646. EBG.Algorithms.MaxWidthSelector = function() {
  6647.    EBG.callSuperConstructor(EBG.Algorithms.MaxWidthSelector, this)
  6648. };
  6649. EBG.Algorithms.MaxWidthSelector.prototype = {
  6650.    selectAsset: function(a, b) {
  6651.        var c = EBG.adaptor.getBoundingClientRect(EBG.adaptor.getElementById(b.placeHolderId));
  6652.        if (b.width) c.width = b.width;
  6653.        var d = null,
  6654.            e;
  6655.        for (e in a) {
  6656.            var f = a[e];
  6657.            f.interaction = f.name = e;
  6658.            if (parseInt(f.selectionValue) >= c.width && f.width <= c.width && this.isAssetValid(f, b) && (!d || Math.abs(d.width - c.width) > Math.abs(f.width - c.width)))
  6659.                if (d = f, d.width == c.width) break
  6660.        }
  6661.        return d
  6662.    },
  6663.    isAssetValid: function(a) {
  6664.        var b = !1;
  6665.        if (EBG.adaptor.getScreenOrientation() == a.orientation.toUpperCase() ||
  6666.            a.orientation.toUpperCase() == EBG.orientation.Both) b = !0;
  6667.        return b
  6668.    }
  6669. };
  6670. EBG.declareClass(EBG.Algorithms.MaxWidthSelector, EBG.Algorithms.BaseSelector);
  6671. EBG.declareNamespace("AdChoice");
  6672. EBG.AdChoice.AdChoiceManager = function(a) {
  6673.    this._adConfig = a;
  6674.    this._active = a.adChoice.includeMarker;
  6675.    this._iconAdded = !1
  6676. };
  6677. EBG.AdChoice.AdChoiceManager.ImageData = function() {
  6678.    this.iconSrc = "";
  6679.    this.id = ""
  6680. };
  6681. EBG.AdChoice.AdChoiceManager.IabIconData = {
  6682.    en: {
  6683.        icon: "OBA_DEFAULT.png",
  6684.        url: "http://www.youronlinechoices.com/uk/"
  6685.    },
  6686.    "de-at": {
  6687.        icon: "OBA_AUSTRIA.png",
  6688.        url: "http://www.youronlinechoices.com/at/"
  6689.    },
  6690.    "fr-be": {
  6691.        icon: "OBA_BELGIUM_FR.png",
  6692.        url: "http://www.youronlinechoices.com/be-fr/"
  6693.    },
  6694.    "nl-be": {
  6695.        icon: "OBA_BELGIUM_NL.png",
  6696.        url: "http://www.youronlinechoices.com/be-nl/"
  6697.    },
  6698.    bg: {
  6699.        icon: "OBA_BULGARIA.png",
  6700.        url: "http://www.youronlinechoices.com/bg/"
  6701.    },
  6702.    cs: {
  6703.        icon: "OBA_CZECH.png",
  6704.        url: "http://www.youronlinechoices.com/cs/"
  6705.    },
  6706.    da: {
  6707.        icon: "OBA_DENMARK.png",
  6708.        url: "http://www.youronlinechoices.com/den/"
  6709.    },
  6710.    fi: {
  6711.        icon: "OBA_FINLAND.png",
  6712.        url: "http://www.youronlinechoices.com/fi/"
  6713.    },
  6714.    fr: {
  6715.        icon: "OBA_FRANCE.png",
  6716.        url: "http://www.youronlinechoices.com/fr/"
  6717.    },
  6718.    de: {
  6719.        icon: "OBA_GERMANY.png",
  6720.        url: "http://www.youronlinechoices.com/de/"
  6721.    },
  6722.    el: {
  6723.        icon: "OBA_GREEK.png",
  6724.        url: "http://www.youronlinechoices.com/gr/"
  6725.    },
  6726.    hu: {
  6727.        icon: "OBA_HUNGARY.png",
  6728.        url: "http://www.youronlinechoices.com/hu/"
  6729.    },
  6730.    "en-ie": {
  6731.        icon: "OBA_IRELAND.png",
  6732.        url: "http://www.youronlinechoices.com/ie/"
  6733.    },
  6734.    it: {
  6735.        icon: "OBA_ITALY.png",
  6736.        url: "http://www.youronlinechoices.com/it/"
  6737.    },
  6738.    nl: {
  6739.        icon: "OBA_NETHERLANDS.png",
  6740.        url: "http://www.youronlinechoices.com/nl/"
  6741.    },
  6742.    no: {
  6743.        icon: "OBA_NORWAY.png",
  6744.        url: "http://www.youronlinechoices.com/nor/"
  6745.    },
  6746.    pl: {
  6747.        icon: "OBA_POLAND.png",
  6748.        url: "http://www.youronlinechoices.com/pl/"
  6749.    },
  6750.    ro: {
  6751.        icon: "OBA_ROMANIA.png",
  6752.        url: "http://www.youronlinechoices.com/ro/"
  6753.    },
  6754.    sl: {
  6755.        icon: "OBA_SLOVAKIA.png",
  6756.        url: "http://www.youronlinechoices.com/sl/"
  6757.    },
  6758.    es: {
  6759.        icon: "OBA_SPAIN.png",
  6760.        url: "http://www.youronlinechoices.com/es/"
  6761.    },
  6762.    sv: {
  6763.        icon: "OBA_SWEDEN.png",
  6764.        url: "http://www.youronlinechoices.com/se/"
  6765.    },
  6766.    "de-ch": {
  6767.        icon: "OBA_SWITZERLAND_DE.png",
  6768.        url: "http://www.youronlinechoices.com/ch-de/"
  6769.    },
  6770.    "fr-ch": {
  6771.        icon: "OBA_SWITZERLAND_FR.png",
  6772.        url: "http://www.youronlinechoices.com/ch-fr/"
  6773.    },
  6774.    "it-ch": {
  6775.        icon: "OBA_SWITZERLAND_IT.png",
  6776.        url: "http://www.youronlinechoices.com/ch-it/"
  6777.    },
  6778.    "en-gb": {
  6779.        icon: "OBA_UK.png",
  6780.        url: "http://www.youronlinechoices.com/uk/"
  6781.    },
  6782.    hr: {
  6783.        icon: "OBA_DEFAULT.png",
  6784.        url: "http://www.youronlinechoices.com/hr/"
  6785.    },
  6786.    is: {
  6787.        icon: "OBA_DEFAULT.png",
  6788.        url: "http://www.youronlinechoices.com/is/"
  6789.    },
  6790.    lt: {
  6791.        icon: "OBA_DEFAULT.png",
  6792.        url: "http://www.youronlinechoices.com/lt/"
  6793.    },
  6794.    lv: {
  6795.        icon: "OBA_DEFAULT.png",
  6796.        url: "http://www.youronlinechoices.com/lv/"
  6797.    },
  6798.    pt: {
  6799.        icon: "OBA_DEFAULT.png",
  6800.        url: "http://www.youronlinechoices.com/pt/"
  6801.    },
  6802.    sk: {
  6803.        icon: "OBA_DEFAULT.png",
  6804.        url: "http://www.youronlinechoices.com/sk/"
  6805.    }
  6806. };
  6807. EBG.AdChoice.AdChoiceManager.NaiIconData = {
  6808.    en: {
  6809.        icon: "OBA_DEFAULT.png",
  6810.        url: "http://www.aboutads.info/consumers"
  6811.    }
  6812. };
  6813. EBG.AdChoice.AdChoiceManager.IabClosedIconName = "OBA.png";
  6814. EBG.AdChoice.AdChoiceManager.NaiClosedIconName = "OBA.png";
  6815. EBG.AdChoice.AdChoiceManager.VisibilityState = {
  6816.    HIDDEN: "hidden",
  6817.    VISIBLE: "visible"
  6818. };
  6819. EBG.AdChoice.AdChoiceManager.Position = {
  6820.    ABSOLUTE: "absolute",
  6821.    RELATIVE: "relative"
  6822. };
  6823. EBG.AdChoice.AdChoiceManager.ImageLoadTimeout = 100;
  6824. EBG.AdChoice.AdChoiceManager.DefaultOffset = -1E3;
  6825. EBG.AdChoice.AdChoiceManager.prototype = {
  6826.    _imgData: null,
  6827.    _imgExpData: null,
  6828.    _iconLocalData: null,
  6829.    _acCloseIconName: null,
  6830.    _spanId: null,
  6831.    _iconsBaseUrl: null,
  6832.    _containerId: null,
  6833.    _assetObjId: null,
  6834.    init: function() {
  6835.        if (this._active) {
  6836.            this._iconsBaseUrl = this._getIconsDir(this._adConfig.adChoice.iconPosition);
  6837.            var a = new EBG.Events.EventSubscription(EBG.Events.EventNames.ADD_CREATIVES, this._handleAdChoice, this);
  6838.            a.timing = EBG.Events.EventTiming.AFTER;
  6839.            a.dispatcherFilters = {
  6840.                "_adConfig.rnd": this._adConfig.rnd
  6841.            };
  6842.            EBG.eventMgr.subscribeToEvent(a);
  6843.            a = new EBG.Events.EventSubscription(EBG.Events.EventNames.ADD_BANNER_DEFAULT_IMAGE_CREATIVE, this._handleAdChoice, this);
  6844.            a.timing = EBG.Events.EventTiming.AFTER;
  6845.            a.dispatcherFilters = {
  6846.                "_adConfig.rnd": this._adConfig.rnd
  6847.            };
  6848.            EBG.eventMgr.subscribeToEvent(a);
  6849.            a = new EBG.Events.EventSubscription(EBG.Events.EventNames.ADD_BANNER_DEFAULT_FLASH_CREATIVE, this._handleAdChoice, this);
  6850.            a.timing = EBG.Events.EventTiming.AFTER;
  6851.            a.dispatcherFilters = {
  6852.                "_adConfig.rnd": this._adConfig.rnd
  6853.            };
  6854.            EBG.eventMgr.subscribeToEvent(a);
  6855.            EBG.eventMgr.subscribeToEvent(new EBG.Events.EventSubscription(EBG.Events.EventNames.PAGE_RESIZE,
  6856.                this._pageResizeHandler, this));
  6857.            this._adConfig.adChoice.certificationProgram == EBG.AcCertProgram.NAI_US ? (this._iconLocalData = this._getIconDataByLanguage(EBG.AdChoice.AdChoiceManager.NaiIconData), this._acCloseIconName = EBG.AdChoice.AdChoiceManager.NaiClosedIconName) : (this._iconLocalData = this._getIconDataByLanguage(EBG.AdChoice.AdChoiceManager.IabIconData), this._acCloseIconName = EBG.AdChoice.AdChoiceManager.IabClosedIconName)
  6858.        }
  6859.    },
  6860.    _handleAdChoice: function(a) {
  6861.        if (a.eventData && !a.eventData.isPanel) this._assetObjId =
  6862.            a.eventData.assetId;
  6863.        if (this._iconAdded) {
  6864.            var a = EBG.adaptor.getElementById(this._containerId),
  6865.                b = EBG.adaptor.getElementById(this._spanId);
  6866.            EBG.adaptor.removeElement(b);
  6867.            EBG.adaptor.appendChildElement(a.id, b)
  6868.        } else this._iconAdded = !0, this._containerId = this._adConfig.placeHolderId, this._imgData = this._getImageData(), this._imgExpData = this._getExpImageData(), this._addAdChoiceIcons(this._imgData, this._imgExpData, this._getAdChoiceUrl()), this._subscribeIconToEvents(this._imgData.id, this._imgExpData.id)
  6869.    },
  6870.    _getImageData: function() {
  6871.        var a =
  6872.            new EBG.AdChoice.AdChoiceManager.ImageData;
  6873.        a.iconSrc = this._iconsBaseUrl + this._acCloseIconName;
  6874.        a.id = "acImage_" + this._adConfig.uid;
  6875.        return a
  6876.    },
  6877.    _getExpImageData: function() {
  6878.        var a = new EBG.AdChoice.AdChoiceManager.ImageData;
  6879.        a.iconSrc = this._iconsBaseUrl + this._iconLocalData.icon;
  6880.        a.id = "acExpImage_" + this._adConfig.uid;
  6881.        return a
  6882.    },
  6883.    _getAdChoiceUrl: function() {
  6884.        var a = "";
  6885.        return a = this._adConfig.adChoice.customUrl ? unescape(this._adConfig.adChoice.customUrl) : this._iconLocalData.url
  6886.    },
  6887.    _getIconDataByLanguage: function(a) {
  6888.        var b =
  6889.            EBG.adaptor.getBrowserLanguage().toLowerCase(),
  6890.            c = a[b];
  6891.        c || (b = b.split("-")[0], c = a[b]);
  6892.        c || (c = a.en);
  6893.        return c
  6894.    },
  6895.    _getIconOffsets: function(a, b, c, d, e, f) {
  6896.        var g = {
  6897.            offsetLeft: EBG.px(EBG.AdChoice.AdChoiceManager.DefaultOffset),
  6898.            offsetTop: EBG.px(EBG.AdChoice.AdChoiceManager.DefaultOffset)
  6899.        };
  6900.        if (this._assetObjId && (adPos = EBG.adaptor.getPositioningById(this._assetObjId, !0, this._adConfig.actualServingMode))) {
  6901.            if (!e || !f) var h = EBG.adaptor.getElementById(this._assetObjId),
  6902.                h = EBG.adaptor.getBoundingClientRect(h),
  6903.                e = e ? e : h.width,
  6904.                f = f ? f : h.height;
  6905.            acPos = EBG.adaptor.getPositioningById(a, !0, this._adConfig.actualServingMode);
  6906.            h = EBG.adaptor.getStyleOfElem(EBG.adaptor.getElementById(a));
  6907.            a = parseInt(h.left) + adPos.X - acPos.X;
  6908.            h = parseInt(h.top) + adPos.Y - acPos.Y;
  6909.            switch (b) {
  6910.                case EBG.AcIconPosition.BottomLeft:
  6911.                    g.offsetLeft = EBG.px(a);
  6912.                    g.offsetTop = EBG.px(h + f - d);
  6913.                    break;
  6914.                case EBG.AcIconPosition.BottomRight:
  6915.                    g.offsetLeft = EBG.px(a + e - c);
  6916.                    g.offsetTop = EBG.px(h + f - d);
  6917.                    break;
  6918.                case EBG.AcIconPosition.TopLeft:
  6919.                    g.offsetLeft = EBG.px(a);
  6920.                    g.offsetTop = EBG.px(h);
  6921.                    break;
  6922.                case EBG.AcIconPosition.TopRight:
  6923.                    g.offsetLeft =
  6924.                        EBG.px(a + e - c), g.offsetTop = EBG.px(h)
  6925.            }
  6926.        }
  6927.        return g
  6928.    },
  6929.    _getIconsDir: function(a) {
  6930.        var b = this._adConfig.imagesDir + "/AdChoice/";
  6931.        switch (a) {
  6932.            case EBG.AcIconPosition.BottomLeft:
  6933.                b += "BottomLeft/";
  6934.                break;
  6935.            case EBG.AcIconPosition.BottomRight:
  6936.                b += "BottomRight/";
  6937.                break;
  6938.            case EBG.AcIconPosition.TopLeft:
  6939.                b += "TopLeft/";
  6940.                break;
  6941.            case EBG.AcIconPosition.TopRight:
  6942.                b += "TopRight/"
  6943.        }
  6944.        return b
  6945.    },
  6946.    _addAdChoiceIcons: function(a, b, c) {
  6947.        var d = "acImgLinkWrapper_" + this._adConfig.uid;
  6948.        this._spanId = "acSpan_" + this._adConfig.uid;
  6949.        var e = EBG.adaptor.getElementById(this._containerId);
  6950.        if (e && (c = {
  6951.                tagName: EBG.Adaptors.TagNames.DIV,
  6952.                attributes: {
  6953.                    id: this._spanId,
  6954.                    style: {
  6955.                        position: EBG.AdChoice.AdChoiceManager.Position.ABSOLUTE,
  6956.                        zIndex: EBG.adaptor.getMaxZIndex(e) + 1
  6957.                    }
  6958.                },
  6959.                children: [{
  6960.                    tagName: EBG.Adaptors.TagNames.A,
  6961.                    attributes: {
  6962.                        id: d,
  6963.                        target: "_blank",
  6964.                        onClick: EBG.format("EBG.adaptor.openPage('{0}');", c),
  6965.                        mmskipreplace: 1
  6966.                    },
  6967.                    children: null
  6968.                }]
  6969.            }, this._containerId == this._adConfig.placeHolderId ? EBG.adaptor.inject(c, EBG.Adaptors.InjectionMethod.APPEND, e) : EBG.adaptor.inject(c, EBG.Adaptors.InjectionMethod.INSERT_BEFORE,
  6970.                e), d = EBG.adaptor.getElementById(d))) {
  6971.            e = {
  6972.                tagName: EBG.Adaptors.TagNames.IMG,
  6973.                attributes: {
  6974.                    id: a.id,
  6975.                    style: {
  6976.                        position: EBG.AdChoice.AdChoiceManager.Position.ABSOLUTE,
  6977.                        visibility: EBG.AdChoice.AdChoiceManager.VisibilityState.VISIBLE,
  6978.                        left: EBG.px(EBG.AdChoice.AdChoiceManager.DefaultOffset),
  6979.                        top: EBG.px(EBG.AdChoice.AdChoiceManager.DefaultOffset)
  6980.                    }
  6981.                },
  6982.                children: null
  6983.            };
  6984.            EBG.adaptor.inject(e, EBG.Adaptors.InjectionMethod.APPEND, d);
  6985.            e = {
  6986.                tagName: EBG.Adaptors.TagNames.IMG,
  6987.                attributes: {
  6988.                    id: b.id,
  6989.                    style: {
  6990.                        position: EBG.AdChoice.AdChoiceManager.Position.ABSOLUTE,
  6991.                        visibility: EBG.AdChoice.AdChoiceManager.VisibilityState.HIDDEN,
  6992.                        left: EBG.px(EBG.AdChoice.AdChoiceManager.DefaultOffset),
  6993.                        top: EBG.px(EBG.AdChoice.AdChoiceManager.DefaultOffset)
  6994.                    }
  6995.                },
  6996.                children: null
  6997.            };
  6998.            EBG.adaptor.inject(e, EBG.Adaptors.InjectionMethod.APPEND, d);
  6999.            var d = EBG.adaptor.getElementById(a.id),
  7000.                e = EBG.adaptor.getElementById(b.id),
  7001.                f = this,
  7002.                g = function() {
  7003.                    EBG.runTimed(f, f._handleImgOnloadEvent, [a.id, 0], EBG.AdChoice.AdChoiceManager.ImageLoadTimeout)
  7004.                },
  7005.                c = function() {
  7006.                    EBG.runTimed(f, f._handleImgOnloadEvent, [b.id, 0],
  7007.                        EBG.AdChoice.AdChoiceManager.ImageLoadTimeout)
  7008.                };
  7009.            if (d) g = new EBG.Events.EventSubscription("load", g, this), g.isElementEvent = !0, g.elementId = a.id, EBG.eventMgr.subscribeToEvent(g), d.src = a.iconSrc;
  7010.            if (e) g = new EBG.Events.EventSubscription("load", c, this), g.isElementEvent = !0, g.elementId = b.id, EBG.eventMgr.subscribeToEvent(g), e.src = b.iconSrc
  7011.        }
  7012.    },
  7013.    _subscribeIconToEvents: function(a, b) {
  7014.        var c = this,
  7015.            d = function() {
  7016.                c._handleMouseOverEvent(a, b)
  7017.            },
  7018.            e = new EBG.Events.EventSubscription("mouseover", d, this);
  7019.        e.isElementEvent = !0;
  7020.        e.elementId =
  7021.            a;
  7022.        EBG.eventMgr.subscribeToEvent(e);
  7023.        e = new EBG.Events.EventSubscription("mouseout", d, this);
  7024.        e.isElementEvent = !0;
  7025.        e.elementId = b;
  7026.        EBG.eventMgr.subscribeToEvent(e)
  7027.    },
  7028.    _handleMouseOverEvent: function(a, b) {
  7029.        var c = EBG.adaptor.getElementById(a),
  7030.            d = EBG.adaptor.getElementById(b),
  7031.            e = EBG.adaptor.getStyleOfElem(c),
  7032.            f = EBG.AdChoice.AdChoiceManager.VisibilityState.VISIBLE,
  7033.            g = EBG.AdChoice.AdChoiceManager.VisibilityState.HIDDEN;
  7034.        if (e.visibility == EBG.AdChoice.AdChoiceManager.VisibilityState.VISIBLE) f = EBG.AdChoice.AdChoiceManager.VisibilityState.HIDDEN,
  7035.            g = EBG.AdChoice.AdChoiceManager.VisibilityState.VISIBLE;
  7036.        e = {
  7037.            visibility: g
  7038.        };
  7039.        EBG.adaptor.setStyleToElem(c, {
  7040.            visibility: f
  7041.        });
  7042.        EBG.adaptor.setStyleToElem(d, e)
  7043.    },
  7044.    _pageResizeHandler: function() {
  7045.        this._handleImgOnloadEvent(this._imgData.id, 0);
  7046.        this._handleImgOnloadEvent(this._imgExpData.id, 0)
  7047.    },
  7048.    _handleImgOnloadEvent: function(a, b) {
  7049.        var c = EBG.adaptor.getElementById(a);
  7050.        imgPos = this._getIconOffsets(a, this._adConfig.adChoice.iconPosition, c.width, c.height, this._adConfig.width, this._adConfig.height);
  7051.        EBGInfra.isDefinedNotNull(b) &&
  7052.            10 > b ? EBG.runTimed(this, this._rehandleImgOnloadEvent, [a, b], EBG.AdChoice.AdChoiceManager.ImageLoadTimeout) : EBG.adaptor.setStyleToElem(c, {
  7053.                left: imgPos.offsetLeft,
  7054.                top: imgPos.offsetTop
  7055.            })
  7056.    },
  7057.    _rehandleImgOnloadEvent: function(a, b) {
  7058.        this._handleImgOnloadEvent(a, b + 1)
  7059.    }
  7060. };
  7061. EBG.declareNamespace("Ads");
  7062. EBG.Ads.Ad = function(a) {
  7063.    this._adConfig = a;
  7064.    this._adConfig.isStdAd = this._isStdAd();
  7065.    this.startTime = (new Date).getTime() / 1E3;
  7066.    this._fixPage();
  7067.    this._updateURLs();
  7068.    this._subscribeEventTriggeringURLs();
  7069.    EBG.ads[a.uid] = this;
  7070.    this._show();
  7071.    this.placeHolderElement ? this._handleMultiBurn() : this._subscribeToAdEvent(EBG.Events.EventNames.SHOW_AD, this._handleMultiBurn, EBG.Events.EventTiming.ONTIME);
  7072.    this._dpm = EBG.dataPipeMgr.getPipe(this._adConfig.sID);
  7073.    this._sendInitAdInformation()
  7074. };
  7075. EBG.Ads.Ad.prototype = {
  7076.    resizePlaceHolder: !0,
  7077.    checkingThrottle: !1,
  7078.    _throttleState: null,
  7079.    _adConfig: null,
  7080.    _adChoice: null,
  7081.    _cdiReason: 0,
  7082.    _showOnlyDefaultImg: !1,
  7083.    _banner: {
  7084.        divId: "",
  7085.        resId: "",
  7086.        width: 0,
  7087.        height: 0
  7088.    },
  7089.    _hasDefaultImageInteraction: !1,
  7090.    _isStdAd: function() {
  7091.        return !0
  7092.    },
  7093.    _subscribeEventTriggeringURLs: function() {
  7094.        if (this._adConfig.eventTrackingURLs) {
  7095.            this._adConfig.eventTrackingURLs = this._eventTrackingURLsAdapter(this._adConfig.eventTrackingURLs);
  7096.            for (var a in this._adConfig.eventTrackingURLs) this._subscribeToAdEvent(a,
  7097.                this._handleEventTrackingURLs, EBG.Events.EventTiming.ONTIME)
  7098.        }
  7099.    },
  7100.    _eventTrackingURLsAdapter: function(a) {
  7101.        function b(b) {
  7102.            c.ebVideoInteraction = c.ebVideoInteraction || [];
  7103.            c.ebVideoInteraction.push({
  7104.                filter: {
  7105.                    "eventData.intName": b
  7106.                },
  7107.                urls: a[d]
  7108.            })
  7109.        }
  7110.        var c = {},
  7111.            d;
  7112.        for (d in a) switch (d) {
  7113.            case "vidStart":
  7114.                b(EBG.VideoInteraction.STARTED);
  7115.                break;
  7116.            case "vid25Played":
  7117.                b(EBG.VideoInteraction.PERCENT_25_PLAYED);
  7118.                break;
  7119.            case "vid50Played":
  7120.                b(EBG.VideoInteraction.PERCENT_50_PLAYED);
  7121.                break;
  7122.            case "vid75Played":
  7123.                b(EBG.VideoInteraction.PERCENT_75_PLAYED);
  7124.                break;
  7125.            case "vidFullyPlayed":
  7126.                b(EBG.VideoInteraction.FULLPLAY)
  7127.        }
  7128.        return c
  7129.    },
  7130.    _handleEventTrackingURLs: function(a) {
  7131.        for (var b = this._adConfig.eventTrackingURLs[a.name], c = 0; c < b.length; c++) {
  7132.            var d = b[c];
  7133.            if (d.filter)
  7134.                for (var e in d.filter) EBG.valueFromPath(a, e) == d.filter[e] && this._reportImpressionTrackingURLs(d.urls);
  7135.            else this._reportImpressionTrackingURLs(d.urls)
  7136.        }
  7137.    },
  7138.    _counterInteractionHandler: function(a) {
  7139.        try {
  7140.            var b = a.eventData.intName;
  7141.            if (!b) b = EBG.Interactions.SystemInts.CLICK;
  7142.            a.eventData.clickUrl = this._replaceURLTokens(a.eventData.clickUrl);
  7143.            a.eventData.clickedVerUrl = this._replaceURLTokens(a.eventData.clickedVerUrl);
  7144.            EBG.intMgr.handleCounterInteraction(b, this._adConfig.uid, 0, null, a.eventData, "undefined" != typeof a.eventData.handleClickInt ? a.eventData.handleClickInt : !0)
  7145.        } catch (c) {}
  7146.    },
  7147.    _versionTrackingImpressionHandler: function(a) {
  7148.        try {
  7149.            a.eventData.impTrackingUrls && this._reportImpressionTrackingURLs(a.eventData.impTrackingUrls)
  7150.        } catch (b) {}
  7151.    },
  7152.    _reportImpressionTrackingURLs: function(a) {
  7153.        if (!EBG.isPreview)
  7154.            for (var b = 0; b < a.length; b++) {
  7155.                var c = a[b];
  7156.                c && (c =
  7157.                    this._replaceURLTokens(c), EBG.adaptor.reportToRemoteServerUsingImage(c))
  7158.            }
  7159.    },
  7160.    _show: function() {
  7161.        this._cdiReason = this._adConfig.showAieDefaultImage ? 4 : this._cdiReason;
  7162.        var a = !this._canShow() || this._adConfig.showOnlyImage || this._adConfig.showAieDefaultImage;
  7163.        this._adConfig.defaultImageDisplayed = !(!a || !this._adConfig.defaultImagePath);
  7164.        var b = this._adConfig.showOnlyImage;
  7165.        this._verifyPlaceHolder();
  7166.        var c = new EBG.Events.Event(EBG.Events.EventNames.SHOW_AD);
  7167.        c.dispatcher = this;
  7168.        c.timing = EBG.Events.EventTiming.BEFORE;
  7169.        c.eventData = {
  7170.            isDefaultImage: this._adConfig.defaultImageDisplayed
  7171.        };
  7172.        EBG.eventMgr.dispatchEvent(c);
  7173.        b !== this._adConfig.showOnlyImage && (a = !this._canShow() || this._adConfig.showOnlyImage || this._adConfig.showAieDefaultImage);
  7174.        this._subscribeToEvents();
  7175.        EBG.intMgr.initAdData(this._adConfig, this._adConfig.reportDelayedImpression ? !0 : !1);
  7176.        this._addSystemInteractions();
  7177.        if (EBG.AdChoice && EBG.AdChoice.AdChoiceManager) this._adChoice = new EBG.AdChoice.AdChoiceManager(this._adConfig), this._adChoice.init();
  7178.        (b = EBG.adaptor.getElementById(this._adConfig.placeHolderId)) &&
  7179.        this.resizePlaceHolder && "undefined" != typeof this._adConfig.display && EBG.adaptor.setElemStyle(b, "display", this._adConfig.display);
  7180.        if (a)
  7181.            if (this._adConfig.defaultImagePath) {
  7182.                if (!this._adConfig.imageOnly) a = new EBG.Events.Event(EBG.Events.EventNames.DEFAULT_IMPRESSION), a.eventData = {
  7183.                    impTrackingUrls: this._adConfig.defaultImpTrackingUrls
  7184.                }, a.dispatcher = this, a.timing = EBG.Events.EventTiming.ONTIME, EBG.eventMgr.dispatchEvent(a);
  7185.                this._subscribeToAdEvent(EBG.Events.EventNames.ADD_BANNER_DEFAULT_IMAGE_CREATIVE, this._terminateShow,
  7186.                    EBG.Events.EventTiming.AFTER);
  7187.                this._showOnlyDefaultImg = !0;
  7188.                this.checkAndShowDefaultImage(this.showDefaultImage)
  7189.            } else this._reportImpression(!0);
  7190.        else this._showOnlyDefaultImg = !1, this._addVideoInteractions(), this._addCustomInteractions(), this._adConfig.useHtmlConvertor && this._subscribeToAdEvent(EBG.Events.EventNames.ADD_CREATIVES, this._terminateShow, EBG.Events.EventTiming.AFTER), this._addCreatives(), this._adConfig.useHtmlConvertor || this._terminateShow()
  7191.    },
  7192.    _terminateShow: function(a) {
  7193.        var b = this.placeHolderElement =
  7194.            EBG.adaptor.getElementById(this._adConfig.placeHolderId);
  7195.        b && this.resizePlaceHolder && (EBG.adaptor.setElemStyle(b, "width", EBG.px(this._adConfig.width)), EBG.adaptor.setElemStyle(b, "height", EBG.px(this._adConfig.height)), EBG.adaptor.setElemStyle(b, "margin", "0px auto"));
  7196.        b = new EBG.Events.Event(EBG.Events.EventNames.SHOW_AD);
  7197.        b.dispatcher = this;
  7198.        b.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
  7199.        b.eventData = {
  7200.            isDefaultImage: a ? !0 : !1
  7201.        };
  7202.        EBG.eventMgr.dispatchEvent(b)
  7203.    },
  7204.    _verifyPlaceHolder: function() {
  7205.        !EBG.adaptor.getElementById(this._adConfig.placeHolderId) &&
  7206.            !document.body && document.write('<img style="width:0;height:0"></img>');
  7207.        return EBG.adaptor.getElementById(this._adConfig.placeHolderId)
  7208.    },
  7209.    _canShow: function() {
  7210.        return !0
  7211.    },
  7212.    _onPlayHandler: function() {
  7213.        this._adConfig.arrOnPlayEvents && this._executeEvents(this._adConfig.arrOnPlayEvents)
  7214.    },
  7215.    _onDownloadHandler: function() {
  7216.        this._adConfig.arrOnStartDnlEvents && this._executeEvents(this._adConfig.arrOnStartDnlEvents)
  7217.    },
  7218.    _collectUrl: function() {
  7219.        if (!EBG.isPreview && this._adConfig.shouldCollectUrl) try {
  7220.            EBG.adaptor.reportToRemoteServer(EBG.format("{0}{1}/BurstingPipe/adServer.bs?cn=curl&ai={2}&url=$${3}$$",
  7221.                EBG.protocol, this._adConfig.bsPath, this._adConfig.adId, top.document.URL))
  7222.        } catch (a) {}
  7223.    },
  7224.    _executeEvents: function(a) {
  7225.        for (var b, c, d = 0; d < a.length; d++) switch (c = this._replaceURLTokens(a[d].url), a[d].typeId) {
  7226.            case 3:
  7227.                b = "ebPlayScript" + d;
  7228.                EBG.adaptor.writeScript(EBG.adaptor.generateElementId(b, this._adConfig.uid), c, this._adConfig.placeHolderId);
  7229.                break;
  7230.            case 5:
  7231.                b = "ebDnlScript" + d;
  7232.                EBG.adaptor.writeScript(EBG.adaptor.generateElementId(b, this._adConfig.uid), c, this._adConfig.placeHolderId);
  7233.                break;
  7234.            case 4:
  7235.                b = "ebPlayIFR" + d;
  7236.                EBG.adaptor.writeReportingIFrame(EBG.adaptor.generateElementId(b, this._adConfig.uid), c, this._adConfig.placeHolderId);
  7237.                break;
  7238.            case 6:
  7239.                b = "ebDnlIFR" + d, EBG.adaptor.writeReportingIFrame(EBG.adaptor.generateElementId(b, this._adConfig.uid), c, this._adConfig.placeHolderId)
  7240.        }
  7241.    },
  7242.    _addSystemInteractions: function() {
  7243.        try {
  7244.            var a = this._adConfig.interactions[EBG.Interactions.SystemInts.CLICK];
  7245.            if (a) {
  7246.                var b = EBG.Interactions.Categories.SYSTEM;
  7247.                this._adConfig.interactions[EBG.Interactions.SystemInts.DEFAULT_CLICK] ? this._hasDefaultImageInteraction = !0 : this._adConfig.interactions[EBG.Interactions.SystemInts.DEFAULT_CLICK] = EBG.cloneObj(a);
  7248.                this._addCounterInteraction(EBG.Interactions.SystemInts.CLICK, b);
  7249.                this._addCounterInteraction(EBG.Interactions.SystemInts.DEFAULT_CLICK, b)
  7250.            }
  7251.            if ((!EBG.Ads.StdBanner || !(this instanceof EBG.Ads.StdBanner)) && (!EBG.Ads.WallpaperAd || !(this instanceof EBG.Ads.WallpaperAd))) this._addCounterInteraction(EBG.Interactions.SystemInts.AD_START, b, !0, 1), this._addCounterInteraction(EBG.Interactions.SystemInts.AD_STACKING, b, !1, 1),
  7252.                this._addCounterInteraction(EBG.Interactions.SystemInts.MULTI_BURN, b, !1, 1), this._addCounterInteraction(EBG.Interactions.SystemInts.AD_COLLISION, b, !1, 1), this._addCounterInteraction(EBG.Interactions.SystemInts.AD_CAROUSEL, b, !1, 1), this._adConfig.adParamsEnabled && this._addCounterInteraction(EBG.Interactions.SystemInts.AD_PARAMS, b, !1, 5, null, null, !0), this._adConfig.verUrlEnabled && this._addCounterInteraction(EBG.Interactions.SystemInts.VER_URL, b, !1, 1, null, null, !0)
  7253.        } catch (c) {}
  7254.    },
  7255.    _addCounterInteraction: function(a,
  7256.        b, c) {
  7257.        var d = this._adConfig.interactions[a],
  7258.            b = new EBG.Interactions.CounterInteractionData(a, b, this._adConfig.uid);
  7259.        b.initiationType = d.nInitiated ? EBG.Interactions.InitiationTypes.USER : EBG.Interactions.InitiationTypes.AUTO;
  7260.        b.countAsClick = d.fClick;
  7261.        if (d.agencyURL) b.remoteServers.agencyUrl = d.agencyURL;
  7262.        if (d.networkURL) b.remoteServers.networkUrl = d.networkURL;
  7263.        this._adjustClickTarget(a);
  7264.        b.counterJumpUrlData = d;
  7265.        b.reportImmediately = c ? !0 : !1;
  7266.        a = new EBG.Interactions.CounterInteraction(b);
  7267.        EBG.intMgr.addInteraction(a)
  7268.    },
  7269.    _addVideoInteractions: function() {},
  7270.    _addCustomInteractions: function() {},
  7271.    _adjustClickTarget: function(a) {
  7272.        var a = this._adConfig.interactions[a],
  7273.            b;
  7274.        switch (a.target) {
  7275.            case 0:
  7276.                b = EBG.WindowTarget.SELF;
  7277.                break;
  7278.            case 2:
  7279.                b = EBG.WindowTarget.TOP;
  7280.                break;
  7281.            default:
  7282.                b = EBG.WindowTarget.BLANK
  7283.        }
  7284.        a.target = b
  7285.    },
  7286.    _subscribeToEvents: function() {
  7287.        this._adConfig.interactionsToReport && this._subscribeToAdEvent(EBG.Events.EventNames.ADD_INTERACTION, this._handleInteractionsSubscription, EBG.Events.EventTiming.BEFORE);
  7288.        this._subscribeToAdEvent(EBG.EBMessage.CLICKTHROUGH,
  7289.            this._counterInteractionHandler);
  7290.        this._subscribeToAdEvent(EBG.EBMessage.VERSION_TRACKING_IMPRESSION, this._versionTrackingImpressionHandler);
  7291.        this._subscribeToAdEvent(EBG.Events.EventNames.DEFAULT_IMPRESSION, this._versionTrackingImpressionHandler, EBG.Events.EventTiming.ONTIME);
  7292.        this._subscribeToAdEvent(EBG.Events.EventNames.DEFAULT_CLICK, this._counterInteractionHandler);
  7293.        this._subscribeToAdEvent(EBG.Events.EventNames.ADD_CREATIVES, this._onAddCreativesHandler, EBG.Events.EventTiming.ONTIME);
  7294.        this._subscribeToAdEvent(EBG.Events.EventNames.SHOW_AD,
  7295.            this._onDownloadHandler, EBG.Events.EventTiming.ONTIME);
  7296.        this._subscribeToAdEvent(EBG.Events.EventNames.SHOW_AD, this._onPlayHandler, EBG.Events.EventTiming.AFTER);
  7297.        this._subscribeToAdEvent(EBG.Events.EventNames.SHOW_AD, this._collectUrl, EBG.Events.EventTiming.AFTER);
  7298.        this._adConfig.adParamsEnabled && this._subscribeToAdEvent(EBG.Events.EventNames.AD_START, this._reportAdParams, EBG.Events.EventTiming.AFTER);
  7299.        this._subscribeToAdEvent(EBG.EBMessage.NOTIFY_INTERACTION_MONITOR, this._notifyInteractionManager);
  7300.        var a =
  7301.            new EBG.Events.EventSubscription(EBG.Events.EventNames.ELEMENT_LOADED, function(a) {
  7302.                a.eventData.adUId == this._adConfig.uid && this._triggerAdStart()
  7303.            }, this);
  7304.        a.timing = EBG.Events.EventTiming.ONTIME;
  7305.        EBG.eventMgr.subscribeToEvent(a);
  7306.        this._subscribeToAdEvent(EBG.Events.EventNames.THROTTLED, this._handleCreativeThrottled)
  7307.    },
  7308.    _handleInteractionsSubscription: function(a) {
  7309.        try {
  7310.            var b = a.eventData.interactionData.reportingName;
  7311.            return this._adConfig.interactionsToReport && this._adConfig.interactionsToReport[b] ? !0 : !1
  7312.        } catch (c) {}
  7313.    },
  7314.    _onAddCreativesHandler: function(a) {
  7315.        this._adConfig.ffs.CFF_FlashThrottle && (!a || !a.eventData || !(a.eventData.creativeType && a.eventData.creativeType == EBG.Events.EventNames.ADD_BANNER_DEFAULT_IMAGE_CREATIVE)) && this._checkForCreativeThrottling();
  7316.        try {
  7317.            if (!EBG.Initializer._getAdClass({
  7318.                    tn: this._adConfig.templateName
  7319.                }).requiresIframeBust || this._adConfig.actualServingMode == EBG.Adaptors.ServingMode.SCRIPT) {
  7320.                var b = a.dispatcher._adConfig.placeHolderId;
  7321.                if (b) {
  7322.                    var c = (this._adConfig.displayWin || EBG.adaptor.getDisplayWin()).document.getElementById(b);
  7323.                    if (c) c.style.backgroundImage = "", c.onclick = function() {}
  7324.                }
  7325.            }
  7326.        } catch (d) {}
  7327.    },
  7328.    _checkForCreativeThrottling: function() {
  7329.        for (cc in this._CCs) this._CCs.hasOwnProperty(cc) && this._CCs[cc].detectThrottling && (this._CCs[cc].detectThrottling(), this._subscribeToAdEvent(EBG.Events.EventNames.MOUSE_OVER, this._stopPollingForThrottle, EBG.Events.EventTiming.ONTIME))
  7330.    },
  7331.    _stopPollingForThrottle: function(a) {
  7332.        var b = !0;
  7333.        if (a && a.eventData && a.eventData.target && a.eventData.target.children) {
  7334.            for (var c in this._CCs) this._CCs.hasOwnProperty(c) &&
  7335.                (a.eventData.target.children[c] && this._CCs[c].stopPollingForThrottle && this._CCs[c].stopPollingForThrottle(), this._CCs[c].isPollingForThrottle && !0 == this._CCs[c].isPollingForThrottle && (b = !1));
  7336.            if (b) a = new EBG.Events.EventSubscription(EBG.Events.EventNames.MOUSE_OVER, this._stopPollingForThrottle, this), a.dispatcherFilters = {
  7337.                "_adConfig.rnd": this._adConfig.rnd
  7338.            }, a.timing = EBG.Events.EventTiming.ONTIME, EBG.eventMgr.unsubscribeFromEvent(a)
  7339.        }
  7340.    },
  7341.    _onAdCreativesAdded: function() {
  7342.        var a = new EBG.Events.Event(EBG.Events.EventNames.AD_CREATIVES_ADDED);
  7343.        a.dispatcher = this;
  7344.        EBG.eventMgr.dispatchEvent(a)
  7345.    },
  7346.    _fixPage: function() {
  7347.        var a = this._adConfig.page,
  7348.            a = a.replace(/\~/ig, "_"),
  7349.            a = a.replace(/\^/ig, "_"),
  7350.            a = a.replace(/\|/ig, "_"),
  7351.            a = escape(a);
  7352.        this._adConfig.page = a
  7353.    },
  7354.    _updateURLs: function() {
  7355.        for (var a = this._adConfig.clickTrackingUrls, b = 0; b < a.length; b++) a[b] = this._replaceURLTokens(a[b]);
  7356.        var a = this._adConfig.interactions,
  7357.            c;
  7358.        for (c in a)
  7359.            if (a.hasOwnProperty(c)) a[c].agencyURL = this._replaceURLTokens(a[c].agencyURL), a[c].networkURL = this._replaceURLTokens(a[c].networkURL),
  7360.                a[c].jumpUrl = this._replaceURLTokens(a[c].jumpUrl)
  7361.    },
  7362.    _handleMultiBurn: function() {
  7363.        this._reportMultiBurn(this._checkMultiBurn())
  7364.    },
  7365.    _checkMultiBurn: function() {
  7366.        var a = {
  7367.                isAdCarousel: !1,
  7368.                isAdCollision: !1,
  7369.                isMultiBurn: !1
  7370.            },
  7371.            b = this._adConfig.advertiserId,
  7372.            c = this._adConfig.placementId,
  7373.            d = this._adConfig.uid;
  7374.        try {
  7375.            var e = EBG.getTopAccessibleWindow(!1);
  7376.            e.ebAds = e.ebAds || {};
  7377.            for (var f in e.ebAds) {
  7378.                var g = e.ebAds[f];
  7379.                if (d != g._adConfig.uid && g.placeHolderElement) {
  7380.                    if (!g.removed) try {
  7381.                        if (0 == g.placeHolderElement.getClientRects().length) g.removed = !0
  7382.                    } catch (h) {
  7383.                        g.removed = !0
  7384.                    }
  7385.                    if (g.removed) {
  7386.                        var i = (new Date).getTime() / 1E3 - g.startTime;
  7387.                        if (!a.isAdCarousel && 10 < i && 150 > i) a.isAdCarousel = !0
  7388.                    } else if (!a.isMultiBurn && c === g._adConfig.placementId) a.isMultiBurn = !0;
  7389.                    else if (!a.isMultiBurn && !a.isAdCollision && b && b === g._adConfig.advertiserId) a.isAdCollision = !0
  7390.                }
  7391.            }
  7392.        } catch (j) {}
  7393.        return a
  7394.    },
  7395.    _reportMultiBurn: function(a) {
  7396.        a.isMultiBurn ? EBG.intMgr.handleCounterInteraction(EBG.Interactions.SystemInts.MULTI_BURN, this._adConfig.uid) : a.isAdCollision && EBG.intMgr.handleCounterInteraction(EBG.Interactions.SystemInts.AD_COLLISION,
  7397.            this._adConfig.uid);
  7398.        a.isAdCarousel && EBG.intMgr.handleCounterInteraction(EBG.Interactions.SystemInts.AD_CAROUSEL, this._adConfig.uid)
  7399.    },
  7400.    _reportAdParams: function() {
  7401.        if (EBG.intMgr.isInteractionExist(EBG.Interactions.SystemInts.AD_PARAMS.toLowerCase(), EBG.Interactions.InteractionTypes.COUNTER, this._adConfig.uid))
  7402.            if (EBG.adaptor.isPageLoaded()) {
  7403.                if (this._adConfig.adParamsEnabled) {
  7404.                    var a = this._getServingModeNum(),
  7405.                        b = this._getBannerLocation(),
  7406.                        b = b && b.X + "x" + b.Y,
  7407.                        c = !this.visibilityMgr ? 0 : this.visibilityMgr.getVisibilityProviderNum(),
  7408.                        d = this._adConfig.width + "x" + this._adConfig.height,
  7409.                        e = this._getAdCodeBase(),
  7410.                        f = EBG.adaptor.browser.getEnvironment();
  7411.                    EBG.intMgr.handleCounterInteraction(EBG.Interactions.SystemInts.AD_PARAMS, this._adConfig.uid, 0, !1, {
  7412.                        value: {
  7413.                            ifr: a,
  7414.                            loc: b,
  7415.                            vsbp: c,
  7416.                            size: d,
  7417.                            cb: e,
  7418.                            env: f
  7419.                        }
  7420.                    })
  7421.                }
  7422.            } else this._subscribeToAdEvent(EBG.Events.EventNames.PAGE_LOAD, this._reportAdParams)
  7423.    },
  7424.    _getBannerLocation: function(a) {
  7425.        if (a && EBG.isNumber(a.X) && EBG.isNumber(a.Y) && this._adConfig.actualServingMode && this._adConfig.actualServingMode == EBG.Adaptors.ServingMode.FRIENDLY_IFRAME)
  7426.            for (var b =
  7427.                    EBG.adaptor.getDisplayWin(); b !== b.parent && b.self !== b.parent;) {
  7428.                var c = EBG.adaptor.getPositioningByElement(b.frameElement);
  7429.                a.X += c.X;
  7430.                a.Y += c.Y;
  7431.                b = b.parent
  7432.            }
  7433.        return a
  7434.    },
  7435.    _getAdCodeBase: function(a) {
  7436.        a = EBG.isDefined(a) ? a : 0;
  7437.        this._showOnlyDefaultImg && (a = 0);
  7438.        1 == a && this._adConfig.hasConverter && this._adConfig.useHtmlConvertor && (a = 3);
  7439.        return a
  7440.    },
  7441.    _getServingModeNum: function() {
  7442.        var a = {
  7443.            SCRIPT: 0,
  7444.            FRIENDLY_IFRAME: 1,
  7445.            IFRAME: 2,
  7446.            INNER_IFRAME: 3,
  7447.            TOPMOST_FRIENDLY_IFRAME: 4
  7448.        };
  7449.        if (!EBG.adaptor.serving) return -1;
  7450.        var b = EBG.adaptor.serving.detectServingEnvironment(this._adConfig.actualServingMode);
  7451.        return EBG.isDefined(a[b]) ? a[b] : -1
  7452.    },
  7453.    _getTemplateNameNum: function() {
  7454.        return {
  7455.            Html5StdBanner: 0,
  7456.            Html5Banner: 1,
  7457.            Html5SEBanner: 2,
  7458.            Html5ExpBanner: 3,
  7459.            Html5PoliteBanner: 4,
  7460.            StdBanner: 5,
  7461.            Banner: 6,
  7462.            SingleExpBanner: 7,
  7463.            ExpBanner: 8,
  7464.            Visibility: 9,
  7465.            FloatingAd: 10,
  7466.            FloatingAdWithReminder: 11,
  7467.            Tracking: 12
  7468.        }[this._adConfig.templateName] || -1
  7469.    },
  7470.    getAdId: function() {
  7471.        return this._adConfig.adId
  7472.    },
  7473.    _replaceURLTokens: function(a) {
  7474.        var b = this._adConfig;
  7475.        try {
  7476.            a && (a = a.replace(/\[%random%\]/ig, b.rnd), a = a.replace(/\[ebRandom\]/ig, b.rnd), a = a.replace(/\[timestamp\]/ig,
  7477.                b.rnd), a = a.replace(/\[%tp_adid%\]/ig, b.adId), a = a.replace(/\[%tp_flightid%\]/ig, b.placementId), a = a.replace(/\[%tp_campaignid%\]/ig, b.campaignId));
  7478.            if (!a || !b.sUrlTokens) return a;
  7479.            if (!EBG.isObj(b.objURLTokens)) b.oURLTokens = this._pairsToObj(b.sUrlTokens, "$$");
  7480.            for (var c in b.oURLTokens) b.oURLTokens.hasOwnProperty(c) && (a = a.replace(RegExp("\\[%" + c + "%\\]", "ig"), b.oURLTokens[c]))
  7481.        } catch (d) {}
  7482.        return a
  7483.    },
  7484.    _pairsToObj: function(a, b) {
  7485.        for (var c = {}, d = unescape(a).split(b), e = 0; e < d.length; e++) try {
  7486.            if (d[e]) {
  7487.                var f = d[e].indexOf("="),
  7488.                    g = d[e].substr(0, f),
  7489.                    h = d[e].substr(f + 1);
  7490.                c[g] = escape(h)
  7491.            }
  7492.        } catch (i) {}
  7493.        return c
  7494.    },
  7495.    _subscribeToAdEvent: function(a, b, c) {
  7496.        a = new EBG.Events.EventSubscription(a, b, this);
  7497.        a.dispatcherFilters = {
  7498.            "_adConfig.rnd": this._adConfig.rnd
  7499.        };
  7500.        if (c) a.timing = c;
  7501.        EBG.eventMgr.subscribeToEvent(a);
  7502.        return a
  7503.    },
  7504.    _getCDIUrl: function(a) {
  7505.        var b = a && a.defaultImagePath ? a.defaultImagePath : null,
  7506.            b = EBG.format("{0}{1}/{2}/adServer.bs?cn=cdi&ai={3}&p={4}&pluid={5}&ru={6}&pc={7}&brt={8}&pltype={9}&sessionid={10}&dir={11}&ord={12}", EBG.protocol, this._adConfig.bsPath,
  7507.                this._adConfig.interactionServer, this._adConfig.adId, this._adConfig.page, this._adConfig.pluId, EBG.isDefinedNotNull(b) && "" != b ? b : EBG.combinePaths(this._adConfig.resourcePath, this._adConfig.defaultImagePath), this._adConfig.sPublisherPlacementId, EBG.adaptor.browser._browserCode, EBG.adaptor.browser._platform, this._adConfig.sID, this._cdiReason, this._adConfig.rnd),
  7508.            c = this._adConfig.massVersioning.targetAudienceId;
  7509.        c && (b += EBG.format("&ta={0}", c));
  7510.        (c = this._adConfig.massVersioning.deliveryGroupId) && (b += EBG.format("&dg={0}",
  7511.            c));
  7512.        a && a.versionId ? b += EBG.format("&vid={0}", a.versionId) : this._adConfig.massVersioning.adVersions && (a = this._removePrefixFromVersions(), b += EBG.format("&vid={0}", a));
  7513.        EBGInfra.isDefinedNotNull(this._adConfig.diAppId) && (b += "&diappid=" + this._adConfig.diAppId);
  7514.        return b
  7515.    },
  7516.    _removePrefixFromVersions: function() {
  7517.        var a = "",
  7518.            b = this._adConfig.massVersioning.adVersions;
  7519.        if (b) {
  7520.            for (var a = [], b = b.split(","), c = 0; c < b.length; c++) {
  7521.                var d = b[c].indexOf("_");
  7522.                a.push(-1 == d ? b[c] : b[c].substring(0, d))
  7523.            }
  7524.            a = a.join()
  7525.        }
  7526.        return a
  7527.    },
  7528.    buildJSONImgObj: function(a,
  7529.        b) {
  7530.        var c = EBG.format(a + "_{0}", this._adConfig.uid);
  7531.        return {
  7532.            tagName: EBG.Adaptors.TagNames.IMG,
  7533.            attributes: {
  7534.                id: c,
  7535.                src: b,
  7536.                width: this._adConfig.width,
  7537.                height: this._adConfig.height,
  7538.                style: {
  7539.                    width: this._adConfig.width,
  7540.                    height: this._adConfig.height
  7541.                },
  7542.                title: this._adConfig.title ? this._adConfig.title : "",
  7543.                onload: EBG.format('(function(e) { var event = new EBG.Events.Event(EBG.Events.EventNames.ELEMENT_LOADED);event.dispatcher = this;event.eventData = { DOMEvent: e, elementId: "{0}", adUId:"{1}" };event.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;EBG.eventMgr.dispatchEvent(event);} )(typeof arguments != "undefined" ? arguments[0] : null);',
  7544.                    c, this._adConfig.uid)
  7545.            }
  7546.        }
  7547.    },
  7548.    setImageClick: function(a, b, c, d, e) {
  7549.        a.attributes.onclick = EBG.format('EBG.ads["' + this._adConfig.uid + '"].onImageClick("{0}", {1},"{2}", "{3}", "{4}", "{5}")', this._adConfig.uid, b, a.attributes.id, c, d, e);
  7550.        EBG.mergeObj({
  7551.            cursor: "pointer; cursor: hand"
  7552.        }, a.attributes.style)
  7553.    },
  7554.    _addDefaultImgRequest: function() {
  7555.        this.checkAndShowDefaultImage(this.showDefaultImage)
  7556.    },
  7557.    checkAndShowDefaultImage: function(a) {
  7558.        var b = "",
  7559.            c = ".xml",
  7560.            d = !0;
  7561.        if (EBG.isDefinedNotNull(this._adConfig.svJSON) || EBG.isDefinedNotNull(this._adConfig.sv3CatalogMap) ||
  7562.            this._adConfig.massVersioning.versionFullPath) c = ".json", d = !1;
  7563.        if (EBG.isDefinedNotNull(this._adConfig.massVersioning) && "" != this._adConfig.massVersioning.defaultAdVersion && "" != this._adConfig.massVersioning.adBasePath) {
  7564.            b = this._adConfig.massVersioning.defaultAdVersion;
  7565.            b = 0 < this._adConfig.massVersioning.massVersionFolderDivider ? EBG.Ads.Ad.Fn.fixMVPathString(b, this._adConfig.massVersioning.massVersionFolderDivider) : b;
  7566.            if (this._adConfig.massVersioning.versionFullPath) b = b.p;
  7567.            b = EBG.combinePaths(this._adConfig.massVersioning.adBasePath,
  7568.                b + c);
  7569.            b = this._adConfig.massVersioning.versionFullPath ? EBG.combinePaths("//" + this._adConfig.sHost, b) : EBG.combinePaths(this._adConfig.resourcePath, b)
  7570.        }
  7571.        c = d ? this._readMassVersionInfo : this._readJsonVersionInfo;
  7572.        (!b || !EBG.adaptor.getDataFromRemoteServer(b, c, this, !0, d)) && a.apply(this)
  7573.    },
  7574.    subscribeToStandardElementEvents: function() {},
  7575.    showDefaultImage: function(a) {
  7576.        var b = !this._adConfig.imageOnly || this._hasDefaultImageInteraction,
  7577.            c = "";
  7578.        this._adConfig.showOnlyImage || this._adConfig.imageOnly || this._adConfig.reportDelayedImpression ?
  7579.            c = a && a.isValid ? a.defaultImagePath : EBG.combinePaths(this._adConfig.resourcePath, this._adConfig.defaultImagePath) : (c = a && a.isValid ? this._getCDIUrl(a) : this._getCDIUrl(), this._adConfig.massVersioning.adVersions = "");
  7580.        var c = this.buildJSONImgObj("ebDefaultImg", c),
  7581.            d = a && a.isValid && a.jumpUrl ? a.jumpUrl : b ? this._adConfig.interactions[EBG.Interactions.SystemInts.DEFAULT_CLICK].jumpUrl : this._adConfig.interactions[EBG.Interactions.SystemInts.CLICK].jumpUrl;
  7582.        d && this.setImageClick(c, b, d, a && a.isValid ? a.selectedVersion :
  7583.            "", a && a.isValid ? a.thirdPartyClks : "");
  7584.        a && a.thirdPartyImps && a.thirdPartyImps.length && this._reportImpressionTrackingURLs(a.thirdPartyImps);
  7585.        a = new EBG.Events.Event(EBG.Events.EventNames.ADD_CREATIVES);
  7586.        a.dispatcher = this;
  7587.        a.eventData = {
  7588.            tagsObj: c,
  7589.            assetId: c.attributes.id,
  7590.            isPanel: !1,
  7591.            creativeType: EBG.Events.EventNames.ADD_BANNER_DEFAULT_IMAGE_CREATIVE
  7592.        };
  7593.        a.timing = EBG.Events.EventTiming.BEFORE;
  7594.        d = EBG.eventMgr.dispatchEvent(a);
  7595.        if (!d && (b = new EBG.Events.Event(EBG.Events.EventNames.ADD_BANNER_DEFAULT_IMAGE_CREATIVE),
  7596.                b.eventData = {
  7597.                    assetId: c.attributes.id
  7598.                }, b.dispatcher = this, b.timing = EBG.Events.EventTiming.BEFORE, d = EBG.eventMgr.dispatchEvent(b), !d)) {
  7599.            var d = EBG.adaptor._getTags(c),
  7600.                e = EBG.adaptor.getElementById(this._adConfig.placeHolderId);
  7601.            EBG.adaptor.setInnerHtml(e, d);
  7602.            this._defaultImgResId = c.attributes.id;
  7603.            this.subscribeToStandardElementEvents(this._defaultImgResId);
  7604.            b.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
  7605.            EBG.eventMgr.dispatchEvent(b);
  7606.            a.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
  7607.            EBG.eventMgr.dispatchEvent(a)
  7608.        }
  7609.    },
  7610.    _triggerAdStart: function(a) {
  7611.        if (!(this._shouldWaitForTriggerAdStart() && !(EBGInfra.isDefined(a) && a.name === EBG.EBMessage.TRIGGER_AD_START) || this._adConfig.adStarted))
  7612.            if (this._adConfig.adStarted = !0, a = new EBG.Events.Event(EBG.Events.EventNames.AD_START), a.eventData = {
  7613.                    intName: EBG.Interactions.SystemInts.Ad_START
  7614.                }, a.dispatcher = this, a.timing = EBG.Events.EventTiming.BEFORE, !EBG.eventMgr.dispatchEvent(a)) this._shouldFireAdStart() && EBG.intMgr.handleCounterInteraction(EBG.Interactions.SystemInts.AD_START, this._adConfig.uid),
  7615.                a.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER, EBG.eventMgr.dispatchEvent(a)
  7616.    },
  7617.    _shouldFireAdStart: function() {
  7618.        var a = !1;
  7619.        if (this._adConfig.isInstream) {
  7620.            if (this._adConfig.isInstreamVisibility || this._adConfig.isInstreamVerification) a = !0
  7621.        } else if (this._adConfig.displayVerification || this._adConfig.visibility.mode == EBG.VisibilityMode.BASIC_MODE || this._adConfig.visibility.mode == EBG.VisibilityMode.ENHANCED_MODE) a = !0;
  7622.        return a
  7623.    },
  7624.    _shouldWaitForTriggerAdStart: function() {
  7625.        return !1
  7626.    },
  7627.    _readJsonVersionInfo: function(a) {
  7628.        var b =
  7629.            JSON.parse(a),
  7630.            a = this._adConfig.massVersioning.defaultAdVersion.indexOf("_"),
  7631.            a = {
  7632.                isValid: !!b.DefaultImage,
  7633.                jumpUrl: b.ClickthroughURL ? b.ClickthroughURL : "",
  7634.                defaultImagePath: b.DefaultImage ? b.DefaultImage : "",
  7635.                selectedVersion: -1 == a ? this._adConfig.massVersioning.defaultAdVersion : this._adConfig.massVersioning.defaultAdVersion.substring(0, a),
  7636.                thirdPartyImps: b.ThirdPartyImpressionURL ? this._parseUrlValue(b.ThirdPartyImpressionURL) : [],
  7637.                thirdPartyClks: b.ThirdPartyClickthroughURL ? this._parseUrlValue(b.ThirdPartyClickthroughURL) : [],
  7638.                versionId: b.versionId ? b.versionId : 0
  7639.            };
  7640.        if (a.isValid && EBG.isNumber(b.DefaultImage)) {
  7641.            a.isValid = !1;
  7642.            var b = this._adConfig.assets,
  7643.                c = "ebMovie" + a.defaultImagePath;
  7644.            if (EBG.isDefinedNotNull(b[c].dsPath)) a.defaultImagePath = EBG.isInWorkshop ? b[c].dsPath : EBG.combinePaths(this._adConfig.resourcePath, b[c].dsPath), a.isValid = !0
  7645.        }(this._showOnlyDefaultImg ? this.showDefaultImage : this._showImgAsCreative).apply(this, [a])
  7646.    },
  7647.    _readMassVersionInfo: function(a) {
  7648.        var b = {
  7649.            isValid: !1,
  7650.            jumpUrl: "",
  7651.            defaultImagePath: "",
  7652.            selectedVersion: "",
  7653.            thirdPartyImps: [],
  7654.            thirdPartyClks: []
  7655.        };
  7656.        try {
  7657.            if (EBG.isDefined(a) && null != a) {
  7658.                var c = a.documentElement.attributes.getNamedItem("productClickThrough"),
  7659.                    d = a.documentElement.attributes.getNamedItem("DefaultImage"),
  7660.                    e = a.documentElement.attributes.getNamedItem("ThirdPartyImps"),
  7661.                    f = a.documentElement.attributes.getNamedItem("ThirdPartyClickThrough"),
  7662.                    g = this._adConfig.massVersioning.defaultAdVersion.indexOf("_"),
  7663.                    b = {
  7664.                        isValid: null != d && "" != d.value,
  7665.                        jumpUrl: null != c ? c.value : "",
  7666.                        defaultImagePath: null != d ? d.value : "",
  7667.                        selectedVersion: -1 ==
  7668.                            g ? this._adConfig.massVersioning.defaultAdVersion : this._adConfig.massVersioning.defaultAdVersion.substring(0, g),
  7669.                        thirdPartyImps: e && e.value ? this._parseUrlValue(e.value) : [],
  7670.                        thirdPartyClks: f && f.value ? this._parseUrlValue(f.value) : []
  7671.                    };
  7672.                if (b.isValid && EBG.isNumber(b.defaultImagePath)) {
  7673.                    b.isValid = !1;
  7674.                    var h = this._adConfig.assets,
  7675.                        i = "ebMovie" + b.defaultImagePath;
  7676.                    if (EBG.isDefinedNotNull(h[i].dsPath)) b.defaultImagePath = EBG.isInWorkshop ? h[i].dsPath : EBG.combinePaths(this._adConfig.resourcePath, h[i].dsPath), b.isValid = !0
  7677.                }
  7678.            }(this._showOnlyDefaultImg ? this.showDefaultImage : this._showImgAsCreative).apply(this, [b])
  7679.        } catch (j) {
  7680.            this.showDefaultImage(b)
  7681.        }
  7682.    },
  7683.    _parseUrlValue: function(a) {
  7684.        for (var b = [], a = a.split("\u007f"), c = 0; c < a.length; c++)
  7685.            for (var d = a[c].split("|"), e = 0; e < d.length; e++) b.push(d[e]);
  7686.        return b
  7687.    },
  7688.    _sendInitAdInformation: function() {
  7689.        this._dpm.send(EBG.DataProfile.GENERAL, {
  7690.            frmt: this._getTemplateNameNum(),
  7691.            cs: this._adConfig.customScripts
  7692.        });
  7693.        if (EBG.adaptor.browser.isMobile()) {
  7694.            var a = {};
  7695.            if (this._adConfig.ffs.CFF_DataPipeUserAgent) a.ua =
  7696.                window.navigator.userAgent;
  7697.            if (this._adConfig.actualServingMode && this._adConfig.actualServingMode == EBG.Adaptors.ServingMode.SCRIPT) a.scrl = ~~(window.innerWidth > document.documentElement.clientWidth), a.fh = ~~(window.innerHeight === this._adConfig.height), a.fw = ~~(window.innerWidth === this._adConfig.width);
  7698.            0 < Object.getOwnPropertyNames(a).length && this._dpm.send(EBG.DataProfile.PLATFORM, a)
  7699.        }
  7700.        a = this._getServingModeNum();
  7701.        this._dpm.send(EBG.DataProfile.SERVING, {
  7702.            srvmd: a
  7703.        });
  7704.        this._adConfig.MRAID && this._dpm.send(EBG.DataProfile.PLATFORM, {
  7705.            mraid: 1
  7706.        });
  7707.        "undefined" != typeof mraid && this._dpm.send(EBG.DataProfile.PLATFORM, {
  7708.            mraidw: 1
  7709.        })
  7710.    },
  7711.    _switchAssetsAfterThrottle: function() {},
  7712.    _handleCreativeThrottled: function(a) {
  7713.        if (this._adConfig.ffs.CFF_FlashThrottle && a.eventData)
  7714.            if (a.eventData.state && a.eventData.state == EBG.ThrottleStates.RESUME) clearTimeout(this._throttleTimeout), this._throttleState = EBG.ThrottleStates.RESUME;
  7715.            else if (a.eventData.state && a.eventData.state == EBG.ThrottleStates.POLLED && a.dispatcher._adConfig.uid == this._adConfig.uid) this._switchAssetsAfterThrottle(),
  7716.            EBG.adaptor.flash.removeThrottleDetectionSwf(this._adConfig.uid);
  7717.        else if (this.visibilityMgr && a.eventData.id) {
  7718.            if (this.visibilityMgr.isVisibile()) {
  7719.                var b = EBG.adaptor.getElementById(a.eventData.id),
  7720.                    b = b && EBG.adaptor.getBoundingClientRect(b);
  7721.                this._throttleState == EBG.ThrottleStates.THROTTLE && (!b || 0 < b.width && 0 < b.height) ? (this._switchAssetsAfterThrottle(), EBG.adaptor.flash.removeThrottleDetectionSwf(this._adConfig.uid)) : this._throttleTimeout = EBG.runTimed(this, this._handleCreativeThrottled, [a], 1E3)
  7722.            } else this._subscribeToAdEvent(EBG.Events.EventNames.PAGE_SCROLL,
  7723.                this._checkIfStillThrottled);
  7724.            this._throttleState = EBG.ThrottleStates.THROTTLE
  7725.        }
  7726.    },
  7727.    _checkIfStillThrottled: function(a) {
  7728.        if (a) {
  7729.            if (this.visibilityMgr && !this._throttleTimeout && this._throttleState == EBG.ThrottleStates.THROTTLE && this.visibilityMgr.isVisibile()) this._throttleTimeout = EBG.runTimed(this, this._checkIfStillThrottled, [], 1E3)
  7730.        } else {
  7731.            if (this._throttleState == EBG.ThrottleStates.THROTTLE && this.visibilityMgr && this.visibilityMgr.isVisibile()) this._switchAssetsAfterThrottle(), EBG.adaptor.flash.removeThrottleDetectionSwf(this._adConfig.uid),
  7732.                a = new EBG.Events.EventSubscription(EBG.Events.EventNames.PAGE_SCROLL, this._checkIfStillThrottled, this), a.dispatcherFilters = {
  7733.                    "_adConfig.rnd": this._adConfig.rnd
  7734.                }, a.timing = EBG.Events.EventTiming.ONTIME, EBG.eventMgr.unsubscribeFromEvent(a);
  7735.            clearTimeout(this._throttleTimeout);
  7736.            this._throttleTimeout = null;
  7737.            if (this._throttleState == EBG.ThrottleStates.RESUME) a = new EBG.Events.EventSubscription(EBG.Events.EventNames.PAGE_SCROLL, this._checkIfStillThrottled, this), a.dispatcherFilters = {
  7738.                    "_adConfig.rnd": this._adConfig.rnd
  7739.                },
  7740.                a.timing = EBG.Events.EventTiming.ONTIME, EBG.eventMgr.unsubscribeFromEvent(a)
  7741.        }
  7742.    },
  7743.    dispatchCustomEvent: function(a, b, c, d) {
  7744.        a = new EBG.Events.Event(a);
  7745.        a.dispatcher = d;
  7746.        a.eventData = {
  7747.            assetId: b
  7748.        };
  7749.        a.timing = c;
  7750.        return EBG.eventMgr.dispatchEvent(a)
  7751.    },
  7752.    _notifyInteractionManager: function(a) {
  7753.        var b = {};
  7754.        if (a && a.eventData) b = a.eventData;
  7755.        b.elapsedTime = "";
  7756.        if (EBG.intMgr.getAdDuration) b.elapsedTime = EBG.intMgr.getAdDuration(this._adConfig.uid);
  7757.        EBG.adaptor.notifyIntMonitor(a.eventData)
  7758.    },
  7759.    onImageClick: function(a, b, c, d, e, f) {
  7760.        try {
  7761.            var g =
  7762.                b ? new EBG.Events.Event(EBG.Events.EventNames.DEFAULT_CLICK) : new EBG.Events.Event(EBG.EBMessage.CLICKTHROUGH);
  7763.            g.eventData = b ? {
  7764.                intName: EBG.Interactions.SystemInts.DEFAULT_CLICK
  7765.            } : {
  7766.                intName: EBG.Interactions.SystemInts.CLICK
  7767.            };
  7768.            if (EBG.isDefined(d)) g.eventData.clickUrl = d;
  7769.            if (EBG.isDefined(e)) g.eventData.clickedVersion = e;
  7770.            if (EBG.isDefined(f)) g.eventData.clickedVerUrl = f;
  7771.            g.dispatcher = EBG.ads[a];
  7772.            EBG.eventMgr.dispatchEvent(g);
  7773.            if (EBG.adaptor.intMonitorExist()) {
  7774.                var h = new EBG.Events.Event(EBG.EBMessage.NOTIFY_INTERACTION_MONITOR);
  7775.                h.eventData = {
  7776.                    command: EBG.EBMessage.CLICKTHROUGH,
  7777.                    args: "",
  7778.                    objName: c,
  7779.                    adId: EBG.Ads.Ad.Fn.getAdIdFromAdUId(a)
  7780.                };
  7781.                EBG.eventMgr.dispatchEvent(h)
  7782.            }
  7783.        } catch (i) {}
  7784.    }
  7785. };
  7786. EBG.declareClass(EBG.Ads.Ad, null);
  7787. EBG.Ads.Ad.Fn = {
  7788.    getAdIdFromAdUId: function(a) {
  7789.        return a.split("_")[0]
  7790.    },
  7791.    getRandFromAdUId: function(a) {
  7792.        return a.split("_")[1]
  7793.    },
  7794.    getVersionToReport: function(a) {
  7795.        return -1 < a.indexOf(",") ? "m" : -1 < a.indexOf("_") ? a.substr(0, a.indexOf("_")) : a
  7796.    },
  7797.    getAdVersions: function(a) {
  7798.        for (var b = "", a = a.adVersions.split(","), c = 0; c < a.length; c++) b && (b += ","), b += a[c];
  7799.        return b
  7800.    },
  7801.    fixMVPathString: function(a, b) {
  7802.        if (0 < b)
  7803.            for (var c = a.split(","), d = "", e = "", f, g, h, i = 0; i < c.length; i++) h = c[i], f = "", EBG.isDefinedNotNull(h.match("_")) && (f = h.substr(h.indexOf("_"))),
  7804.                h = parseInt(h), g = parseInt(h / b), h = g + f + "/" + h, d += e + h, "" == e && (e = ",");
  7805.        return d
  7806.    },
  7807.    _handlePageResizeOrScroll: function() {}
  7808. };
  7809. EBG.Ads.RichAd = function(a) {
  7810.    this._downloadMode = a.dlm;
  7811.    EBG.callSuperConstructor(EBG.Ads.RichAd, this, [a])
  7812. };
  7813. EBG.Ads.RichAd.prototype = {
  7814.    isInFullScreenMode: !1,
  7815.    visibilityMgr: null,
  7816.    videoLoaderDrivers: [],
  7817.    _wallpaper: null,
  7818.    _registeredToMouseMove: !1,
  7819.    _mouseMoveTimeOut: null,
  7820.    _creativeContainerReadyHandled: !1,
  7821.    _isStdAd: function() {
  7822.        return !1
  7823.    },
  7824.    _subscribeToEvents: function() {
  7825.        try {
  7826.            EBG.callSuperFunction(EBG.Ads.RichAd, this, "_subscribeToEvents"), EBG.adaptor.isPageLoaded() ? EBG.runTimed(this, this._handlePageLoaded, [], 0) : this._subscribeToAdEvent(EBG.Events.EventNames.PAGE_LOAD, this._handlePageLoaded), this._subscribeToAdEvent(EBG.EBMessage.NOTIFIED_INTERACTION,
  7827.                    this._notifiedInteractionHandler), this._subscribeToAdEvent(EBG.EBMessage.VIDEO_INTERACTION, this._videoInteractionHandler), this._subscribeToAdEvent(EBG.EBMessage.USER_ACTION_COUNTER, this._counterInteractionHandler), this._subscribeToAdEvent(EBG.EBMessage.AUTOMATIC_EVENT_COUNTER, this._counterInteractionHandler), this._subscribeToAdEvent(EBG.EBMessage.START_TIMER, this._startTimerHandler), this._subscribeToAdEvent(EBG.EBMessage.STOP_TIMER, this._stopTimerHandler), this._subscribeToAdEvent(EBG.EBMessage.START_VIDEO_TIMER,
  7828.                    this._startTimerVideoHandler), this._subscribeToAdEvent(EBG.EBMessage.STOP_VIDEO_TIMER, this._stopTimerHandler), this._subscribeToAdEvent(EBG.EBMessage.UPDATE_TIMER, this._updateTimerHandler), this._subscribeToAdEvent(EBG.EBMessage.START_VIDEO, this._startAggregateHandler), this._subscribeToAdEvent(EBG.EBMessage.STOP_VIDEO, this._stopAggregateHandler), this._subscribeToAdEvent(EBG.EBMessage.UPDATE_VIDEO_DURATION, this._updateAggregationTimeHandler), this._subscribeToAdEvent(EBG.EBMessage.INIT_VIDEO_LOADER, this._initVideoLoaderHandler),
  7829.                this._subscribeToAdEvent(EBG.EBMessage.VIDEO_LOAD, this._videoLoadHandler), this._subscribeToAdEvent(EBG.EBMessage.VIDEO_FS_OPEN, this._videoFSOpenHandler), this._subscribeToAdEvent(EBG.EBMessage.VIDEO_FS_CLOSE, this._videoFSCloseHandler), this._subscribeToAdEvent(EBG.EBMessage.VIDEO_FS_AUTO_CLOSE, this._videoFSAutocloseHandler), this._subscribeToAdEvent(EBG.EBMessage.SET_STATE, this._setStateInCreativeState), this._subscribeToAdEvent(EBG.EBMessage.RESET_STATE, this._setStateInCreativeState), this._subscribeToAdEvent(EBG.Events.EventNames.MOUSE_MOVE_NEEDED,
  7830.                    this._mouseMoveNeededHandler, EBG.Events.EventTiming.BEFORE), this._subscribeToAdEvent(EBG.Events.EventNames.SHOW_AD, this.adCreativesAddedHandler, EBG.Events.EventTiming.AFTER), this._subscribeToAdEvent(EBG.Events.EventNames.ADD_CREATIVES, this.addCreativesHandler, EBG.Events.EventTiming.ONTIME), this._subscribeToAdEvent(EBG.Events.EventNames.ADD_BANNER_DEFAULT_IMAGE_CREATIVE, this.addCreativesHandler, EBG.Events.EventTiming.ONTIME), this._subscribeToAdEvent(EBG.Events.EventNames.DWELL_UNIQUE, this._dwellUniqueEventHandler,
  7831.                    EBG.Events.EventTiming.ONTIME), this._subscribeToAdEvent(EBG.Events.EventNames.RICH_FLASH_PLAYED, this._richFlashPlayedEventHandler, EBG.Events.EventTiming.ONTIME), this._subscribeToAdEvent(EBG.EBMessage.SHOW_DEFAULT_IMAGE, this._addDefaultImgRequest), this._subscribeToAdEvent(EBG.Events.EventNames.CREATIVE_CONTAINER_READY, this._handleDelayedImpressionReport, EBG.Events.EventTiming.AFTER), this._subscribeToAdEvent(EBG.Events.EventNames.ADD_BANNER_DEFAULT_IMAGE_CREATIVE, this._handleDelayedImpressionReport,
  7832.                    EBG.Events.EventTiming.AFTER), this._dwellTimeManager = new EBG.Interactions.DwellTimeManager(this._adConfig), this._dwellTimeManager.init(), this._adConfig.bgImgSrc && (this._subscribeToAdEvent(EBG.Events.EventNames.CLOSE_AD, this._removeBackgroundImage), this._subscribeToAdEvent(EBG.Events.EventNames.PAGE_UNLOAD, this._removeBackgroundImage))
  7833.        } catch (a) {}
  7834.    },
  7835.    _handlePageLoaded: function() {},
  7836.    _handleDelayedImpressionReport: function() {
  7837.        if (!this._creativeContainerReadyHandled && this._adConfig.reportDelayedImpression) this._creativeContainerReadyHandled = !0, this._adConfig.delayedImpParams && (this._reportImpression(), this._clearDelayedImpData()), (this._adConfig.impressionTrackingURLs || 0 < this._adConfig.impressionTrackingURLs) && this._reportImpressionTrackingURLs(this._adConfig.impressionTrackingURLs), EBG.intMgr.allowInteractionReport(this._adConfig.uid)
  7838.    },
  7839.    _clearDelayedImpData: function() {
  7840.        this._adConfig.delayedImpParams = null
  7841.    },
  7842.    _reportImpression: function(a) {
  7843.        var b = EBGInfra.isDefined(this._adConfig.page) && "" != this._adConfig.page ? 1 : 0,
  7844.            b = EBG.format("{0}{1}/{2}/adServer.bs?cn=display&code=10&PluID={3}&EyeblasterID={4}&Page={5}&WebPageSource={6}&ForceDisplay={7}&Resolution={8}&sessionid={9}&Optout={10}&usercookie={11}",
  7845.                EBG.protocol, this._adConfig.bsPath, this._adConfig.appPool, this._adConfig.pluId, this._adConfig.adId, this._adConfig.page, b, EBG.isPreview ? 1 : 0, EBG.adaptor.getResolution(), this._adConfig.sID, this._adConfig.optOut, this._adConfig.usercookie);
  7846.        this._adConfig.delayedImpParams && (b += this._adConfig.delayedImpParams);
  7847.        a && (b += "&isBlank=1");
  7848.        EBG.adaptor.flash && (b += "&FlashVersion=" + EBG.adaptor.flash.version);
  7849.        this._adConfig.massVersioning.targetAudienceId && (b += "&ta=" + this._adConfig.massVersioning.targetAudienceId);
  7850.        this._adConfig.massVersioning.deliveryGroupId &&
  7851.            (b += "&dg=" + this._adConfig.massVersioning.deliveryGroupId);
  7852.        this._adConfig.massVersioning.subDeliveryGroupId && (b += "&sdg=" + this._adConfig.massVersioning.subDeliveryGroupId);
  7853.        this._adConfig.defaultImageDisplayed && (b += "&di=1");
  7854.        this._adConfig.defaultImageReason && (b += "&dir=" + this._adConfig.defaultImageReason);
  7855.        this._adConfig.massVersioning.adVersions && (b += "&vid=" + this._removePrefixFromVersions());
  7856.        EBGInfra.isDefinedNotNull(this._adConfig.diAppId) && (b += "&diappid=" + this._adConfig.diAppId);
  7857.        b += "&ord=" + Math.random();
  7858.        EBG.adaptor.reportToRemoteServer(b, !0)
  7859.    },
  7860.    _mouseMoveNeededHandler: function() {
  7861.        if (!this._registeredToMouseMove) {
  7862.            var a = new EBG.Events.EventSubscription(EBG.Events.EventNames.MOUSE_MOVE, this._mouseMoveHandler, this);
  7863.            a.isDocumentEvent = !0;
  7864.            EBG.eventMgr.subscribeToEvent(a);
  7865.            this._registeredToMouseMove = !0
  7866.        }
  7867.    },
  7868.    _mouseMoveHandler: function(a) {
  7869.        try {
  7870.            if (!this._mouseMoveTimeOut) {
  7871.                var b = this;
  7872.                b._mouseMoveTimeOut = setTimeout(function() {
  7873.                    b._mouseMoveTimeOut = null;
  7874.                    for (var c in b._CCs)
  7875.                        if (b._CCs.hasOwnProperty(c) && b._CCs[c]._registeredToMouseMove) {
  7876.                            var e = {},
  7877.                                e = EBG.adaptor.getMouseCoordinates(a.eventData);
  7878.                            b._CCs[c]._handleMouseMove(e)
  7879.                        }
  7880.                }, 100)
  7881.            }
  7882.        } catch (c) {}
  7883.    },
  7884.    _dwellUniqueEventHandler: function(a) {
  7885.        EBG.intMgr.reportDwellUnique(this._adConfig.uid, a.eventData.firstTime)
  7886.    },
  7887.    _richFlashPlayedEventHandler: function() {
  7888.        EBG.intMgr.reportRichFlashPlayed(this._adConfig.uid)
  7889.    },
  7890.    addCreativesHandler: function(a) {
  7891.        try {
  7892.            this._adConfig.bgImgSrc && this._changeBackgroundImage(), this._updateVisibilityManagerData(a.eventData), this._updateAdStackingData(a.eventData)
  7893.        } catch (b) {}
  7894.    },
  7895.    _updateVisibilityManagerData: function(a) {
  7896.        if (a.isPanel) {
  7897.            this.visibilityMgrPanelCollection =
  7898.                this.visibilityMgrPanelCollection || {};
  7899.            var b = !(this._panels && this._panels[a.panelName] && this._panels[a.panelName].visibilityIntEnabled || 1 == EBG.adaptor.getObjKeys(this._adConfig.panels).length);
  7900.            this.visibilityMgrPanelCollection[a.assetId] || (this.visibilityMgrPanelCollection[a.assetId] = new EBG.RichModules.VisibilityManager(this._adConfig, a.assetId, {
  7901.                isPanel: !0,
  7902.                muteInteractions: b,
  7903.                customData: {
  7904.                    panelName: a.panelName
  7905.                }
  7906.            }))
  7907.        } else this.visibilityMgr ? this.visibilityMgr.updateResourceObjId(a.assetId) : this.visibilityMgr =
  7908.            new EBG.RichModules.VisibilityManager(this._adConfig, a.assetId)
  7909.    },
  7910.    _updateAdStackingData: function(a) {
  7911.        if (a.isPanel) {
  7912.            if (this._panels && 1 == EBG.adaptor.getObjKeys(this._adConfig.panels).length) {
  7913.                if (!this._adStackingDetectorPanel) this._adStackingDetectorPanel = new EBG.RichModules.AdStackingDetector(this._adConfig, !0);
  7914.                this._adStackingDetectorPanel.addElementId(a.assetId, !0)
  7915.            }
  7916.        } else {
  7917.            if (!this._adStackingDetector) this._adStackingDetector = new EBG.RichModules.AdStackingDetector(this._adConfig, !1);
  7918.            this._adStackingDetector.addElementId(a.assetId, !0)
  7919.        }
  7920.    },
  7921.    _addPreloadImg: function() {
  7922.        this._preloadImgResId = this._addImgAsCreative("ebPreloadImg", EBG.isInWorkshop ? this._adConfig.preloadImagePath : EBG.combinePaths(this._adConfig.resourcePath, this._adConfig.preloadImagePath), EBG.Events.EventNames.ADD_BANNER_PRELOAD_IMAGE_CREATIVE)
  7923.    },
  7924.    _addImgAsCreative: function(a, b, c, d) {
  7925.        a = this.buildJSONImgObj(a, d && d.isValid ? d.defaultImagePath : b);
  7926.        (b = d && d.isValid ? d.jumpUrl : this._adConfig.interactions[EBG.Interactions.SystemInts.CLICK].jumpUrl) && this.setImageClick(a, !1, b, d &&
  7927.            d.isValid ? d.selectedVersion : "", d && d.isValid ? d.thirdPartyClks : "");
  7928.        b = new EBG.Events.Event(EBG.Events.EventNames.ADD_CREATIVES);
  7929.        b.dispatcher = this;
  7930.        b.eventData = {
  7931.            tagsObj: a,
  7932.            assetId: a.attributes.id,
  7933.            isPanel: !1,
  7934.            creativeType: c
  7935.        };
  7936.        b.timing = EBG.Events.EventTiming.BEFORE;
  7937.        var e = EBG.eventMgr.dispatchEvent(b);
  7938.        if (e || (e = this.dispatchCustomEvent(c, a.attributes.id, EBG.Events.EventTiming.BEFORE, this))) return a.attributes.id;
  7939.        var e = EBG.adaptor._getTags(a),
  7940.            f = EBG.adaptor.getElementById(this._adConfig.placeHolderId);
  7941.        if (this._richShown) return null;
  7942.        var g = EBG.adaptor.getElementById("emptyDiv" + this._banner.divId);
  7943.        d && g ? EBG.adaptor.setInnerHtml(g, e) : EBG.adaptor.setInnerHtml(f, e);
  7944.        this.subscribeToStandardElementEvents(a.attributes.id);
  7945.        b.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
  7946.        EBG.eventMgr.dispatchEvent(b);
  7947.        this.dispatchCustomEvent(c, a.attributes.id, EBG.Events.EventTiming.ONTIME_AND_AFTER, this);
  7948.        return a.attributes.id
  7949.    },
  7950.    _showImgAsCreative: function(a) {
  7951.        if (!this._richShown) this._defaultImgResId = this._addImgAsCreative("ebDefaultImg", EBG.isInWorkshop ?
  7952.            this._adConfig.defaultImagePath : EBG.combinePaths(this._adConfig.resourcePath, this._adConfig.defaultImagePath), EBG.Events.EventNames.ADD_BANNER_DEFAULT_IMAGE_CREATIVE, a)
  7953.    },
  7954.    adCreativesAddedHandler: function() {
  7955.        try {
  7956.            this._startTimer(EBG.Interactions.SystemInts.AD_DURATION)
  7957.        } catch (a) {}
  7958.    },
  7959.    getAdLocationOnPage: function() {
  7960.        var a = this.getAdOffset();
  7961.        if (null == a) return a;
  7962.        var b = EBG.adaptor.getWindowViewPortMetrics(this._adConfig.displayWin || EBG.adaptor.getDisplayWin());
  7963.        return {
  7964.            isAdOnLeft: a.X + this._adConfig.width / 2 < b.Width /
  7965.                2,
  7966.            isAdOnTop: a.Y + this._adConfig.height / 2 < b.Height / 2
  7967.        }
  7968.    },
  7969.    getAdOffset: function() {
  7970.        return null
  7971.    },
  7972.    getVideoLoaderDriver: function(a, b) {
  7973.        for (var b = b.replace(/\./ig, "/"), c = 0; c < this.videoLoaderDrivers.length; c++) {
  7974.            var d = this.videoLoaderDrivers[c];
  7975.            if (d.data.res.id == a && d.data.apiPath == b) return this.videoLoaderDrivers[c]
  7976.        }
  7977.        return null
  7978.    },
  7979.    _initVideoLoaderHandler: function(a) {
  7980.        a.eventData.apiPath = a.eventData.apiPath.replace(/\./ig, "/");
  7981.        a.eventData.res = EBG.adaptor.getElementById(a.flashResId);
  7982.        a.eventData.ad = this;
  7983.        this.videoLoaderDrivers.push(new EBG.Video.VideoLoaderDriver(a.eventData))
  7984.    },
  7985.    _videoLoadHandler: function(a) {
  7986.        a.eventData.apiPath = a.eventData.apiPath.replace(/\./ig, "/");
  7987.        this.getVideoLoaderDriver(a.flashResId, a.eventData.apiPath).load(a.eventData)
  7988.    },
  7989.    _startAggregateHandler: function(a) {
  7990.        try {
  7991.            EBG.intMgr.isInteractionExist(EBG.VideoInteraction.FULLSCREEN_DURATION.toLowerCase(), EBG.Interactions.InteractionTypes.TIMER, this._adConfig.uid) || (this._addAggregateInteraction(EBG.VideoInteraction.FULLSCREEN_DURATION, EBG.Interactions.Categories.VIDEO), this._addAggregateInteraction(EBG.VideoInteraction.VIDEO_PLAY_DURATION,
  7992.                EBG.Interactions.Categories.VIDEO));
  7993.            var b = a.eventData.intName,
  7994.                c = this._getAssetIdFromEvent(a);
  7995.            EBG.intMgr.startAggregate(b, this._adConfig.uid, c)
  7996.        } catch (d) {}
  7997.    },
  7998.    _updateAggregationTimeHandler: function(a) {
  7999.        try {
  8000.            var b = a.eventData.intName,
  8001.                c = parseInt(a.eventData.deltalDuration),
  8002.                d = this._getAssetIdFromEvent(a);
  8003.            EBG.intMgr.updateAggregation(b, this._adConfig.uid, c, d)
  8004.        } catch (e) {}
  8005.    },
  8006.    _stopAggregateHandler: function(a) {
  8007.        try {
  8008.            var b = a.eventData.intName,
  8009.                c = this._getAssetIdFromEvent(a);
  8010.            EBG.intMgr.stopAggregate(b, this._adConfig.uid,
  8011.                c)
  8012.        } catch (d) {}
  8013.    },
  8014.    _startTimerVideoHandler: function(a) {
  8015.        try {
  8016.            EBG.intMgr.isInteractionExist(EBG.VideoInteraction.FULLSCREEN_DURATION.toLowerCase(), EBG.Interactions.InteractionTypes.TIMER, this._adConfig.uid) || (this._addTimerInteraction(EBG.VideoInteraction.FULLSCREEN_DURATION, EBG.Interactions.Categories.VIDEO), this._addTimerInteraction(EBG.VideoInteraction.VIDEO_PLAY_DURATION, EBG.Interactions.Categories.VIDEO))
  8017.        } catch (b) {}
  8018.        this._startTimerHandler(a)
  8019.    },
  8020.    _startTimerHandler: function(a) {
  8021.        try {
  8022.            var b = a.eventData.intName,
  8023.                c = this._getAssetIdFromEvent(a);
  8024.            this._startTimer(b, c)
  8025.        } catch (d) {}
  8026.    },
  8027.    _stopTimerHandler: function(a) {
  8028.        try {
  8029.            var b = a.eventData.intName,
  8030.                c = this._getAssetIdFromEvent(a);
  8031.            this._stopTimer(b, c)
  8032.        } catch (d) {}
  8033.    },
  8034.    _getAssetIdFromEvent: function(a) {
  8035.        var b = EBGInfra.isDefined(a.eventData.assetId) ? a.eventData.assetId : null;
  8036.        if ((!EBGInfra.isDefined(b) || !EBGInfra.notNull(b)) && a.eventData.ebmovie)
  8037.            if (b = 0, "0" != a.eventData.ebmovie) {
  8038.                a = EBG.format("ebMovie{0}", a.eventData.ebmovie);
  8039.                if (this._adConfig.assets && this._adConfig.assets[a]) b = this._adConfig.assets[a].assetID;
  8040.                if (this._adConfig.bestAsset && this._adConfig.bestAsset[a]) b = this._adConfig.bestAsset[a].assetID
  8041.            }
  8042.        return b
  8043.    },
  8044.    _updateTimerHandler: function(a) {
  8045.        try {
  8046.            var b = a.eventData.intName,
  8047.                c = a.eventData.timerValue;
  8048.            if ("ebintduration" == b) b = EBG.Interactions.SystemInts.INT_DURATION, c /= 1E3;
  8049.            this._updateTimer(b, c)
  8050.        } catch (d) {}
  8051.    },
  8052.    _startTimer: function(a, b) {
  8053.        EBG.intMgr.startTimer(a, this._adConfig.uid, b)
  8054.    },
  8055.    _stopTimer: function(a, b) {
  8056.        EBG.intMgr.stopTimer(a, this._adConfig.uid, b)
  8057.    },
  8058.    _updateTimer: function(a, b) {
  8059.        EBG.intMgr.updateTimer(a, this._adConfig.uid,
  8060.            b)
  8061.    },
  8062.    _notifiedInteractionHandler: function(a) {
  8063.        try {
  8064.            if (a.eventData.name == EBG.Interactions.SystemInts.PLAYER_PARAMS) a.eventData.value.env = EBG.adaptor.browser.getEnvironment();
  8065.            EBG.intMgr.handleCounterInteraction(a.eventData.name, this._adConfig.uid, 0, !1, a.eventData)
  8066.        } catch (b) {}
  8067.    },
  8068.    _videoInteractionHandler: function(a) {
  8069.        try {
  8070.            var b = a.eventData,
  8071.                c = this._getAssetIdFromEvent(a),
  8072.                d = b.userInitiated ? b.userInitiated : !1;
  8073.            if (this._adConfig.ffs.CFF_QuartileViewability) {
  8074.                var e;
  8075.                if (b.intName == EBG.VideoInteraction.STARTED && this.visibilityMgr &&
  8076.                    this.visibilityMgr.calculateVisibilityPercentage() >= this._adConfig.visibility.iabMinSurface) this._handleVideoVisibilityChangeSub = this._subscribeToAdEvent(EBG.Events.EventNames.VISIBILITY_CHECK, function(a) {
  8077.                    if (a.eventData.percentage < this._adConfig.visibility.iabMinSurface) this._videoRemainedVisible = !1, EBG.eventMgr.unsubscribeFromEvent(this._handleVideoVisibilityChangeSub)
  8078.                }, EBG.Events.EventTiming.ONTIME), this._videoRemainedVisible = !0;
  8079.                EBGInfra.hasOwnValue(EBG.VideoQuartiles, b.intName, !0) && this._videoRemainedVisible &&
  8080.                    (e = {
  8081.                        value: 1
  8082.                    });
  8083.                b.intName == EBG.VideoInteraction.FULLPLAY && this._handleVideoVisibilityChangeSub && EBG.eventMgr.unsubscribeFromEvent(this._handleVideoVisibilityChangeSub);
  8084.                EBG.intMgr.handleVideoInteraction(b.intName, this._adConfig.uid, c, d, e)
  8085.            } else EBG.intMgr.handleVideoInteraction(b.intName, this._adConfig.uid, c, d)
  8086.        } catch (f) {}
  8087.    },
  8088.    _videoFSOpenHandler: function(a) {
  8089.        this.isInFullScreenMode = !0;
  8090.        a = {
  8091.            eventData: {
  8092.                assetId: this._adConfig.FSMovie.assetID,
  8093.                userInitiated: !0,
  8094.                intName: "ebFSStart"
  8095.            }
  8096.        };
  8097.        this._videoInteractionHandler(a);
  8098.        a = new EBG.Events.Event(EBG.Events.EventNames.FULL_SCREEN_START);
  8099.        a.dispatcher = this;
  8100.        a.eventData = "FullScreen";
  8101.        EBG.eventMgr.dispatchEvent(a)
  8102.    },
  8103.    _videoFSCloseHandler: function() {
  8104.        this.isInFullScreenMode = !1;
  8105.        var a = {
  8106.            eventData: {
  8107.                assetId: this._adConfig.FSMovie.assetID,
  8108.                userInitiated: !0,
  8109.                intName: "ebFSEnd"
  8110.            }
  8111.        };
  8112.        a.eventData.assetId = this._adConfig.FSMovie.assetID;
  8113.        this._videoInteractionHandler(a);
  8114.        a = new EBG.Events.Event(EBG.Events.EventNames.FULL_SCREEN_END);
  8115.        a.dispatcher = this;
  8116.        a.eventData = "FullScreen";
  8117.        EBG.eventMgr.dispatchEvent(a)
  8118.    },
  8119.    _videoFSAutocloseHandler: function() {},
  8120.    _addSystemInteractions: function() {
  8121.        EBG.callSuperFunction(EBG.Ads.RichAd, this, "_addSystemInteractions");
  8122.        try {
  8123.            var a = EBG.Interactions.Categories.SYSTEM;
  8124.            this._addTimerInteraction(EBG.Interactions.SystemInts.INT_DURATION, a);
  8125.            this._addTimerInteraction(EBG.Interactions.SystemInts.AD_DURATION, a);
  8126.            this._addTimerInteraction(EBG.Interactions.SystemInts.DWELL_TIME, a);
  8127.            this._addCounterInteraction(EBG.Interactions.SystemInts.VISIBILITY_RECORDABLE, a, !1, 1);
  8128.            this._addCounterInteraction(EBG.Interactions.SystemInts.VISIBILITY_AGENCY_RECORDABLE,
  8129.                a, !1, 1);
  8130.            this._addCounterInteraction(EBG.Interactions.SystemInts.VISIBILITY_ADVERTISER_RECORDABLE, a, !1, 1);
  8131.            this._addCounterInteraction(EBG.Interactions.SystemInts.VISIBILITY_ADVERTISER, a, !1, 1);
  8132.            this._addCounterInteraction(EBG.Interactions.SystemInts.VISIBILITY_AGENCY, a, !1, 1);
  8133.            this._addCounterInteraction(EBG.Interactions.SystemInts.VISIBILITY_IAB, a, !1, 1);
  8134.            this._addTimerInteraction(EBG.Interactions.SystemInts.VISIBILITY_AGENCY_DURATION, a);
  8135.            this._addTimerInteraction(EBG.Interactions.SystemInts.VISIBILITY_ADVERTISER_DURATION,
  8136.                a);
  8137.            this._addTimerInteraction(EBG.Interactions.SystemInts.VISIBILITY_AVG_AD_SURFACE, a);
  8138.            EBG.adaptor.isInApp() || this._addTimerInteraction(EBG.Interactions.SystemInts.VISIBILITY_AVG_SCREEN_SHARE, a);
  8139.            this._adConfig.playerParamsEnabled && this._addCounterInteraction(EBG.Interactions.SystemInts.PLAYER_PARAMS, a, !1, 5, null, null, !0)
  8140.        } catch (b) {}
  8141.    },
  8142.    _addCounterInteraction: function(a, b, c, d, e, f, g) {
  8143.        var h = this._adConfig.interactions[EBG.isDefinedNotNull(f) ? f : a],
  8144.            i = new EBG.Interactions.CounterInteractionData(a, b, this._adConfig.uid);
  8145.        if (e) i.isPanel = !0;
  8146.        h ? EBG.callSuperFunction(EBG.Ads.RichAd, this, "_addCounterInteraction", [a, b, c]) : (i.initiationType = EBG.Interactions.InitiationTypes.AUTO, i.numLeftToReport = i.numToReport = d ? d : i.numLeftToReport, i.reportImmediately = c ? !0 : !1, i.useInteractionsStrPipe = g ? !0 : !1, a = new EBG.Interactions.CounterInteraction(i), EBG.intMgr.addInteraction(a, f))
  8147.    },
  8148.    _addTimerInteraction: function(a, b, c) {
  8149.        a = new EBG.Interactions.TimerInteractionData(a, b, this._adConfig.uid);
  8150.        if (c) a.isPanel = c;
  8151.        c = new EBG.Interactions.TimerInteraction(a);
  8152.        EBG.intMgr.addInteraction(c)
  8153.    },
  8154.    _addAggregateInteraction: function(a, b, c) {
  8155.        a = new EBG.Interactions.AggregationInteractionData(a, b, this._adConfig.uid);
  8156.        if (c) a.isPanel = c;
  8157.        c = new EBG.Interactions.AggregateInteraction(a);
  8158.        EBG.intMgr.addInteraction(c)
  8159.    },
  8160.    _addVideoInteractions: function() {
  8161.        try {
  8162.            this._addVideoInteraction(EBG.VideoInteraction.STARTED), this._addVideoInteraction(EBG.VideoInteraction.PERCENT_25_PLAYED), this._addVideoInteraction(EBG.VideoInteraction.PERCENT_50_PLAYED), this._addVideoInteraction(EBG.VideoInteraction.PERCENT_75_PLAYED),
  8163.                this._addVideoInteraction(EBG.VideoInteraction.FULLPLAY), this._addVideoInteraction(EBG.VideoInteraction.MUTE, !0), this._addVideoInteraction(EBG.VideoInteraction.UNMUTE, !0), this._addVideoInteraction(EBG.VideoInteraction.UNMUTED), this._addVideoInteraction(EBG.VideoInteraction.PAUSE, !0), this._addVideoInteraction(EBG.VideoInteraction.REPLAY, !0), this._addVideoInteraction(EBG.VideoInteraction.SLIDER_DRAGGED, !0), this._addVideoInteraction(EBG.VideoInteraction.FULLSCREEN_START, !0), this._addVideoInteraction(EBG.VideoInteraction.FULLSCREEN_END, !0), this._addVideoInteraction(EBG.VideoInteraction.FULLSCREEN_MUTE, !0), this._addVideoInteraction(EBG.VideoInteraction.FULLSCREEN_PAUSE, !0), this._addVideoInteraction(EBG.VideoInteraction.USER_INITIATED_VIDEO, !1, 1)
  8164.        } catch (a) {}
  8165.    },
  8166.    _addVideoInteraction: function(a, b, c) {
  8167.        a = new EBG.Interactions.CounterInteractionData(a, EBG.Interactions.Categories.VIDEO, this._adConfig.uid);
  8168.        a.initiationType = b ? EBG.Interactions.InitiationTypes.USER : EBG.Interactions.InitiationTypes.AUTO;
  8169.        if (c) a.numLeftToReport = c;
  8170.        b = new EBG.Interactions.CounterInteraction(a);
  8171.        EBG.intMgr.addInteraction(b)
  8172.    },
  8173.    _addCustomInteractions: function() {
  8174.        try {
  8175.            var a = this._adConfig.interactions,
  8176.                b;
  8177.            for (b in a)
  8178.                if (a.hasOwnProperty(b)) {
  8179.                    var c = EBG.intMgr.adsData[this._adConfig.uid];
  8180.                    switch (a[b].type) {
  8181.                        case 0:
  8182.                            c.Counter.hasOwnProperty(b) || b !== EBG.Interactions.SystemInts.CLICK && b !== EBG.Interactions.SystemInts.DEFAULT_CLICK && this._addCounterInteraction(b, EBG.Interactions.Categories.CUSTOM);
  8183.                            break;
  8184.                        case 1:
  8185.                            c.Timer.hasOwnProperty(b) || this._addTimerInteraction(b, EBG.Interactions.Categories.CUSTOM)
  8186.                    }
  8187.                }
  8188.        } catch (d) {}
  8189.    },
  8190.    subscribeToStandardElementEvents: function(a) {
  8191.        var b = new EBG.Events.EventSubscription("mouseover", this._handleMouseEvent, this);
  8192.        b.isElementEvent = !0;
  8193.        b.elementId = a;
  8194.        EBG.eventMgr.subscribeToEvent(b);
  8195.        b = new EBG.Events.EventSubscription("mouseout", this._handleMouseEvent, this);
  8196.        b.isElementEvent = !0;
  8197.        b.elementId = a;
  8198.        EBG.eventMgr.subscribeToEvent(b)
  8199.    },
  8200.    _handleMouseEvent: function(a) {
  8201.        var b = a.currentTarget ? a.currentTarget : a.srcElement,
  8202.            c = a.relatedTarget ? a.relatedTarget : null,
  8203.            d = "",
  8204.            e = b.id,
  8205.            f = e.lastIndexOf("_") + 1,
  8206.            g = "",
  8207.            g = b.id.split("_"),
  8208.            h = g.length,
  8209.            g = g[h - 2] + "_" + g[h - 1],
  8210.            g = EBGInfra.isDefined(g) ? g : "";
  8211.        f && (d = e.substring(f));
  8212.        e = "mouseover" == a.type ? new EBG.Events.Event(EBG.Events.EventNames.MOUSE_OVER) : new EBG.Events.Event(EBG.Events.EventNames.MOUSE_OUT);
  8213.        if (!("mouseout" == a.type && EBGInfra.isDefined(EBG.ads[g]) && EBG.ads[g].isInFullScreenMode)) e.dispatcher = {
  8214.            _adConfig: {
  8215.                rnd: d
  8216.            }
  8217.        }, e.eventData = {
  8218.            target: b,
  8219.            relatedTarget: c
  8220.        }, EBG.eventMgr.dispatchEvent(e)
  8221.    },
  8222.    _verifyPlaceHolder: function() {
  8223.        EBG.callSuperFunction(EBG.Ads.RichAd, this, "_verifyPlaceHolder") || EBG.adaptor.addPlaceHolder({
  8224.            tagName: EBG.Adaptors.TagNames.DIV,
  8225.            attributes: {
  8226.                id: this._adConfig.placeHolderId,
  8227.                dir: "ltr"
  8228.            },
  8229.            children: null
  8230.        })
  8231.    },
  8232.    _changeBackgroundImage: function() {
  8233.        this._wallpaper = new EBG.Adaptors.Wallpaper;
  8234.        var a = new EBG.Adaptors.Wallpaper.BgData;
  8235.        a.imgSrc = EBG.combinePaths(this._adConfig.resourcePath, this._adConfig.bgImgSrc);
  8236.        a.tiling = this._adConfig.bgRepeat;
  8237.        a.scrolling = this._adConfig.bgIgnoreScrolling;
  8238.        a.positionX = this._adConfig.bgPosX;
  8239.        a.positionY = this._adConfig.bgPosY;
  8240.        this._wallpaper.SetBackgroundImage(a)
  8241.    },
  8242.    _removeBackgroundImage: function() {
  8243.        this._wallpaper &&
  8244.            this._wallpaper.RemoveBackgroundImage()
  8245.    },
  8246.    _setStateInCreativeState: function(a) {
  8247.        this._adConfig.optOut || (a = EBG.format("{0}{1}/{2}/adServer.bs?cn=SetState&CampaignID={3}&StateValue={4}&ord={5}", EBG.protocol, this._adConfig.bsPath, "BurstingPipe", this._adConfig.campaignId, a.eventData.stateValue ? a.eventData.stateValue : "", EBG.getRandomNumber()), EBG.adaptor.reportToRemoteServer(a, !0, !0))
  8248.    }
  8249. };
  8250. EBG.declareClass(EBG.Ads.RichAd, EBG.Ads.Ad);
  8251. EBG.Ads.RichBannerHtml5 = function(a) {
  8252.    this._updateAdConfig(a);
  8253.    if (EBG.AdaptiveUtils && a.adaptiveAd) {
  8254.        this._adConfig = a;
  8255.        this._verifyPlaceHolder();
  8256.        var b = EBG.adaptor.getElementById(a.placeHolderId),
  8257.            c = a.width && EBG.isNumber(a.width) ? a.width + "px" : "100%",
  8258.            d = a.height && EBG.isNumber(a.height) ? a.height + "px" : "100%";
  8259.        this.resizePlaceHolder = !1;
  8260.        EBG.adaptor.setElemStyle(b, "width", c);
  8261.        EBG.adaptor.setElemStyle(b, "height", d);
  8262.        this._adaptiveUtils = new EBG.AdaptiveUtils(a);
  8263.        this._adaptiveUtils.updateAdConfig();
  8264.        this._adaptiveUtils.subscribeToEvents()
  8265.    }
  8266.    EBG.callSuperConstructor(EBG.Ads.RichBannerHtml5,
  8267.        this, [a])
  8268. };
  8269. EBG.Ads.RichBannerHtml5.requiresIframeBust = !1;
  8270. EBG.Ads.RichBannerHtml5.prototype = {
  8271.    _isClickOccur: !1,
  8272.    _CCs: {},
  8273.    _banner: {
  8274.        divId: "",
  8275.        resId: "",
  8276.        width: 0,
  8277.        height: 0
  8278.    },
  8279.    _canShow: function() {
  8280.        var a = !1;
  8281.        this._adConfig.adHtmlPath ? EBG.adaptor.browser.isIE() && !this._adConfig.isPreview ? (a = (this._adConfig.displayWin || EBG.adaptor.getDisplayWin()).document.documentMode, a = 9 == a && this._adConfig.isSafeFrame ? !1 : 8 < a) : a = !0 : this._adConfig.imageOnly = !0;
  8282.        return a
  8283.    },
  8284.    _updateAdConfig: function(a) {
  8285.        this._updateSVJSON(a)
  8286.    },
  8287.    _updateSVJSON: function(a) {
  8288.        var b = EBG.isGlobalDef("ebAdXmlPath") ? ebAdXmlPath :
  8289.            "";
  8290.        if (b && a.svJSON) a.svPreview = b;
  8291.        if (a.sv3CatalogMap && a.massVersioning && a.massVersioning.adVersions && "" != a.massVersioning.adVersions) versions = 0 < a.massVersioning.massVersionFolderDivider ? EBG.Ads.Ad.Fn.fixMVPathString(a.massVersioning.adVersions, a.massVersioning.massVersionFolderDivider) : a.massVersioning.adVersions, a.versions = versions;
  8292.        if (a.massVersioning && a.massVersioning.versionFullPath && (a.versions = a.massVersioning.adVersions, b = EBG.isGlobalDef("ebAdJson") ? ebAdJson : null)) a.versionPreviewJson = b
  8293.    },
  8294.    _subscribeToEvents: function() {
  8295.        EBG.callSuperFunction(EBG.Ads.RichBannerHtml5,
  8296.            this, "_subscribeToEvents");
  8297.        this._subscribeToAdEvent(EBG.EBMessage.CLICKTHROUGH, this._updateAssetsWithClick);
  8298.        this._subscribeToAdEvent(EBG.EBMessage.SWIPE, function() {
  8299.            EBG.intMgr.handleCounterInteraction(EBG.Interactions.SystemInts.SWIPE, this._adConfig.uid)
  8300.        });
  8301.        this._subscribeToAdEvent(EBG.EBMessage.DISPOSE, function() {
  8302.            var a = new EBG.Events.Event(EBG.Events.EventNames.PAGE_UNLOAD);
  8303.            EBG.eventMgr.dispatchEvent(a)
  8304.        });
  8305.        this._adConfig.ffs.CFF_IFrameHidden && this._subscribeToAdEvent(EBG.Events.EventNames.CREATIVE_CONTAINER_READY,
  8306.            function(a) {
  8307.                this._bannerCC && 1 == this._downloadMode && this._bannerCC.iframeId == a.eventData && EBG.adaptor.removeElement(this._preloadImgResId || this._defaultImgResId)
  8308.            }, EBG.Events.EventTiming.BEFORE);
  8309.        this._shouldWaitForTriggerAdStart() && this._subscribeToAdEvent(EBG.EBMessage.TRIGGER_AD_START, this._triggerAdStart)
  8310.    },
  8311.    _updateAssetsWithClick: function(a) {
  8312.        this._isClickOccur = !0;
  8313.        clickedProductId = a && a.eventData && a.eventData.isProductClick && a.eventData.clickedVersion ? a.eventData.clickedVersion : null;
  8314.        var a = {
  8315.                clickOccur: !0,
  8316.                clickedProductId: clickedProductId
  8317.            },
  8318.            b;
  8319.        for (b in this._CCs) this._CCs.hasOwnProperty(b) && this._CCs[b].updateClick(a)
  8320.    },
  8321.    _writeCreativeElements: function() {
  8322.        var a = EBG.adaptor.generateElementId("BannerDiv", this._adConfig.uid),
  8323.            b = {
  8324.                tagName: EBG.Adaptors.TagNames.DIV,
  8325.                attributes: {
  8326.                    id: a,
  8327.                    dir: "ltr",
  8328.                    style: {}
  8329.                },
  8330.                children: this._bannerCC.buildCreativeContainerJson()
  8331.            };
  8332.        if ("undefined" != typeof this._adConfig.display) b.attributes.style.display = this._adConfig.display;
  8333.        var c = new EBG.Events.Event(EBG.Events.EventNames.ADD_CREATIVES);
  8334.        c.dispatcher = this;
  8335.        c.eventData = {
  8336.            tagsObj: b,
  8337.            assetId: b.children[0] ? b.children[0].attributes.id : this._bannerCC.iframeId,
  8338.            isPanel: !1,
  8339.            creativeType: EBG.Events.EventNames.ADD_HTML5_MAIN_CREATIVE
  8340.        };
  8341.        c.timing = EBG.Events.EventTiming.BEFORE;
  8342.        if (!EBG.eventMgr.dispatchEvent(c)) EBG.adaptor.addInlineDOM(b, this._adConfig.placeHolderId), this.bannerDivId = a, this._banner.divId = a, this._banner.width = this._adConfig.width, this._banner.height = this._adConfig.height, c.timing = EBG.Events.EventTiming.ONTIME, EBG.eventMgr.dispatchEvent(c),
  8343.            this.subscribeToStandardElementEvents(a), c.timing = EBG.Events.EventTiming.AFTER, EBG.eventMgr.dispatchEvent(c)
  8344.    },
  8345.    _addCreatives: function() {
  8346.        this._loadBanner()
  8347.    },
  8348.    _loadBanner: function() {
  8349.        this._bannerCC = new EBG.IFrameCC(this._adConfig, {
  8350.            clickOccur: this._isClickOccur
  8351.        });
  8352.        this._bannerCC.iframeId = EBG.adaptor.generateElementId("BannerIFrame", this._adConfig.uid);
  8353.        this._CCs[this._bannerCC.iframeId] = this._bannerCC;
  8354.        this._bannerCC.setAssetCreativeParams();
  8355.        this._writeCreativeElements()
  8356.    },
  8357.    _shouldWaitForTriggerAdStart: function() {
  8358.        if (!0 ===
  8359.            this._adConfig.isInstream) return !0
  8360.    },
  8361.    _addSystemInteractions: function() {
  8362.        EBG.callSuperFunction(EBG.Ads.RichBannerHtml5, this, "_addSystemInteractions");
  8363.        if (EBG.adaptor.browser.isMobile()) try {
  8364.            var a = new EBG.Interactions.CounterInteractionData(EBG.Interactions.SystemInts.SWIPE, EBG.Interactions.Categories.SYSTEM, this._adConfig.uid);
  8365.            a.initiationType = EBG.Interactions.InitiationTypes.USER;
  8366.            var b = new EBG.Interactions.CounterInteraction(a);
  8367.            EBG.intMgr.addInteraction(b, EBG.Interactions.SystemInts.SWIPE)
  8368.        } catch (c) {}
  8369.    },
  8370.    _getBannerLocation: function() {
  8371.        var a;
  8372.        if (this._bannerCC && this._bannerCC.iframeId) a = EBG.adaptor.getPositioningById(this._bannerCC.iframeId, !0, this._adConfig.actualServingMode);
  8373.        else if (this._preloadImgResId) a = EBG.adaptor.getPositioningById(this._preloadImgResId);
  8374.        else return null;
  8375.        return EBG.callSuperFunction(EBG.Ads.RichBannerHtml5, this, "_getBannerLocation", [a])
  8376.    },
  8377.    _getAdCodeBase: function() {
  8378.        return EBG.callSuperFunction(EBG.Ads.RichBannerHtml5, this, "_getAdCodeBase", [2])
  8379.    },
  8380.    _switchAssetsAfterThrottle: function() {},
  8381.    _shouldCheckIfFlashBlocked: function() {
  8382.        return !1
  8383.    }
  8384. };
  8385. EBG.declareClass(EBG.Ads.RichBannerHtml5, EBG.Ads.RichAd);
  8386. EBG.Ads.PoliteBannerHtml5 = function(a) {
  8387.    EBG.callSuperConstructor(EBG.Ads.PoliteBannerHtml5, this, [a])
  8388. };
  8389. EBG.Ads.PoliteBannerHtml5.requiresIframeBust = !1;
  8390. EBG.Ads.PoliteBannerHtml5.prototype = {
  8391.    _preloadImgResId: null,
  8392.    _richShown: !1,
  8393.    _addCreatives: function() {
  8394.        if (1 == this._downloadMode) EBG.isDefined(this._adConfig.preloadImagePath) ? "" != this._adConfig.preloadImagePath ? this.checkAndShowDefaultImage(this._addPreloadImg) : this._preloadImgResId = this._addImgAsCreative("ebPreloadImg", EBG.combinePaths(ebBigS, "Res/blank_1X1.gif"), EBG.Events.EventNames.ADD_BANNER_PRELOAD_IMAGE_CREATIVE) : this._downloadMode = 3;
  8395.        if (3 == this._downloadMode) this._loadBanner(), this._richShown = !0
  8396.    },
  8397.    _handlePageLoaded: function() {
  8398.        if (1 == this._downloadMode)
  8399.            if (null != this._preloadImgResId) this._loadBanerAfterPreload(this._preloadImgResId);
  8400.            else if (null != this._defaultImgResId && !this._adConfig.showOnlyImage && !this._adConfig.imageOnly && !this._adConfig.defaultImageDisplayed) this._loadBanerAfterPreload(this._defaultImgResId);
  8401.        else if (null == this._defaultImgResId && !this._adConfig.showOnlyImage && !this._adConfig.imageOnly && !this._adConfig.defaultImageDisplayed) this._loadBanner(), this._richShown = !0
  8402.    },
  8403.    _loadBanerAfterPreload: function(a) {
  8404.        this._adConfig.ffs.CFF_IFrameHidden ||
  8405.            EBG.adaptor.removeElement(a);
  8406.        this._loadBanner();
  8407.        this._richShown = !0
  8408.    }
  8409. };
  8410. EBG.declareClass(EBG.Ads.PoliteBannerHtml5, EBG.Ads.RichBannerHtml5);
  8411. EBG.Ads.ExpBaseHtml5 = function(a) {
  8412.    if (a.isSafeFrame && EBG.SFUtil) this._sfUtil = new EBG.SFUtil(a);
  8413.    EBG.callSuperConstructor(EBG.Ads.ExpBaseHtml5, this, [a])
  8414. };
  8415. EBG.Ads.ExpBaseHtml5.prototype = {
  8416.    _panelsName: [],
  8417.    _sfUtil: null,
  8418.    _wlxObj: null,
  8419.    _adLocForSkype: {
  8420.        isAdOnLeft: !1,
  8421.        isAdOnTop: !0
  8422.    },
  8423.    _expandTimeStamp: {},
  8424.    _show: function() {
  8425.        this._setPanels();
  8426.        if (this._sfUtil) this._sfUtil.register();
  8427.        else if (this._adConfig.isSafeFrame) try {
  8428.            $sf.ext.register(this._adConfig.width, this._adConfig.height)
  8429.        } catch (a) {}
  8430.        EBG.callSuperFunction(EBG.Ads.ExpBaseHtml5, this, "_show")
  8431.    },
  8432.    _addMouseListenerForSkype: function(a) {
  8433.        if (a && a.id) {
  8434.            $this = this;
  8435.            var b = new EBG.Events.EventSubscription("mouseenter", function(a) {
  8436.                a =
  8437.                    a.screenX - a.clientX;
  8438.                EBG.isDefined($this._skypeExpansionCorrection) && EBG.isDefined($this._skypeExpansionCorrection.prevExpansionWasLeft) && EBG.isDefined($this._skypeExpansionCorrection.xOffset) && $this._skypeExpansionCorrection.prevExpansionWasLeft && (a += $this._skypeExpansionCorrection.xOffset);
  8439.                var b = EBG.adaptor.getDisplayWin();
  8440.                $this._adLocForSkype = {
  8441.                    isAdOnLeft: a - b.screenX < b.outerWidth / 2 + 12,
  8442.                    isAdOnTop: !0
  8443.                }
  8444.            });
  8445.            b.isElementEvent = !0;
  8446.            b.elementId = a.id;
  8447.            EBG.eventMgr.subscribeToEvent(b)
  8448.        }
  8449.    },
  8450.    _canShow: function() {
  8451.        var a =
  8452.            EBG.callSuperFunction(EBG.Ads.ExpBaseHtml5, this, "_canShow");
  8453.        if (a && this._sfUtil) {
  8454.            if (a = this._sfUtil.canExpand(), !a) this._cdiReason = 3
  8455.        } else if (this._adConfig.isSafeFrame && a) try {
  8456.            var b = this._getMaxExpansionBoundaries(),
  8457.                c = $sf.ext.geom().exp,
  8458.                d;
  8459.            for (d in b)
  8460.                if (c[d] = c[d] ? 1 * c[d] : 0, c[d] < b[d]) return this._cdiReason = 3, !1;
  8461.            a = !(!$sf.ext.supports()["exp-ovr"] && b.b + b.t + b.l + b.r)
  8462.        } catch (e) {
  8463.            this._cdiReason = 3, a = !1
  8464.        }
  8465.        return a
  8466.    },
  8467.    _getMaxExpansionBoundaries: function() {
  8468.        var a = {
  8469.                l: 0,
  8470.                r: 0,
  8471.                b: 0,
  8472.                t: 0
  8473.            },
  8474.            b = this._adConfig.panels || {};
  8475.        if ("Html5SEBanner" ==
  8476.            this._adConfig.templateName) b.banner = {
  8477.            xPos: -1 * this._adConfig.expansionParams.x,
  8478.            yPos: -1 * this._adConfig.expansionParams.y,
  8479.            width: this._adConfig.expansionParams.width,
  8480.            height: this._adConfig.expansionParams.height
  8481.        };
  8482.        for (var c in b) {
  8483.            var d = b[c],
  8484.                e = {
  8485.                    l: 0,
  8486.                    r: 0,
  8487.                    b: 0,
  8488.                    t: 0
  8489.                };
  8490.            e.l = Math.max(-1 * d.xPos, 0);
  8491.            e.r = Math.max(d.xPos + d.width - (this._bannerCC ? this._bannerCC.getWidth() : this._adConfig.width), 0);
  8492.            e.t = Math.max(-1 * d.yPos, 0);
  8493.            e.b = Math.max(d.yPos + d.height - (this._bannerCC ? this._bannerCC.getHeight() : this._adConfig.height), 0);
  8494.            for (var f in e) a[f] = Math.max(a[f], e[f])
  8495.        }
  8496.        return a
  8497.    },
  8498.    _subscribeToEvents: function() {
  8499.        EBG.callSuperFunction(EBG.Ads.ExpBaseHtml5, this, "_subscribeToEvents");
  8500.        this._subscribeToAdEvent(EBG.EBMessage.EXPAND, this._handleExpand);
  8501.        this._subscribeToAdEvent(EBG.EBMessage.COLLAPSE, this._handleCollapse);
  8502.        this._subscribeToAdEvent(EBG.EBMessage.RESET_COLLAPSE_TIMER, this._resetCollapseTimer);
  8503.        this._subscribeToAdEvent(EBG.Events.EventNames.EXPAND, this._resetCollapseTimer);
  8504.        EBG.eventMgr.subscribeToEvent(new EBG.Events.EventSubscription(EBG.Events.EventNames.PAGE_UNLOAD,
  8505.            this._unLoadHandler, this));
  8506.        this._adConfig.isSkype && this._adConfig.expandDynamic && this._adConfig.ffs.CFF_SkypeDynamic && this._subscribeToAdEvent(EBG.Events.EventNames.CREATIVE_CONTAINER_READY, function(a) {
  8507.            a.dispatcher == this._bannerCC && this._addMouseListenerForSkype(a.dispatcher._iframe)
  8508.        }, EBG.Events.EventTiming.AFTER)
  8509.    },
  8510.    _resetCollapseTimer: function(a) {
  8511.        var b = a && a.eventData && a.eventData.panelName ? a.eventData.panelName.toLowerCase() : this._defaultPanel;
  8512.        if (a.name == EBG.Events.EventNames.EXPAND) {
  8513.            var c = a.dispatcher.autoCollapse;
  8514.            if (!c && this._adConfig.expansionParams && this._adConfig.expansionParams.autoCollapse) c = this._adConfig.expansionParams.autoCollapse;
  8515.            a.eventData && "string" == typeof a.eventData && (b = a.eventData.toLowerCase());
  8516.            this._expandTimeStamp[b] = new Date;
  8517.            c && (a = EBG.cloneObj(a), EBG.runTimed(this, this._handleCollapse, [a, this._expandTimeStamp[b]], c))
  8518.        } else this._expandTimeStamp && this._handleCollapse && (this._expandTimeStamp[b] = new Date, 0 <= a.eventData.newTimerValue && EBG.runTimed(this, this._handleCollapse, [a, this._expandTimeStamp[b]],
  8519.            a.eventData.newTimerValue))
  8520.    },
  8521.    _cancelCollapseTimer: function(a) {
  8522.        a = a ? a.toLowerCase() : this._defaultPanel;
  8523.        this._expandTimeStamp[a] = 0
  8524.    },
  8525.    _addSystemInteractions: function() {
  8526.        EBG.callSuperFunction(EBG.Ads.ExpBaseHtml5, this, "_addSystemInteractions");
  8527.        this._addPanelInteraction(EBG.ExpBaseInteractions.PANELS_VIEWED, EBG.Interactions.Categories.SYSTEM, EBG.Interactions.InitiationTypes.AUTO, 1);
  8528.        for (var a = 0; a < this._panelsName.length; a++) panelName = this._panelsName[a], this._addPanelInteraction(panelName, EBG.Interactions.Categories.CUSTOM,
  8529.            EBG.Interactions.InitiationTypes.USER, -1, !0), this._addPanelInteraction(EBG.format("{0}_{1}", panelName, EBG.ExpBaseInteractions.AUTO_SHOW), EBG.Interactions.Categories.CUSTOM, EBG.Interactions.InitiationTypes.AUTO, -1, !0), this._addTimerInteraction(EBG.format("{0}_{1}", panelName, EBG.ExpBaseInteractions.DURATION), EBG.Interactions.Categories.CUSTOM, !0);
  8530.        a = EBG.Interactions.Categories.SYSTEM;
  8531.        this._addCounterInteraction("P" + EBG.Interactions.SystemInts.VISIBILITY_RECORDABLE, a, !1, 1, !0);
  8532.        this._addCounterInteraction("P" +
  8533.            EBG.Interactions.SystemInts.VISIBILITY_AGENCY_RECORDABLE, a, !1, 1, !0);
  8534.        this._addCounterInteraction("P" + EBG.Interactions.SystemInts.VISIBILITY_ADVERTISER_RECORDABLE, a, !1, 1, !0);
  8535.        this._addCounterInteraction("P" + EBG.Interactions.SystemInts.VISIBILITY_ADVERTISER, a, !1, 1, !0);
  8536.        this._addCounterInteraction("P" + EBG.Interactions.SystemInts.VISIBILITY_AGENCY, a, !1, 1, !0);
  8537.        this._addCounterInteraction("P" + EBG.Interactions.SystemInts.VISIBILITY_IAB, a, !1, 1, !0);
  8538.        this._addTimerInteraction("P" + EBG.Interactions.SystemInts.VISIBILITY_AGENCY_DURATION,
  8539.            a, !0);
  8540.        this._addTimerInteraction("P" + EBG.Interactions.SystemInts.VISIBILITY_ADVERTISER_DURATION, a, !0);
  8541.        this._addTimerInteraction("P" + EBG.Interactions.SystemInts.VISIBILITY_AVG_AD_SURFACE, a, !0);
  8542.        EBG.adaptor.isInApp() || this._addTimerInteraction("P" + EBG.Interactions.SystemInts.VISIBILITY_AVG_SCREEN_SHARE, a, !0);
  8543.        this._addCounterInteraction("P" + EBG.Interactions.SystemInts.AD_STACKING, a, !1, 1, !0)
  8544.    },
  8545.    _addPanelInteraction: function(a, b, c, d, e) {
  8546.        a = new EBG.Interactions.CounterInteractionData(a, b, this._adConfig.uid);
  8547.        a.countAsClick = 0;
  8548.        a.initiationType = c;
  8549.        if (-1 !== d) a.numLeftToReport = d;
  8550.        if (e) a.isPanel = e;
  8551.        c = new EBG.Interactions.CounterInteraction(a);
  8552.        EBG.intMgr.addInteraction(c)
  8553.    },
  8554.    getAdOffset: function() {
  8555.        var a = {};
  8556.        return a = this._sfUtil ? this._sfUtil.getAdOffset() : EBG.adaptor.getPositioningById(this._bannerCC.iframeId, !0, this._adConfig.actualServingMode, !0)
  8557.    },
  8558.    _handleCloseAd: function() {},
  8559.    _getWlxObj: function() {
  8560.        var a = null;
  8561.        try {
  8562.            EBG.isGlobalDef("gEbDisableSmartServeAPI") || (a = window.$WLXRmAd || window.parent && window.parent.$WLXRmAd)
  8563.        } catch (b) {}
  8564.        return a
  8565.    },
  8566.    _wlxInit: function(a) {
  8567.        try {
  8568.            var b = !!this._wlxObj;
  8569.            this._wlxObj = this._getWlxObj();
  8570.            this._adConfig.ffs.CFF_SkypeDynamic && this._wlxObj.resetState();
  8571.            if (!b || this._adConfig.ffs.CFF_SkypeDynamic) a = a || this._getMaxExpansionBoundaries(), this._wlxObj.init({
  8572.                width: this._adConfig.width,
  8573.                height: this._adConfig.height,
  8574.                offsetLeft: a.l,
  8575.                offsetRight: a.r,
  8576.                offsetTop: a.t,
  8577.                offsetBottom: a.b
  8578.            })
  8579.        } catch (c) {}
  8580.    }
  8581. };
  8582. EBG.declareClass(EBG.Ads.ExpBaseHtml5, EBG.Ads.PoliteBannerHtml5);
  8583. EBG.Ads.SEBannerHtml5 = function(a) {
  8584.    this.panelFrequencyMgr = new EBG.RichModules.PanelFrequencyManager;
  8585.    EBG.callSuperConstructor(EBG.Ads.SEBannerHtml5, this, [a]);
  8586.    this._updateSafeFramePanel()
  8587. };
  8588. EBG.Ads.SEBannerHtml5.requiresIframeBust = !0;
  8589. EBG.Ads.SEBannerHtml5.prototype = {
  8590.    expansionParamsOrg: null,
  8591.    _skypeExpansionCorrection: {},
  8592.    _bannerMousePos: {
  8593.        X: null,
  8594.        Y: null
  8595.    },
  8596.    _handleExpand: function(a) {
  8597.        if (this._bannerCC && !this._bannerCC.isExpanded()) try {
  8598.            var b = !1;
  8599.            a.eventData && (this._onInitExpansionParams(a), a.eventData.actionType && (b = a.eventData.actionType === EBG.ActionType.AUTO));
  8600.            var c = this._adConfig.panelName;
  8601.            this._handleDynamicExpansion();
  8602.            a = new EBG.Events.Event(EBG.Events.EventNames.EXPAND);
  8603.            a.dispatcher = this;
  8604.            a.timing = EBG.Events.EventTiming.BEFORE;
  8605.            a.eventData =
  8606.                c;
  8607.            if (!EBG.eventMgr.dispatchEvent(a)) {
  8608.                if (this._sfUtil) this._sfUtil.expand({
  8609.                    push: this._isPushDown
  8610.                });
  8611.                else if (this._adConfig.isSafeFrame || this._adConfig.isSkype) {
  8612.                    var d = this._getMaxExpansionBoundaries();
  8613.                    if (this._adConfig.isSafeFrame) {
  8614.                        if (this._isPushDown) d.push = !0;
  8615.                        try {
  8616.                            $sf.ext.expand(d)
  8617.                        } catch (e) {}
  8618.                    } else if (this._adConfig.isSkype) try {
  8619.                        this._wlxInit(), this._wlxObj.expand({
  8620.                            left: d.l,
  8621.                            right: d.r,
  8622.                            top: d.t,
  8623.                            bottom: d.b
  8624.                        })
  8625.                    } catch (f) {}
  8626.                }
  8627.                this._bannerCC.expand();
  8628.                if (this._adConfig.isSafeFrame) {
  8629.                    var g = EBG.adaptor.getElementById(this._bannerCC.iframeId);
  8630.                    g && (EBG.adaptor.setElemStyle(g, "position", "fixed"), EBG.adaptor.setElemStyle(g, "left", "0px"), EBG.adaptor.setElemStyle(g, "top", "0px"))
  8631.                }
  8632.                a.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
  8633.                EBG.eventMgr.dispatchEvent(a);
  8634.                b ? (EBG.intMgr.handleCounterInteraction(EBG.format("{0}_{1}", c, EBG.ExpBaseInteractions.AUTO_SHOW), this._adConfig.uid), this.panelFrequencyMgr.onExpand()) : EBG.intMgr.handleCounterInteraction(c, this._adConfig.uid);
  8635.                EBG.intMgr.startTimer(EBG.format("{0}_{1}", c, EBG.ExpBaseInteractions.DURATION),
  8636.                    this._adConfig.uid)
  8637.            }
  8638.        } catch (h) {}
  8639.    },
  8640.    _handleDynamicExpansion: function() {
  8641.        if (this._adConfig.expandDynamic) this.expansionParamsOrg = EBG.cloneObj(this._adConfig.expansionParams), this._updateExpansion(this._adConfig.isSkype && this._adConfig.ffs.CFF_SkypeDynamic ? this._adLocForSkype : this.getAdLocationOnPage())
  8642.    },
  8643.    _handleMoveMoveMsg: function(a) {
  8644.        this._bannerMousePos = {
  8645.            X: a.eventData.clientX,
  8646.            Y: a.eventData.clientY
  8647.        }
  8648.    },
  8649.    _getMaxExpansionBoundaries: function() {
  8650.        if (!this._adConfig.ffs.CFF_SkypeDynamic) return EBG.callSuperFunction(EBG.Ads.SEBannerHtml5,
  8651.            this, "_getMaxExpansionBoundaries", []);
  8652.        var a = {
  8653.                l: 0,
  8654.                r: 0,
  8655.                b: 0,
  8656.                t: 0
  8657.            },
  8658.            b = this._adConfig.panels || {};
  8659.        b.banner = {
  8660.            xPos: -1 * this._adConfig.expansionParams.x,
  8661.            yPos: -1 * this._adConfig.expansionParams.y,
  8662.            width: this._adConfig.expansionParams.width,
  8663.            height: this._adConfig.expansionParams.height
  8664.        };
  8665.        for (var c in b) {
  8666.            var d = b[c],
  8667.                e = {
  8668.                    l: 0,
  8669.                    r: 0,
  8670.                    b: 0,
  8671.                    t: 0
  8672.                };
  8673.            e.l = Math.max(-1 * d.xPos, 0);
  8674.            e.r = Math.max(d.xPos + d.width - (this._bannerCC ? this._bannerCC.getWidth() : this._adConfig.width), 0);
  8675.            e.t = Math.max(-1 * d.yPos, 0);
  8676.            e.b = Math.max(d.yPos + d.height - (this._bannerCC ?
  8677.                this._bannerCC.getHeight() : this._adConfig.height), 0);
  8678.            for (var f in e) a[f] = Math.max(a[f], e[f])
  8679.        }
  8680.        return a
  8681.    },
  8682.    _updateVisibilityManagerData: function(a) {
  8683.        if (!this.visibilityMgr) a = EBG.adaptor.getElementById(a.assetId), this.visibilityMgr = new EBG.RichModules.VisibilityManager(this._adConfig, a.children && a.children.length && a.children[0].id || a.id)
  8684.    },
  8685.    _updateAdStackingData: function(a) {
  8686.        if (!a.isPanel) {
  8687.            if (!this._adStackingDetector) this._adStackingDetector = new EBG.RichModules.AdStackingDetector(this._adConfig, !1);
  8688.            (a = EBG.adaptor.getElementById(a.assetId)) &&
  8689.            a.children[0] && a.children[0].id && this._adStackingDetector.addElementId(a.children[0].id, !0)
  8690.        }
  8691.    },
  8692.    _updateExpansion: function(a) {
  8693.        this._adConfig.expansionParams.x = a.isAdOnLeft ? 0 : this._adConfig.expansionParams.width - this._bannerCC.getWidth();
  8694.        this._adConfig.expansionParams.y = a.isAdOnTop ? 0 : this._adConfig.expansionParams.height - this._bannerCC.getHeight();
  8695.        this._updateSafeFramePanel();
  8696.        if (this._adConfig.isSkype && this._adConfig.ffs.CFF_SkypeDynamic && this._adConfig.expandDynamic) this._skypeExpansionCorrection = {
  8697.            prevExpansionWasLeft: !a.isAdOnLeft,
  8698.            xOffset: this._adConfig.expansionParams.x
  8699.        }
  8700.    },
  8701.    _handleCollapse: function(a, b) {
  8702.        if (!(!this._bannerCC || !this._bannerCC.isExpanded() || b && this._expandTimeStamp[this._adConfig.panelName.toLowerCase()] != b)) try {
  8703.            var c = new EBG.Events.Event(EBG.Events.EventNames.COLLAPSE);
  8704.            c.dispatcher = this;
  8705.            c.timing = EBG.Events.EventTiming.BEFORE;
  8706.            c.eventData = this._adConfig.panelName;
  8707.            if (!EBG.eventMgr.dispatchEvent(c)) {
  8708.                var d = !1;
  8709.                if (this._bannerMousePos.X > this._bannerCC.getWidth() + this._adConfig.expansionParams.x || this._bannerMousePos.X <
  8710.                    this._adConfig.expansionParams.x || this._bannerMousePos.Y > this._bannerCC.getHeight() + this._adConfig.expansionParams.y || this._bannerMousePos.Y < this._adConfig.expansionParams.y) d = !0;
  8711.                this._handleDynamicCollapse();
  8712.                if (this._sfUtil) this._sfUtil.collapse();
  8713.                else if (this._adConfig.isSafeFrame) try {
  8714.                        $sf.ext.collapse()
  8715.                    } catch (e) {} else if (this._adConfig.isSkype) try {
  8716.                        this._wlxObj.collapse(), this._adConfig.ffs.CFF_SkypeDynamic && this._adConfig.expandDynamic && this._wlxObj.resetState()
  8717.                    } catch (f) {}
  8718.                    this._bannerCC.collapse();
  8719.                if (this._adConfig.isSafeFrame) {
  8720.                    var g = EBG.cloneObj(this._adConfig.expansionParams);
  8721.                    g.x *= -1;
  8722.                    g.y *= -1;
  8723.                    var h = EBG.adaptor.getElementById(this._bannerCC.iframeId);
  8724.                    h && (EBG.adaptor.setElemStyle(h, "left", g.x + "px"), EBG.adaptor.setElemStyle(h, "top", g.y + "px"))
  8725.                }
  8726.                c.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
  8727.                EBG.eventMgr.dispatchEvent(c);
  8728.                if (d) {
  8729.                    var i = new EBG.Events.Event(EBG.Events.EventNames.MOUSE_OUT);
  8730.                    i.dispatcher = {
  8731.                        _adConfig: {
  8732.                            rnd: this._adConfig.rnd
  8733.                        }
  8734.                    };
  8735.                    i.eventData = {
  8736.                        target: this._bannerCC._iframe
  8737.                    };
  8738.                    EBG.eventMgr.dispatchEvent(i)
  8739.                }
  8740.                EBG.intMgr.stopTimer(EBG.format("{0}_{1}",
  8741.                    this._adConfig.panelName, EBG.ExpBaseInteractions.DURATION), this._adConfig.uid)
  8742.            }
  8743.        } catch (j) {}
  8744.    },
  8745.    _handleDynamicCollapse: function() {
  8746.        if (this._adConfig.expandDynamic) this._adConfig.expansionParams = EBG.cloneObj(this.expansionParamsOrg), EBG.adaptor.setElemStyle(this._bannerCC._iframe, "left", EBG.px(-1 * this._adConfig.expansionParams.x)), EBG.adaptor.setElemStyle(this._bannerCC._iframe, "top", EBG.px(-1 * this._adConfig.expansionParams.y))
  8747.    },
  8748.    _onInitExpansionParams: function(a) {
  8749.        try {
  8750.            if (a.eventData && EBG.isDefined(a.eventData.x) &&
  8751.                EBG.isDefined(a.eventData.y) && EBG.isDefined(a.eventData.width) && EBG.isDefined(a.eventData.height)) this._adConfig.expansionParams.x = a.eventData.x, this._adConfig.expansionParams.y = a.eventData.y, this._adConfig.expansionParams.width = a.eventData.width, this._adConfig.expansionParams.height = a.eventData.height, this._adConfig.expansionParams.autoCollapse = a.eventData.autoCollapse, this._updateSafeFramePanel()
  8752.        } catch (b) {}
  8753.    },
  8754.    _subscribeToEvents: function() {
  8755.        EBG.callSuperFunction(EBG.Ads.SEBannerHtml5, this, "_subscribeToEvents");
  8756.        this._subscribeToAdEvent(EBG.EBMessage.INIT_EXPANSION_PARAMS, this._onInitExpansionParams);
  8757.        this._subscribeToAdEvent(EBG.EBMessage.MOUSE_MOVE, this._handleMoveMoveMsg);
  8758.        var a = new EBG.Events.EventSubscription(EBG.Events.EventNames.ELEMENT_LOADED, this._autoExpandPanel, this);
  8759.        a.timing = EBG.Events.EventTiming.AFTER;
  8760.        EBG.eventMgr.subscribeToEvent(a)
  8761.    },
  8762.    _unLoadHandler: function() {
  8763.        EBG.adaptor.removeElement(this._bannerCC._iframeDivId);
  8764.        this._bannerCC.resetExpanded()
  8765.    },
  8766.    _setPanels: function() {
  8767.        this._panelsName.push(this._adConfig.panelName)
  8768.    },
  8769.    _loadBanner: function() {
  8770.        this._bannerCC = new EBG.SEIFrameCC(this._adConfig, {
  8771.            clickOccur: this._isClickOccur
  8772.        });
  8773.        this._bannerCC.iframeId = EBG.adaptor.generateElementId("BannerIFrame", this._adConfig.uid);
  8774.        this._CCs[this._bannerCC.iframeId] = this._bannerCC;
  8775.        this._bannerCC.setAssetCreativeParams();
  8776.        EBG.callSuperFunction(EBG.Ads.SEBannerHtml5, this, "_writeCreativeElements");
  8777.        if (this._adConfig.ffs.CFF_SEHtml5Cliping) EBG.adaptor.getElementById(this._banner.divId).style.display = "inline-block";
  8778.        if (this._adConfig.isSkype &&
  8779.            !this._adConfig.isSafeFrame) {
  8780.            var a = EBG.adaptor.getElementById(this._adConfig.placeHolderId),
  8781.                b = EBG.adaptor.getBoundingClientRect(a).bottom - this._bannerCC.getHeight();
  8782.            a.style.position = "relative";
  8783.            a.style.top = EBG.px(-b)
  8784.        }
  8785.    },
  8786.    getAdOffset: function() {
  8787.        var a = EBG.callSuperFunction(EBG.Ads.SEBannerHtml5, this, "getAdOffset");
  8788.        a.X += this._adConfig.expansionParams.x;
  8789.        a.Y += this._adConfig.expansionParams.y;
  8790.        return a
  8791.    },
  8792.    _handleCloseAd: function() {
  8793.        this._handleCollapse()
  8794.    },
  8795.    _getBannerLocation: function() {
  8796.        var a = EBG.callSuperFunction(EBG.Ads.SEBannerHtml5,
  8797.            this, "_getBannerLocation");
  8798.        a.X -= this._adConfig.expansionParams.x;
  8799.        a.Y -= this._adConfig.expansionParams.y;
  8800.        return a
  8801.    },
  8802.    _updateSafeFramePanel: function() {
  8803.        if (this._sfUtil) {
  8804.            var a = {};
  8805.            a[this._adConfig.panelName] = {
  8806.                width: this._adConfig.expansionParams.width,
  8807.                height: this._adConfig.expansionParams.height,
  8808.                xPos: -1 * this._adConfig.expansionParams.x,
  8809.                yPos: -1 * this._adConfig.expansionParams.y
  8810.            };
  8811.            this._sfUtil.updatePanels(a)
  8812.        }
  8813.    },
  8814.    _autoExpandPanel: function() {
  8815.        this.panelFrequencyMgr.initialize(this._adConfig);
  8816.        1 < this._adConfig.uponShow &&
  8817.            this.panelFrequencyMgr.shouldExpand() && this._handleExpand({
  8818.                type: EBG.EBMessage.EXPAND,
  8819.                eventData: {
  8820.                    actionType: EBG.ActionType.AUTO
  8821.                }
  8822.            })
  8823.    }
  8824. };
  8825. EBG.declareClass(EBG.Ads.SEBannerHtml5, EBG.Ads.ExpBaseHtml5);
  8826. EBG.declareNamespace("CreativeContainer");
  8827. EBG.CreativeContainer = function(a) {
  8828.    this._adConfig = a
  8829. };
  8830. EBG.declareClass(EBG.CreativeContainer, null);
  8831. EBGInfra.mergeObj({
  8832.    getCC: function(a, b, c) {
  8833.        var d = null;
  8834.        if ((a = EBG.ads[a]) && a._panels && a._panels[b]) d = a._panels[b].CC;
  8835.        else if (EBG.hasOwnValue(EBG.adParts, b) && !c)
  8836.            for (var e in a._CCs)
  8837.                if (-1 < e.toLowerCase().indexOf(b.toLowerCase())) {
  8838.                    d = a._CCs[e];
  8839.                    break
  8840.                }
  8841.        return d
  8842.    }
  8843. }, EBGInfra, !1);
  8844. EBGInfra.mergeObj(EBGInfra, EBG, !1);
  8845. EBG.declareNamespace("API.CC");
  8846. EBG.API.CC.getRes = function(a, b) {
  8847.    var c = EBGInfra.getCC(a, b),
  8848.        d = null;
  8849.    if (c)
  8850.        if (c._flashResID) d = EBG.adaptor.getElementById(c._flashResID);
  8851.        else if (c._iframe) d = c._iframe;
  8852.    return d
  8853. };
  8854. EBG.API.CC.getResID = function(a, b) {
  8855.    var c = EBGInfra.getCC(a, b),
  8856.        d = null;
  8857.    if (c)
  8858.        if (c._flashResID) d = c._flashResID;
  8859.        else if (c.iframeId) d = c.iframeId;
  8860.    return d
  8861. };
  8862. EBG.declareNamespace("IFrameCC");
  8863. EBG.IFrameCC = function(a, b) {
  8864.    EBG.callSuperConstructor(EBG.IFrameCC, this, [a]);
  8865.    this._isClickOccur = b.clickOccur;
  8866.    this._isEBInitialized = !1;
  8867.    this._isDocLoaded = !1;
  8868.    this._iframe = null;
  8869.    this.iframeId = null;
  8870.    this._isReqInitReceived = !1;
  8871.    this._assetCreativeParams = null;
  8872.    this._subscribeToEvents();
  8873.    this.pm = EBG.pm;
  8874.    this.useFriendlyIframe = this._adConfig.isSafeFrame || this._adConfig.isSkype;
  8875.    this._registerToEvents();
  8876.    this._listenToMessages();
  8877.    this._videoAssetsActive = []
  8878. };
  8879. EBG.IFrameCC.prototype = {
  8880.    _isContentLoading: !1,
  8881.    _videoAssetsActive: null,
  8882.    isAssetFullyLoaded: function() {
  8883.        return this._isEBInitialized && this._isDocLoaded
  8884.    },
  8885.    _subscribeToEvents: function() {
  8886.        if (!EBG.adaptor.isReady()) {
  8887.            var a = new EBG.Events.EventSubscription(EBG.EBMessage.ADAPTOR_READY, this._checkSendInit, this);
  8888.            a.timing = EBG.Events.EventTiming.ONTIME;
  8889.            EBG.eventMgr.subscribeToEvent(a)
  8890.        }
  8891.        if (this._adConfig.ffs.CFF_IFrameHidden && (!this._adConfig.customJSVars || !this._adConfig.customJSVars.hasOwnProperty("mdBillboardPanelName"))) {
  8892.            var b =
  8893.                new EBG.Events.EventSubscription(EBG.Events.EventNames.CREATIVE_CONTAINER_READY, function(a) {
  8894.                    if (this.iframeId && a.eventData == this.iframeId) this._iframe.style.display = this._iframeDisplay || "inline", EBG.eventMgr.unsubscribeFromEvent(b)
  8895.                }, this);
  8896.            b.timing = EBG.Events.EventTiming.ONTIME;
  8897.            EBG.eventMgr.subscribeToEvent(b)
  8898.        }
  8899.    },
  8900.    isEBInitialized: function() {
  8901.        return this._isEBInitialized
  8902.    },
  8903.    isDocLoaded: function() {
  8904.        return this._isDocLoaded
  8905.    },
  8906.    updateClick: function(a) {
  8907.        this._isClickOccur = a.clickOccur;
  8908.        this._sendMessage(EBG.EBMessage.UPDATE_CLICK,
  8909.            a)
  8910.    },
  8911.    setAssetCreativeParams: function() {
  8912.        if (this._adConfig.AdCreativeParams) this._assetCreativeParams = this._adConfig.AdCreativeParams
  8913.    },
  8914.    _handleMessage: function(a, b) {
  8915.        if (this._iframe)
  8916.            if (this._iframe.contentWindow) {
  8917.                if (b.source === this._iframe.contentWindow) {
  8918.                    var c = JSON.parse(b.data);
  8919.                    if (c) switch (c.type) {
  8920.                        case EBG.EBMessage.REQ_INIT:
  8921.                            this._isReqInitReceived = !0;
  8922.                            (EBG.adaptor.isReady() || !EBG.adaptor.isSDKDefined()) && this._sendInitToCreative();
  8923.                            break;
  8924.                        case EBG.EBMessage.INITDONE:
  8925.                            this._handleInitDone();
  8926.                            break;
  8927.                        case EBG.EBMessage.GET_ENVIROMENT:
  8928.                            this._sendAdKitData(c.type);
  8929.                            break;
  8930.                        case EBG.EBMessage.CLOSE_AD:
  8931.                            this._dispatchCloseAdEvent();
  8932.                            break;
  8933.                        default:
  8934.                            this._handleGeneralMessage(c)
  8935.                    }
  8936.                }
  8937.            } else EBG.runTimed(this, this._handleMessage, [a, b], 20);
  8938.        else this._getIframeElement(), EBG.runTimed(this, this._handleMessage, [a, b], 20)
  8939.    },
  8940.    _handleGeneralMessage: function(a) {
  8941.        var b = new EBG.Events.Event(a.type);
  8942.        b.dispatcher = this;
  8943.        if (a.data && (b.eventData = a.data, b.eventData && b.eventData.command)) this[b.eventData.command](b.eventData);
  8944.        EBG.eventMgr.dispatchEvent(b);
  8945.        this.handleIntMonitor(a)
  8946.    },
  8947.    handleIntMonitor: function(a) {
  8948.        if (EBG.adaptor.intMonitorExist()) {
  8949.            var b =
  8950.                new EBG.Events.Event(EBG.EBMessage.NOTIFY_INTERACTION_MONITOR);
  8951.            b.eventData = this._createIntMonitorObj(a);
  8952.            EBG.eventMgr.dispatchEvent(b)
  8953.        }
  8954.    },
  8955.    _handleInitDone: function() {
  8956.        this._isContentLoading = !1;
  8957.        this._isEBInitialized = !0;
  8958.        var a = new EBG.Events.Event(EBG.Events.EventNames.CREATIVE_CONTAINER_READY);
  8959.        a.dispatcher = this;
  8960.        a.eventData = this.iframeId;
  8961.        EBG.eventMgr.dispatchEvent(a);
  8962.        if (EBG.adaptor.isPageLoaded()) a = new EBG.Events.Event(EBG.Events.EbEventNames.PAGE_LOAD), a.dispatcher = this, this._handleEvents(a)
  8963.    },
  8964.    _saveAssetSrc: function(a) {
  8965.        a.src =
  8966.            this.iframeId
  8967.    },
  8968.    _registerVideo: function(a) {
  8969.        -1 == EBGInfra.indexOfArray(this._videoAssetsActive, a.assetId) && this._videoAssetsActive.push(a.assetId)
  8970.    },
  8971.    _unregisterVideo: function(a) {
  8972.        if (0 < this._videoAssetsActive.length) var b = EBGInfra.indexOfArray(this._videoAssetsActive, a.assetId);
  8973.        this._videoAssetsActive.splice(b, 1)
  8974.    },
  8975.    notifyDocLoaded: function(a) {
  8976.        this._isDocLoaded = !0;
  8977.        this._saveAssetSrc(a)
  8978.    },
  8979.    getWidth: function() {
  8980.        return EBG.isDefinedNotNull(this._adConfig.width) ? this._adConfig.width : this.getActualSize().width
  8981.    },
  8982.    getHeight: function() {
  8983.        return EBG.isDefinedNotNull(this._adConfig.height) ? this._adConfig.height : this.getActualSize().height
  8984.    },
  8985.    getActualSize: function() {
  8986.        var a = EBG.adaptor.getElementById(this.iframeId);
  8987.        return a ? EBG.adaptor.getBoundingClientRect(a) : {
  8988.            width: 0,
  8989.            height: 0
  8990.        }
  8991.    },
  8992.    getAdPartsData: function() {
  8993.        var a = {
  8994.            type: EBG.adParts.BANNER,
  8995.            adkitConfigUrl: this._adConfig.assets["config.js"] ? this._adConfig.resourcePath + this._adConfig.assets["config.js"].dsPath : ""
  8996.        };
  8997.        a.width = a.containerWidth = this.getWidth();
  8998.        a.height = a.containerHeight =
  8999.            this.getHeight();
  9000.        return a
  9001.    },
  9002.    _sendAdKitData: function(a) {
  9003.        var b = EBG.cloneObj(this._adConfig.adKitData),
  9004.            c = EBG.ads && this._adConfig && this._adConfig.uid && EBG.ads[this._adConfig.uid] ? EBG.ads[this._adConfig.uid]._adaptiveUtils : null;
  9005.        if (c) {
  9006.            b.adParts = b.adParts || {};
  9007.            b.adParts.type = EBG.adParts.BANNER;
  9008.            b.adParts.adkitConfigUrl = this._adConfig.assets["config.js"] ? this._adConfig.resourcePath + this._adConfig.assets["config.js"].dsPath : "";
  9009.            var c = c.getAsset(),
  9010.                d = this.getActualSize();
  9011.            if (c) b.adParts.name = c.name, b.adParts.width =
  9012.                c.width, b.adParts.height = c.height;
  9013.            if (d) b.adParts.containerWidth = d.width, b.adParts.containerHeight = d.height, b.actualWidth = d.width, b.actualHeight = d.height
  9014.        } else b.adParts = this.getAdPartsData();
  9015.        this._sendMessage(a, b)
  9016.    },
  9017.    _createIntMonitorObj: function(a) {
  9018.        var b = "";
  9019.        if (a) switch (a.type) {
  9020.            case EBG.EBMessage.VIDEO_INTERACTION:
  9021.                a.data && (b = EBG.format("'{0}',{1}", a.data.intName, a.data.ordinalNum));
  9022.                break;
  9023.            case EBG.EBMessage.EXPAND:
  9024.            case EBG.EBMessage.COLLAPSE:
  9025.                b = this._handleSpecialInt(a);
  9026.                break;
  9027.            default:
  9028.                b = a.data.intName
  9029.        }
  9030.        return {
  9031.            command: a.type,
  9032.            args: b,
  9033.            objName: this.iframeId,
  9034.            adId: this._adConfig.adId
  9035.        }
  9036.    },
  9037.    _handleSpecialInt: function(a) {
  9038.        var b = "";
  9039.        switch (a.type) {
  9040.            case EBG.EBMessage.EXPAND:
  9041.                b = a.data && EBGInfra.isDefinedNotNull(a.data.panelName) ? a.data.panelName : "";
  9042.                b += a.data && EBGInfra.isDefinedNotNull(a.data.actionType) && "" != a.data.actionType ? "," + a.data.actionType : ",User";
  9043.                break;
  9044.            case EBG.EBMessage.COLLAPSE:
  9045.                b = a.data && EBGInfra.isDefinedNotNull(a.data.panelName) ? a.data.panelName : ""
  9046.        }
  9047.        return b
  9048.    },
  9049.    _listenToMessages: function() {
  9050.        for (var a in EBG.EBMessage) EBG.EBMessage.hasOwnProperty(a) &&
  9051.            (a = EBG.EBMessage[a], EBG.pm.bind(a, this._handleMessage, this, this._adConfig.displayWin || EBG.adaptor.getDisplayWin()))
  9052.    },
  9053.    _sendMessage: function(a, b) {
  9054.        this._iframe && (this.useFriendlyIframe ? EBG.runTimed(this, function() {
  9055.            this._iframe.contentWindow.EBG.pm.dispatch(a, b, window, this._iframe.contentWindow)
  9056.        }, [], 1) : EBG.pm({
  9057.            target: this._iframe.contentWindow,
  9058.            type: a,
  9059.            data: b
  9060.        }))
  9061.    },
  9062.    _handleEvents: function(a) {
  9063.        this._isEBInitialized && this._sendMessage(a.name, a.eventData)
  9064.    },
  9065.    _registerToEvents: function() {
  9066.        for (var a in EBG.Events.EbEventNames) EBG.Events.EbEventNames.hasOwnProperty(a) &&
  9067.            EBG.eventMgr.subscribeToEvent(new EBG.Events.EventSubscription(EBG.Events.EbEventNames[a], this._handleEvents, this))
  9068.    },
  9069.    _dispatchCloseAdEvent: function() {
  9070.        var a = new EBG.Events.Event(EBG.Events.EventNames.CLOSE_AD);
  9071.        a.dispatcher = this;
  9072.        a.timing = EBG.Events.EventTiming.ONTIME;
  9073.        EBG.eventMgr.dispatchEvent(a)
  9074.    },
  9075.    _checkSendInit: function() {
  9076.        this._isReqInitReceived && this._sendInitToCreative()
  9077.    },
  9078.    _sendInitToCreative: function() {
  9079.        if (this._adConfig) {
  9080.            var a = {
  9081.                assetCreativeParams: this._assetCreativeParams,
  9082.                clickOccur: this._isClickOccur,
  9083.                clickedProductIds: this._getClickedProductIDs(),
  9084.                adConfig: this._adConfig,
  9085.                ffs: EBG.serverResponses[this._adConfig.uid].ffs,
  9086.                dsBasePath: this._adConfig.resourcePath,
  9087.                events: EBG.Events.EbEventNames,
  9088.                assetId: this.iframeId
  9089.            };
  9090.            this._sendMessage(EBG.EBMessage.INIT, a)
  9091.        }
  9092.    },
  9093.    _getIframeElement: function() {
  9094.        var a = EBG.adaptor.getElementById(this.iframeId);
  9095.        a ? (this._iframe = a, this.useFriendlyIframe && !this._isContentLoading && this._loadContentToIframe(this.getIframePath())) : EBG.runTimed(this, this._getIframeElement, [], 20)
  9096.    },
  9097.    _loadContentToIframe: function(a) {
  9098.        this._isContentLoading = !0;
  9099.        var b = a.split("/");
  9100.        b.pop();
  9101.        var b = b.join("/") + "/",
  9102.            c = a.match(/\?.*$/)[0],
  9103.            d = this._adConfig.adKitData;
  9104.        d.adParts = this.getAdPartsData();
  9105.        var e = this;
  9106.        this._getAssetHtmlContent(a, function(a) {
  9107.            a ? (a = '<base href="' + b + '"/>' + a, e._iframe.contentWindow.document.open("text/html", "replace"), e._iframe.contentWindow.ebSafeFrame = {
  9108.                pm: function(a) {
  9109.                    a && EBG.runTimed(e, function() {
  9110.                        e.pm.dispatch(a.type, a.data, e._iframe.contentWindow, a.target)
  9111.                    }, [], 1)
  9112.                },
  9113.                getClickTagUrl: function() {
  9114.                    return EBG.intMgr.getClickTag(e._adConfig.uid)
  9115.                },
  9116.                getAdKitData: function() {
  9117.                    return {
  9118.                        data: JSON.stringify({
  9119.                            data: d,
  9120.                            type: EBG.EBMessage.GET_ENVIROMENT
  9121.                        }),
  9122.                        source: window
  9123.                    }
  9124.                }
  9125.            }, e._iframe.contentWindow.ebQueryString = c, e._iframe.contentWindow.document.write(a), setTimeout(function() {
  9126.                e._iframe.contentWindow.document.close()
  9127.            }, 200)) : e._isContentLoading = !1
  9128.        })
  9129.    },
  9130.    _getAssetHtmlContent: function(a, b) {
  9131.        EBG.adaptor.getDataFromRemoteServer(a, function(a) {
  9132.            b(a)
  9133.        }, this, !0, !1)
  9134.    },
  9135.    _buildIfrmSrc: function(a) {
  9136.        a = EBG.format("{0}?v={1}", EBG.combinePaths(this._adConfig.resourcePath, a), EBG.html5Ver);
  9137.        this._adConfig.ffs.CFF_EBLoaderNew && this._adConfig.useAsyncEBLoader &&
  9138.            (a += "&n=1");
  9139.        this._adConfig.ffs.CFF_EBVpaidVersion && (a += "&vpaidV=" + this._adConfig.moduleInfo.vpaidVersionHtml5);
  9140.        this._adConfig.pluId && (a += "&plu=" + this._adConfig.pluId, this._adConfig.sHost && (a += "&sHost=" + this._adConfig.sHost));
  9141.        this._adConfig.isInstream && (a += "&nonCached=" + this._adConfig.sms);
  9142.        this._adConfig.isClickTag && (a = EBG.format("{0}&clickTag={1}", a, escape(EBG.intMgr.getClickTag(this._adConfig.uid))));
  9143.        EBG.isPreview && (a = EBG.format("{0}&isPreview={1}", a, "1"));
  9144.        return a
  9145.    },
  9146.    buildCreativeContainerJson: function() {
  9147.        var a =
  9148.            this.useFriendlyIframe ? this.getFriendlyIframePath() : this.getIframePath(),
  9149.            a = {
  9150.                tagName: EBG.Adaptors.TagNames.IFRAME,
  9151.                attributes: {
  9152.                    id: this.iframeId,
  9153.                    src: a,
  9154.                    onload: EBG.format('(function(e) { var event = new EBG.Events.Event(EBG.Events.EventNames.ELEMENT_LOADED);event.dispatcher = this;event.eventData = { DOMEvent: e, elementId: "{0}", adUId:"{1}" };event.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;EBG.eventMgr.dispatchEvent(event);} )(typeof arguments != "undefined" ? arguments[0] : null);', this.iframeId,
  9155.                        this._adConfig.uid),
  9156.                    width: this._adConfig.width ? this._adConfig.width : "100%",
  9157.                    height: this._adConfig.height ? this._adConfig.height : "100%",
  9158.                    allowfullscreen: !0
  9159.                }
  9160.            };
  9161.        if (this._adConfig.ffs.CFF_IFrameHidden) a.attributes.style = {
  9162.            display: "none"
  9163.        };
  9164.        this._getIframeElement();
  9165.        return [a]
  9166.    },
  9167.    getIframePath: function() {
  9168.        return this._buildIfrmSrc(this._adConfig.adHtmlPath)
  9169.    },
  9170.    getFriendlyIframePath: function() {
  9171.        var a, b = "";
  9172.        if (EBG.adaptor.browser.isIE() && 11 > EBG.adaptor.browser.getVersion()) {
  9173.            try {
  9174.                if ((a = EBG.adaptor.inject({
  9175.                        tagName: EBG.Adaptors.TagNames.IFRAME,
  9176.                        attributes: {
  9177.                            id: "ebSampleIFrame" + this._adConfig.rnd,
  9178.                            src: "",
  9179.                            width: 1,
  9180.                            height: 1,
  9181.                            allowfullscreen: !0,
  9182.                            visibility: "hidden",
  9183.                            display: "none"
  9184.                        }
  9185.                    }, EBG.Adaptors.InjectionMethod.APPEND, EBG.adaptor.getElementById(this._adConfig.placeHolderId))) && a.contentWindow) a.contentWindow.document.open("text/html", "replace"), a.contentWindow.document.stam = {}
  9186.            } catch (c) {
  9187.                b = "javascript:'<script>window.onload=function(){document.write(\\'<script>document.domain=\\\"" + document.domain + "\\\";<\\\\/script>\\');document.close();};<\/script>'"
  9188.            }
  9189.            a &&
  9190.                a.parentElement && a.parentElement.removeChild(a)
  9191.        }
  9192.        return b
  9193.    },
  9194.    _getClickedProductIDs: function() {
  9195.        return this._adConfig.uid && EBG.intMgr.adsData[this._adConfig.uid] && EBG.intMgr.adsData[this._adConfig.uid].isProductClicked ? EBG.intMgr.adsData[this._adConfig.uid].isProductClicked : {}
  9196.    }
  9197. };
  9198. EBG.declareClass(EBG.IFrameCC, EBG.CreativeContainer);
  9199. EBG.declareNamespace("API.CC");
  9200. EBG.API.CC.sendMessage = function(a, b, c, d) {
  9201.    (a = EBGInfra.getCC(a, b, !0)) && EBG.isFunc(a._sendMessage) && (ret = a._sendMessage(c, d))
  9202. };
  9203. EBG.declareNamespace("SEIFrameCC");
  9204. EBG.SEIFrameCC = function(a, b) {
  9205.    EBG.callSuperConstructor(EBG.SEIFrameCC, this, [a, b])
  9206. };
  9207. EBG.SEIFrameCC.prototype = {
  9208.    _panelExpanded: !1,
  9209.    _handleSpecialInt: function(a) {
  9210.        var b = "";
  9211.        switch (a.type) {
  9212.            case EBG.EBMessage.EXPAND:
  9213.                b = this._adConfig.panelName;
  9214.                b += a.data && EBGInfra.isDefinedNotNull(a.data.actionType) && "" != a.data.actionType ? "," + a.data.actionType : ",User";
  9215.                break;
  9216.            case EBG.EBMessage.COLLAPSE:
  9217.                b = this._adConfig.panelName
  9218.        }
  9219.        return b
  9220.    },
  9221.    _dispatchEvent: function(a) {
  9222.        a = new EBG.Events.Event(a);
  9223.        a.dispatcher = this;
  9224.        EBG.eventMgr.dispatchEvent(a)
  9225.    },
  9226.    getWidth: function() {
  9227.        return this._adConfig.width ? this._adConfig.width :
  9228.            this._adConfig.chosenWidth
  9229.    },
  9230.    getHeight: function() {
  9231.        return this._adConfig.height ? this._adConfig.height : this._adConfig.chosenHeight
  9232.    },
  9233.    getAdPartsData: function() {
  9234.        var a = this._adConfig.assets["config.js"] ? this._adConfig.resourcePath + this._adConfig.assets["config.js"].dsPath : "",
  9235.            b = this.getActualSize();
  9236.        return {
  9237.            type: EBG.adParts.BANNER,
  9238.            width: this.isExpanded() ? this._adConfig.expansionParams.width : this.getWidth(),
  9239.            height: this.isExpanded() ? this._adConfig.expansionParams.height : this.getHeight(),
  9240.            containerWidth: b.width,
  9241.            containerHeight: b.height,
  9242.            adkitConfigUrl: a
  9243.        }
  9244.    },
  9245.    buildCreativeContainerJson: function() {
  9246.        var a = EBG.adaptor.generateElementId("BlankImg", this._adConfig.uid),
  9247.            b = EBG.adaptor.generateElementId("IframeDiv", this._adConfig.uid);
  9248.        this._adConfig.resourcePath = EBG.combinePaths(this._adConfig.resourcePath, "");
  9249.        var c = this._adConfig.expansionParams,
  9250.            d = {
  9251.                width: this.getWidth(),
  9252.                height: this.getHeight()
  9253.            },
  9254.            d = EBG.adaptor.getClipParams(c, d),
  9255.            a = {
  9256.                tagName: EBG.Adaptors.TagNames.IMG,
  9257.                attributes: {
  9258.                    id: a,
  9259.                    src: EBG.combinePaths(ebBigS, "Res/blank_1X1.gif"),
  9260.                    width: this.getWidth(),
  9261.                    height: this.getHeight()
  9262.                }
  9263.            },
  9264.            e = this.useFriendlyIframe ? this.getFriendlyIframePath() : this.getIframePath(),
  9265.            c = this._adConfig.ffs.CFF_SEHtml5Cliping ? {
  9266.                tagName: EBG.Adaptors.TagNames.DIV,
  9267.                attributes: {
  9268.                    id: "parent_" + b,
  9269.                    style: {
  9270.                        display: "block",
  9271.                        position: "relative",
  9272.                        "z-index": 1
  9273.                    }
  9274.                },
  9275.                children: [{
  9276.                    tagName: EBG.Adaptors.TagNames.DIV,
  9277.                    attributes: {
  9278.                        id: b,
  9279.                        style: {
  9280.                            display: "block",
  9281.                            width: EBG.px(c.width),
  9282.                            height: EBG.px(c.height),
  9283.                            left: EBG.px(-c.x),
  9284.                            top: EBG.px(-c.y),
  9285.                            clip: EBG.adaptor.getClipTag(d.top, d.right, d.bottom, d.left),
  9286.                            position: "absolute"
  9287.                        }
  9288.                    },
  9289.                    children: [{
  9290.                        tagName: EBG.Adaptors.TagNames.IFRAME,
  9291.                        attributes: {
  9292.                            id: this.iframeId,
  9293.                            src: e,
  9294.                            allowTransparency: "true",
  9295.                            allowfullscreen: !0,
  9296.                            onload: EBG.format('(function(e) { var event = new EBG.Events.Event(EBG.Events.EventNames.ELEMENT_LOADED);event.dispatcher = this;event.eventData = { DOMEvent: e, elementId: "{0}", adUId:"{1}" };event.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;EBG.eventMgr.dispatchEvent(event);} )(typeof arguments != "undefined" ? arguments[0] : null);', this.iframeId,
  9297.                                this._adConfig.uid),
  9298.                            style: {
  9299.                                left: "0px",
  9300.                                top: "0px",
  9301.                                width: EBG.px(c.width),
  9302.                                height: EBG.px(c.height),
  9303.                                "z-index": EBG.minZIndex,
  9304.                                visibility: this._adConfig.ffs.CFF_IFrameHidden && (!this._adConfig.customJSVars || !this._adConfig.customJSVars.hasOwnProperty("mdBillboardPanelName")) ? "hidden" : "visible"
  9305.                            }
  9306.                        }
  9307.                    }]
  9308.                }]
  9309.            } : {
  9310.                tagName: EBG.Adaptors.TagNames.DIV,
  9311.                attributes: {
  9312.                    id: b,
  9313.                    style: {
  9314.                        display: "block",
  9315.                        position: "relative"
  9316.                    }
  9317.                },
  9318.                children: [{
  9319.                    tagName: EBG.Adaptors.TagNames.IFRAME,
  9320.                    attributes: {
  9321.                        id: this.iframeId,
  9322.                        src: e,
  9323.                        allowTransparency: "true",
  9324.                        allowfullscreen: !0,
  9325.                        onload: EBG.format('(function(e) { var event = new EBG.Events.Event(EBG.Events.EventNames.ELEMENT_LOADED);event.dispatcher = this;event.eventData = { DOMEvent: e, elementId: "{0}", adUId:"{1}" };event.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;EBG.eventMgr.dispatchEvent(event);} )(typeof arguments != "undefined" ? arguments[0] : null);', this.iframeId, this._adConfig.uid),
  9326.                        style: {
  9327.                            left: EBG.px(-c.x),
  9328.                            top: EBG.px(-c.y),
  9329.                            width: EBG.px(c.width),
  9330.                            height: EBG.px(c.height),
  9331.                            "z-index": EBG.minZIndex,
  9332.                            clip: EBG.adaptor.getClipTag(d.top,
  9333.                                d.right, d.bottom, d.left),
  9334.                            position: "absolute"
  9335.                        }
  9336.                    }
  9337.                }]
  9338.            };
  9339.        this._iframeDivId = b;
  9340.        EBG.callSuperFunction(EBG.SEIFrameCC, this, "_getIframeElement", [this.iframeId]);
  9341.        return [c, a]
  9342.    },
  9343.    resetExpanded: function() {
  9344.        this._panelExpanded = !1
  9345.    },
  9346.    isExpanded: function() {
  9347.        return this._panelExpanded
  9348.    },
  9349.    expand: function() {
  9350.        EBG.adaptor.expand(this._adConfig.ffs.CFF_SEHtml5Cliping ? this._iframe.parentElement : this._iframe, this._adConfig.expansionParams);
  9351.        this._panelExpanded = !0;
  9352.        this._dispatchEvent(EBG.EBMessage.EXPAND_DONE);
  9353.        this._requestMouseMove(!0)
  9354.    },
  9355.    collapse: function() {
  9356.        var a = {
  9357.            width: this.getWidth(),
  9358.            height: this.getHeight()
  9359.        };
  9360.        EBG.adaptor.collapse(this._adConfig.ffs.CFF_SEHtml5Cliping ? this._iframe.parentElement : this._iframe, this._adConfig.expansionParams, a);
  9361.        this._panelExpanded = !1;
  9362.        this._dispatchEvent(EBG.EBMessage.COLLAPSE_DONE);
  9363.        this._requestMouseMove(!1)
  9364.    },
  9365.    _requestMouseMove: function(a) {
  9366.        this._sendMessage(EBG.EBMessage.REQ_MOUSE_MOVE, {
  9367.            shouldStart: !!a
  9368.        })
  9369.    }
  9370. };
  9371. EBG.declareClass(EBG.SEIFrameCC, EBG.IFrameCC);
  9372. EBG.declareNamespace("API.CC");
  9373. EBG.API.CC.getPanelExpanded = function(a, b) {
  9374.    var c = EBGInfra.getCC(a, b, !0);
  9375.    ret = null;
  9376.    c && EBG.isFunc(c.isExpanded) && (ret = c.isExpanded());
  9377.    return ret
  9378. };
  9379. EBG.API.CC.setPanelExpanded = function(a, b, c) {
  9380.    return (a = EBGInfra.getCC(a, b, !0)) && EBG.isBool(c) && EBG.isDefined(a._panelExpanded) ? (EBG.isDefined(a.panelUtil) ? a.panelUtil._panelExpanded = c : a._panelExpanded = c, c) : null
  9381. };
  9382. EBG.API.CC.expand = function(a, b) {
  9383.    var c = EBGInfra.getCC(a, b, !0);
  9384.    c && EBG.isFunc(c.expand) && c.expand()
  9385. };
  9386. EBG.API.CC.collapse = function(a, b, c) {
  9387.    (a = EBGInfra.getCC(a, b, !0)) && EBG.isFunc(a.collapse) && a.collapse(c)
  9388. };
  9389. EBG.API.CC.removeAsset = function(a, b, c, d) {
  9390.    (a = EBGInfra.getCC(a, b, !0)) && EBG.isFunc(a.removeAsset) && a.removeAsset(c, d)
  9391. };
  9392. EBG.API.CC.recalculatePanelPosition = function(a, b) {
  9393.    var c = EBGInfra.getCC(a, b, !0);
  9394.    c && EBG.isFunc(c.recalculatePanelPosition) && c.recalculatePanelPosition()
  9395. };
  9396. EBG.API.CC.getProps = function(a, b) {
  9397.    var c = EBGInfra.getCC(a, b, !0);
  9398.    ret = null;
  9399.    if (c)
  9400.        if (EBG.isDefined(c.panelUtil)) ret = c.panelUtil.props;
  9401.        else if (EBG.isObj(c.props)) ret = c.props;
  9402.    return ret
  9403. };
  9404. EBG.API.CC.setProps = function(a, b, c) {
  9405.    a = EBGInfra.getCC(a, b, !0);
  9406.    if ((a = EBG.isDefined(a.panelUtil) ? a.panelUtil : a) && EBG.isFunc(a.setProperties) && EBG.isObj(c))
  9407.        for (var d in c)
  9408.            if (c.hasOwnProperty(d)) {
  9409.                a.props.hasOwnProperty(d) || (a.props[d] = {});
  9410.                for (var e in c[d]) c[d].hasOwnProperty(e) && (a.props[d][e] = c[d][e])
  9411.            }
  9412. };
  9413. EBG.declareNamespace("SFUtil");
  9414. EBG.SFUtil = function(a) {
  9415.    this.setExpandParams(a.panels, a.width, a.height)
  9416. };
  9417. EBG.SFUtil.prototype = {
  9418.    _isSafeFrameExpanded: !1,
  9419.    _panels: {},
  9420.    _width: 0,
  9421.    _height: 0,
  9422.    setExpandParams: function(a, b, c) {
  9423.        this._panels = a ? this.createPanels(a) : this._panels;
  9424.        this._width = b ? b : this._width;
  9425.        this._height = c ? c : this._height
  9426.    },
  9427.    register: function() {
  9428.        try {
  9429.            $sf.ext.register(this._width, this._height)
  9430.        } catch (a) {}
  9431.    },
  9432.    expand: function(a) {
  9433.        if (!this._isSafeFrameExpanded) {
  9434.            var b = this._calcBounderies();
  9435.            try {
  9436.                if (a && a.push && $sf.ext.supports()["exp-push"]) b.push = !0;
  9437.                $sf.ext.expand(b);
  9438.                this._isSafeFrameExpanded = !0
  9439.            } catch (c) {}
  9440.        }
  9441.    },
  9442.    canExpand: function() {
  9443.        try {
  9444.            var a =
  9445.                this._calcBounderies(),
  9446.                b = $sf.ext.geom().exp,
  9447.                c;
  9448.            for (c in a)
  9449.                if (b[c] = b[c] ? 1 * b[c] : 0, b[c] < a[c]) return !1;
  9450.            var d = $sf.ext.supports();
  9451.            return !(!d["exp-ovr"] && !d["exp-push"] && a.b + a.t + a.l + a.r)
  9452.        } catch (e) {
  9453.            return !1
  9454.        }
  9455.    },
  9456.    _calcBounderies: function() {
  9457.        var a = {
  9458.                l: 0,
  9459.                r: 0,
  9460.                b: 0,
  9461.                t: 0
  9462.            },
  9463.            b;
  9464.        for (b in this._panels) {
  9465.            var c = {
  9466.                    l: 0,
  9467.                    r: 0,
  9468.                    b: 0,
  9469.                    t: 0
  9470.                },
  9471.                d = this._panels[b];
  9472.            c.l = Math.max(-1 * d.xPos, 0);
  9473.            c.r = Math.max(d.xPos + d.width - this._width, 0);
  9474.            c.t = Math.max(-1 * d.yPos, 0);
  9475.            c.b = Math.max(d.yPos + d.height - this._height, 0);
  9476.            for (var e in a) a[e] = Math.max(c[e], a[e])
  9477.        }
  9478.        return a
  9479.    },
  9480.    collapse: function() {
  9481.        if (this._isSafeFrameExpanded) {
  9482.            var a = !0,
  9483.                b;
  9484.            for (b in this._panels) {
  9485.                if (this._panels[b].CC && this._panels[b].CC.isExpanded() && b != panelName) {
  9486.                    a = !1;
  9487.                    break
  9488.                }
  9489.                if (this._panels[b].CC && this._panels[b].CC._ExpandMethod == EBG.ExpandCollapseMethod.CLIP) {
  9490.                    a = !1;
  9491.                    break
  9492.                }
  9493.            }
  9494.            try {
  9495.                if (a) $sf.ext.collapse(), this._isSafeFrameExpanded = !1
  9496.            } catch (c) {}
  9497.        }
  9498.    },
  9499.    createPanels: function(a) {
  9500.        var b = {},
  9501.            c;
  9502.        for (c in a) b[c] = {}, b[c].xPos = a[c].xPos, b[c].yPos = a[c].yPos, b[c].width = a[c].width, b[c].height = a[c].height;
  9503.        return b
  9504.    },
  9505.    updatePanels: function(a) {
  9506.        this._panels =
  9507.            a
  9508.    },
  9509.    getWindowViewPortMetrics: function() {
  9510.        var a = $sf.ext.geom();
  9511.        return {
  9512.            Height: a.par.h,
  9513.            Width: a.par.w
  9514.        }
  9515.    },
  9516.    getAdOffset: function() {
  9517.        var a = $sf.ext.geom();
  9518.        return {
  9519.            X: -a.exp.l,
  9520.            Y: -a.exp.t
  9521.        }
  9522.    }
  9523. };
  9524. EBG.declareClass(EBG.SFUtil, null);
  9525. EBG.declareNamespace("BWDetection");
  9526. EBG.BWDetection = {
  9527.    checked: !1,
  9528.    checking: !1,
  9529.    speed: 0,
  9530.    _adjustment: 0.75,
  9531.    _images: [{
  9532.        path: EBG.format("{0}{1}micro.gif", ebPtcl, ebO.sms),
  9533.        bytes: 51,
  9534.        start: null,
  9535.        end: null
  9536.    }, {
  9537.        path: EBG.format("{0}{1}micro.gif", ebPtcl, ebO.sms),
  9538.        bytes: 51,
  9539.        start: null,
  9540.        end: null
  9541.    }, {
  9542.        path: EBG.format("{0}{1}bw_image.png", ebPtcl, ebO.sms),
  9543.        bytes: 43677,
  9544.        start: null,
  9545.        end: null
  9546.    }],
  9547.    _loaded: 0,
  9548.    _loadImage: function(a) {
  9549.        this._images[a].start = (new Date).getTime();
  9550.        var b = new Image,
  9551.            c = Math.random();
  9552.        b.onload = function() {
  9553.            EBG.BWDetection._imageLoaded(a)
  9554.        };
  9555.        b.src = this._images[a].path +
  9556.            "?rnd=" + c
  9557.    },
  9558.    _imageLoaded: function(a) {
  9559.        this._images[a].end = (new Date).getTime();
  9560.        this._loaded++;
  9561.        this._loaded == this._images.length && this._calculateSpeed()
  9562.    },
  9563.    _dispatchEvent: function() {
  9564.        var a = new EBG.Events.Event(EBG.Events.EventNames.BANDWITH_DETECTED);
  9565.        a.dispatcher = this;
  9566.        a.eventData = this.speed;
  9567.        EBG.eventMgr.dispatchEvent(a)
  9568.    },
  9569.    _calculateSpeed: function() {
  9570.        var a = Math.min(this._images[0].end - this._images[0].start, this._images[1].end - this._images[1].start),
  9571.            b = this._images[2].end - this._images[2].start,
  9572.            c = b,
  9573.            d = this._images[2].bytes;
  9574.        b > a && (c = b - a, d -= this._images[0].bytes);
  9575.        this.speed = Math.round(8 * (d / (c / 1E3) / 1024)) * this._adjustment;
  9576.        if (Infinity == this.speed) this.speed = 25E3;
  9577.        this.checked = !0;
  9578.        this.checking = !1;
  9579.        this._dispatchEvent()
  9580.    },
  9581.    init: function() {
  9582.        this.checking = !0;
  9583.        this._loadImage(0);
  9584.        this._loadImage(1);
  9585.        this._loadImage(2);
  9586.        var a = this;
  9587.        setTimeout(function() {
  9588.            if (!a.checked) a.speed = 56, a.checked = !0, a.checking = !1, a._dispatchEvent()
  9589.        }, 5E3)
  9590.    }
  9591. };
  9592. var tempExtensionHook = ebO.extensionHooks;
  9593. try {
  9594.    ebO.extensionHooks.splice(0, 0, function(a, b) {
  9595.        function c() {
  9596.            EBG.Interactions.checkURL = function(a) {
  9597.                if (a) {
  9598.                    var b = a.toLowerCase();
  9599.                    b.match("^[^?]*:.*") || (a = "http://" + b);
  9600.                    return a
  9601.                }
  9602.            }
  9603.        }
  9604.        EBG.getFeatureFlagValue(b.ffs, "CFF_DeepLink") && c()
  9605.    })
  9606. } catch (e$$104) {
  9607.    ebO.extensionHooks = tempExtensionHook
  9608. }
  9609. tempExtensionHook = ebO.extensionHooks;
  9610. try {
  9611.    ebO.extensionHooks.splice(0, 0, function(a, b) {
  9612.        function c() {
  9613.            b.adConfig.UiVz = !1;
  9614.            if (EBG.Adaptors && EBG.Adaptors.ServingMgr && EBG.Adaptors.ServingMgr.prototype) EBG.Initializer._initServingMode = function(a) {
  9615.                var b = this._getAdClass(a);
  9616.                a.requiresIframeBust = b.requiresIframeBust;
  9617.                var c = EBGInfra.isDefined(EBG.adaptor.serving) ? EBG.adaptor.serving.detectServingMode(!0) : null;
  9618.                if (EBG.adaptor.isSafeFrame()) a.ifrm = 0, a.adConfig.UiVz = !1;
  9619.                else {
  9620.                    if (b.requiresIframeBust) {
  9621.                        if (!a.ifrm || a.soi) a.ifrm = 0;
  9622.                        if (a.innerIframe) a.ifrm = EBG.Adaptors.ServingMode.INNER_IFRAME;
  9623.                        EBG.adaptor.initServingMode(a.ifrm, !1, c)
  9624.                    } else if (a.ifrm = 0, b != EBG.Ads.StdBanner && b != EBG.Ads.StdBannerHtml5 && (EBG.adaptor.initServingMode(a.ifrm, !b.requiresIframeBust, c), c == EBG.Adaptors.ServingMode.FRIENDLY_IFRAME)) try {
  9625.                        document.close()
  9626.                    } catch (d) {}
  9627.                    if (EBG.adaptor.inPlacementIframe() || !b.requiresIframeBust && !a.innerIframe && c == EBG.Adaptors.ServingMode.IFRAME && !EBG.adaptor.isSkype() && b != EBG.Ads.StdBanner && b != EBG.Ads.StdBannerHtml5 && !EBG.adaptor.isSafeFrame())
  9628.                        if (b.requiresIframeBust || a.IABBV || a.IABEV || a.invVis) a.ifrm =
  9629.                            1, b = new EBG.Events.EventSubscription(EBG.Events.EventNames.AIE_LOADED, this._handleAieLoad, this), b.dispatcherFilters = {
  9630.                                "_adConfig.rnd": a.rnd,
  9631.                                "_adConfig.templateName": a.tn
  9632.                            }, b.timing = EBG.Events.EventTiming.BEFORE, EBG.eventMgr.subscribeToEvent(b), EBG.adaptor.serving.handleAieServing(a)
  9633.                }
  9634.            }, EBG.Adaptors.ServingMgr.prototype.checkAie = function(a, c, d) {
  9635.                EBG.serverResponses = EBG.serverResponses || {};
  9636.                EBG.serverResponses[a.adConfig.uid] || (EBG.serverResponses[a.adConfig.uid] = a);
  9637.                d.ebO = EBG.cloneObj(a);
  9638.                if (EBG.adaptor.browser.isIE() &&
  9639.                    9 > EBG.adaptor.browser.getVersion()) try {
  9640.                    delete d.ebO.ut, delete d.ebO.fru
  9641.                } catch (h) {
  9642.                    d.ebO.ut = "", d.ebO.fru = ""
  9643.                }
  9644.                EBG.iframeLocation ? c.apply(d, ['{"iflExists":1,"iflCheck":0}']) : EBG.isDefinedNotNull(b.aiE) && EBG.isDefinedNotNull(b.aiE.iflExists) ? c.apply(d, [JSON.stringify(b.aiE)]) : (a = encodeURIComponent(document.referrer || document.location.href)) ? EBG.adaptor.getDataFromRemoteServer(ebPtcl + b.bs + this.aieServerRequestPrefix + a + this.aieServerRequestPrefixVersion, this._handleAddInEyeServerResponse, this, !0, !1) || c.apply(d, ['{"iflExists":1,"iflCheck":0}']) : c.apply(d)
  9645.            }, EBG.Adaptors.ServingMgr.prototype.handleAieServing = function(a) {
  9646.                this.checkAie(a, this._handleAddInEyeServerResponse, this)
  9647.            }, EBG.Adaptors.ServingMgr.prototype._handleAddInEyeServerResponse = function(a, b) {
  9648.                var c;
  9649.                try {
  9650.                    c = !b && a ? JSON.parse(a) : {
  9651.                        iflExists: 0,
  9652.                        iflCheck: 1
  9653.                    }
  9654.                } catch (d) {
  9655.                    c = {
  9656.                        iflExists: 0,
  9657.                        iflCheck: 1
  9658.                    }
  9659.                }
  9660.                EBG.serverResponses[this.ebO.adConfig.uid].aiE = c;
  9661.                this.ebO.aiE = c;
  9662.                if (!this.ebO.dmn) this.ebO.dmn = c.Domain ? c.Domain : this._ebGetHostName(document.referrer);
  9663.                if (this.ebO.requiresIframeBust &&
  9664.                    c && c.iflExists) this.insertInnerIframe(this.ebO.phid, c.iflCheck ? EBG.Adaptors.IframeMode.SERVEANDVERIFY : EBG.Adaptors.IframeMode.SERVE);
  9665.                else {
  9666.                    if (this.ebO.requiresIframeBust) this.ebO.adConfig.showAieDefaultImage = 1;
  9667.                    this.ebO.ifrm = 0;
  9668.                    var i = new EBG.Events.Event(EBG.Events.EventNames.AIE_LOADED);
  9669.                    i.eventData = {
  9670.                        loadDefault: !0,
  9671.                        currentResponse: this.ebO
  9672.                    };
  9673.                    i.timing = EBG.Events.EventTiming.BEFORE;
  9674.                    EBG.eventMgr.dispatchEvent(i);
  9675.                    c.iflCheck && this.insertInnerIframe(this.ebO.phid, EBG.Adaptors.IframeMode.VERIFY)
  9676.                }
  9677.            };
  9678.            if (EBG.RichModules &&
  9679.                EBG.RichModules.VisibilityManager) {
  9680.                var a = function() {
  9681.                    return !0
  9682.                };
  9683.                EBG.RichModules.BasicVisibilityProvider.prototype.shouldReportRecordable = a;
  9684.                EBG.RichModules.GeometricVisibilityProvider.prototype.shouldReportRecordable = a;
  9685.                EBG.RichModules.GeometricVisibilityProvider._isAvailable = function(a) {
  9686.                    return (a.actualServingMode != EBG.Adaptors.ServingMode.IFRAME || EBG.adaptor.serving.servingMode == EBG.Adaptors.ServingMode.INNER_IFRAME) && !(a.ffs.CFF_MRAIDVis && EBG.adaptor.isInApp())
  9687.                };
  9688.                EBG.RichModules.MouseVisibilityProvider.prototype.shouldReportRecordable =
  9689.                    a;
  9690.                EBG.RichModules.MouseVisibilityProvider.prototype.shouldReportRecordable = a;
  9691.                EBG.RichModules.GridVisibilityProvider.prototype.shouldReportRecordable = a;
  9692.                if (EBG.RichModules.MraidVisibilityProvider) EBG.RichModules.MraidVisibilityProvider.prototype.shouldReportRecordable = a;
  9693.                EBG.RichModules.FlashVisibilityProvider.prototype.shouldReportRecordable = a;
  9694.                EBG.RichModules.SafeFrameVisibilityProvider.prototype.shouldReportRecordable = a;
  9695.                EBG.RichModules.FFVisibilityProvider.prototype.shouldReportRecordable = a;
  9696.                EBG.RichModules.VisibilityManager.prototype._availableVisibilityProviders = [EBG.RichModules.GeometricVisibilityProvider, EBG.RichModules.SafeFrameVisibilityProvider, EBG.RichModules.AddingEyeProvider, EBG.RichModules.MouseVisibilityProvider, EBG.RichModules.GridVisibilityProvider, EBG.RichModules.FlashVisibilityProvider, EBG.RichModules.FFVisibilityProvider, EBG.RichModules.MraidVisibilityProvider];
  9697.                a = EBG.RichModules.VisibilityManager.prototype;
  9698.                EBG.RichModules.VisibilityManager = function(a, b, c) {
  9699.                    this.adConfig = a;
  9700.                    this._resObjId = b;
  9701.                    this._res = EBG.adaptor.getElementById(b);
  9702.                    this.actualServingMode =
  9703.                        this.adConfig.actualServingMode;
  9704.                    this._averageLastCalcTime = (new Date).getTime();
  9705.                    this._isPanel = c;
  9706.                    this._dpm = EBG.dataPipeMgr.getPipe(this.adConfig.sID);
  9707.                    if (this._shouldInitialize())(this._visibilityProvider = this._getVisibilityProvider(this._resObjId, this.adConfig)) ? (this._dpm.send(EBG.DataProfile.VISIBILITY, {
  9708.                        vsr: 1,
  9709.                        vsbp: this.getVisibilityProviderNum()
  9710.                    }), this._initializeVisibilityData(), this._subscribeToEvents(), a = function() {
  9711.                        this._visibilityProvider.shouldReportRecordable() && this._reportVisibilityRecordable();
  9712.                        this._visibilityProvider.start()
  9713.                    }, this.adConfig.adStarted ? a.apply(this) : (a = new EBG.Events.EventSubscription(EBG.Events.EventNames.AD_START, a, this), a.timing = EBG.Events.EventTiming.ONTIME, EBG.eventMgr.subscribeToEvent(a))) : this._dpm.send(EBG.DataProfile.VISIBILITY, {
  9714.                        uvsr: 3
  9715.                    })
  9716.                };
  9717.                EBG.RichModules.VisibilityManager.ThreholdType = {
  9718.                    IAB: 0,
  9719.                    Agency: 1,
  9720.                    Advertiser: 2
  9721.                };
  9722.                EBG.RichModules.VisibilityManager.VisibilityPollingTimer = 1E3;
  9723.                EBG.RichModules.VisibilityManager.prototype = a;
  9724.                EBG.RichModules.VisibilityManager.prototype._shouldInitialize =
  9725.                    function() {
  9726.                        EBG.Initializer._getAdClass({
  9727.                            tn: this.adConfig.templateName
  9728.                        });
  9729.                        return this.adConfig.visibility.mode == EBG.VisibilityMode.DEFAULT_MODE ? !1 : !0
  9730.                    }
  9731.            }
  9732.        }
  9733.        EBG.getFeatureFlagValue(b.ffs, "CFF_RemoveUivz") && c()
  9734.    })
  9735. } catch (e$$107) {
  9736.    ebO.extensionHooks = tempExtensionHook
  9737. }
  9738. tempExtensionHook = ebO.extensionHooks;
  9739. try {
  9740.    ebO.extensionHooks.splice(0, 0, function(a, b) {
  9741.        function c() {
  9742.            if (EBG.Interactions && EBG.Interactions.InteractionManager && EBG.Interactions.InteractionManager.prototype.reportInteractionQueues) EBG.Interactions.InteractionManager.prototype.reportInteractionQueues = function(a, b, c) {
  9743.                    if (!(EBG.getTime() > EBG.Interactions.InteractionManager.INTERACTION_THRESHOLD_SEC)) {
  9744.                        var a = EBG.isBool(a) ? a : !0,
  9745.                            b = EBG.isBool(b) ? b : !1,
  9746.                            g = {},
  9747.                            h = {},
  9748.                            i;
  9749.                        for (i in this.adsData)
  9750.                            if (this.adsData.hasOwnProperty(i)) {
  9751.                                var j = this.adsIntQueues[i];
  9752.                                if (!this.adsData[i].delayIntReport)
  9753.                                    for (; j.length;) {
  9754.                                        for (var k =
  9755.                                                this._getAdReportData(i), m = this.adsData[i].adConfig._interactionPipe, l = 0, p = this._isUnloadHandled ? j.length : EBG.Interactions.InteractionManager.intStackLength, n = 0; n < j.length && n < p; n++) k += j[n], l++;
  9756.                                        for (n = 0; n < l; n++) j.shift();
  9757.                                        this._isUnloadHandled ? (l = g[m] ? g[m] : "", "" != l && (l += "|"), h[m] || (h[m] = this._getPipeParams(i, b)), l += k, g[m] = l) : this._reportServer(m + k + this._getPipeParams(i, b), a, c)
  9758.                                    }
  9759.                            }
  9760.                        for (var r in g) this._reportServer(r + g[r] + (h[r] ? h[r] : ""), a, c)
  9761.                    }
  9762.                }, EBG.Interactions.InteractionManager.prototype._handleDataParams =
  9763.                function(a, b, c) {
  9764.                    var b = this._getAdReportData(a),
  9765.                        c = encodeURIComponent(c),
  9766.                        g = this._getPipeParams(a, !1);
  9767.                    this._reportServer(this.adsData[a].adConfig._interactionsStrPipe + "$$" + b + c + "$$" + g, !0)
  9768.                }
  9769.        }
  9770.        EBG.getFeatureFlagValue(b.ffs, "CFF_SupportMultiEnv") && c()
  9771.    })
  9772. } catch (e$$108) {
  9773.    ebO.extensionHooks = tempExtensionHook
  9774. }
  9775. EBG.declareNamespace("API.Ad");
  9776. EBG.API.Ad.setCustomVar = function(a, b, c, d) {
  9777.    d = !!d;
  9778.    a = EBG.ads[a];
  9779.    if (!EBGInfra.isDefinedNotNull(a)) throw "Ad doesn't exist";
  9780.    a._adConfig.customJSVars = a._adConfig.customJSVars || {};
  9781.    var e = a._adConfig.hasOwnProperty(b);
  9782.    e && !d && "undefined" === a._adConfig[b] && (d = !0, c = void 0);
  9783.    if (d || !e) a._adConfig[b] = c, a._adConfig.customJSVars[b] = c
  9784. };
  9785. EBG.API.Ad.getCustomVar = function(a, b, c) {
  9786.    a = EBG.ads[a];
  9787.    if (!EBGInfra.isDefinedNotNull(a)) throw "Ad doesn't exist";
  9788.    a._adConfig.hasOwnProperty(b) && (c = "undefined" == a._adConfig[b] ? void 0 : a._adConfig[b]);
  9789.    return c
  9790. };
  9791. EBG.API.Ad.recalcPosition = function(a) {
  9792.    (a = EBG.ads[a]) && a._handlePageResizeOrScroll && a._handlePageResizeOrScroll()
  9793. };
  9794. EBG.API.Ad.isExpanded = function(a, b) {
  9795.    var c, d = EBG.ads[a],
  9796.        e = !1;
  9797.    if (d && d._CCs)
  9798.        for (c in d._CCs)
  9799.            if ("undefined" != typeof d._CCs[c].isExpanded && d._CCs[c].isExpanded() && !(EBGInfra.isDefined(b) && "" != b && d._CCs[c].props.panel.name.toLowerCase() != b.toLowerCase())) {
  9800.                e = !0;
  9801.                break
  9802.            }
  9803.    return e
  9804. };
  9805. EBG.API.Ad.shouldExpand = function(a) {
  9806.    return (a = EBG.ads[a]) && a.panelFrequencyMgr && a.panelFrequencyMgr.shouldExpand()
  9807. };
  9808. EBG.declareNamespace("API.Banner");
  9809. EBG.API.Banner.getElements = function(a) {
  9810.    var b = {},
  9811.        c = EBG.ads[a];
  9812.    if (!c) return null;
  9813.    a = c._banner && c._banner.resId || c._bannerCC && c._bannerCC.iframeId || c._preloadImgResId || c._defaultImgResId;
  9814.    c = c._banner && c._banner.divId || c._adConfig.placeHolderId;
  9815.    if (a) b.banner = EBG.API.Adaptor.getElementById(a);
  9816.    if (c) b.bannerDiv = EBG.API.Adaptor.getElementById(c);
  9817.    return b
  9818. };
  9819. EBG.API.Ad.getPlaceholder = function(a) {
  9820.    return !EBG.ads[a] ? null : EBG.API.Adaptor.getElementById(EBG.API.Ad.getAdData(a, "placeHolderId"))
  9821. };
  9822. EBG.API.Banner.callFunc = function(a, b, c) {
  9823.    return (a = EBG.API.Banner.getElements(a)) && a.banner && a.banner[b] ? a.banner[b](c) : null
  9824. };
  9825. EBG.API.Banner.setViewabilityElem = function(a, b) {
  9826.    var c = EBG.ads[a];
  9827.    if (c && EBG.Initializer._getAdClass({
  9828.            tn: c._adConfig.templateName
  9829.        }).requiresIframeBust) {
  9830.        if (c.visibilityMgr) c.visibilityMgr.updateResourceObjId(b);
  9831.        else if (c._adConfig.suppressBanner) c._updateVisibilityManagerData({
  9832.            assetId: b,
  9833.            isPanel: !1
  9834.        });
  9835.        else var d = c._subscribeToAdEvent(EBG.Events.EventNames.ADD_CREATIVES, function(a) {
  9836.            if (-1 < ["ADD_HTML5_MAIN_CREATIVE", "ADD_BANNER_RICH_FLASH_CREATIVE", "ADD_BANNER_DEFAULT_IMAGE_CREATIVE", "ADD_BANNER_DEFAULT_FLASH_CREATIVE"].indexOf(a.eventData.creativeType)) {
  9837.                var f =
  9838.                    c.visibilityMgr;
  9839.                f && f.updateResourceObjId(b); - 1 < ["ADD_HTML5_MAIN_CREATIVE", "ADD_BANNER_RICH_FLASH_CREATIVE"].indexOf(a.eventData.creativeType) && EBG.eventMgr.unsubscribeFromEvent(d)
  9840.            }
  9841.        }, EBG.Events.EventTiming.AFTER);
  9842.        return !0
  9843.    }
  9844.    return null
  9845. };
  9846. EBG.API.Ad.getAdData = function() {
  9847.    var a = {},
  9848.        b = {
  9849.            bannerResId: "_banner.resId",
  9850.            bannerDivId: "_banner.divId",
  9851.            defaultPanelName: "_defaultPanel"
  9852.        };
  9853.    return function(c, d) {
  9854.        var e = EBG.ads[c];
  9855.        if (!e || !d) return {};
  9856.        var f = d = EBG.isArray(d) ? d : !d || "*" === d ? EBG.getObjKeys(a[c]) : [d];
  9857.        a[c] = a[c] || {};
  9858.        for (var g = a[c], h = 0; h < f.length; h++) {
  9859.            var i = f[h],
  9860.                j = b[i];
  9861.            j || (j = "_adConfig." + i);
  9862.            try {
  9863.                var k = g,
  9864.                    m;
  9865.                if (EBG.isFunc(j)) m = j(e);
  9866.                else {
  9867.                    for (var l = e, p = j.split("."), j = 0; j < p.length; j++) l = l[p[j]];
  9868.                    m = EBG.isObj(l) ? EBG.cloneObj(l) : l
  9869.                }
  9870.                k[i] = m
  9871.            } catch (n) {}
  9872.        }
  9873.        return 1 ===
  9874.            d.length ? g[d[0]] : g
  9875.    }
  9876. }();
  9877. EBG.API.Ad.setAdData = function() {
  9878.    var a = function() {},
  9879.        b = {
  9880.            customJSVars: "_adConfig.customJSVars",
  9881.            _showOnlyDefaultImg: "_showOnlyDefaultImg",
  9882.            _downloadMode: "_downloadMode",
  9883.            doNotTouch: a
  9884.        };
  9885.    return function(c, d) {
  9886.        var e = EBG.ads[c];
  9887.        if (!e || !d) e = !1;
  9888.        else {
  9889.            var f = {},
  9890.                g;
  9891.            for (g in d) {
  9892.                var h = d[g],
  9893.                    i = b[g];
  9894.                i || (i = "_adConfig." + g);
  9895.                try {
  9896.                    if (EBG.isFunc(i)) i === a ? f[g] = "BLOCKED" : i(e, h);
  9897.                    else {
  9898.                        for (var j = e, k = i.split("."), i = 0; i < k.length - 1; i++) j[k[i]] = j[k[i]] || {}, j = j[k[i]];
  9899.                        j[k[k.length - 1]] = h
  9900.                    }
  9901.                } catch (m) {
  9902.                    f[g] = "Error"
  9903.                }
  9904.            }
  9905.            e = f
  9906.        }
  9907.        return e
  9908.    }
  9909. }();
  9910. EBG.API.Ad.willCloseAdParts = function(a, b) {
  9911.    var c = null;
  9912.    "undefined" == typeof b && (b = "_eyeblaster");
  9913.    "string" == typeof b && (b = b.toLowerCase(), EBG.intMgr.adsData[a] && EBG.intMgr.adsData[a].Counter && EBG.intMgr.adsData[a].Counter[b] && (c = !!EBG.intMgr.adsData[a].Counter[b].interactionData.counterJumpUrlData.fClose));
  9914.    return c
  9915. };
  9916. EBG.API.Ad.unload = function(a) {
  9917.    if (a = EBG.ads[a]) {
  9918.        if (EBG.isFunc(a._unLoadHandler)) return a._unLoadHandler(), !0;
  9919.        if (EBG.isFunc(a._handlePageUnload)) return a._handlePageUnload(), !0
  9920.    }
  9921.    return !1
  9922. };
  9923. EBG.API.Ad.getAssetUrl = function(a, b) {
  9924.    var c = EBG.ads[a],
  9925.        d = null;
  9926.    c && c._adConfig.assets.hasOwnProperty(b) && (d = EBG.combinePaths(c._adConfig.resourcePath, b));
  9927.    return d
  9928. };
  9929. EBG.declareNamespace("API.Expansion");
  9930. EBG.API.Expansion.expand = function(a, b) {
  9931.    var c = EBG.ads[a];
  9932.    if (c && EBG.eventMgr) {
  9933.        var d = new EBG.Events.Event(EBG.EBMessage.EXPAND);
  9934.        d.dispatcher = c._bannerCC || EBGInfra.getCC(a, EBG.adParts.BANNER) || EBGInfra.getCC(a, EBG.adParts.RICHBANNER) || EBGInfra.getCC(a, EBG.adParts.PANEL) || c;
  9935.        d.eventData = b || {};
  9936.        EBG.eventMgr.dispatchEvent(d)
  9937.    }
  9938. };
  9939. EBG.API.Expansion.collapse = function(a, b) {
  9940.    var c = EBG.ads[a];
  9941.    if (c && EBG.eventMgr) {
  9942.        var d = new EBG.Events.Event(EBG.EBMessage.COLLAPSE);
  9943.        d.dispatcher = EBGInfra.getCC(a, EBG.adParts.PANEL) || c._bannerCC || EBGInfra.getCC(a, EBG.adParts.RICHBANNER) || EBGInfra.getCC(a, EBG.adParts.BANNER) || c;
  9944.        d.eventData = b || {};
  9945.        EBG.eventMgr.dispatchEvent(d)
  9946.    }
  9947. };
  9948. EBG.declareNamespace("API.EventManager");
  9949. EBG.API.EventManager.FilterNames = {
  9950.    MY_AD: "myAd",
  9951.    MY_PANEL: "myPanel"
  9952. };
  9953. EBG.API.EventManager.subscribeToEvent = function(a, b, c, d, e) {
  9954.    a = new EBG.Events.EventSubscription(a, b, e);
  9955.    if (d) a.dispatcherFilters = EBG.API.EventManager.getFilters(d);
  9956.    if (c) a.timing = c;
  9957.    EBG.eventMgr.subscribeToEvent(a)
  9958. };
  9959. EBG.API.EventManager.subscribeToElementEvent = function(a, b, c, d, e, f) {
  9960.    b = new EBG.Events.EventSubscription(b, c, f);
  9961.    if (e) b.dispatcherFilters = EBG.API.EventManager.getFilters(e);
  9962.    if (d) b.timing = d;
  9963.    b.isElementEvent = !0;
  9964.    b.elementId = a;
  9965.    EBG.eventMgr.subscribeToEvent(b)
  9966. };
  9967. EBG.API.EventManager.unsubscribeFromEvent = function(a, b, c, d, e) {
  9968.    a = new EBG.Events.EventSubscription(a, b, e);
  9969.    if (d) a.dispatcherFilters = EBG.API.EventManager.getFilters(d);
  9970.    if (c) a.timing = c;
  9971.    EBG.eventMgr.unsubscribeFromEvent(a)
  9972. };
  9973. EBG.API.EventManager.unsubscribeFromElementEvent = function(a, b, c, d, e, f) {
  9974.    b = new EBG.Events.EventSubscription(b, c, f);
  9975.    if (e) b.dispatcherFilters = EBG.API.EventManager.getFilters(e);
  9976.    if (d) b.timing = d;
  9977.    b.isElementEvent = !0;
  9978.    b.elementId = a;
  9979.    EBG.eventMgr.unsubscribeFromEvent(b)
  9980. };
  9981. EBG.API.EventManager.getFilters = function(a) {
  9982.    var b = {};
  9983.    if (EBG.isObj(a) || EBG.isArray(a))
  9984.        for (var c in a)
  9985.            if (a.hasOwnProperty(c)) switch (c) {
  9986.                case EBG.API.EventManager.FilterNames.MY_AD:
  9987.                    b["_adConfig.uid"] = a[c];
  9988.                    break;
  9989.                case EBG.API.EventManager.FilterNames.MY_PANEL:
  9990.                    b["props.panel.name"] = a[c].toLowerCase();
  9991.                    break;
  9992.                default:
  9993.                    b[c] = a[c]
  9994.            }
  9995.            return b
  9996. };
  9997. EBG.API.EventManager.dispatchEvent = function(a, b, c, d) {
  9998.    a = new EBG.Events.Event(a);
  9999.    a.dispatcher = b;
  10000.    a.eventData = c;
  10001.    a.timing = d;
  10002.    EBG.eventMgr.dispatchEvent(a)
  10003. };
  10004. EBG.declareNamespace("API.Adaptor");
  10005. EBG.API.Adaptor.getElementById = function(a) {
  10006.    return EBG.adaptor.getElementById(a)
  10007. };
  10008. EBG.API.Adaptor.getDisplayWin = function() {
  10009.    return EBG.adaptor.getDisplayWin()
  10010. };
  10011. EBG.API.Adaptor.getPageWin = function() {
  10012.    return EBG.adaptor.getPageWin()
  10013. };
  10014. EBG.API.Adaptor.getViewPortMetrics = function(a) {
  10015.    return EBG.adaptor.getWindowViewPortMetrics(a)
  10016. };
  10017. EBG.API.Adaptor.getPageMetrics = function(a) {
  10018.    var a = a || EBG.API.Adaptor.getDisplayWin(),
  10019.        b = a.document.body,
  10020.        c = EBG.API.Adaptor.getScrollLeftTop(a == window),
  10021.        a = EBG.adaptor.getPageMetrics ? EBG.adaptor.getPageMetrics(a) : {
  10022.            Width: null,
  10023.            Height: null
  10024.        };
  10025.    a.height = a.Height;
  10026.    a.width = a.Width;
  10027.    a.scrollbarWidth = EBG.adaptor.getScrollerWidth ? EBG.adaptor.getScrollerWidth() : null;
  10028.    a.scrollbarsHidden = "hidden" == b.style.overflow;
  10029.    a.scrollHeight = b.scrollHeight;
  10030.    a.scrollWidth = b.scrollWidth;
  10031.    a.offsetHeight = b.offsetHeight;
  10032.    a.offsetWidth = b.offsetWidth;
  10033.    a.clientHeight = b.clientHeight;
  10034.    a.clientWidth = b.clientWidth;
  10035.    a.scrollLeft = c.X;
  10036.    a.scrollTop = c.Y;
  10037.    return a
  10038. };
  10039. EBG.API.Adaptor.showScrollBars = function(a) {
  10040.    EBG.adaptor.showScrollBars(a)
  10041. };
  10042. EBG.API.Adaptor.hideScrollBars = function(a) {
  10043.    EBG.adaptor.hideScrollBars(a)
  10044. };
  10045. EBG.API.Adaptor.restoreScrollBarsState = function(a) {
  10046.    EBG.adaptor.restoreScrollBarsState(a)
  10047. };
  10048. EBG.API.Adaptor.getEyeDiv = function() {
  10049.    return EBG.adaptor.getElementById(EBG.Const.OUTER_DIV)
  10050. };
  10051. EBG.API.Adaptor.inject = function(a, b, c) {
  10052.    return EBG.adaptor.inject(a, b, c)
  10053. };
  10054. EBG.API.Adaptor.setStyle = function(a, b, c) {
  10055.    c = EBG.isDefined(c) ? c : !0;
  10056.    EBG.adaptor.setStyleToElem(a, b, c)
  10057. };
  10058. EBG.API.Adaptor.getStyle = function(a, b, c) {
  10059.    if (a && b) {
  10060.        if (c) return EBG.adaptor.getStyleOfElem(a)[b];
  10061.        if (window.getComputedStyle) return window.getComputedStyle(a)[b]
  10062.    }
  10063. };
  10064. EBG.API.Adaptor.getBrowserData = function() {
  10065.    return {
  10066.        platform: EBG.adaptor.browser._platform,
  10067.        browser: EBG.adaptor.browser._browserType,
  10068.        browserVersion: EBG.adaptor.browser._browserVer,
  10069.        device: EBG.adaptor.browser._deviceType
  10070.    }
  10071. };
  10072. EBG.API.Adaptor.getScreenOrientation = function() {
  10073.    return EBG.adaptor.getScreenOrientation(!1)
  10074. };
  10075. EBG.API.Adaptor.getPositioningById = function(a, b, c) {
  10076.    return EBG.adaptor.getPositioningById(a, b, c)
  10077. };
  10078. EBG.API.Adaptor.getPositioningByElement = function(a, b, c) {
  10079.    return EBG.adaptor.getPositioningByElement(a, b, c)
  10080. };
  10081. EBG.API.Adaptor.setStyleToElems = function(a, b, c) {
  10082.    c = EBG.isDefined(c) ? c : !0;
  10083.    EBG.isArray(a) || (a = [a]);
  10084.    for (var d = 0; d < a.length; d++) a[d].style && EBG.adaptor.setStyleToElem(a[d], b, c)
  10085. };
  10086. EBG.API.Adaptor.getHostName = function(a) {
  10087.    return EBG.adaptor.getHostName(a)
  10088. };
  10089. EBG.API.Adaptor.getDomain = function(a) {
  10090.    return EBG.adaptor.getDomain(a)
  10091. };
  10092. EBG.API.Adaptor.getScrollLeftTop = function(a, b) {
  10093.    return EBG.adaptor.getScrollLeftTop(a, b)
  10094. };
  10095. EBG.API.Adaptor.removeElement = function(a) {
  10096.    EBG.adaptor.removeElement(a)
  10097. };
  10098. EBG.API.Adaptor.clip = function(a, b, c, d, e) {
  10099.    "function" == typeof EBG.adaptor.clip && EBG.adaptor.clip(a, b, c, d, e)
  10100. };
  10101. EBG.API.Adaptor.unclip = function(a) {
  10102.    "function" == typeof EBG.adaptor.unclip && EBG.adaptor.unclip(a)
  10103. };
  10104. EBG.API.Adaptor.getElementMetrics = function(a) {
  10105.    "string" == EBG.typeOf(a) && (a = EBG.adaptor.getElementById(a));
  10106.    if (!a) return null;
  10107.    var b = {},
  10108.        c = a.getBoundingClientRect();
  10109.    b.width = c.width ? c.width : c.right - c.left;
  10110.    b.height = c.height ? c.height : c.bottom - c.top;
  10111.    b.viewPortRelative = {
  10112.        top: c.top,
  10113.        bottom: c.bottom,
  10114.        left: c.left,
  10115.        right: c.right
  10116.    };
  10117.    a = EBG.API.Adaptor.getScrollLeftTop(a.ownerDocument.defaultView ? a.ownerDocument.defaultView : a.ownerDocument.parentWindow);
  10118.    b.pageRelative = {
  10119.        top: c.top + a.Y,
  10120.        bottom: c.bottom + a.Y,
  10121.        left: c.left + a.X,
  10122.        right: c.right + a.X
  10123.    };
  10124.    return b
  10125. };
  10126. EBG.API.Adaptor.setClass = function(a, b, c) {
  10127.    "array" !== EBG.typeOf(a) && (a = [a]);
  10128.    "array" !== EBG.typeOf(b) && (b = [b]);
  10129.    for (var d in a) {
  10130.        var e = "string" === EBG.typeOf(a[d]) ? EBG.adaptor.getElementById(a[d]) : a[d];
  10131.        if (e && EBG.isDefined(e.className))
  10132.            for (var f in b)
  10133.                if ("string" === EBG.typeOf(b[f]))
  10134.                    if (c) e.className = b[f];
  10135.                    else if (!EBG.API.Adaptor.hasClass(e, b[f])) {
  10136.            var g = " ";
  10137.            "" === e.className && (g = "");
  10138.            e.className += g + b[f]
  10139.        }
  10140.    }
  10141. };
  10142. EBG.API.Adaptor.removeClass = function(a, b) {
  10143.    "array" !== EBG.typeOf(a) && (a = [a]);
  10144.    "array" !== EBG.typeOf(b) && (b = [b]);
  10145.    for (var c in a) {
  10146.        var d = "string" === EBG.typeOf(a[c]) ? EBG.adaptor.getElementById(a[c]) : a[c];
  10147.        if (d && EBG.isDefined(d.className)) {
  10148.            for (var e in b)
  10149.                if ("string" === EBG.typeOf(b[e])) d.className = d.className.replace(RegExp("(^|\\s+)" + b[e] + "(\\s+|$)", "g"), " ");
  10150.            d.className = d.className.replace(/^||$/g, "")
  10151.        }
  10152.    }
  10153. };
  10154. EBG.API.Adaptor.hasClass = function(a, b, c) {
  10155.    var d = 0,
  10156.        c = EBG.isDefined(c) ? c : !0;
  10157.    "array" !== EBG.typeOf(a) && (a = [a]);
  10158.    "array" !== EBG.typeOf(b) && (b = [b]);
  10159.    for (var e in a) {
  10160.        var f = "string" === EBG.typeOf(a[e]) ? EBG.adaptor.getElementById(a[e]) : a[e];
  10161.        if (f && EBG.isDefined(f.className))
  10162.            for (var g in b) "string" === EBG.typeOf(b[g]) && null !== f.className.match(RegExp("(^|\\s+)" + b[g] + "(\\s+|$)")) && d++
  10163.    }
  10164.    return c ? d === a.length * b.length : 0 < d
  10165. };
  10166. EBG.API.Adaptor.getHighestZIndex = function() {
  10167.    return 2147483647
  10168. };
  10169. (function() {
  10170.    var a = function() {
  10171.        var a = navigator.userAgent.toLowerCase(),
  10172.            c = function(c) {
  10173.                "string" == typeof c && (c = [c]);
  10174.                for (var d = 0; d < c.length; d++)
  10175.                    if (-1 < a.indexOf(c[d])) return !0;
  10176.                return !1
  10177.            },
  10178.            d = EBG.adaptor && EBG.adaptor.browser ? EBG.adaptor.browser : {};
  10179.        if (!(EBG.adaptor && EBG.adaptor.browser == d)) {
  10180.            d.ver = "unknown";
  10181.            d.isMobile = function() {
  10182.                return c("android,iphone,ipod,ipad,blackberry,windows phone,silk".split(","))
  10183.            };
  10184.            d.isMac = function() {
  10185.                return c("opera")
  10186.            };
  10187.            d.isAndroid = function() {
  10188.                return c("android")
  10189.            };
  10190.            d.isFF = function() {
  10191.                return c("firefox")
  10192.            };
  10193.            if (d.isFF()) d.ver = parseInt(a.slice(a.indexOf("firefox/") + 8));
  10194.            d.isIE = function() {
  10195.                return c(["msie", "trident"])
  10196.            };
  10197.            if (d.isIE()) d.ver = parseInt(c("msie") ? a.slice(a.indexOf("msie ") + 5) : a.slice(a.indexOf("rv:") + 3));
  10198.            d.isOpera = function() {
  10199.                return c("opera")
  10200.            };
  10201.            if (d.isOpera()) d.ver = parseInt(c("opera/9.80") ? a.slice(a.indexOf("version/") + 8) : a.slice(a.indexOf("opera/") + 6));
  10202.            d.isChrome = function() {
  10203.                return c("chrome")
  10204.            };
  10205.            if (d.isChrome()) d.ver = parseInt(a.slice(a.indexOf("chrome/") + 7));
  10206.            d.isSafari = function() {
  10207.                return c("safari") &&
  10208.                    !c("chrome")
  10209.            };
  10210.            if (d.isSafari()) d.ver = parseInt(a.slice(a.indexOf("version/") + 8));
  10211.            d.isStrictType = function() {
  10212.                return d.isIE() && "CSS1Compat" == document.compatMode
  10213.            };
  10214.            d.getDocumentMode = function() {
  10215.                return document.documentMode
  10216.            };
  10217.            d.getVersion = function() {
  10218.                return d.ver
  10219.            }
  10220.        }
  10221.        var e = window.EBG && EBG.EBAPI && EBG.EBAPI.prototype || window.EBG && EBG.API;
  10222.        if (!e.os) {
  10223.            e.os = {};
  10224.            var f = e.os;
  10225.            f.ua = a;
  10226.            f.uahas = c;
  10227.            f.mobile = d.isMobile();
  10228.            f.mac = d.isMac();
  10229.            f.kindle = c(["silk/", "kindle"]);
  10230.            f.android = d.isAndroid();
  10231.            f.windows = c("windows");
  10232.            f.windowsphone =
  10233.                c("windows phone");
  10234.            f.windowsdesktop = f.windows && !f.windowsphone;
  10235.            f.linux = c("linux") && !f.android;
  10236.            f.ipod = c("ipod");
  10237.            f.ipad = c("ipad");
  10238.            f.iphone = c("iphone") && !f.ipad;
  10239.            f.ios = f.iphone || f.ipad || f.ipod;
  10240.            f.blackberry = c("blackberry");
  10241.            f.firefox = c("firefox") && c("mobile;") && !(f.ios || f.android || f.linux || f.blackberry);
  10242.            f.name = f.windowsphone ? "windowsphone" : f.windows ? "windows" : f.mac ? "mac" : f.linux ? "linux" : f.android ? "android" : f.ios ? "ios" : "unknown";
  10243.            var g = 0;
  10244.            switch (f.name) {
  10245.                case "windowsphone":
  10246.                    f.verS = "windows";
  10247.                    g = a.indexOf("windows phone ");
  10248.                    if (-1 < g) {
  10249.                        for (var g = a.slice(g + 14), h = 0; h < g.length; h++) {
  10250.                            var i = g.charAt(h);
  10251.                            if (isNaN(i) && "." !== i) break
  10252.                        }
  10253.                        0 < h && (g = g.slice(0, h));
  10254.                        f.verS = g
  10255.                    }
  10256.                    break;
  10257.                case "windows":
  10258.                    f.verS = "windows";
  10259.                    g = a.indexOf("windows nt ");
  10260.                    if (-1 < g) {
  10261.                        g = a.slice(g + 11);
  10262.                        for (h = 0; h < g.length && !(i = g.charAt(h), isNaN(i) && "." !== i); h++);
  10263.                        0 < h && (g = g.slice(0, h));
  10264.                        switch (g) {
  10265.                            case "5.1":
  10266.                                f.verS = "xp";
  10267.                                break;
  10268.                            case "5.2":
  10269.                                f.verS = "server2003";
  10270.                                break;
  10271.                            case "6.0":
  10272.                                f.verS = "vista";
  10273.                                break;
  10274.                            case "6.1":
  10275.                                f.verS = "7";
  10276.                                break;
  10277.                            case "6.2":
  10278.                                f.verS = "8";
  10279.                                break;
  10280.                            case "6.3":
  10281.                                f.verS = "8.1";
  10282.                                break;
  10283.                            case "10.0":
  10284.                                f.verS =
  10285.                                    "10"
  10286.                        }
  10287.                    }
  10288.                    break;
  10289.                case "mac":
  10290.                    g = a.indexOf("mac os x ") + 9;
  10291.                    f.verS = a.slice(g);
  10292.                    g = f.verS.indexOf(";");
  10293.                    if (-1 < g) f.verS = f.verS.slice(0, g);
  10294.                    f.verS = f.verS.replace(/_/g, ".");
  10295.                    break;
  10296.                case "linux":
  10297.                    f.verS = "linux";
  10298.                    break;
  10299.                case "android":
  10300.                    g = a.indexOf("android ") + 8;
  10301.                    f.verS = a.slice(g);
  10302.                    g = f.verS.indexOf(";");
  10303.                    if (-1 < g) f.verS = f.verS.slice(0, g);
  10304.                    break;
  10305.                case "ios":
  10306.                    g = a.indexOf(" os ") + 4;
  10307.                    f.verS = a.slice(g);
  10308.                    for (h = 0; h < f.verS.length && !(i = f.verS.charAt(h), isNaN(i) && "_" !== i); h++);
  10309.                    if (0 < h) f.verS = f.verS.slice(0, h);
  10310.                    f.verS = f.verS.replace(/_/g, ".");
  10311.                    break;
  10312.                case "unknown":
  10313.                    f.verS = "unknown"
  10314.            }
  10315.            g = window.ebO && ebO.ffs && ebO.ffs.CFF_TrimOSVerS || window.EB && EB._adConfig && EB._adConfig.ffs && EB._adConfig.ffs.CFF_TrimOSVerS;
  10316.            if (f.verS.trim && g) f.verS = f.verS.trim();
  10317.            f.verN = parseFloat(f.verS);
  10318.            f.verI = f.ver = parseInt(f.verN);
  10319.            f[f.name + f.ver] = !0
  10320.        }
  10321.        if (!e.browser) {
  10322.            e.browser = {};
  10323.            g = e.browser;
  10324.            f = e.os;
  10325.            e = function(c) {
  10326.                return parseInt(a.slice(a.indexOf(c) + c.length))
  10327.            };
  10328.            g.strict = d.isStrictType();
  10329.            g.docmode = d.getDocumentMode();
  10330.            g.webkit = c("webkit");
  10331.            g.ver = d.getVersion();
  10332.            g.firefox = d.isFF();
  10333.            g.ie = d.isIE();
  10334.            g.opera = d.isOpera();
  10335.            g.chrome = d.isChrome();
  10336.            g.safari = d.isSafari();
  10337.            g.edge = c("edge/");
  10338.            if (g.edge) g.ver = e("edge/");
  10339.            g.silk = c("silk/");
  10340.            if (g.silk) g.ver = e("silk/");
  10341.            g.uc = c("ucbrowser/");
  10342.            if (g.uc) g.ver = e("ucbrowser/");
  10343.            g.android = c("android") && !(g.chrome || g.firefox || g.opera || g.uc || g.silk);
  10344.            g.name = g.android ? "android" : g.uc ? "uc" : g.opera ? "opera" : g.silk ? "silk" : g.edge ? "edge" : g.ie ? "ie" : g.firefox ? "firefox" : g.chrome ? "chrome" : g.safari ? "safari" : "unknown";
  10345.            g[g.name + g.ver] = !0;
  10346.            g.checkCSSSupportability = function(a, b) {
  10347.                for (var c = !1,
  10348.                        d = document.createElement("div"), e = ["", "webkit", "moz", "ms", "o"], f = 0; f < e.length; f++)
  10349.                    if (a = "" === e[f] ? a : e[f] + EBG.capitalize(a), "" === d.style[a] && (d.style[a] = b, "" !== d.style[a])) {
  10350.                        c = !0;
  10351.                        break
  10352.                    }
  10353.                return c
  10354.            };
  10355.            g.supportsViewportUnits = !/android[1-4]\.[0-3]/i.test(a);
  10356.            g.supportsFixedPositioning = !/android2/i.test(a);
  10357.            g.supportsCSSTransitions = g.checkCSSSupportability("transition", "width 2s");
  10358.            f[f.name + f.ver + g.name + g.ver] = !0
  10359.        }
  10360.    };
  10361.    EBG && EBG.EBAPI ? EBG.EBAPI.prototype.browserInit = a : a()
  10362. })();
  10363. EBG.declareNamespace("Initializer");
  10364. EBG.Initializer = {
  10365.    initialize: function() {
  10366.        var a = null,
  10367.            b;
  10368.        void 0 !== b && b || (a = EBG.Initializer._getCurrentServerResponse(a), EBG.Initializer._initGlobals(a), EBG.Initializer._callExtensionHooks(a), EBG.Initializer._initAdaptor(a), EBG.Initializer._initManagers(a), EBG.Initializer._initDisplayAd(a));
  10369.        return a
  10370.    },
  10371.    _initManagers: function(a) {
  10372.        var b = new EBG.Events.Event(EBG.Events.EventNames.INIT_MANAGERS);
  10373.        b.eventData = {
  10374.            "_adConfig.rnd": a.rnd
  10375.        };
  10376.        b.timing = EBG.Events.EventTiming.BEFORE;
  10377.        EBG.eventMgr.dispatchEvent(b);
  10378.        EBG.Initializer._initInteractionManager(a);
  10379.        EBG.Initializer._initAnimationManager(a);
  10380.        EBG.Initializer._initDataPipeManager(a);
  10381.        (!~a.tn.toLowerCase().indexOf("html5") || !a.ffs.CFF_Html5Shrink) && EBG.Initializer._initPositioningHelper();
  10382.        b.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
  10383.        EBG.eventMgr.dispatchEvent(b)
  10384.    },
  10385.    _initDisplayAd: function(a) {
  10386.        EBG.Initializer._updateAdConfig(a);
  10387.        a.ffs.CFF_ClientDITest && a.diParams && EBG.adaptor.loadModule(ebBigS + "UserProviders" + ebO.uipv + "/SizmekDI.js", a.adConfig, function() {
  10388.            var b = a.diParams;
  10389.            b.cookie = a.adConfig.usercookie;
  10390.            b.userAgent = navigator.userAgent;
  10391.            (new EBGUIP.SizmekDI({}, b)).post("//datahub.serving-sys.com/samurai/collect/di")
  10392.        }, this);
  10393.        this._sendInitialDataPipeData(a);
  10394.        if (EBG.Initializer._shouldInitAd(a)) {
  10395.            if (EBG.isDefined(EBG.adaptor.getDisplayWin().EBG)) try {
  10396.                EBGInfra.mergeObj(EBG, EBG.adaptor.getDisplayWin().EBG, !1)
  10397.            } catch (b) {
  10398.                if (a.ffs.CFF_IEFreedScriptMerge) EBG.adaptor.getDisplayWin().EBG = EBG
  10399.            } else EBG.adaptor.getDisplayWin().EBG = EBG;
  10400.            EBG.Initializer._initAd(a)
  10401.        }
  10402.    },
  10403.    _InitAdPreGlobals: function(a) {
  10404.        try {
  10405.            var b = EBG.adaptor.getPageWin();
  10406.            if (!b.gEbPageGUID) b.gEbPageGUID = a.adConfig.rnd;
  10407.            EBG.pageGUID = b.gEbPageGUID
  10408.        } catch (c) {
  10409.            EBG.pageGUID = a.adConfig.rnd
  10410.        }
  10411.    },
  10412.    _shouldInitAd: function(a) {
  10413.        if (a.ffs.CFF_TopmostIframeBust) {
  10414.            var b = !1;
  10415.            a.innerIframe ? b = !0 : 0 == a.ifrm ? b = a.requiresIframeBust && EBG.adaptor.serving && EBG.adaptor.serving.servingMode == EBG.Adaptors.ServingMode.IFRAME && (!a.aiE || a.aiE && void 0 === a.aiE.iflExists) ? !1 : !0 : -1 == a.ifrm && EBG.adaptor.serving && EBG.adaptor.serving.servingMode != EBG.Adaptors.ServingMode.IFRAME && (b = !0);
  10416.            return b
  10417.        }
  10418.        return a.innerIframe ||
  10419.            0 == a.ifrm || -1 == a.ifrm && EBG.adaptor.serving && EBG.adaptor.serving.servingMode != EBG.Adaptors.ServingMode.IFRAME
  10420.    },
  10421.    _getCurrentServerResponse: function() {
  10422.        for (var a = 0, b; a < ebOArr.length;) {
  10423.            if ((b = ebOArr[a]) && this._getAdClass(b)) {
  10424.                ebOArr.splice(a, 1);
  10425.                break
  10426.            }
  10427.            a++
  10428.        }
  10429.        return b
  10430.    },
  10431.    _initGlobals: function(a) {
  10432.        var b = navigator.userAgent.toLowerCase(),
  10433.            c = a.adConfig;
  10434.        EBG.isOfflineDemo = !!window.gEbfOfflineDemo;
  10435.        if ("/" == a.resPath.charAt(a.resPath.length - 1) && "/" == a.resPath.charAt(a.resPath.length - 2)) a.resPath = a.resPath.substring(0, a.resPath.length -
  10436.            1);
  10437.        EBG.resourcePath = a.resPath;
  10438.        c.rnd = a.rnd;
  10439.        c.uid = EBG.format("{0}_{1}", c.adId, c.rnd);
  10440.        c.resourcePath = a.resPath;
  10441.        c.ffs = a.ffs;
  10442.        EBG.sms = c.sms = a.sms || "";
  10443.        EBG.fcsVirtualPath = a.fvp || "";
  10444.        EBG.pluId = a.pi;
  10445.        EBG.dataCapture = EBG.bs = a.bs;
  10446.        EBG.protocol = ebPtcl;
  10447.        EBG.reportPageVer = a.rpv;
  10448.        EBG.html5Ver = a.html5v;
  10449.        EBG.flashPixelVer = a.vfp;
  10450.        EBG.intReportTimeout = a.irt || null;
  10451.        EBG.isMSNMessenger = (-1 < b.indexOf("msn messenger") || -1 < b.indexOf("windows live messenger")) && window == parent;
  10452.        EBG.isIMBanner = window.gfEbExpBanerIM || window.gfEbExpBannerIM;
  10453.        EBG.isPreview = !!a.pr;
  10454.        EBG.isInWorkshop = window.gEbFlyLocal;
  10455.        EBG.iframeLocation = a.ifl || window.gstrEbIframeLocation;
  10456.        EBG.minZIndex = a.z || window.gnEbMinZIndex || 1E4;
  10457.        EBG.eyeDivRefElement = window.gEbEyeDivRefElement;
  10458.        EBG.eventMgr = EBG.eventMgr || new EBG.Events.EventManager;
  10459.        b = EBG.getTopAccessibleWindow(!1);
  10460.        b.ebAds = b.ebAds || {};
  10461.        EBG.ads = b.ebAds;
  10462.        EBG.serverResponses = EBG.serverResponses || {};
  10463.        if ((b = c.adHtmlPath) && a.h5mi) c.adKitData = {
  10464.            paths: {
  10465.                cachedScript: ebBigS,
  10466.                nonCachedScript: ebPtcl + a.sms,
  10467.                folderRoot: ebResourcePath + b.substring(0,
  10468.                    b.lastIndexOf("/") + 1)
  10469.            },
  10470.            version: a.h5mi.adkitversion
  10471.        }
  10472.    },
  10473.    _initServingMode: function(a) {
  10474.        var b = this._getAdClass(a),
  10475.            c = a.adConfig;
  10476.        a.requiresIframeBust = b.requiresIframeBust;
  10477.        var d = EBG.adaptor.serving ? EBG.adaptor.serving.detectServingMode(!0) : null;
  10478.        if (EBG.adaptor.isSafeFrame()) a.ifrm = 0, c.UiVz = !1;
  10479.        else if (b.requiresIframeBust) {
  10480.            if (a.innerIframe) a.ifrm = EBG.Adaptors.ServingMode.INNER_IFRAME;
  10481.            if (!a.ifrm || a.soi) a.ifrm = 0;
  10482.            EBG.adaptor.initServingMode(a.ifrm, !1, d, a.ffs.CFF_TopmostIframeBust);
  10483.            if (EBG.adaptor.inPlacementIframe()) b =
  10484.                new EBG.Events.EventSubscription(EBG.Events.EventNames.AIE_LOADED, this._handleAieLoad, this), b.dispatcherFilters = {
  10485.                    "_adConfig.rnd": a.rnd
  10486.                }, b.timing = EBG.Events.EventTiming.BEFORE, EBG.eventMgr.subscribeToEvent(b), EBG.adaptor.serving.handleAieServing(a)
  10487.        } else if (a.ifrm = 0, b != EBG.Ads.StdBanner && b != EBG.Ads.StdBannerHtml5) {
  10488.            EBG.adaptor.initServingMode(a.ifrm, !b.requiresIframeBust, d);
  10489.            if (d == EBG.Adaptors.ServingMode.FRIENDLY_IFRAME) {
  10490.                c.UiVz = !1;
  10491.                try {
  10492.                    document.close()
  10493.                } catch (e) {}
  10494.            }
  10495.            if (d == EBG.Adaptors.ServingMode.SCRIPT) c.UiVz = !1
  10496.        } else c.UiVz = !1
  10497.    },
  10498.    _handleAieLoad: function(a) {
  10499.        a.eventData.loadDefault && a.eventData.currentResponse.tn != EBG.adTypes.VisibilityAd && (EBG.Initializer._initManagers(a.eventData.currentResponse), EBG.Initializer._initDisplayAd(a.eventData.currentResponse))
  10500.    },
  10501.    _callExtensionHooks: function(a) {
  10502.        if (a.extensionHooks)
  10503.            for (; 0 !== a.extensionHooks.length;) a.extensionHooks.pop().apply(null, [a.adConfig, a])
  10504.    },
  10505.    getRichestAdaptor: function() {
  10506.        return EBG.Adaptors.WebAdaptor || EBG.Adaptors.StdWebAdaptor
  10507.    },
  10508.    getRichestInteractionManager: function() {
  10509.        return EBG.Interactions.InteractionManager ||
  10510.            EBG.Interactions.StdInteractionManager
  10511.    },
  10512.    _initAdaptor: function(a) {
  10513.        var b = this.getRichestAdaptor(),
  10514.            c = new EBG.Events.Event(EBG.Events.EventNames.CREATE_ADAPTOR);
  10515.        c.eventData = {
  10516.            currentClass: b
  10517.        };
  10518.        c.timing = EBG.Events.EventTiming.BEFORE;
  10519.        EBG.eventMgr.dispatchEvent(c);
  10520.        if (!EBG.adaptor || EBG.adaptor.constructor.toString() !== c.eventData.currentClass.toString()) b = new c.eventData.currentClass, EBG.adaptor = b;
  10521.        c.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
  10522.        EBG.eventMgr.dispatchEvent(c);
  10523.        EBG.adaptor.initInnerModules(a.plt,
  10524.            a.bt, a.bv, a.dt, a.bc, !!a.adConfig.ffs.CFF_NoInDapIF);
  10525.        this._initServingMode(a);
  10526.        EBG.adaptor.registerSpecialBrowserEvents();
  10527.        EBG.eventMgr.attachToAdaptor()
  10528.    },
  10529.    _initInteractionManager: function(a) {
  10530.        newEvent = new EBG.Events.Event(EBG.Events.EventNames.CREATE_INT_MGR);
  10531.        newEvent.eventData = {
  10532.            currentClass: this.getRichestInteractionManager()
  10533.        };
  10534.        newEvent.timing = EBG.Events.EventTiming.BEFORE;
  10535.        EBG.eventMgr.dispatchEvent(newEvent);
  10536.        if (!EBG.intMgr || EBG.intMgr.constructor.toString() != newEvent.eventData.currentClass.toString()) a =
  10537.            new newEvent.eventData.currentClass(a), EBG.intMgr = a;
  10538.        newEvent.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
  10539.        EBG.eventMgr.dispatchEvent(newEvent)
  10540.    },
  10541.    _initAnimationManager: function(a) {
  10542.        try {
  10543.            if (EBG.RichModules && EBG.RichModules.AnimationManager) {
  10544.                newEvent = new EBG.Events.Event(EBG.Events.EventNames.CREATE_ANIM_MGR);
  10545.                newEvent.eventData = EBG.RichModules.AnimationManager;
  10546.                newEvent.timing = EBG.Events.EventTiming.BEFORE;
  10547.                EBG.eventMgr.dispatchEvent(newEvent);
  10548.                if (!EBG.animationMgr) EBG.animationMgr = new newEvent.eventData;
  10549.                if (!EBG.animator && EBG.RichModules && EBG.RichModules.Animator) EBG.animator = new EBG.RichModules.Animator(a.adConfig);
  10550.                newEvent.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
  10551.                EBG.eventMgr.dispatchEvent(newEvent)
  10552.            }
  10553.        } catch (b) {}
  10554.    },
  10555.    _initDataPipeManager: function(a) {
  10556.        var b, c = (1 == a.dt || 2 == a.dt) && a.ffs.CFF_DataPipeMobile,
  10557.            d = !1,
  10558.            e = !1;
  10559.        if ("https://" != EBG.protocol || a.ffs.CFF_DataPipeHttps) {
  10560.            if (a.ffs.CFF_DataPipeAlways) e = !0;
  10561.            else if (c || (d = this._getNumericDataFromFlag(a.ffs, "CFF_DataPipeGeneral"))) c = d || this._getNumericDataFromFlag(a.ffs,
  10562.                "CFF_DataPipeThreshold"), e = Math.floor(1E4 * Math.random()) + 1 <= 100 * c;
  10563.            e && (b = ["general", "platform", "serving", "visibility", "error"])
  10564.        }
  10565.        a.dpu = a.dpu || "//datahub.serving-sys.com/samurai/collect/events";
  10566.        EBG.dataPipeMgr = new EBG.DataPipeManager(a.dpu, b)
  10567.    },
  10568.    _getNumericDataFromFlag: function(a, b) {
  10569.        for (var c in a)
  10570.            if (0 == c.indexOf(b) && a[c]) {
  10571.                var d = parseFloat(c.substr(b.length).replace("_", "."));
  10572.                if (!isNaN(d)) return d
  10573.            }
  10574.        return 0
  10575.    },
  10576.    _initPositioningHelper: function() {
  10577.        try {
  10578.            if (EBG.Positioning && EBG.Positioning.PositionManager) {
  10579.                newEvent =
  10580.                    new EBG.Events.Event(EBG.Events.EventNames.CREATE_POSITIONING_HELPER);
  10581.                newEvent.eventData = EBG.Positioning.PositionManager;
  10582.                newEvent.timing = EBG.Events.EventTiming.BEFORE;
  10583.                EBG.eventMgr.dispatchEvent(newEvent);
  10584.                if (!EBG.posHelper) EBG.posHelper = new newEvent.eventData;
  10585.                newEvent.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
  10586.                EBG.eventMgr.dispatchEvent(newEvent)
  10587.            }
  10588.        } catch (a) {}
  10589.    },
  10590.    _initAd: function(a) {
  10591.        try {
  10592.            var b = this._getAdClass(a),
  10593.                c = a.adConfig;
  10594.            newEvent = new EBG.Events.Event(EBG.Events.EventNames.CREATE_AD);
  10595.            newEvent.eventData = {
  10596.                currentClass: b,
  10597.                adConfig: c
  10598.            };
  10599.            newEvent.timing = EBG.Events.EventTiming.BEFORE;
  10600.            newEvent.dispatcher = {
  10601.                _adConfig: {
  10602.                    rnd: c.rnd,
  10603.                    uid: c.uid
  10604.                }
  10605.            };
  10606.            EBG.eventMgr.dispatchEvent(newEvent);
  10607.            EBG.Initializer._InitAdPreGlobals(a);
  10608.            new newEvent.eventData.currentClass(c);
  10609.            newEvent.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
  10610.            EBG.eventMgr.dispatchEvent(newEvent);
  10611.            EBG.adaptor.getDisplayWin().EBG.ads[c.uid] || (EBG.adaptor.getDisplayWin().EBG.ads[c.uid] = EBG.ads[c.uid]);
  10612.            if (EBG.BWDetection && window.gEBMainWindow && gEBMainWindow.EBP)
  10613.                if (gEBMainWindow.EBP.ebBW &&
  10614.                    gEBMainWindow.EBP.ebBW.checked) EBG.BWDetection.speed = gEBMainWindow.EBP.ebBW.speed, EBG.BWDetection.checked = !0;
  10615.                else if (gEBMainWindow.EBP.BW && gEBMainWindow.EBP.BW.checked) EBG.BWDetection.speed = gEBMainWindow.EBP.BW.speed, EBG.BWDetection.checked = !0;
  10616.            if (c.pckAssets) {
  10617.                var b = 0,
  10618.                    d;
  10619.                for (d in c.pckAssets) c.pckAssets.hasOwnProperty(d) && b++;
  10620.                if (0 < b && !EBG.BWDetection.checked) c.bwApplied = !0, EBG.BWDetection.init();
  10621.                c.BWD = EBG.BWDetection
  10622.            }
  10623.        } catch (e) {
  10624.            if (a.ffs.CFF_DataPipeErrors) {
  10625.                a = "_initAd";
  10626.                c = "none";
  10627.                if (e.stack) c = e.stack.match(/((.*)@|at(.*)).*:(\d+:\d+)/),
  10628.                    c.length = 5, a = c[2] || c[3], c = c[4];
  10629.                this._dpm.send(EBG.DataProfile.ERROR, {
  10630.                    errmsg: e.message,
  10631.                    errfunc: a,
  10632.                    errpos: c
  10633.                })
  10634.            }
  10635.        }
  10636.    },
  10637.    _getAdClass: function(a) {
  10638.        var b;
  10639.        switch (a.tn) {
  10640.            case EBG.adTypes.RichBannerHtml5:
  10641.                b = EBG.Ads.RichBannerHtml5;
  10642.                break;
  10643.            case EBG.adTypes.PoliteBannerHtml5:
  10644.                b = EBG.Ads.PoliteBannerHtml5;
  10645.                break;
  10646.            case EBG.adTypes.SEBannerHtml5:
  10647.                b = EBG.Ads.SEBannerHtml5;
  10648.                break;
  10649.            case EBG.adTypes.ExpBannerHtml5:
  10650.                b = EBG.Ads.ExpBannerHtml5;
  10651.                break;
  10652.            case EBG.adTypes.StdBannerHtml5:
  10653.                b = EBG.Ads.StdBannerHtml5;
  10654.                break;
  10655.            case EBG.adTypes.StdBanner:
  10656.                b =
  10657.                    a.IABBV || a.IABEV ? EBG.Ads.StdBannerEx : EBG.Ads.StdBanner;
  10658.                break;
  10659.            case EBG.adTypes.Banner:
  10660.                b = EBG.Ads.RichBanner;
  10661.                break;
  10662.            case EBG.adTypes.SingleExpBanner:
  10663.                b = EBG.Ads.SingleExpBanner;
  10664.                break;
  10665.            case EBG.adTypes.ExpBanner:
  10666.                b = EBG.Ads.ExpBanner;
  10667.                break;
  10668.            case EBG.adTypes.VisibilityAd:
  10669.                b = EBG.Ads.VisibilityAd;
  10670.                break;
  10671.            case EBG.adTypes.FloatingAd:
  10672.                b = EBG.Ads.Floating;
  10673.                break;
  10674.            case EBG.adTypes.FloatingAdWithRem:
  10675.                b = EBG.Ads.FloatingWithReminder;
  10676.                break;
  10677.            case EBG.adTypes.TrackingAd:
  10678.                b = EBG.Ads.TrackingAd;
  10679.                break;
  10680.            case EBG.adTypes.WallpaperAd:
  10681.                b = EBG.Ads.WallpaperAd
  10682.        }
  10683.        return b
  10684.    },
  10685.    _updateAdConfig: function(a) {
  10686.        var b = a.adConfig;
  10687.        b.sHost = window.sHost;
  10688.        EBG.serverResponses[b.uid] || (EBG.serverResponses[b.uid] = a);
  10689.        b.placeHolderId = a.phid;
  10690.        b.sUrlTokens = a.ut;
  10691.        if (a.element_id) b.element_id = a.element_id;
  10692.        var c = EBG.adaptor.getPageWin();
  10693.        if (c = EBG.getPageUrl(c)) b.ebReferrer = c;
  10694.        b.html5supported = a.html5Enabled;
  10695.        b.useHtmlConvertor = b.html5supported && window.ebUseHtml5;
  10696.        b.preloadCustomScript = window.ebAdCS;
  10697.        b.actualServingMode = EBG.adaptor.serving ? EBG.adaptor.serving.detectServingMode(!0) : null;
  10698.        if (a.ffs.CFF_RemoveUivz) EBG.adaptor.focused =
  10699.            b.focused ? b.focused : EBG.adaptor.focused;
  10700.        if (a.ffs.CFF_ServingMode) b.displayWin = EBG.adaptor.getDisplayWin(), b.pageWin = EBG.adaptor.getPageWin();
  10701.        if (a.ffs.CFF_SupportMultiEnv) b._interactionServer = a.is || "BurstingPipe", b._interactionPipe = EBG.combinePaths(EBG.protocol + a.bs, b._interactionServer + "/adServer.bs?cn=int&iv=2&int="), b._interactionsStrPipe = EBG.combinePaths(EBG.protocol + a.bs, b._interactionServer + "/adServer.bs?cn=int&iv=2&interactionsStr=");
  10702.        if (b.expandDynamic) b.showSinglePanel = 1;
  10703.        if (!b.clickTrackingUrls) b.clickTrackingUrls = [];
  10704.        if (a.ncu) b.clickTrackingUrls.push(a.ncu), b.ncu = a.ncu;
  10705.        if (!b.defaultImpTrackingUrls) b.defaultImpTrackingUrls = [], b.defaultClickTrackingUrls = [];
  10706.        if (a.dctu) b.defaultClickTrackingUrls = a.dctu;
  10707.        if (a.ditu) b.defaultImpTrackingUrls = a.ditu;
  10708.        b.delayedImpParams = a.delayedImpParams;
  10709.        b.impressionTrackingURLs = [];
  10710.        if (a.itu && 0 < a.itu.length) b.impressionTrackingURLs = a.itu;
  10711.        window.gEbBAd && (gEbBAd.playRS && gEbBAd.playRS.strNUrl && b.impressionTrackingURLs.push(gEbBAd.playRS.strNUrl), gEbBAd.strNImpUrl && b.impressionTrackingURLs.push(gEbBAd.strNImpUrl));
  10712.        b.imageOnly = !1;
  10713.        b.page = a.p;
  10714.        b.massVersioning = {
  10715.            targetAudienceId: a.ta && "-1" != a.ta ? a.ta : "",
  10716.            deliveryGroupId: a.dg && "-1" != a.dg ? a.dg : "",
  10717.            subDeliveryGroupId: a.sdg && "-1" != a.sdg ? a.sdg : "",
  10718.            adVersions: a.av || "",
  10719.            defaultAdVersion: a.avd || "",
  10720.            adBasePath: a.abp || "",
  10721.            massVersionFolderDivider: a.mvfd || 0,
  10722.            versionTargetAudienceId: a.tav && "-1" != a.tav ? a.tav : "",
  10723.            dgTargetAudienceId: a.tadg && "-1" != a.tadg ? a.tadg : "",
  10724.            originalDeliveryGroupId: a.dgo && "-1" != a.dgo ? a.dgo : ""
  10725.        };
  10726.        if (0 <= b.massVersioning.adVersions.indexOf("/")) {
  10727.            if (b.massVersioning.defaultAdVersion) b.massVersioning.defaultAdVersion =
  10728.                JSON.parse(b.massVersioning.defaultAdVersion);
  10729.            b.massVersioning.versionFullPath = !0
  10730.        }
  10731.        if (a.soi) b.showOnlyImage = a.soi, b.massVersioning.adVersions = b.massVersioning.defaultAdVersion;
  10732.        if (EBGInfra.isDefinedNotNull(a.diAppId)) b.diAppId = a.diAppId;
  10733.        b.reportDelayedImpression = a.rdi || 0;
  10734.        b.defaultImageReason = a.dir || "";
  10735.        b.mobileSDK = a.sdk || "";
  10736.        b.isOfflineDemo = EBG.isOfflineDemo;
  10737.        if ("undefined" == typeof b.openWindow) b.openWindow = !0;
  10738.        this._updateAdConfigToHandleOpenWindow(a);
  10739.        b.bigSDir = unescape(ebBigS);
  10740.        b.imagesDir = unescape(ebBigS) +
  10741.            "Res/Images" + a.imgv + "/";
  10742.        b.modulesDir = unescape(ebBigS) + "Modules" + a.modv + "/";
  10743.        b.arrOnStartDnlEvents = a.osde;
  10744.        b.arrOnPlayEvents = a.ope;
  10745.        b.isGeoStrict = 0 != a.igs ? 1 : 0;
  10746.        b.geoData = a.geo ? a.geo : {};
  10747.        c = a.oo || 0;
  10748.        EBG.adaptor.optOut = b.optOut = window.gEbFOptOut || c;
  10749.        EBG.adaptor.histLen = b.histLen = a.hl || 30;
  10750.        b.sPublisherPlacementId = a.ppi || "";
  10751.        b.width = b.width || "";
  10752.        b.height = b.height || "";
  10753.        b.adHtmlOptions ? (b.width = a.adw || b.width, b.height = a.adh || b.height, b.defaultWidth = a.w || b.width, b.defaultHeight = a.h || b.height, b.adaptiveAd = !0) : (b.width =
  10754.            a.w || b.width, b.height = a.h || b.height);
  10755.        b.shouldCollectUrl = a.cu || 0;
  10756.        b.sID = a.sid || "";
  10757.        b.dlm = a.dlm || 3;
  10758.        b.testImp = !!a.t;
  10759.        b.usercookie = a.usercookie || "";
  10760.        b.visibility = {};
  10761.        c = b.visibility;
  10762.        c.mode = EBG.VisibilityMode.DEFAULT_MODE;
  10763.        if (a.IABEV || a.insVis) c.mode = EBG.VisibilityMode.ENHANCED_MODE;
  10764.        else if (a.IABBV) c.mode = EBG.VisibilityMode.BASIC_MODE;
  10765.        c.iabMinSurface = a.IABMS;
  10766.        c.iabMinDuration = a.IABMD;
  10767.        c.agencyMinSurface = a.AgMS;
  10768.        c.agencyMinDuration = a.AgMD;
  10769.        c.advertiserMinSurface = a.AdMS;
  10770.        c.advertiserMinDuration = a.AdMD;
  10771.        c.iabMinLargeSurface =
  10772.            30;
  10773.        c.iabMinLargeDuration = a.IABMD;
  10774.        b.isInstreamVisibility = !!a.insVis;
  10775.        b.isInstreamVerification = !!a.insVer;
  10776.        b.displayVerification = !!a.disVer;
  10777.        if (b.panels) {
  10778.            c = !1;
  10779.            1 == EBG.adaptor.getObjKeys(b.panels).length && (c = !0);
  10780.            for (var d in b.panels)
  10781.                if (b.panels.hasOwnProperty(d)) b.panels[d].visibilityIntEnabled = c
  10782.        }
  10783.        if (d = b.interactionsToReport)
  10784.            if (d[EBG.Interactions.SystemInts.AD_START] = EBG.Interactions.SystemInts.AD_START, d[EBG.Interactions.SystemInts.AD_STACKING] = EBG.Interactions.SystemInts.AD_STACKING, d[EBG.Interactions.SystemInts.MULTI_BURN] =
  10785.                EBG.Interactions.SystemInts.MULTI_BURN, d[EBG.Interactions.SystemInts.AD_COLLISION] = EBG.Interactions.SystemInts.AD_COLLISION, d[EBG.Interactions.SystemInts.AD_CAROUSEL] = EBG.Interactions.SystemInts.AD_CAROUSEL, d.visibility && (d[EBG.Interactions.SystemInts.VISIBILITY_RECORDABLE] = EBG.Interactions.SystemInts.VISIBILITY_RECORDABLE, d[EBG.Interactions.SystemInts.VISIBILITY_AGENCY_RECORDABLE] = EBG.Interactions.SystemInts.VISIBILITY_AGENCY_RECORDABLE, d[EBG.Interactions.SystemInts.VISIBILITY_ADVERTISER_RECORDABLE] =
  10786.                    EBG.Interactions.SystemInts.VISIBILITY_ADVERTISER_RECORDABLE, d[EBG.Interactions.SystemInts.VISIBILITY_ADVERTISER] = EBG.Interactions.SystemInts.VISIBILITY_ADVERTISER, d[EBG.Interactions.SystemInts.VISIBILITY_AGENCY] = EBG.Interactions.SystemInts.VISIBILITY_AGENCY, d[EBG.Interactions.SystemInts.VISIBILITY_IAB] = EBG.Interactions.SystemInts.VISIBILITY_IAB, d[EBG.Interactions.SystemInts.VISIBILITY_ADVERTISER_DURATION] = EBG.Interactions.SystemInts.VISIBILITY_ADVERTISER_DURATION, d[EBG.Interactions.SystemInts.VISIBILITY_AGENCY_DURATION] =
  10787.                    EBG.Interactions.SystemInts.VISIBILITY_AGENCY_DURATION, d[EBG.Interactions.SystemInts.VISIBILITY_AVG_AD_SURFACE] = EBG.Interactions.SystemInts.VISIBILITY_AVG_AD_SURFACE, !EBG.adaptor.isInApp())) d[EBG.Interactions.SystemInts.VISIBILITY_AVG_SCREEN_SHARE] = EBG.Interactions.SystemInts.VISIBILITY_AVG_SCREEN_SHARE;
  10788.        b.adParamsEnabled = b.displayVerification || b.isInstreamVerification || !!a.ap;
  10789.        b.playerParamsEnabled = b.isInstreamVerification || !!a.pp;
  10790.        b.verUrlEnabled = b.isInstreamVerification || !!a.verUrl;
  10791.        if (b.defaultFlashName &&
  10792.            !b.defaultFlashPath) b.defaultFlashPath = b.imagesDir + "BannerAssets/" + b.defaultFlashName;
  10793.        b.offsetX = a.offsetX || 0;
  10794.        b.offsetY = a.offsetY || 0;
  10795.        b.adChoice = {};
  10796.        b.adChoice.certificationProgram = a.AcCP;
  10797.        b.adChoice.customUrl = a.CAcURL;
  10798.        b.adChoice.includeMarker = b.AcIncludeMarker;
  10799.        b.adChoice.iconPosition = parseInt(b.AcIconPosition);
  10800.        if (a.wm) b.wmode = a.wm.toLowerCase();
  10801.        if (!b.pushDownConfig && "none" != a.disp) b.display = a.disp || "inline";
  10802.        b.disableAutoExpand = a.dex || 0;
  10803.        b.aiE = a.aiE || {};
  10804.        b.appPool = a.appPool || "BurstingPipe";
  10805.        b.interactionServer =
  10806.            a.is || "BurstingPipe";
  10807.        b.advertiserId = a.advid;
  10808.        b.moduleInfo = a.h5mi || {};
  10809.        try {
  10810.            if (window.gEbBAd) {
  10811.                if (gEbBAd.panelsWMode) b.panelsWMode = gEbBAd.panelsWMode;
  10812.                if (gEbBAd.strWmode) b.wmode = gEbBAd.strWmode.toLowerCase()
  10813.            }
  10814.        } catch (e) {}
  10815.        if (EBG.adaptor.isSafeFrame()) {
  10816.            b.isSafeFrame = !0;
  10817.            b.expandDynamic = 0;
  10818.            for (var f in b.panels) {
  10819.                d = b.panels[f];
  10820.                try {
  10821.                    var g = $sf.ext.geom();
  10822.                    if (d.posType == EBG.PanelPositionType.PAGE_RELATIVE_PERCENTAGE || d.posType == EBG.PanelPositionType.VIEWPORT_RELATIVE_PERCENTAGE) d.xPos = Math.round((g.win.w - d.width) * (d.xPos /
  10823.                        100)), d.yPos = Math.round((g.win.h - d.height) * (d.yPos / 100));
  10824.                    d.posType != EBG.PanelPositionType.BANNER_RELATIVE_PIXELS && (d.xPos -= g.self.l, d.yPos -= g.self.t)
  10825.                } catch (h) {
  10826.                    d.xPos = 0, d.yPos = 0
  10827.                }
  10828.                d.posType = EBG.PanelPositionType.BANNER_RELATIVE_PIXELS
  10829.            }
  10830.        }
  10831.        if (EBG.adaptor.isSkype() && (b.isSkype = !0, !a.ffs.CFF_SkypeDynamic)) b.expandDynamic = 0;
  10832.        if (a.ffs.CFF_FireFoxFlash && !a.ffs.CFF_FlashBlockPixel) a = EBG.adaptor.flash.getFlashVersionForBlockingDetection(), b.minimalflashVer = a || b.minimalflashVer, b.flashVer = a || b.flashVer;
  10833.        b.isInApp =
  10834.            EBG.adaptor.isInApp();
  10835.        b.locationPolling = this._setLocationPolling(b.locationPolling)
  10836.    },
  10837.    _setLocationPolling: function(a) {
  10838.        0 < a ? (a = Math.min(a, 100), a = Math.max(a, 10)) : a = 0;
  10839.        return a
  10840.    },
  10841.    _updateAdConfigToHandleOpenWindow: function(a) {
  10842.        var b = a.adConfig;
  10843.        b.bsPath = b.dataCapture = a.bs;
  10844.        b.pluId = EBG.pluId;
  10845.        b.protocol = EBG.protocol;
  10846.        if (EBGInfra.isDefined(a.lid)) b.lineId = a.lid;
  10847.        b.isPreview = !!a.pr
  10848.    },
  10849.    _sendInitialDataPipeData: function(a) {
  10850.        this._dpm = EBG.dataPipeMgr.getPipe(a.adConfig.sID);
  10851.        this._dpm.send(EBG.DataProfile.GENERAL, {
  10852.            adid: a.adConfig.adId,
  10853.            time: +new Date
  10854.        });
  10855.        this._dpm.send(EBG.DataProfile.PLATFORM, {
  10856.            os: EBG.adaptor.browser._platform,
  10857.            brsrc: EBG.adaptor.browser._browserCode,
  10858.            brsrv: EBG.adaptor.browser._browserVer,
  10859.            brsrt: EBG.adaptor.browser._browserType,
  10860.            env: EBG.adaptor.browser.getEnvironment()
  10861.        });
  10862.        a = window && window.location && window.location.href ? window.location.href.substr(0, 50) : "";
  10863.        this._dpm.send(EBG.DataProfile.SERVING, {
  10864.            url: a
  10865.        })
  10866.    }
  10867. };
  10868. try {
  10869.    var currentResponse = EBG.Initializer.initialize();
  10870.    if (currentResponse.adConfig.UiVz && !currentResponse.requiresIframeBust && (currentResponse.IABBV || currentResponse.IABEV) && !EBG.adaptor.isSafeFrame() && "Visibility" != currentResponse.tn) {
  10871.        var vizClone = EBG.cloneObj(currentResponse);
  10872.        vizClone.tn = vizClone.adConfig.templateName = "Visibility";
  10873.        vizClone.ifrm = 2;
  10874.        vizClone.soi = 0;
  10875.        ebOArr[ebOArr.length] = vizClone;
  10876.        var newEbSrc = ebSrc.replace(currentResponse.tn, vizClone.tn),
  10877.            newEbSrc = newEbSrc.replace(/ex(debug|_api|)\.js/ig,
  10878.                ".js"),
  10879.            newScript = document.createElement("SCRIPT");
  10880.        newScript.src = newEbSrc;
  10881.        vizClone.ebSrc = newEbSrc;
  10882.        if (currentResponse.adConfig.adStarted) {
  10883.            var target = document.getElementById(vizClone.phid);
  10884.            target && target.appendChild(newScript)
  10885.        } else {
  10886.            var sub = new EBG.Events.EventSubscription(EBG.Events.EventNames.AD_START, function() {
  10887.                var a = document.getElementById(vizClone.phid);
  10888.                a && a.appendChild(newScript)
  10889.            }, this);
  10890.            sub.timing = EBG.Events.EventTiming.ONTIME;
  10891.            EBG.eventMgr.subscribeToEvent(sub)
  10892.        }
  10893.    }
  10894. } catch (e$$117) {};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement