Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- EBGInfra = {
- declareNamespace: function(a) {
- for (var b = window.EBG, a = a.split("."), c = 0; c < a.length; c++) {
- var d = a[c],
- e = b[d];
- e || (e = b[d] = {});
- b = e
- }
- },
- declareClass: function(a, b) {
- a.prototype.constructor = a;
- if (b) a.__superClass = b, a.__basePrototypePending = !0, EBG._resolveInheritance(a);
- return a
- },
- runTimed: function(a, b, c, d) {
- return setTimeout(function() {
- b.apply(a, c)
- }, d)
- },
- setInterval: function(a, b, c, d) {
- return setInterval(function() {
- b.apply(a, c)
- }, d)
- },
- clearInterval: function(a) {
- clearInterval(a)
- },
- sequence: function() {
- var a = [],
- b =
- function(c) {
- c.count--;
- if (0 <= c.count) return EBG.runTimed(this, b, [c], c.interval), c.tfunc.apply(c.context, c.args);
- EBG.isFunc(c.callback) && c.callback.apply(c.cbContext, c.cbArgs);
- a[c.index] = null
- };
- return function(c, d, e, f, g, h, i, j, k, m) {
- if (EBG.isFunc(d)) {
- var l;
- a: {
- for (l = 0; l < a.length; l++)
- if (a[l] && a[l].func == d) break a;l = !1
- }
- h = EBG.isNumber(h) ? h : g;
- m = m || {};
- if (EBG.isFunc(j) && !EBG.isDefined(m.trailing)) m.trailing = !1;
- c = {
- context: c,
- func: d,
- tfunc: !1 === l ? this.throttle(d, h, m) : a[l].tfunc,
- args: e ? e : [],
- count: f,
- interval: g,
- cbContext: i,
- callback: j,
- cbArgs: k ? k : []
- };
- d = a.push(c) - 1;
- a[d].index = d;
- return b(c)
- }
- return !1
- }
- }(),
- debounce: function(a, b, c) {
- var d, e, f, g, h, i = function() {
- var j = (new Date).getTime() - g;
- j < b && 0 <= j ? d = setTimeout(i, b - j) : (d = null, c || (h = a.apply(f, e), d || (f = e = null)))
- };
- return function() {
- f = this;
- e = arguments;
- g = (new Date).getTime();
- var j = c && !d;
- d || (d = setTimeout(i, b));
- j && (h = a.apply(f, e), f = e = null);
- return h
- }
- },
- throttle: function(a, b, c) {
- var d, e, f, g = null,
- h = 0;
- c || (c = {});
- var i = function() {
- h = !1 === c.leading ? 0 : (new Date).getTime();
- g = null;
- f = a.apply(d, e);
- g || (d = e = null)
- };
- return function() {
- var j = (new Date).getTime();
- !h && !1 === c.leading && (h = j);
- var k = b - (j - h);
- d = this;
- e = arguments;
- 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));
- return f
- }
- },
- _resolveInheritance: function(a) {
- if (a.__basePrototypePending) {
- var b = a.__superClass;
- EBG._resolveInheritance(b);
- var b = b.prototype,
- c = a.prototype,
- d;
- for (d in b) c[d] = c[d] || b[d];
- delete a.__basePrototypePending
- }
- },
- callSuperConstructor: function(a, b, c) {
- (a = a.__superClass) &&
- (c ? a.apply(b, c) : a.apply(b));
- return b
- },
- callSuperFunction: function(a, b, c, d) {
- if (a = a.__superClass) var e = a.prototype[c];
- try {
- if (e) return d ? e.apply(b, d) : e.apply(b)
- } catch (f) {}
- },
- typeOf: function(a) {
- var b = typeof a;
- if ("object" == b)
- if (a) {
- 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";
- if (!(a instanceof Object) && ("[object Function]" ==
- Object.prototype.toString.call(a) || "undefined" != typeof a.call && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("call"))) return "function"
- } else return "function" == b && "undefined" == typeof a.call ? "object" : "null";
- return b
- },
- isFunc: function(a) {
- return "function" == EBG.typeOf(a)
- },
- isDefined: function(a) {
- return "undefined" != EBG.typeOf(a)
- },
- notNull: function(a) {
- return null != a
- },
- isDefinedNotNull: function(a) {
- return this.isDefined(a) && this.notNull(a)
- },
- hasValue: function(a) {
- return null != a && "undefined" !=
- EBG.typeOf(a)
- },
- hasOwnValue: function(a, b, c) {
- for (var d in a)
- if (a.hasOwnProperty(d))
- if (c) {
- if (a[d].toLowerCase() === b.toLowerCase()) return !0
- } else if (a[d] === b) return !0;
- return !1
- },
- getRandomNumber: function() {
- var a = "";
- try {
- a = Math.random().toString(), a = a.substr(a.indexOf(".") + 1)
- } catch (b) {
- a = ""
- }
- return a
- },
- isObj: function(a) {
- return "object" == EBG.typeOf(a)
- },
- isArray: function(a) {
- return "array" == EBG.typeOf(a)
- },
- isBool: function(a) {
- return "boolean" == EBG.typeOf(a)
- },
- isNumber: function(a) {
- return !isNaN(parseFloat(a)) && isFinite(a)
- },
- format: function(a) {
- for (var b = 1; b < arguments.length; b++) a = a.replace(RegExp("\\{" + (b - 1) + "\\}", "gi"), "" + arguments[b]);
- return a
- },
- throwEx: function(a) {
- throw {
- name: "",
- message: a
- };
- },
- mergeObj: function(a, b, c) {
- var c = !!c,
- d;
- for (d in a)
- if (a.hasOwnProperty(d) && (!b.hasOwnProperty(d) || c)) b[d] = a[d]
- },
- cloneObj: function(a) {
- if (!EBG.isObj(a)) return null;
- var b = {},
- c;
- for (c in a) a.hasOwnProperty(c) && (b[c] = EBG.isObj(a[c]) ? EBG.cloneObj(a[c]) : a[c]);
- return b
- },
- combinePaths: function(a, b) {
- a = a || "";
- b = b || "";
- a && "/" != a[a.length - 1] && b && "/" !=
- b[0] && (a += "/");
- var c = a;
- b && (c += b);
- return c
- },
- px: function(a) {
- return EBG.format("{0}px", a)
- },
- strEQ: function(a, b, c) {
- return a && b ? c ? a === b : a.toLowerCase() === b.toLowerCase() : !1
- },
- indexOfArray: function(a, b) {
- for (var c = 0; c < a.length; c++)
- if (a[c] == b) return c;
- return -1
- },
- filterArray: function(a, b, c) {
- var d = a.length >>> 0;
- if ("function" != typeof b) throw new TypeError;
- for (var e = [], f = 0; f < d; f++)
- if (f in a) {
- var g = a[f];
- b.call(c || window, g, f, a) && e.push(g)
- }
- return e
- },
- mapArray: function(a, b, c) {
- var d = a.length >>> 0;
- if ("function" != typeof b) throw new TypeError;
- for (var e = [], f = 0; f < d; f++) f in a && e.push(b.call(c || window, a[f], f, a));
- return e
- },
- isGlobalDef: function(a, b) {
- var c = "undefined" != typeof window[a];
- b && c && (c = eval(a + "==" + b));
- return c
- },
- numberToEnum: function(a, b) {
- var c = "",
- d;
- for (d in b)
- if (b.hasOwnProperty(d) && b[d] === a) {
- c = d;
- break
- }
- return c
- },
- getPageUrl: function(a) {
- try {
- return a && a.location && a.location.href ? a.location.href : null
- } catch (b) {
- return null
- }
- },
- _isXMLHttpRequestSupported: function() {
- var a = window.XMLHttpRequest ? new XMLHttpRequest : null;
- return a && EBG.isBool(a.withCredentials)
- },
- htmlDecode: function(a) {
- this.helperDiv = this.helperDiv ? this.helperDiv : document.createElement("div");
- this.helperDiv.innerHTML = a;
- return this.helperDiv.textContent
- },
- htmlEncode: function(a) {
- this.helperDiv = this.helperDiv ? this.helperDiv : document.createElement("div");
- this.helperDiv.textContent = a;
- return this.helperDiv.innerHTML
- },
- getDataFromRemoteServer: function(a, b, c, d, e) {
- if (!a || EBG.isOfflineDemo) return !1;
- var d = EBG.isBool(d) ? d : !0,
- e = EBG.isBool(e) ? e : !1,
- f = function() {
- try {
- if (e) {
- var a, d;
- 9 === document.documentMode ?
- 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));
- b.call(c, d)
- } else b.call(c, i.responseText)
- } catch (f) {
- b.call(c)
- }
- },
- g = !1;
- try {
- if (this._isXMLHttpRequestSupported()) {
- var h = new XMLHttpRequest;
- h.open("GET", a, d);
- g = !0;
- if (d) h.onreadystatechange = function() {
- 4 == h.readyState && (200 == h.status ? b.call(c, e ? h.responseXML : h.responseText) : b.call(c))
- };
- h.send();
- d || b.call(c, e ? h.responseXML : h.responseText)
- } else if (window.XDomainRequest && d) {
- var i = new XDomainRequest;
- if (i) i.onerror = function() {
- EBG.log.error("XDomain request error");
- b.call(c)
- }, i.ontimeout = function() {
- EBG.log.error("XDomain request timeout");
- b.call(c)
- }, i.onload = f, i.onprogress = function() {}, i.open("get", a), i.send(), g = !0
- }
- } catch (j) {
- g = !1
- }
- return g
- },
- getFeatureFlagValue: function(a, b) {
- if (!EBG.isDefined(a)) return !1;
- if (EBG.isArray(a)) {
- for (var c = 0; c < a.length; c++)
- if (a[c].name == b) return a[c].state;
- return !1
- }
- return !!a[b]
- },
- isPercentage: function(a) {
- return a instanceof String ? -1 < a.indexOf("%") : !1
- },
- getTime: function() {
- var a = (new Date).getTime() / 1E3;
- return function() {
- return (new Date).getTime() / 1E3 - a
- }
- }(),
- getObjKeys: function(a) {
- a = a || {};
- if (Object.keys) return Object.keys(a);
- var b = [],
- c;
- for (c in a) a.hasOwnProperty(c) && b.push(c);
- return b
- },
- serializeObject: function(a) {
- var b = [],
- c;
- for (c in a) a.hasOwnProperty(c) && b.push(c + "=" + a[c]);
- return b.join("&")
- },
- capitalize: function(a) {
- return a.charAt(0).toUpperCase() + a.slice(1)
- },
- getTopAccessibleWindow: function() {
- var a =
- window.ebO && ebO.ffs && ebO.ffs || window.EB && EB._adConfig && EB._adConfig.ffs;
- if (!a) {
- var b = arguments.callee;
- return function() {
- return b()()
- }
- }
- var c = window;
- if (c.location.ancestorOrigins && a && a.CFF_ancestorOrigins) {
- for (var d = window, e = window, a = c.location.ancestorOrigins, f = !1, g = 0; g < a.length; g++) {
- var c = c.parent,
- h = document.createElement("a");
- h.href = a[g];
- h = h.hostname;
- window.location.origin === a[g] || "" === window.location.hostname && "" === h ? (e = c, f || (d = c)) : f = !0
- }
- return function(a) {
- return ("boolean" == typeof a ? a : 1) ? d : e
- }
- }
- try {
- if (c.top.document.domain ||
- "" === c.parent.document.domain) c = c.top;
- else throw new DOMException;
- } catch (i) {
- try {
- for (c = window; c !== c.parent && c.self !== c.parent;)
- if (c.parent.document.domain || "" === c.parent.document.domain) c = c.parent
- } catch (j) {}
- }
- return function() {
- return c
- }
- }(),
- getBigScript: function() {
- var a;
- if (document.currentScript) a = document.currentScript;
- else {
- var b = document.getElementsByTagName("script");
- a = b[b.length - 1]
- }
- return function() {
- return a
- }
- }(),
- valueFromPath: function(a, b, c) {
- for (var b = b.split("."), d = 0; d < b.length; d++) a = a[b[d]];
- return EBG.isObj(a) &&
- c ? EBG.cloneObj(a) : a
- }
- };
- EBG = window.EBG || {};
- EBGInfra.mergeObj(EBGInfra, EBG, !1);
- EBG.declareNamespace("Logging");
- EBG.Logging.LoggerLevels = {
- NONE: 0,
- ERROR: 1,
- INFO: 2,
- WARN: 3,
- DEBUG: 4
- };
- EBG.Logging.Logger = function(a) {
- this._level = a;
- this.startNestingGroupNames = [];
- this.endNestingGroupNames = [];
- this._stringFilters = [];
- this._fGroupFilter = !1;
- this._maxIndent = 15
- };
- EBG.Logging.Logger.prototype = {
- setLevel: function(a) {
- this._level = a
- },
- setFilter: function(a, b) {
- "string" == EBG.typeOf(a) && (a = [a]);
- this._fGroupFilter = EBG.isDefined(b) ? b : !0;
- this._stringFilters = a
- },
- debug: function(a) {
- this._reportToLog(EBG.Logging.LoggerLevels.DEBUG, arguments)
- },
- info: function(a) {
- this._reportToLog(EBG.Logging.LoggerLevels.INFO, arguments)
- },
- warn: function(a) {
- this._reportToLog(EBG.Logging.LoggerLevels.WARN, arguments)
- },
- error: function(a) {
- this._reportToLog(EBG.Logging.LoggerLevels.ERROR, arguments)
- },
- exception: function(a,
- b) {
- var c = "string" !== b ? EBG.format("Exception in {0}. message: {1}", a, b.message) : EBG.format("Exception in: {0}. message: {1}", a, b);
- b.stack && (c += EBG.format(" stack: {0}", b.stack));
- this._reportToLog(EBG.Logging.LoggerLevels.ERROR, [c])
- },
- startGroup: function(a) {
- this._supportNesting() && this._passesFilter(a) && this.startNestingGroupNames.push(a)
- },
- endGroup: function() {
- this._supportNesting() && 0 < this.endNestingGroupNames.length && window.console.groupEnd(this.endNestingGroupNames.pop())
- },
- _consoleAvailable: function() {
- return void 0 !==
- window.console
- },
- _supportNesting: function() {
- return this._consoleAvailable() ? void 0 !== window.console.group : !1
- },
- _supportErrorMessage: function() {
- return void 0 !== window.console.error
- },
- _supportInfoMessage: function() {
- return void 0 !== window.console.info || void 0 !== window.opera
- },
- _supportWarnMessage: function() {
- return void 0 !== window.console.warn || void 0 !== window.opera
- },
- _supportObjectView: function() {
- return void 0 !== window.console.dir || void 0 !== window.opera
- },
- _callConsoleFunction: function(a, b) {
- var c = !1;
- switch (a) {
- case EBG.Logging.LoggerLevels.INFO:
- this._supportInfoMessage() &&
- (window.console.info(b), c = !0);
- break;
- case EBG.Logging.LoggerLevels.WARN:
- this._supportWarnMessage() && (window.console.warn(b), c = !0);
- break;
- case EBG.Logging.LoggerLevels.ERROR:
- this._supportErrorMessage() && (consoleFunction = window.console.error(b), c = !0)
- }
- c || window.console.log(b)
- },
- _resetNesting: function() {
- for (var a = 0; a <= this._maxIndent; a++) this.endGroup();
- console.warn("Reset log group nesting. MaxIndent = " + this._maxIndent)
- },
- _passesFilter: function(a) {
- var b = !1;
- if (0 == this._stringFilters.length) b = !0;
- else
- for (var c =
- 0; c < this._stringFilters.length; c++)
- if (-1 < a.indexOf(this._stringFilters[c])) {
- b = !0;
- break
- } return b
- },
- _reportToLog: function(a, b) {
- if (this._level >= a && this._consoleAvailable()) {
- var c = b[0];
- "[object String]" !== Object.prototype.toString.call(c) ? this._supportObjectView() || (c = c.toString()) : c = EBG.format.apply(null, b);
- if (void 0 === window.opera) {
- for (; this.startNestingGroupNames.length;) window.console.group(this.startNestingGroupNames[0]), this.endNestingGroupNames.push(this.startNestingGroupNames.shift());
- (this._passesFilter(c) ||
- this._fGroupFilter && 0 < this.endNestingGroupNames.length) && this._callConsoleFunction(a, c);
- this.endNestingGroupNames.length > this._maxIndent && this._resetNesting()
- } else this._passesFilter(c) && opera.postError(c)
- }
- }
- };
- EBG.declareClass(EBG.Logging.Logger, null);
- EBG.log = EBG.log || new EBG.Logging.Logger(EBG.Logging.LoggerLevels.DEBUG);
- EBG.declareNamespace("Reporter");
- EBG.Reporter.ServerReporter = function(a) {
- this.reportFrequency = a.reportFrequency || 0;
- this.bs = a.bs
- };
- EBG.Reporter.ServerReporter.prototype = {
- bs: null,
- report: function(a) {
- this._shouldReport() && this._reportMessage(a)
- },
- getCallStack: function() {
- try {
- throw Error();
- } catch (a) {
- return formatCallStack(a.stack)
- }
- },
- _shouldReport: function() {
- var a = !1;
- 0 < this.reportFrequency && this.reportFrequency / 100 > Math.random() && (a = !0);
- return a
- },
- formatCallStack: function(a) {
- if (a) {
- for (var b; b != a;) b = a, a = a.replace(/((https?:\/..*\/)[^\/:]*:\d+(?:.|\n)*)\2/, "$1");
- a = a.replace(/\n/g, "")
- }
- return a
- },
- _reportMessage: function(a) {
- var b = EBG.format("{0}{1}/BurstingPipe/adServer.bs?cn=cLog&ord={2}",
- EBG.protocol, this.bs, Math.random()),
- c;
- for (c in a) a.hasOwnProperty(c) && (b += "&" + c + "=" + a[c]);
- EBG.adaptor.reportToRemoteServerUsingImage(b)
- }
- };
- EBG.declareClass(EBG.Reporter.ServerReporter, null);
- (function(a, b, c) {
- b || (b = {
- fn: {},
- extend: function() {
- for (var a = arguments[0], b = 1, c = arguments.length; b < c; b++) {
- var d = arguments[b],
- i;
- for (i in d) a[i] = d[i]
- }
- return a
- }
- });
- b.fn.pm = function() {
- return this
- };
- b.pm = EBG.pm = function(a) {
- d.send(a)
- };
- b.pm.bind = EBG.bind = function(a, b, c, h, i) {
- d.bind(a, b, c, h, i)
- };
- b.pm.unbind = EBG.unbind = function(a, b) {
- d.unbind(a, b)
- };
- b.pm.dispatch = function(a, b, c, h) {
- d._dispatch({
- data: JSON.stringify({
- data: b,
- type: a
- }),
- source: c,
- target: h,
- origin: null
- })
- };
- b.pm.origin = EBG.pm.origin = null;
- var d = {
- send: function(a) {
- var a =
- b.extend({}, d.defaults, a),
- c = a.target;
- if (a.target && a.type) {
- var g = {
- data: a.data,
- type: a.type
- };
- if (a.success) g.callback = d._callback(a.success);
- if (a.error) g.errback = d._callback(a.error);
- "postMessage" in c && !a.hash && (d._bind(), c.postMessage(JSON.stringify(g), a.origin || "*"))
- }
- },
- bind: function(c, f, g, h, i, j) {
- "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({
- fn: f,
- origin: i || b.pm.origin,
- bindObj: g
- }))
- },
- unbind: function(a, b) {
- var c =
- d.data("listeners.postmessage");
- if (c && a)
- if (b) {
- var h = c[a];
- if (h) {
- for (var i = [], j = 0, k = h.length; j < k; j++) {
- var m = h[j];
- m.fn !== b && i.push(m)
- }
- c[a] = i
- }
- } else delete c[a]
- },
- data: function(a, b) {
- return b === c ? d._data[a] : d._data[a] = b
- },
- _data: {},
- _CHARS: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),
- _random: function() {
- for (var a = [], b = 0; 32 > b; b++) a[b] = d._CHARS[0 | 32 * Math.random()];
- return a.join("")
- },
- _callback: function(a) {
- var b = d.data("callbacks.postmessage");
- b || (b = {}, d.data("callbacks.postmessage",
- b));
- var c = d._random();
- b[c] = a;
- return c
- },
- _bind: function(b) {
- 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))
- },
- _dispatch: function(a) {
- var b = {};
- try {
- b = JSON.parse(a.data)
- } catch (c) {
- return
- }
- if (b.type) {
- var h = (d.data("callbacks.postmessage") || {})[b.type];
- if (h) h(b.data);
- else
- for (var h = (d.data("listeners.postmessage") || {})[b.type] || [], i = 0, j = h.length; i < j; i++) {
- var k = h[i];
- if (k.origin && a.origin !== k.origin) b.errback && d.send({
- target: a.source,
- data: {
- message: "postmessage origin mismatch",
- origin: [a.origin, k.origin]
- },
- type: b.errback
- });
- else try {
- var m;
- m = k.bindObj ? k.fn.apply(k.bindObj, [b.data, a]) : k.fn(b.data, a);
- b.callback && d.send({
- target: a.source,
- data: m,
- type: b.callback
- })
- } catch (l) {
- b.errback && d.send({
- target: a.source,
- data: l,
- type: b.errback
- })
- }
- }
- }
- }
- };
- b.extend(d, {
- defaults: {
- target: null,
- url: null,
- type: null,
- data: null,
- success: null,
- error: null,
- origin: "*",
- hash: !1
- }
- })
- })(this, "undefined" === typeof jQuery ?
- null : jQuery);
- "JSON" in window && window.JSON || (JSON = {});
- (function() {
- function a(a) {
- return 10 > a ? "0" + a : a
- }
- function b(a) {
- e.lastIndex = 0;
- return e.test(a) ? '"' + a.replace(e, function(a) {
- var b = h[a];
- return "string" === typeof b ? b : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4)
- }) + '"' : '"' + a + '"'
- }
- function c(a, d) {
- var e, h, p, n, r = f,
- q, o = d[a];
- o && "object" === typeof o && "function" === typeof o.toJSON && (o = o.toJSON(a));
- "function" === typeof i && (o = i.call(d, a, o));
- switch (typeof o) {
- case "string":
- return b(o);
- case "number":
- return isFinite(o) ? "" + o : "null";
- case "boolean":
- case "null":
- return "" +
- o;
- case "object":
- if (!o) return "null";
- f += g;
- q = [];
- if ("[object Array]" === Object.prototype.toString.apply(o)) {
- n = o.length;
- for (e = 0; e < n; e += 1) q[e] = c(e, o) || "null";
- p = 0 === q.length ? "[]" : f ? "[\n" + f + q.join(",\n" + f) + "\n" + r + "]" : "[" + q.join(",") + "]";
- f = r;
- return p
- }
- if (i && "object" === typeof i) {
- n = i.length;
- for (e = 0; e < n; e += 1) h = i[e], "string" === typeof h && (p = c(h, o)) && q.push(b(h) + (f ? ": " : ":") + p)
- } else
- for (h in o) Object.hasOwnProperty.call(o, h) && (p = c(h, o)) && q.push(b(h) + (f ? ": " : ":") + p);
- p = 0 === q.length ? "{}" : f ? "{\n" + f + q.join(",\n" + f) + "\n" +
- r + "}" : "{" + q.join(",") + "}";
- f = r;
- return p
- }
- }
- if ("function" !== typeof Date.prototype.toJSON) Date.prototype.toJSON = function() {
- return this.getUTCFullYear() + "-" + a(this.getUTCMonth() + 1) + "-" + a(this.getUTCDate()) + "T" + a(this.getUTCHours()) + ":" + a(this.getUTCMinutes()) + ":" + a(this.getUTCSeconds()) + "Z"
- }, String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
- return this.valueOf()
- };
- var d = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
- e = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
- f, g, h = {
- "\u0008": "\\b",
- "\t": "\\t",
- "\n": "\\n",
- "\u000c": "\\f",
- "\r": "\\r",
- '"': '\\"',
- "\\": "\\\\"
- },
- i;
- if ("function" !== typeof JSON.stringify) JSON.stringify = function(a, b, d) {
- var e;
- g = f = "";
- if ("number" === typeof d)
- for (e = 0; e < d; e += 1) g += " ";
- else "string" === typeof d && (g = d);
- if ((i = b) && "function" !== typeof b && ("object" !== typeof b || "number" !== typeof b.length)) throw Error("JSON.stringify");
- return c("", {
- "": a
- })
- };
- if ("function" !== typeof JSON.parse) JSON.parse = function(a, b) {
- function c(a, d) {
- var e, f, g = a[d];
- if (g && "object" === typeof g)
- for (e in g) Object.hasOwnProperty.call(g, e) && (f = c(g, e), void 0 !== f ? g[e] = f : delete g[e]);
- return b.call(a, d, g)
- }
- var e;
- d.lastIndex = 0;
- d.test(a) && (a = a.replace(d, function(a) {
- return "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4)
- }));
- if (/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
- "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) return e = eval("(" + a + ")"), "function" === typeof b ? c({
- "": e
- }, "") : e;
- throw new SyntaxError("JSON.parse");
- }
- })();
- MsgProtocol = function() {};
- MsgProtocol.prototype = {
- _interval_id: null,
- _last_hash: "",
- _cache_bust: 1,
- postMessage: function(a, b, c) {
- c = c || parent;
- if (b) c.location ? c.location = b.replace(/#.*$/, "") + "#" + +new Date + this._cache_bust++ + "&" + a : c.src = b.replace(/#.*$/, "") + "#" + +new Date + this._cache_bust++ + "&" + a
- },
- receiveMessages: function(a, b) {
- this._interval_id && clearInterval(this._interval_id);
- this._interval_id = null;
- if (a) this._interval_id = setInterval(function() {
- var b = document.location.hash,
- d = /^#?\d+&/;
- if (b !== this._last_hash && d.test(b)) this._last_hash =
- b, a({
- data: b.replace(d, "")
- })
- }, b)
- },
- finishMessaging: function() {
- clearInterval(this._interval_id);
- this._interval_id = null
- }
- };
- "undefined" != typeof EBG ? EBG.msgProtocol = new MsgProtocol : EBG = {
- msgProtocol: new MsgProtocol
- };
- EBG.declareNamespace("API");
- EBG.API.InjectionMethod = {
- APPEND: "append",
- INSERT_BEFORE: "insertBefore",
- INSERT_AFTER: "insertAfter",
- FIRST_CHILD: "firstChild",
- LAST_CHILD: "lastChild"
- };
- EBG.API.BrowserTypes = {
- NON_SUPPORTED: 0,
- IE: 1,
- FF: 2,
- NN: 3,
- SAFARI: 4,
- CHROME: 5,
- AOL: 6,
- OPERA: 7,
- EDGE: 8
- };
- EBG.API.PlatformTypes = {
- NON_SUPPORTED: 0,
- WIN_95: 1,
- WIN_98: 2,
- WIN_2000: 3,
- WIN_XP: 4,
- WIN_ME: 5,
- WIN_NT: 6,
- MAC: 7,
- WIN_VISTA: 8,
- WIN_7: 9,
- IPHONE: 10,
- IPAD: 11,
- IPOD: 12,
- ANDROID_2_TAB: 13,
- ANDROID_3_TAB: 14,
- WIN_10: 15,
- ANDROID_5_TAB: 16,
- ANDROID_2_MOBILE: 17,
- ANDROID_3_MOBILE: 18,
- WIN_MOBILE_7: 19,
- ANDROID_4_TAB: 20,
- ANDROID_4_MOBILE: 21,
- WIN_8: 22,
- MAC_NEW: 23,
- MAC_YOSEMITE: 24,
- ANDROID_5_MOBILE: 25,
- CROS: 26,
- FBAN: 27,
- SMART_TV: 28,
- UBUNTU: 29,
- LINUX: 30,
- ANDROID_1: 31
- };
- EBG.API.DeviceTypes = {
- DESKTOP: 0,
- MOBILE: 1,
- TABLET: 2,
- UNKNOWN: 3
- };
- EBG.API.EventNames = {
- CREATE_AD: "CREATE_AD",
- CREATE_ADAPTOR: "CREATE_ADAPTOR",
- CREATE_INT_MGR: "CREATE_INT_MGR",
- CREATE_ANIM_MGR: "CREATE_ANIM_MGR",
- CREATE_POSITIONING_HELPER: "CREATE_POSITIONING_HELPER",
- SHOW_AD: "SHOW_AD",
- ADD_CREATIVES: "ADD_CREATIVES",
- ADD_INTERACTION: "ADD_INTERACTION",
- ADD_EYE_DIV: "ADD_EYE_DIV",
- ADD_HTML5_MAIN_CREATIVE: "ADD_HTML5_MAIN_CREATIVE",
- ADD_HTML5_PANEL_CREATIVE: "ADD_HTML5_PANEL_CREATIVE",
- ADD_EMPTY_BANNER_CREATIVE: "ADD_EMPTY_BANNER_CREATIVE",
- ADD_BANNER_DEFAULT_IMAGE_CREATIVE: "ADD_BANNER_DEFAULT_IMAGE_CREATIVE",
- ADD_BANNER_PRELOAD_IMAGE_CREATIVE: "ADD_BANNER_PRELOAD_IMAGE_CREATIVE",
- ADD_BANNER_DEFAULT_FLASH_CREATIVE: "ADD_BANNER_DEFAULT_FLASH_CREATIVE",
- ADD_BANNER_RICH_FLASH_CREATIVE: "ADD_BANNER_RICH_FLASH_CREATIVE",
- ADD_FLOATING_INTRO_CREATIVE: "ADD_FLOATING_INTRO_CREATIVE",
- ADD_FLOATING_REMINDER_CREATIVE: "ADD_FLOATING_REMINDER_CREATIVE",
- ADD_FLOATING_MINISITE_CREATIVE: "ADD_FLOATING_MINISITE_CREATIVE",
- ADD_PANEL_RICH_FLASH_CREATIVE: "ADD_PANEL_RICH_FLASH_CREATIVE",
- SHOW_BANNER_RICH_FLASH_CREATIVE: "SHOW_BANNER_RICH_FLASH_CREATIVE",
- SHOW_PANEL_RICH_FLASH_CREATIVE: "SHOW_PANEL_RICH_FLASH_CREATIVE",
- SHOW_PANEL_CREATIVE: "SHOW_PANEL_CREATIVE",
- SHOW_REMINDER: "SHOW_REMINDER",
- SHOW_MINISITE: "SHOW_MINISITE",
- PAGE_LOAD: "PAGE_LOAD",
- COLLECT_TIMERS: "COLLECT_TIMERS",
- PAGE_UNLOAD: "PAGE_UNLOAD",
- PAGE_BEFORE_UNLOAD: "PAGE_BEFORE_UNLOAD",
- PAGE_HIDE: "PAGE_HIDE",
- PAGE_RESIZE: "PAGE_RESIZE",
- PAGE_SCROLL: "PAGE_SCROLL",
- PAGE_FOCUS: "PAGE_FOCUS",
- PAGE_FOCUSIN: "PAGE_FOCUSIN",
- PAGE_FOCUSOUT: "PAGE_FOCUSOUT",
- PAGE_BLUR: "PAGE_BLUR",
- PAGE_HIDDEN: "PAGE_HIDDEN",
- PAGE_VISIBLE: "PAGE_VISIBLE",
- INTERACTION_REPORT_REMOTE_SERVERS: "INTERACTION_REPORT_REMOTE_SERVERS",
- START_TIMER: "START_TIMER",
- STOP_TIMER: "STOP_TIMER",
- UPDATE_TIMER: "UPDATE_TIMER",
- HANDLE_COUNTER_INTERACTION: "HANDLE_COUNTER_INTERACTION",
- HANDLE_TIMER_INTERACTION: "HANDLE_TIMER_INTERACTION",
- DEFAULT_CLICK: "DEFAULT_CLICK",
- EXPAND: "EXPAND",
- COLLAPSE: "COLLAPSE",
- USER_INTERACTION: "USER_INTERACTION",
- MOUSE_OVER: "MOUSE_OVER",
- MOUSE_OUT: "MOUSE_OUT",
- MOUSE_MOVE: "MOUSE_MOVE",
- MODULE_LOAD: "MODULE_LOAD",
- USER_INITIATED_VIDEO: "USER_INITIATED_VIDEO",
- DWELL_UNIQUE: "DWELL_UNIQUE",
- DWELL_VIDEO_START: "DWELL_VIDEO_START",
- DWELL_VIDEO_STOP: "DWELL_VIDEO_STOP",
- CREATIVE_CONTAINER_READY: "CREATIVE_CONTAINER_READY",
- RICH_FLASH_PLAYED: "RICH_FLASH_PLAYED",
- REPLAY_AD: "REPLAY_AD",
- BANDWITH_DETECTED: "BANDWITH_DETECTED",
- FULL_SCREEN_START: "FULL_SCREEN_START",
- FULL_SCREEN_END: "FULL_SCREEN_STOP",
- ANIMATE_PANEL: "ANIMATE_PANEL",
- CLOSE_AD: "CLOSE_AD",
- OPEN_PAGE: "OPEN_PAGE",
- MAX_AD_DURATION: "MAX_AD_DURATION",
- FLASH_IN_FRAME_TWO: "FLASH_IN_FRAME_TWO",
- SHOW_HIDE_ELEMENTS: "SHOW_HIDE_ELEMENTS",
- DEFAULT_IMPRESSION: "DEFAULT_IMPRESSION",
- AIE_LOADED: "AIE_LOADED",
- INIT_MANAGERS: "INIT_MANAGERS",
- MOUSE_MOVE_NEEDED: "MOUSE_MOVE_NEEDED",
- VISIBILITY_CHECK: "VISIBILITY_CHECK",
- VISIBILITY_HIDDEN: "VISIBILITY_HIDDEN",
- AD_START: "AD_START",
- ELEMENT_LOADED: "ELEMENT_LOADED",
- AD_STACKING: "AD_STACKING",
- SCREEN_ORIENTATION: "SCREEN_ORIENTATION",
- PORTRAIT: "PORTRAIT",
- LANDSCAPE: "LANDSCAPE",
- CHANGE_PANEL_POSITION: "CHANGE_PANEL_POSITION",
- PANEL_FREQUENCY_LOADED: "PANEL_FREQUENCY_LOADED",
- THROTTLED: "THROTTLED",
- FLASH_DETECTED: "FLASH_DETECTED",
- ANIMATION: "ANIMATION"
- };
- EBG.API.EbEventNames = {
- PAGE_LOAD: EBG.API.EventNames.PAGE_LOAD,
- SCREEN_ORIENTATION: EBG.API.EventNames.SCREEN_ORIENTATION,
- VISIBILITY: EBG.API.EventNames.VISIBILITY_CHECK
- };
- EBG.VideoInteraction = {
- STARTED: "ebVideoStarted",
- PERCENT_25_PLAYED: "eb25Per_Played",
- PERCENT_50_PLAYED: "eb50Per_Played",
- PERCENT_75_PLAYED: "eb75Per_Played",
- FULLPLAY: "ebVideoFullPlay",
- MUTE: "ebVideoMute",
- UNMUTE: "ebVideoUnmute",
- PAUSE: "ebVideoPause",
- REPLAY: "ebVideoReplay",
- UNMUTED: "ebVideoUnmuted",
- FULLSCREEN_START: "ebFSStart",
- FULLSCREEN_END: "ebFSEnd",
- FULLSCREEN_MUTE: "ebFSVideoMute",
- FULLSCREEN_PAUSE: "ebFSVideoPause",
- SLIDER_DRAGGED: "ebSliderDragged",
- VIDEO_PLAY_DURATION: "ebVideoPlayDuration",
- VIDEO_ASSET_DURATION: "ebVideoAssetDuration",
- FULLSCREEN_DURATION: "ebFSVideoPlayDuration",
- FULLSCREEN_ASSET_DURATION: "ebFSVideoAssetDuration",
- USER_INITIATED_VIDEO: "ebUserInitiatedVideo"
- };
- EBG.VideoQuartiles = [EBG.VideoInteraction.STARTED, EBG.VideoInteraction.PERCENT_25_PLAYED, EBG.VideoInteraction.PERCENT_50_PLAYED, EBG.VideoInteraction.PERCENT_75_PLAYED, EBG.VideoInteraction.FULLPLAY];
- EBG.EBMessage = {
- REQ_INIT: "reqInit",
- INIT: "ebInit",
- INITDONE: "ebInitDone",
- GET_ENVIROMENT: "ebGetEnvironment",
- SHOW_DEFAULT_IMAGE: "ebShowDefaultImage",
- CLICKTHROUGH: "ebclickthrough",
- NOTIFIED_INTERACTION: "ebNotifiedInteraction",
- VERSION_TRACKING_IMPRESSION: "ebversiontrackingimpression",
- USER_ACTION_COUNTER: "ebCIUserActionCounter",
- AUTOMATIC_EVENT_COUNTER: "ebCIAutomaticEventCounter",
- START_TIMER: "ebCIStartTimer",
- UPDATE_TIMER: "ebUpdateTimer",
- STOP_TIMER: "ebCIStopTimer",
- START_VIDEO_TIMER: "ebStartVideoTimer",
- STOP_VIDEO_TIMER: "ebendvideotimer",
- VIDEO_INTERACTION: "ebVideoInteraction",
- VIDEO_LOAD: "ebVideoLoad",
- INIT_VIDEO_LOADER: "ebInitVideoLoader",
- VIDEO_FS_OPEN: "ebVideoFSOpen",
- VIDEO_FS_CLOSE: "ebVideoFSClose",
- VIDEO_FS_AUTO_CLOSE: "ebVideoFSAutoClose",
- START_VIDEO: "ebtStartVideo",
- STOP_VIDEO: "ebtStoptVideo",
- UPDATE_VIDEO_DURATION: "ebtUpdateVideoDuration",
- FULL_SCREEN_OPEN: "ebFullScreenOpen",
- FULL_SCREEN_CLOSE: "ebFullScreenClose",
- FULL_SCREEN_AUTO_CLOSE: "ebFullScreenAutoClose",
- MOUSE_MOVE: "ebMouseMove",
- PAGE_LOAD: "ebPageLoad",
- TRIGGER_AD_START: "ebTriggerAdStart",
- INIT_EXPANSION_PARAMS: "ebInitExpansionParams",
- RESET_COLLAPSE_TIMER: "ebResetCollapseTimer",
- NEW_SE: "ebNewSE",
- EXPAND: "ebExpandPanel",
- EXPAND_DONE: "ebExpandDone",
- COLLAPSE: "ebCollapsePanel",
- COLLAPSE_DONE: "ebCollapseDone",
- NOTIFY_INTERACTION_MONITOR: "NotifyInteractionMonitor",
- HIDE_INTRO: "ebHideIntro",
- INTRO_FULL_PLAY: "ebIntroFullPlay",
- KEEP_AD_OPREN: "ebKeepAdOpen",
- GO_TO_MINISITE: "ebGoToMiniSite",
- UPDATE_CLICK: "ebUpdateClick",
- DOCUMENT_LOADED: "ebDocumentLoaded",
- PLAY_VIDEO_ON_NATIVE_PLAYER: "playVideoOnNativePlayer",
- CREATE_CALENDAR_EVENT: "createCalendarEvent",
- STORE_PICTURE: "storePicture",
- SDK_DATA_CHANGE: "sdkDataChange",
- SDK_EVENT: "sdkEvent",
- ADAPTOR_READY: "adaptorReady",
- SWIPE: "ebSwipe",
- DISPOSE: "ebDispose",
- SET_RESIZE_PROPS: "ebResizeProperties",
- RESIZE: "ebResize",
- SET_EXPAND_PROPS: "ebExpandProperties",
- SET_ORIENTATION_PROPS: "ebOrientationProperties",
- CLOSE: "ebClose",
- CLOSE_AD: "ebclosead",
- SET_STATE: "ebSetstate",
- RESET_STATE: "ebResetstate",
- REQ_MOUSE_MOVE: "ebReqMouseMove",
- ANIMATION: "ebAnimation",
- VISIBILITY: "ebVisibility"
- };
- EBG.DurationInteraction = {
- TIMER: "Timer",
- AGGREGATE: "Aggregate"
- };
- EBG.Animation = {
- Easing: {
- linear: "linear",
- easeInQuad: "easeInQuad",
- easeOutQuad: "easeOutQuad",
- easeInOutQuad: "easeInOutQuad",
- easeInCubic: "easeInCubic",
- easeOutCubic: "easeOutCubic",
- easeInOutCubic: "easeInOutCubic",
- easeInQuart: "easeInQuart",
- easeOutQuart: "easeOutQuart",
- easeInOutQuart: "easeInOutQuart",
- easeInQuint: "easeInQuint",
- easeOutQuint: "easeOutQuint",
- easeInOutQuint: "easeInOutQuint"
- },
- TransitionEasing: {
- ease: "ease",
- linear: "linear",
- easeIn: "easeIn",
- easeOut: "easeOut",
- easeInOut: "easeInOut"
- }
- };
- EBG.INNERIFRAMEMessage = {
- LOADED: "ebInnerIframeLoaded",
- INIT: "ebInitInnerIframe",
- VERIFY: "ebVerifyInnerIframe",
- EBO: "ebO",
- GLOBALPARAMS: "ebGlobalParams",
- CONTINUE_SENDING: "ContinueSending",
- NOT_LASTMSG: "NotLastMsg",
- LASTMSG: "LastMsg",
- ADCONFIG_REQUEST: "AdConfig_Request",
- SECRET_TAGS: "Secret_Tags"
- };
- EBG.FS = {
- EB_VERSION_TRACKING_IMPRESSION: "ebversiontrackingimpression",
- EB_CLICKTHROUGH: "ebclickthrough",
- EB_CREATIVE_EVENT_SUBSCRIPTION: "ebcreativeaddhdr",
- EB_CI_USER_ACTION_COUNTER: "ebciuseractioncounter",
- EB_CI_AUTOMATIC_EVENT_COUNTER: "ebciautomaticeventcounter",
- EB_VIDEO_INTERACTION: "ebvideointeraction",
- EB_START_TIMER: "ebstarttimer",
- EB_END_TIMER: "ebendtimer",
- EB_CI_START_TIMER: "ebcistarttimer",
- EB_CI_STOP_TIMER: "ebcistoptimer",
- EB_UPDATE_TIMER: "ebupdatetimer",
- EB_START_VIDEO_TIMER: "ebstartvideotimer",
- EB_STOP_VIDEO_TIMER: "ebendvideotimer",
- EB_PAGE_LOAD: "ebpageload",
- EB_COMMAND: "ebcommand",
- EB_MSG: "ebmsg",
- EB_EXPAND_PANEL: "ebexpandpanel",
- EB_COLLAPSE_PANEL: "ebcollapsepanel",
- EB_SET_STATE: "ebsetstate",
- EB_RESET_STATE: "ebresetstate",
- EB_MOUSE_TRACKER: "ebmousetracker",
- EB_MOUSE_MOVE: "ebmousemove",
- EB_TEST_DC: "ebtestdc",
- EB_CLOSE_AD: "ebclosead",
- EB_REPLAY_AD: "ebreplayad",
- EB_REPLAY_EXP: "ebreplayexp",
- EB_LOAD_RICH_BANNER: "ebloadrichbanner",
- EB_SHOW_RICH_BANNER: "ebshowrichbanner",
- EB_INIT_VIDEO_LOADER: "ebinitvideoloader",
- EB_HIDE_INTRO: "ebhideintro",
- EB_INTRO_FULL_PLAY: "ebintrofullplay",
- EB_KEEP_AD_OPREN: "ebkeepadopen",
- EB_GO_TO_MINISITE: "ebgotominisite",
- EB_VIDEO_LOAD: "ebvideoload",
- EB_VIDEO_LOAD_AND_PLAY: "ebvideoloadandplay",
- EB_FULL_SCREEN_OPEN: "ebfullscreenopen",
- EB_FULL_SCREEN_CLOSE: "ebfullscreenclose",
- EB_FULL_SCREEN_AUTO_CLOSE: "ebfullscreenautoclose",
- EB_VIDEO_FS_OPEN: "ebvideofsopen",
- EB_VIDEO_FS_CLOSE: "ebvideofsclose",
- EB_VIDEO_FS_AUTO_CLOSE: "ebvideofsautoclose",
- EB_START_VIDEO: "ebtstartvideo",
- EB_STOP_VIDEO: "ebtstopvideo",
- EB_UPDATE_VIDEO_DURATION: "ebtupdatevideoduration",
- EB_GET_JS_VAR: "ebgetjsvar",
- EB_GET_ALL_JS_VARS: "ebgetalljsvars",
- EB_SET_JS_VAR: "ebsetjsvar",
- EB_INIT_SE: "ebinitse",
- EB_SET_SE_PROXY: "ebsetseproxy",
- EB_SE_EXPAND_STARTED: "ebseexpandstarted",
- EB_SE_RETRACT_STARTED: "ebseretractstarted",
- EB_SE_RETRACT_FINISHED: "ebseretractfinished",
- EB_NOTIFICATION: "notification",
- EB_VIDEO_ACTIVE_MODE: "ebvideoactivemode",
- EB_THROTTLE: "ebthrottle"
- };
- EBG.ActionType = {
- USER: "user",
- AUTO: "auto"
- };
- EBG.ExpBaseInteractions = {
- PANELS_VIEWED: "ebPanelsViewed",
- AUTO_SHOW: "autoshow",
- DURATION: "duration"
- };
- EBG.SingleExpInteractions = EBG.ExpBaseInteractions;
- EBG.orientation = {
- Both: "BOTH",
- Landscape: "LANDSCAPE",
- Portrait: "PORTAIT"
- };
- EBG.adTypes = {
- RichBannerHtml5: "Html5Banner",
- PoliteBannerHtml5: "Html5PoliteBanner",
- SEBannerHtml5: "Html5SEBanner",
- ExpBannerHtml5: "Html5ExpBanner",
- StdBanner: "StdBanner",
- Banner: "Banner",
- SingleExpBanner: "SingleExpBanner",
- ExpBanner: "ExpBanner",
- VisibilityAd: "Visibility",
- FloatingAd: "FloatingAd",
- FloatingAdWithRem: "FloatingAdWithReminder",
- TrackingAd: "Tracking",
- StdBannerHtml5: "Html5StdBanner",
- WallpaperAd: "WallpaperAd"
- };
- EBG.adParts = {
- BANNER: "banner",
- PANEL: "panel",
- DEFAULTBANNER: "defaultBanner",
- RICHBANNER: "richBanner"
- };
- EBG.WindowTarget = {
- BLANK: "_blank",
- SELF: "_self",
- PARENT: "_parent",
- TOP: "_top"
- };
- EBG.Const = {
- OUTER_DIV: "eyeDiv",
- DATACAPTURE: "/BurstingPipe/BurstingDataCapturePipe.asp",
- AKAMAIFCS_PLUID_9: "rtmp://flv.stream.atwola.com/flash/flv/mm",
- AKAMAIFCS_PLUID_43: "rtmp://eyeblaster.fcod.msecnd.net/vod/a10061/e1",
- AKAMAIFCS_PLUID_42_45: "rtmp://cp57388.edgefcs.net/ondemand",
- AKAMAI_DEFAULT: "rtmp://cp16207.edgefcs.net/ondemand",
- SHOW_HIDE_FLAG: "data-ebhidingoverlappingelement",
- SHOW_HIDE_BACKUP: "data-ebvisibilitybackup"
- };
- EBG.PanelPositionType = {
- PAGE_RELATIVE_PERCENTAGE: 0,
- BANNER_RELATIVE_PIXELS: 1,
- PAGE_RELATIVE_PIXELS: 2,
- VIEWPORT_RELATIVE_PERCENTAGE: 3,
- VIEWPORT_RELATIVE_PIXELS: 4
- };
- EBG.PanelCorner = {
- TOP_LEFT: 1,
- TOP_RIGHT: 2,
- BOTTOM_LEFT: 3,
- BOTTOM_RIGHT: 4
- };
- EBG.AnimationType = {
- NONE: "none",
- LINEAR: "linear",
- EASE_OUT: "easeout",
- EASE_OUT_SNAP: "easeoutsnap"
- };
- EBG.ExpandCollapseMethod = {
- CLIP: "clip",
- RESIZE: "resize"
- };
- EBG.AnimationDefaults = {
- easeOutCoefficient: 0.1,
- stepTime: 10,
- linearSteps: 50,
- snapThreshold: 10,
- animationType: EBG.AnimationType.NONE,
- snap: !1,
- checkShowHideOnEachStep: !1,
- hideAssetAfterExpand: !1,
- removeAssetAfterExpand: !1,
- hideAssetAfterCollapse: !0,
- removeAssetAfterCollapse: !0,
- method: EBG.ExpandCollapseMethod.ExpBanner,
- endAnimationHideAsset: !1,
- endAnimationRemoveAsset: !1
- };
- EBG.AnimationPushDownDefaults = {
- easeOutCoefficient: 0.1,
- stepTime: 50,
- linearSteps: 20,
- snapThreshold: 10,
- animationType: EBG.AnimationType.LINEAR,
- snap: !1,
- method: EBG.ExpandCollapseMethod.RESIZE,
- checkShowHideOnEachStep: !1,
- hideAssetAfterExpand: !1,
- removeAssetAfterExpand: !1,
- hideAssetAfterCollapse: !0,
- removeAssetAfterCollapse: !0,
- method: EBG.ExpandCollapseMethod.ExpBanner,
- endAnimationHideAsset: !1,
- endAnimationRemoveAsset: !1
- };
- EBG.AnimProps = {
- easeOutCoefficient: "easeOutCoefficient",
- snapThreshold: "snapThreshold",
- method: "method",
- endAnimationHideAsset: "endAnimationHideAsset",
- endAnimationRemoveAsset: "endAnimationRemoveAsset"
- };
- EBG.AnimDefaultProps = {
- stepTime: "stepTime",
- linearSteps: "linearSteps",
- animationType: "animationType"
- };
- EBG.AnimNonDefaultPanelValues = {
- animationType: EBG.AnimationType.NONE,
- stepTime: 0,
- linearSteps: 1
- };
- EBG.AnimExpansionProps = {
- hideAssetAfterExpand: "hideAssetAfterExpand",
- removeAssetAfterExpand: "removeAssetAfterExpand"
- };
- EBG.AnimCollapseProps = {
- hideAssetAfterCollapse: "hideAssetAfterCollapse",
- removeAssetAfterCollapse: "removeAssetAfterCollapse"
- };
- EBG.ProtectedElementIds = ["ebAd", "eyeDiv", "ebDefault", "ebRich", "ebDiv"];
- EBG.VisibilityMode = {
- DEFAULT_MODE: "defaultMode",
- BASIC_MODE: "basicMode",
- ENHANCED_MODE: "enhancedMode"
- };
- EBG.AcCertProgram = {
- IAB_EU: 0,
- NAI_US: 1
- };
- EBG.AcIconPosition = {
- TopRight: 0,
- TopLeft: 1,
- BottomRight: 2,
- BottomLeft: 3
- };
- EBG.PreloadType = {
- DefaultImg: 0,
- PreloadImg: 1,
- DefaultFlash: 2
- };
- EBG.ThrottleStates = {
- LOAD: "load",
- THROTTLE: "throttle",
- RESUME: "resume",
- PAUSE: "pause",
- POLLED: "polled"
- };
- EBG.WebEnvironment = {
- BROWSER: 0,
- ANDROID_MOBILE_BROWESR: 1,
- ANDROID_WEB_VIEW: 2,
- IOS_MOBILE_BROWSER: 3,
- IOS_WEB_VIEW: 4,
- OTHER_MOBILE_BROWSER: 5,
- OTHER_WEB_VIEW: 6,
- ANDROID_UNKNOWN: 97,
- IOS_UNKNOWN: 98,
- UNKNOWN: 99
- };
- EBG.SDK_STATES = EBG.SDK_STATES || {};
- EBG.SDK_STATES.API = {
- DEFAULT: "SDKdefault",
- EXPANDED: "SDKexpanded",
- LOADING: "SDKloading",
- RESIZED: "SDKresized"
- };
- EBG.SDK_EVENTS = EBG.SDK_EVENTS || {};
- EBG.SDK_EVENTS.API = {
- STATE_CHANGE: "SDKstateChange",
- ERROR: "SDKerror",
- READY: "SDKready",
- VIEWABLE_CHANGE: "SDKviewableChange",
- SIZE_CHANGE: "SDKsizeChange",
- RESIZE_PROPS_CHANGE: "SDKresizePropsChange",
- EXPAND_PROPS_CHANGE: "SDKexpandPropsChange",
- WINDOW_SIZE_CHANGE: "windowSizeChange"
- };
- EBG.declareNamespace("Events");
- EBG.Events.EventTiming = {
- BEFORE: "BEFORE",
- ONTIME: "ONTIME",
- AFTER: "AFTER",
- ONTIME_AND_AFTER: "ONTIME_AND_AFTER"
- };
- EBG.Events.EventNames = EBG.API.EventNames;
- EBG.Events.EbEventNames = EBG.API.EbEventNames;
- EBG.Events.EventSubscription = function(a, b, c) {
- this.eventName = a;
- this.callback = b;
- this.callbackBinding = c ? c : null
- };
- EBG.Events.EventSubscription.prototype = {
- dispatcherFilters: null,
- timing: EBG.Events.EventTiming.ONTIME,
- isElementEvent: !1,
- elementId: "",
- isDocumentEvent: !1,
- isValid: function() {
- return EBG.isFunc(this.callback) && (!this.callbackBinding || EBG.isObj(this.callbackBinding))
- },
- toString: function() {
- 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))
- }
- };
- EBG.declareClass(EBG.Events.EventSubscription, null);
- EBG.Events.Event = function(a) {
- this.name = a;
- this.creationTime = +new Date
- };
- EBG.Events.Event.prototype = {
- dispatcher: null,
- eventData: null,
- timing: null,
- toString: function() {
- return EBG.format("Event: name={0}, creationTime={1}, dispatcher={2}, eventData={3}", this.name, this.creationTime, EBG.typeOf(this.dispatcher), EBG.typeOf(this.eventData))
- }
- };
- EBG.declareClass(EBG.Events.Event, null);
- EBG.Events.EventManager = function() {
- this._subscriptions = {}
- };
- EBG.Events.EventManager.prototype = {
- _subscriptions: {},
- subscribeToEvent: function(a) {
- if (a.isValid())
- if (a.isElementEvent) EBG.adaptor && EBG.adaptor.subscribeToEventOnElement(a.eventName, a.elementId, a.callback);
- else {
- var b = this._subscriptions[a.eventName] = this._subscriptions[a.eventName] || {},
- c;
- 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,
- a.isDocumentEvent))
- }
- },
- unsubscribeFromEvent: function(a) {
- if (a && a.isValid())
- if (a.isElementEvent) EBG.adaptor && EBG.adaptor.unsubscribeFromEventOnElement(a.eventName, a.elementId, a.callback);
- else if (this._subscriptions[a.eventName] && this._subscriptions[a.eventName][a.timing]) {
- var b = this._subscriptions[a.eventName][a.timing],
- a = this._getSubscriptionId(a, b); - 1 != a && (b[a] = null)
- }
- },
- dispatchEvent: function(a) {
- var b = !1;
- switch (a.timing) {
- case EBG.Events.EventTiming.BEFORE:
- case EBG.Events.EventTiming.ONTIME:
- case EBG.Events.EventTiming.AFTER:
- b =
- this._dispatchEventByTiming(a, a.timing);
- break;
- case EBG.Events.EventTiming.ONTIME_AND_AFTER:
- b = (b = this._dispatchEventByTiming(a, EBG.Events.EventTiming.ONTIME)) || this._dispatchEventByTiming(a, EBG.Events.EventTiming.AFTER);
- break;
- default:
- b = (b = (b = this._dispatchEventByTiming(a, EBG.Events.EventTiming.BEFORE)) || this._dispatchEventByTiming(a, EBG.Events.EventTiming.ONTIME)) || this._dispatchEventByTiming(a, EBG.Events.EventTiming.AFTER)
- }
- return b
- },
- attachToAdaptor: function() {
- EBG.adaptor.setListener(this.dispatchEvent,
- this)
- },
- _dispatchEventByTiming: function(a, b) {
- var c = this._subscriptions[a.name];
- if (!c) return !1;
- for (var c = c[b], d = !1, e = 0; e < c.length; e++) {
- var f = c[e];
- if (f && (f = this._dispatchEventToSubscription(a, f), EBG.isBool(f) && !f)) {
- d = !0;
- break
- }
- }
- return d
- },
- _dispatchEventToSubscription: function(a, b) {
- var c = b.dispatcherFilters;
- if (EBG.isObj(c))
- for (var d in c)
- if (c.hasOwnProperty(d)) {
- var e = c[d],
- f = !0,
- g = d.split("."),
- h = a.dispatcher;
- if (h)
- for (var i = 0; i < g.length; i++) {
- var h = h[g[i]],
- j = i == g.length - 1;
- if (!h || j && h !== e) {
- f = !1;
- break
- }
- }
- if (!f) return null
- }
- c =
- null;
- d = b.callback;
- if (EBG.isFunc(d)) {
- e = [a];
- try {
- c = d.apply(b.callbackBinding, e)
- } catch (k) {}
- }
- return c
- },
- _getSubscriptionId: function(a, b) {
- for (var c = 0; c < b.length; c++)
- 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;
- return -1
- },
- _compareFilters: function(a, b) {
- if (!EBG.isObj(a)) return EBG.isObj(b) ? !1 : !0;
- if (!EBG.isObj(b)) return !1;
- for (var c in a)
- if (a.hasOwnProperty(c))
- if (b.hasOwnProperty(c)) {
- if (a[c] !==
- b[c]) return !1
- } else return !1;
- for (c in b)
- if (b.hasOwnProperty(c) && !a.hasOwnProperty(c)) return !1;
- return !0
- }
- };
- EBG.declareClass(EBG.Events.EventManager, null);
- EBG.eventMgr = EBG.eventMgr || new EBG.Events.EventManager;
- EBG.declareNamespace("Adaptors");
- EBG.Adaptors.TagNames = {
- DIV: "div",
- IFRAME: "iframe",
- IMG: "img",
- SCRIPT: "script",
- OBJECT: "object",
- EMBED: "embed",
- SPAN: "span",
- A: "a",
- BODY: "body"
- };
- EBG.Adaptors.InjectionMethod = EBG.API.InjectionMethod;
- EBG.Adaptors.WindowProp = {
- top: "top",
- left: "left",
- location: "location",
- menubar: "menubar",
- width: "width",
- height: "height"
- };
- EBG.Adaptors.MoreSupportedEvent = {
- visibilitychange: 1,
- mozvisibilitychange: 1,
- msvisibilitychange: 1,
- webkitvisibilitychange: 1
- };
- EBG.Adaptors.StdWebAdaptor = function() {
- this._setEvents()
- };
- EBG.Adaptors.StdWebAdaptor.onEnvEvent = function() {
- EBG.adaptor._handleEvent.apply(EBG.adaptor, arguments)
- };
- EBG.Adaptors.StdWebAdaptor.prototype = {
- _environmentEvents: {},
- _logicalEvents: {},
- _subscribedEvents: {},
- _subscribedEventsOnElement: [],
- _listener: null,
- _listenerBinding: null,
- _loadedModules: {},
- initInnerModules: function(a, b, c, d, e) {
- if (!this.browser) this.browser = new EBG.Adaptors.Browser(a, b, c, d, e);
- if (!this.flash) this.flash = EBG.Adaptors.FlashDetector ? new EBG.Adaptors.FlashDetector : null
- },
- registerSpecialBrowserEvents: function() {},
- loadModule: function(a, b, c, d) {
- if (!a || !b || !b.modulesDir) return !1;
- var e = this,
- b = 0 == a.indexOf("http") ?
- a : b.modulesDir + a + ".js",
- a = a.toLowerCase(),
- f = new EBG.Events.Event(EBG.Events.EventNames.MODULE_LOAD);
- f.dispatcher = this;
- f.eventData = {
- name: a
- };
- f.timing = EBG.Events.EventTiming.BEFORE;
- if (!EBG.eventMgr.dispatchEvent(f))
- if (this._loadedModules[a]) this._loadedModules[a].loading && c ? this._loadedModules[a].callback.push({
- func: c,
- binding: d || window
- }) : EBG.runTimed(this, function() {
- this._handleModuleLoaded(a)
- }, [], 0);
- else {
- this._loadedModules[a] = {
- loading: !0,
- loaded: !1,
- callback: c ? [{
- func: c,
- binding: d || window
- }] : []
- };
- var g = document.createElement("script");
- g.type = "text/javascript";
- g.async = !0;
- g.readyState ? g.onreadystatechange = function() {
- if ("loaded" === g.readyState || "complete" === g.readyState) g.onreadystatechange = null, e._handleModuleLoaded(a)
- } : g.onload = function() {
- e._handleModuleLoaded(a)
- };
- g.src = b;
- (EBG.getBigScript().parentElement || document.getElementsByTagName("html")[0]).appendChild(g)
- }
- },
- _handleModuleLoaded: function(a) {
- var b = this._loadedModules[a];
- b.loading = !1;
- b.loaded = !0;
- var c = new EBG.Events.Event(EBG.Events.EventNames.MODULE_LOAD);
- c.dispatcher = this;
- c.eventData = {
- name: a
- };
- c.timing = EBG.Events.EventTiming.ONTIME;
- if (!EBG.eventMgr.dispatchEvent(c)) {
- for (a = 0; a < b.callback.length; a++) {
- var d = b.callback[a];
- d.func.apply(d.binding)
- }
- c.timing = EBG.Events.EventTiming.AFTER;
- EBG.eventMgr.dispatchEvent(c)
- }
- },
- copy: function(a) {
- for (var b in this._subscribedEvents) this._subscribedEvents.hasOwnProperty(b) && (this._removeEventListener(window, this._environmentEvents[b].name, EBG.Adaptors.StdWebAdaptor.onEnvEvent), a.subscribeToEvent(b));
- for (b = 0; b < this._subscribedEventsOnElement.length; b++) {
- var c =
- this._subscribedEventsOnElement[b];
- if (c) {
- var d = c.elementId,
- e = c.eventName,
- c = c.callback,
- f = this.getElementById(d);
- f && (this._removeEventListener(f, e, c), a.subscribeToEventOnElement(e, d, c))
- }
- }
- a.flash = this.flash || null
- },
- intMonitorExist: function() {
- return EBG.isPreview && top.ebHandleFsCommandsPrev
- },
- notifyIntMonitor: function(a) {
- top.ebHandleFsCommandsPrev(a.command, a.args, a.objName, a.adId, a.elapsedTime)
- },
- hasEvent: function(a) {
- return !!this._environmentEvents[a]
- },
- generateElementId: function(a, b) {
- return EBG.format("eb{0}_{1}",
- a, b)
- },
- _getTags: function(a, b) {
- EBG.isGlobalDef("JSON");
- var c = "";
- if (b && a.tagName == EBG.Adaptors.TagNames.SCRIPT && a.text && !a.attributes) b.push(a);
- else {
- c = "";
- a.attributes && (this._setObjDefaultAttributes(a), c = this._getObjAttributesStr(a));
- c = EBG.format("<{0} {1}>", a.tagName, c);
- a.innerHTML && (c += a.innerHTML);
- a.text && (c += a.text);
- a.params && (c += this._getObjParamsStr(a));
- if (a.children)
- for (var d = 0; d < a.children.length; d++) c += this._getTags(a.children[d], b);
- c += EBG.format("</{0}>", a.tagName)
- }
- return c
- },
- writeReportingIFrame: function(a,
- b, c) {
- this.inject({
- tagName: EBG.Adaptors.TagNames.IFRAME,
- attributes: {
- id: a,
- src: b,
- style: {
- width: "0px",
- height: "0px"
- },
- frameborder: 0
- }
- }, EBG.Adaptors.InjectionMethod.APPEND, this.getElementById(c))
- },
- writeScript: function(a, b, c) {
- try {
- this.inject({
- tagName: EBG.Adaptors.TagNames.SCRIPT,
- attributes: {
- id: a,
- name: a,
- src: b
- }
- }, EBG.Adaptors.InjectionMethod.APPEND, this.getElementById(c))
- } catch (d) {}
- },
- write: function(a) {
- this._documentWrite(this._getTags(a))
- },
- inject: function(a, b, c) {
- if (c && a) {
- var d = c.ownerDocument.createElement(a.tagName);
- if (a.attributes) {
- this._setObjDefaultAttributes(a);
- for (var e in a.attributes) EBG.isObj(a.attributes[e]) ? this.setStyleToElem(d, a.attributes[e]) : d.setAttribute(e, a.attributes[e])
- }
- switch (b) {
- case EBG.Adaptors.InjectionMethod.INSERT_BEFORE:
- c.parentNode.insertBefore(d, c);
- break;
- case EBG.Adaptors.InjectionMethod.INSERT_AFTER:
- c.nextSibling ? c.parentNode.insertBefore(d, c.nextSibling) : c.parentNode.appendChild(d);
- break;
- case EBG.Adaptors.InjectionMethod.FIRST_CHILD:
- c.firstChild ? c.insertBefore(d, c.firstChild) : c.appendChild(d);
- break;
- default:
- c.appendChild(d)
- }
- e = "";
- if (a.innerHTML) e = a.innerHTML;
- var f = [];
- if (a.children)
- for (var g = 0; g < a.children.length; g++) {
- var h = a.children[g];
- e += EBG.adaptor._getTags(h, f);
- h.meta && !0 == h.meta.isChromePowerSaver && this._resizeAfterPaint(h.attributes.id, h.meta.origWidth, h.meta.origHeight)
- }
- if (e) d.innerHTML = e;
- if (a.text) d.text = a.text;
- for (g = 0; g < f.length; g++) this.inject(f[g], b, c);
- return d
- }
- },
- addInlineDOM: function(a, b) {
- this.inject(a, EBG.Adaptors.InjectionMethod.APPEND, this.getElementById(b))
- },
- setInnerHtml: function(a,
- b) {
- if (a) a.innerHTML = b
- },
- setStyleToElem: function(a, b, c) {
- if (a && "object" === typeof b)
- if (c)
- for (var d in b) {
- if (b.hasOwnProperty(d))
- if (void 0 === a.style[d])
- for (var c = ["Webkit", "Moz", "ms", "O"], e = window.getComputedStyle ? window.getComputedStyle(a, null) : a.style, f = 0; f < c.length; f++) {
- var g = c[f] + EBG.capitalize(d);
- if (void 0 !== e[g]) {
- a.style[g] = b[d];
- break
- }
- } else a.style[d] = b[d]
- } else
- for (d in b) b.hasOwnProperty(d) && (a.style[d] = b[d])
- },
- getStyleOfElem: function(a) {
- if (a) return a.style
- },
- setListener: function(a, b) {
- this._listener =
- a;
- this._listenerBinding = b
- },
- hasHiddenParent: function(a) {
- if (!a) return !1;
- for (var b = "none" == window.getComputedStyle(a).display;
- (a = a.parentElement) && !(b = "none" == window.getComputedStyle(a).display););
- return b
- },
- subscribeToEvent: function(a, b) {
- var c = this.getDisplayWin(),
- d = this.getPageWin();
- if (this.hasEvent(a) && !this._subscribedEvents[a]) {
- var e = this._environmentEvents[a],
- f = e.inCurWin ? window : this.getPageWin();
- if (b) f = f.document;
- this._logicalEvents[e.name].signInAllWindows && this.serving.detectServingMode(!0) ===
- 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);
- this._subscribedEvents[a] = {}
- }
- },
- subscribeToEventOnElement: function(a, b, c) {
- var d = !1,
- e = "string" == typeof b ? this.getDisplayWin().document.getElementById(b) : b;
- e || (d = !0);
- for (var f = this._subscribedEventsOnElement.length, g = 0; g < f; g++)
- if (this._subscribedEventsOnElement[g] &&
- this._subscribedEventsOnElement[g].elementId == b && this._subscribedEventsOnElement[g].eventName == a) {
- d = !0;
- break
- }
- d || (this._addEventListener(e, a, c), this._subscribedEventsOnElement[f] = {
- elementId: b,
- eventName: a,
- callback: c
- })
- },
- unsubscribeFromEventOnElement: function(a, b, c) {
- var d = "string" == typeof b ? this.getDisplayWin().document.getElementById(b) : b;
- if (d) {
- for (var e = this._subscribedEventsOnElement.length, f = -1, g = 0; g < e; g++)
- if (this._subscribedEventsOnElement[g] && this._subscribedEventsOnElement[g].elementId == b && this._subscribedEventsOnElement[g].eventName ==
- a && this._subscribedEventsOnElement[g].callback == c) {
- f = g;
- break
- }
- 0 <= g && (this._removeEventListener(d, a, c), this._subscribedEventsOnElement[f] = null)
- }
- },
- _addEventListener: function(a, b, c) {
- "load" == b && this.isPageLoaded() ? setTimeout(function() {
- c({
- type: "load"
- })
- }, 5) : window.addEventListener ? a.addEventListener(b, c, !1) : window.attachEvent && a.attachEvent("on" + b, c)
- },
- _removeEventListener: function(a, b, c) {
- window.removeEventListener ? a.removeEventListener(b, c, !1) : window.detachEvent && a.detachEvent("on" + b, c)
- },
- _checkIfPropExist: function(a,
- b) {
- return a && 0 <= a ? EBG.format(", {0}={1}", b, a) : ""
- },
- openPage: function(a, b) {
- var c = EBG.WindowTarget.BLANK,
- d = "",
- e = null;
- 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),
- d += this._checkIfPropExist(b.width, EBG.Adaptors.WindowProp.width), d += this._checkIfPropExist(b.height, EBG.Adaptors.WindowProp.height);
- return e = "" != d ? window.open(a, c, d) : window.open(a, c)
- },
- reportBeacon: function(a) {
- navigator && EBG.isFunc(navigator.sendBeacon) && navigator.sendBeacon(a)
- },
- reportToRemoteServerUsingImage: function() {
- var a = [];
- return function(b) {
- for (var c = 0; c < a.length; c++)
- if (a[c] === b) return;
- this.ReportingImg = new Image;
- this.ReportingImg.src = b;
- a.push(b)
- }
- }(),
- getDataFromRemoteServer: function(a, b, c, d,
- e) {
- return EBG.getDataFromRemoteServer(a, b, c, d, e)
- },
- reportToRemoteServer: function(a, b, c, d) {
- if (a && !EBG.isOfflineDemo) {
- var b = !!b,
- d = d || this.getRequestMethod(a),
- e;
- "POST" == d && (e = a.split("?"), a = e[0], e = e[1]);
- var f = !1;
- try {
- if (this.browser.isSafari() && "POST" == d) {
- var g = document.createElement("iframe");
- g.style.display = "none";
- g.style.width = "0px";
- g.style.height = "0px";
- document.body.appendChild(g);
- g = g.contentWindow ? g.contentWindow : g.contentDocument.document ? g.contentDocument.document : g.contentDocument;
- g.document.open();
- g.document.write(this.getIframeFormScript(a, e));
- g.document.close();
- f = !0
- } else if (EBG._isXMLHttpRequestSupported()) {
- var h = new XMLHttpRequest;
- h.setRequestHeader("Content-type", "text/plain");
- h.open(d, a, b);
- if (b || !b && !this.browser.isFF()) h.withCredentials = !0;
- try {
- h.send(e)
- } catch (i) {
- if (b) throw i;
- }
- f = !0
- } else if (window.XDomainRequest && !c && b) {
- var j = new XDomainRequest;
- j.open(d, a);
- j.send(e);
- f = !0
- }
- } catch (k) {
- f = !1
- }
- f || this.reportToRemoteServerUsingImage(a)
- }
- },
- getIframeFormScript: function(a, b) {
- return '<script>var e=document.createElement("form"),t="' +
- 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>'
- },
- getElementById: function(a, b) {
- var c = null,
- b = b ? b : this.getDisplayWin();
- EBG.isDefinedNotNull(a) && (c = b.document.getElementById(a));
- return c
- },
- supportsPageLoadEvents: function() {
- return !(this.browser.isOpera() &&
- 14 > this.browser.getVersion()) && !(this.browser.isIE() && 7 > this.browser.getVersion())
- },
- getHostName: function(a) {
- return (a ? a : this.getDisplayWin()).location.hostname
- },
- getDomain: function(a) {
- return (a ? a : this.getDisplayWin()).document.domain
- },
- getDisplayWin: function() {
- return window
- },
- getPageWin: function() {
- return window
- },
- inInnerIframe: function() {
- return !1
- },
- inPlacementIframe: function() {
- return !1
- },
- _setEvents: function() {
- this.supportsPageLoadEvents && (this._setEvent(EBG.Events.EventNames.PAGE_LOAD, "load"), this._setEvent(EBG.Events.EventNames.PAGE_UNLOAD,
- "unload", !0), this._setEvent(EBG.Events.EventNames.PAGE_BEFORE_UNLOAD, "beforeunload", !0), this._setEvent(EBG.Events.EventNames.PAGE_HIDE, "pagehide", !0));
- this._setEvent(EBG.Events.EventNames.PAGE_RESIZE, "resize");
- this._setEvent(EBG.Events.EventNames.SCREEN_ORIENTATION, "orientationchange");
- this._setEvent(EBG.Events.EventNames.MOUSE_MOVE, "mousemove", !1, ["clientX", "clientY", "pageX", "pageY", "view"], !0)
- },
- _setEvent: function(a, b, c, d, e) {
- this._environmentEvents[a] = {
- name: b,
- inCurWin: c ? c : !1
- };
- this._logicalEvents[b] = {
- name: a,
- signInAllWindows: e
- };
- if (d) {
- this._logicalEvents[b].attr = [];
- for (a = 0; a < d.length; a++) this._logicalEvents[b].attr[a] = d[a]
- }
- },
- _documentWrite: function(a) {
- document.write(a)
- },
- isPageLoaded: function() {
- if (this._isPageLoaded) return !0;
- this._isPageLoaded = EBGInfra.isDefined(window.gEBMainWindow) && EBGInfra.isDefined(gEBMainWindow.EBP) && gEBMainWindow.EBP.isPageLoaded;
- if (!this._isPageLoaded && this.getPageWin().document.readyState) this._isPageLoaded = "complete" == this.getPageWin().document.readyState;
- return EBG.adaptor._isPageLoaded
- },
- _handleEvent: function(a) {
- var b = this._logicalEvents[a.type].name;
- switch (b) {
- case EBG.Events.EventNames.PAGE_LOAD:
- this._isPageLoaded = !0;
- break;
- case EBG.Events.EventNames.PAGE_RESIZE:
- EBG.adaptor.inInnerIframe() && this.serving.rehidePlacementIframe();
- break;
- case EBG.Events.EventNames.SCREEN_ORIENTATION:
- this._handleOrientationEvent();
- return;
- case EBG.Events.EventNames.PAGE_BEFORE_UNLOAD:
- if (this.browser.isIE() && this._isPageLoaded) return
- }
- b && (b = new EBG.Events.Event(b), EBGInfra.isDefinedNotNull(this._logicalEvents[a.type].attr) &&
- this._prepareLogicalEventData(b, a, this._logicalEvents[a.type].attr), EBG.isFunc(this._listener) && this._listener.call(this._listenerBinding, b))
- },
- _handleOrientationEvent: function() {},
- _prepareLogicalEventData: function(a, b, c) {
- try {
- a.eventData = {};
- for (var d = 0; d < c.length; d++) a.eventData[c[d]] = b[c[d]]
- } catch (e) {}
- },
- _getDefaultAttributes: function(a) {
- var b = {};
- switch (a.toLowerCase()) {
- case EBG.Adaptors.TagNames.IFRAME:
- b = {
- marginheight: "0px",
- marginwidth: "0px",
- frameborder: "0",
- scrolling: "no"
- }
- }
- return b
- },
- _getDefaultStyle: function(a) {
- var b = {
- border: "0px",
- padding: "0px",
- margin: "0px"
- };
- switch (a.toLowerCase()) {
- case EBG.Adaptors.TagNames.DIV:
- EBG.mergeObj({
- top: "0px",
- left: "0px",
- overflow: "visible",
- fontSize: "0px",
- lineHeight: "0px",
- textAlign: "left"
- }, b, !0)
- }
- return b
- },
- _setObjDefaultAttributes: function(a) {
- var b = this._getDefaultAttributes(a.tagName);
- EBG.mergeObj(a.attributes, b, !0);
- b.style = this._getDefaultStyle(a.tagName);
- a.attributes.style && EBG.mergeObj(a.attributes.style, b.style, !0);
- a.attributes = b
- },
- _getObjParamsStr: function(a) {
- var a = a.params,
- b = "",
- c;
- for (c in a) a.hasOwnProperty(c) && (b += EBG.format("<PARAM name='{0}' value='{1}'>", c, a[c]));
- return b
- },
- _getObjAttributesStr: function(a) {
- var a = a.attributes,
- b = "",
- c;
- for (c in a)
- if (a.hasOwnProperty(c)) {
- var d = a[c];
- if (EBG.isObj(d)) {
- var e = d,
- d = "",
- f;
- for (f in e)
- if (e.hasOwnProperty(f)) {
- var g = e[f];
- "textAlign" == f && (f = "text-align");
- d += EBG.format("{0}:{1}; ", f, g)
- }
- }
- if (d) try {
- d = d.toString().replace(/\"/ig, """), b += EBG.format(' {0}="{1}"', c, d)
- } catch (h) {}
- }
- return b
- },
- _resizeAfterPaint: function(a, b, c) {
- b && c && EBG.runTimed(this,
- function() {
- var d = this.getElementById(a);
- this.setElemStyle(d, "width", b);
- this.setElemStyle(d, "height", c)
- }, [], 50)
- },
- handleEvent: function(a) {
- this._handleEvent(a)
- },
- setElemStyle: function(a, b, c) {
- a.style[b] = c
- },
- getBrowserLanguage: function() {
- var a = "en-US";
- if ("undefined" !== typeof navigator.language) a = navigator.language;
- else if ("undefined" !== typeof navigator.userLanguage) a = navigator.userLanguage;
- return a
- },
- getPositioningById: function(a, b, c) {
- return this.getPositioningByElement(this.getElementById(a), b, c)
- },
- getPositioningByElement: function(a,
- b, c) {
- a = a && a.getBoundingClientRect ? a.getBoundingClientRect() : null;
- if (!a) return null;
- b = this.getScrollLeftTop(b, c);
- return {
- X: Math.floor(a.left) + b.X,
- Y: Math.floor(a.top) + b.Y
- }
- },
- getScrollLeftTop: function(a, b) {
- var c = this._getCurrentWindow(a, b),
- d = c.document,
- e = {
- X: {
- "0": "XOffset",
- 1: "Left"
- },
- Y: {
- "0": "YOffset",
- 1: "Top"
- }
- },
- f;
- 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);
- return e
- },
- _getCurrentWindow: function(a) {
- try {
- return a ?
- this.getDisplayWin() : top
- } catch (b) {}
- },
- getRequestMethod: function(a) {
- return this.browser.isIE() && 6 == this.browser.getVersion() || this.isInApp() ? "GET" : 2E3 < a.length ? "POST" : "GET"
- },
- removeElement: function(a) {
- if (a = this.getElementById(a)) a.parentNode.removeChild(a), a.removeNode && a.removeNode(!0)
- },
- appendChildElement: function(a, b) {
- a && b && this.getElementById(a).appendChild(b)
- },
- getMaxZIndex: function(a) {
- if (this.browser.isIE() && 8 > this.browser.getVersion()) return 10001;
- var b = 0;
- if (a) {
- var c = this.getStyleOfElem(a);
- c && c.zIndex &&
- (b = c.zIndex);
- for (var d in a.childNodes) d && a.childNodes[d] && (c = this.getMaxZIndex(a.childNodes[d]), b = b > c ? b : c)
- }
- return b
- },
- setCookieKeyValuePair: function(a, b, c) {
- if (EBG.isDefined(a) && "" != a && EBG.isDefined(b)) b = EBG.isDefined(c) && c ? escape(b) : b, document.cookie = a + "=" + b + ";"
- },
- isSafeFrame: function() {
- return !(!window.$sf || !$sf.ext)
- },
- isInApp: function() {
- return !1
- },
- isSkype: function() {
- try {
- return !!(window.$WLXRmAd || window.parent && window.parent.$WLXRmAd)
- } catch (a) {
- return !1
- }
- },
- isReady: function() {
- return !0
- },
- getBoundingClientRect: function(a,
- b) {
- if (!a || !this.getElementById(a.id)) return null;
- var b = b || {},
- c = a.getBoundingClientRect(),
- c = {
- top: ~~c.top,
- left: ~~c.left,
- bottom: ~~c.bottom,
- right: ~~c.right
- };
- c.width = ~~c.width || c.right - c.left;
- c.height = ~~c.height || c.bottom - c.top;
- if (b.clip) try {
- var d = /rect\((.*?)px(.*?)px(.*?)px(.*?)px\)/g.exec(this.getComputedStyle(a).getPropertyValue("clip"));
- if (d) {
- for (var e = 1; e < d.length; e++) d[e] = parseFloat(d[e].replace(",", ""));
- if (0 != d[1] + d[2] + d[3] + d[4]) {
- var f = {
- top: c.top + d[1],
- left: c.left + d[4]
- };
- f.right = Math.min(f.left +
- (d[2] - d[4]), c.right);
- f.bottom = Math.min(f.top + (d[3] - d[1]), c.bottom);
- f.width = f.right - f.left;
- f.height = f.bottom - f.top;
- c = f
- }
- }
- } catch (g) {}
- if (b.relativeToTop) {
- 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(),
- d = d + i.top,
- e = e + i.left,
- h = h.parent;
- c.top += d;
- c.left += e;
- c.bottom += d;
- c.right += e
- }
- b.relativeToWindow && (h = this.getElementWindow(a), d = h.pageXOffset || h.document.documentElement.scrollLeft, e = h.pageYOffset ||
- h.document.documentElement.scrollTop, c.top += e, c.left += d, c.bottom += e, c.right += d);
- return c
- },
- getComputedStyle: function() {
- return window.getComputedStyle ? function(a, b) {
- return (this.getElementWindow(a) || window).getComputedStyle(a, b)
- } : function(a) {
- var b = {};
- b.el = a;
- b.getPropertyValue = function(b) {
- var d = /(\-([a-z]){1})/g;
- "float" == b && (b = "styleFloat");
- d.test(b) && (b = b.replace(d, function(a, b, c) {
- return c.toUpperCase()
- }));
- return a.currentStyle[b] ? a.currentStyle[b] : a.style[b] ? a.style[b] : null
- };
- return b
- }
- }(),
- isPageVisible: function(a) {
- var b = !0;
- (b = (b = this._getVisibilityEventHidden()) && document[b] ? !1 : !0) && this.browser.isIE() && this.serving.detectServingMode(!0) != EBG.Adaptors.ServingMode.IFRAME && (b = b && (this.focused || a));
- return b
- },
- _getVisibilityEventHidden: function() {
- var a = null;
- "undefined" !== typeof document.hidden ? a = "hidden" : "undefined" !== typeof document.mozHidden ? a = "mozHidden" : "undefined" !== typeof document.msHidden ? a = "msHidden" : "undefined" !== typeof document.webkitHidden && (a = "webkitHidden");
- return a
- },
- getObjKeys: function(a) {
- a = a || {};
- if (Object.keys) return Object.keys(a);
- var b = [],
- c;
- for (c in a) a.hasOwnProperty(c) && b.push(c);
- return b
- },
- isNode: function(a) {
- return "object" === typeof Node ? a instanceof Node : a && "object" === typeof a && "number" === typeof a.nodeType && "string" === typeof a.nodeName
- },
- isElement: function(a) {
- return "object" === typeof HTMLElement ? a instanceof HTMLElement : a && "object" === typeof a && null !== a && 1 === a.nodeType && "string" === typeof a.nodeName
- },
- isElementOrNode: function(a) {
- return this.isElement(a) || this.isNode(a)
- }
- };
- EBG.declareClass(EBG.Adaptors.StdWebAdaptor, null);
- EBG.Adaptors.WebAdaptor = function() {
- this._init();
- EBG.callSuperConstructor(EBG.Adaptors.WebAdaptor, this);
- EBG.adaptor && EBG.adaptor.copy(this)
- };
- EBG.Adaptors.WebAdaptor.prototype = {
- _previousWidth: -1,
- _previousHeight: -1,
- _screenOrientation: "",
- scrollBarWidth: 0,
- _isReady: !1,
- focused: !1,
- _init: function() {
- this._sendReady()
- },
- isReady: function() {
- return this._isReady
- },
- isSDKDefined: function() {
- return !1
- },
- updateScrollBarWidth: function() {
- EBG.adaptor.scrollBarWidth = EBG.adaptor.getScrollerWidth()
- },
- initInnerModules: function(a, b, c, d, e, f) {
- EBG.callSuperFunction(EBG.Adaptors.WebAdaptor, this, "initInnerModules", [a, b, c, d, e]);
- this.updateScrollBarWidth();
- if (!this.serving) this.serving =
- EBG.Adaptors.ServingMgr ? new EBG.Adaptors.ServingMgr : null;
- this.serving.noInDapIFFlag = f;
- this._addEventListener(this.getDisplayWin(), "resize", EBG.adaptor.updateScrollBarWidth)
- },
- _pageResizeHandler: function() {
- this._handleOrientationEvent()
- },
- _handleOrientationEvent: function() {
- this._checkOrientationEvent();
- EBG.runTimed(this, this._checkOrientationEvent, [], 300)
- },
- _checkOrientationEvent: function() {
- if (this.browser.isMobile() && this._isOrientationChange()) {
- this._setScreenOrientation();
- var a = new EBG.Events.Event(EBG.Events.EventNames.SCREEN_ORIENTATION);
- a.dispatcher = this;
- a.eventData = {
- screenOrientation: this._screenOrientation
- };
- EBG.eventMgr.dispatchEvent(a)
- }
- },
- registerSpecialBrowserEvents: function() {
- 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" !=
- typeof gEBMainWindow.EBP && gEBMainWindow.EBP.focused;
- EBG.eventMgr.subscribeToEvent(new EBG.Events.EventSubscription(EBG.Events.EventNames.PAGE_RESIZE, this._pageResizeHandler, this));
- this._updateInitialOrientationValues()
- },
- _updateInitialOrientationValues: function() {
- this.browser.isMobile() && this._setScreenOrientation(EBG.adaptor.serving._getTopFriendlyIframe(EBG.adaptor.getDisplayWin()))
- },
- _updateFocusOut: function() {
- EBG.runTimed(EBG.adaptor, function() {
- if (!(EBG.adaptor.getPageWin().screenTop > -2 * EBG.adaptor.getPageWin().screen.availHeight)) {
- var a =
- new EBG.Events.Event(EBG.Events.EventNames.PAGE_HIDDEN);
- a.dispatcher = EBG.adaptor;
- EBG.eventMgr.dispatchEvent(a)
- }
- }, [], 50)
- },
- _updateFocused: function() {
- EBG.adaptor.focused = !0;
- var a = new EBG.Events.Event(EBG.Events.EventNames.PAGE_VISIBLE);
- a.dispatcher = EBG.adaptor;
- EBG.eventMgr.dispatchEvent(a);
- try {
- 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)
- } catch (b) {}
- },
- _setEvents: function() {
- EBG.callSuperFunction(EBG.Adaptors.WebAdaptor, this, "_setEvents", []);
- this._setEvent(EBG.Events.EventNames.PAGE_SCROLL, "scroll");
- this._setEvent(EBG.Events.EventNames.PAGE_FOCUS, "focus");
- this._setEvent(EBG.Events.EventNames.PAGE_BLUR, "blur");
- var a = this._getVisibilityEventName();
- "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))
- },
- initServingMode: function(a,
- b, c, d) {
- b = b ? b : !1;
- switch (a) {
- case EBG.Adaptors.ServingMode.INNER_IFRAME:
- this.serving.setServingMode(EBG.Adaptors.ServingMode.INNER_IFRAME);
- break;
- case -1:
- this.serving.detectServingMode(!1);
- break;
- case 0:
- !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) :
- this.serving.setServingMode(EBG.Adaptors.ServingMode.IFRAME) : this.serving.setServingMode(EBG.Adaptors.ServingMode.TOPMOST_FRIENDLY_IFRAME) : b && this.serving.setServingMode(EBG.Adaptors.ServingMode.SCRIPT);
- break;
- case 1:
- case 2:
- this.serving.setServingMode(EBG.Adaptors.ServingMode.IFRAME)
- }
- },
- addPlaceHolder: function(a) {
- this.inInnerIframe() && (this.inject(a, EBG.Adaptors.InjectionMethod.INSERT_BEFORE, this.serving.placementIframe), this.serving.hidePlacementIframe())
- },
- getPageWin: function() {
- return this.serving &&
- this.serving.pageWin ? this.serving.pageWin : window
- },
- getDisplayWin: function() {
- return this.serving && this.serving.displayWin ? this.serving.displayWin : window
- },
- _getDocument: function() {
- return this.getDisplayWin().document
- },
- isCookiesSupported: function() {
- var a = navigator.cookieEnabled ? !0 : !1;
- if ("undefined" == typeof navigator.cookieEnabled)
- if (document.cookie = "ebTestcookie", -1 != document.cookie.indexOf("ebTestcookie")) {
- var a = !0,
- b = new Date;
- b.setTime(b.getTime() - 1E3);
- document.cookie = "ebTestcookie; expires=" + b.toGMTString()
- } else a = !1;
- return a
- },
- inInnerIframe: function() {
- return this.serving && this.serving.placementIframe
- },
- inPlacementIframe: function() {
- return this.serving && this.serving.servingMode === EBG.Adaptors.ServingMode.IFRAME
- },
- setElemStyle: function(a, b, c) {
- a.style[b] = c
- },
- setElemAttribute: function(a, b, c) {
- a[b] = c
- },
- getClipTag: function(a, b, c, d) {
- return EBG.format("rect({0}px {1}px {2}px {3}px)", a, b, c, d)
- },
- clip: function(a, b, c, d, e) {
- a.style.clip = this.getClipTag(b, c, d, e)
- },
- unclip: function(a) {
- a.style.clip = "rect(auto auto auto auto)"
- },
- expand: function(a,
- b) {
- this.setElemStyle(a, "left", EBG.px(-b.x));
- this.setElemStyle(a, "top", EBG.px(-b.y));
- this.setElemStyle(a, "width", EBG.px(b.width));
- this.setElemStyle(a, "height", EBG.px(b.height));
- this.unclip(a)
- },
- collapse: function(a, b, c) {
- b = this.getClipParams(b, c);
- this.clip(a, b.top, b.right, b.bottom, b.left)
- },
- resize: function(a, b, c) {
- this.setElemStyle(a, "width", EBG.px(b));
- this.setElemStyle(a, "height", EBG.px(c))
- },
- getClipParams: function(a, b) {
- return {
- top: a.y,
- right: a.x + b.width,
- bottom: a.y + b.height,
- left: a.x
- }
- },
- getCurrentStyleAttr: function(a,
- b) {
- var c = null;
- try {
- c = a.currentStyle ? a.currentStyle[b] : a.ownerDocument.defaultView.getComputedStyle(a, null).getPropertyValue(b)
- } catch (d) {}
- 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);
- return c
- },
- getViewPortMetrics: function() {
- return this.getWindowViewPortMetrics()
- },
- getWindowViewPortMetrics: function(a) {
- try {
- var a = a ? a : this.getDisplayWin(),
- b = a.document,
- c = {
- Height: 0,
- Width: 0
- },
- d = b.documentMode;
- if (this.browser.isIE() && (5 == d || !this.browser.isStrictType(b))) c.Width = b.body.clientWidth, c.Height = b.body.clientHeight;
- else if (this.browser.isIE()) c.Width = b.documentElement.clientWidth, c.Height = b.documentElement.clientHeight;
- else if (c.Width = a.innerWidth, c.Height = a.innerHeight, "hidden" != b.body.style.overflow) {
- if (b.body.offsetWidth > c.Width || b.body.scrollWidth > c.Width || 0 < a.scrollMaxX) c.Height -= this.scrollBarWidth;
- if (b.body.offsetHeight > c.Height || b.body.scrollHeight >
- c.Height || 0 < a.scrollMaxY) c.Width -= this.scrollBarWidth
- }
- } catch (e) {}
- return c
- },
- getPageMetrics: function(a) {
- try {
- var b = a ? a.document : this.getDisplayWin().document,
- a = {
- Height: 0,
- Width: 0
- };
- a.Height = Math.max(b.body.scrollHeight, b.documentElement.scrollHeight, b.body.offsetHeight, b.documentElement.offsetHeight, b.body.clientHeight, b.documentElement.clientHeight);
- a.Width = Math.max(b.body.scrollWidth, b.documentElement.scrollWidth, b.body.offsetWidth, b.documentElement.offsetWidth, b.body.clientWidth, b.documentElement.clientWidth);
- return a
- } catch (c) {}
- },
- saveInitialScrollBarState: function(a) {
- a.EBG = a.EBG || {};
- var b = a.document;
- a.EBG._scrollBarsInitialState = null != a.EBG._scrollBarsInitialState ? a.EBG._scrollBarsInitialState : b.body.style.overflow
- },
- showScrollBars: function(a) {
- a = a ? a : this.getDisplayWin();
- this.saveInitialScrollBarState(a);
- a.document.body.style.overflow = "auto"
- },
- hideScrollBars: function(a) {
- a = a ? a : this.getDisplayWin();
- this.saveInitialScrollBarState(a);
- a.document.body.style.overflow = "hidden"
- },
- restoreScrollBarsState: function(a) {
- var a =
- a ? a : this.getDisplayWin(),
- b = a.document;
- if (null != a.EBG._scrollBarsInitialState) b.body.style.overflow = a.EBG._scrollBarsInitialState
- },
- _getCurrentWindow: function(a, b) {
- try {
- 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
- } catch (c) {}
- },
- getPositioningById: function(a, b, c, d) {
- b = this.serving.servingMode == EBG.Adaptors.ServingMode.INNER_IFRAME ? !0 : b;
- return this.getPositioningByElement(this.getElementById(a),
- b, c, d)
- },
- getIframePosition: function() {
- var a = {
- X: 0,
- Y: 0
- };
- 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;
- return a
- },
- getPositioningByElement: function(a, b, c, d) {
- if (!a) return null;
- var b = this.serving.servingMode == EBG.Adaptors.ServingMode.INNER_IFRAME || EBG.isPreview ? !0 : b,
- e = a.getBoundingClientRect ? a.getBoundingClientRect() : null;
- if (!e) return null;
- a = Math.round(e.left);
- e = Math.round(e.top);
- if (!EBG.isDefined(d) || !d) b = this.getScrollLeftTop(b, c), a += b.X, e += b.Y;
- return {
- X: a,
- Y: e
- }
- },
- getScrollLeftTop: function(a, b) {
- a = b == EBG.Adaptors.ServingMode.IFRAME ? !0 : a;
- return EBG.callSuperFunction(EBG.Adaptors.WebAdaptor, this, "getScrollLeftTop", [a, b])
- },
- getBodyPositioning: function(a) {
- var b = this.getDisplayWin(),
- c = this.isCurrWin();
- (a = EBG.adaptor.getPositioningByElement(b.document.body, !c, a)) || (a = {
- X: 0,
- Y: 0
- });
- return a
- },
- isCurrWin: function() {
- return this.getDisplayWin() === this.getPageWin()
- },
- _calculatePositioning: function() {
- return null
- },
- getScrollerWidth: function() {
- try {
- if (EBG.adaptor.browser._platform == EBG.adaptor.browser._platformTypes.IPAD || EBG.adaptor.browser._platform == EBG.adaptor.browser._platformTypes.IPHONE) return 0;
- var a = null,
- b = null,
- c = 0,
- d = 0,
- e = 0,
- a = document.createElement("div");
- a.style.position = "absolute";
- a.style.top = "-1000px";
- a.style.left = "-1000px";
- a.style.width = "100px";
- a.style.height = "50px";
- a.style.overflow = "auto";
- b = document.createElement("div");
- b.style.width = "100%";
- b.style.height =
- "200px";
- a.appendChild(b);
- document.body.appendChild(a);
- d = b.offsetWidth;
- document.body.removeChild(document.body.lastChild);
- a.style.overflow = "hidden";
- document.body.appendChild(a);
- c = b.offsetWidth;
- document.body.removeChild(document.body.lastChild);
- return c - d ? c - d : 0
- } catch (f) {}
- },
- getResolution: function() {
- var a = 0;
- switch (window.screen.width) {
- case 640:
- a = 1;
- break;
- case 800:
- a = 2;
- break;
- case 1024:
- a = 4;
- break;
- case 1152:
- a = 8;
- break;
- case 1280:
- a = 16;
- break;
- case 1600:
- a = 32;
- break;
- case 1400:
- a = 64;
- break;
- case 1920:
- a = 128;
- break;
- case 1680:
- a =
- 256;
- break;
- case 1366:
- a = 512;
- break;
- case 1440:
- a = 1024;
- break;
- case 1360:
- a = 2048;
- break;
- case 768:
- a = 4096;
- break;
- case 1093:
- a = 8192;
- break;
- case 960:
- a = 16384;
- break;
- case 2560:
- a = 32768
- }
- return a
- },
- _handleEvent: function(a) {
- var b = this._logicalEvents[a.type].name;
- switch (b) {
- case EBG.Events.EventNames.PAGE_HIDDEN:
- case EBG.Events.EventNames.PAGE_VISIBLE:
- b = this.isPageVisible() ? EBG.Events.EventNames.PAGE_VISIBLE : EBG.Events.EventNames.PAGE_HIDDEN;
- break;
- default:
- EBG.callSuperFunction(EBG.Adaptors.WebAdaptor, this, "_handleEvent", [a]);
- return
- }
- 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))
- },
- _isOrientationChange: function() {
- var a = EBG.adaptor.serving._getTopFriendlyIframe(EBG.adaptor.getDisplayWin());
- return a.innerWidth !== this._previousWidth || a.innerHeight != this._previousHeight ? this._screenOrientation !== (a.innerHeight >=
- a.innerWidth ? EBG.Events.EventNames.PORTRAIT : EBG.Events.EventNames.LANDSCAPE) : !1
- },
- _setScreenOrientation: function(a) {
- a = a ? a : EBG.adaptor.serving._getTopFriendlyIframe(EBG.adaptor.getDisplayWin());
- this._screenOrientation = a.innerHeight >= a.innerWidth ? EBG.Events.EventNames.PORTRAIT : EBG.Events.EventNames.LANDSCAPE;
- this._previousWidth = a.innerWidth;
- this._previousHeight = a.innerHeight
- },
- getScreenOrientation: function(a) {
- ("boolean" == typeof a ? a : 1) && this._setScreenOrientation();
- return this._screenOrientation
- },
- _sendReady: function() {
- this._isReady = !0;
- var a = new EBG.Events.Event(EBG.EBMessage.ADAPTOR_READY);
- a.dispatcher = this;
- a.timing = EBG.Events.EventTiming.BEFORE;
- if (!EBG.eventMgr.dispatchEvent(a)) a.timing = EBG.Events.EventTiming.ONTIME, EBG.eventMgr.dispatchEvent(a)
- },
- getMouseCoordinates: function(a) {
- var b = {
- mouseX: 0,
- mouseY: 0
- };
- 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;
- return b
- },
- _getVisibilityEventName: function() {
- var a = null;
- "undefined" !==
- typeof document.hidden ? a = "visibilitychange" : "undefined" !== typeof document.mozHidden ? a = "mozvisibilitychange" : "undefined" !== typeof document.msHidden ? a = "msvisibilitychange" : "undefined" !== typeof document.webkitHidden && (a = "webkitvisibilitychange");
- return a
- },
- getElementWindow: function(a) {
- if (!a) return null;
- a = a.ownerDocument;
- return a.defaultView || a.parentWindow || window
- }
- };
- EBG.declareClass(EBG.Adaptors.WebAdaptor, EBG.Adaptors.StdWebAdaptor);
- EBG.Adaptors = EBG.Adaptors || {};
- EBG.Adaptors.Browser = function(a, b, c, d, e) {
- this.set(a, b, c, d, e)
- };
- EBG.Adaptors.Browser.prototype = {
- _platform: 0,
- _browserType: 0,
- _browserVer: 0,
- _browserCode: 0,
- _deviceType: 0,
- _browserTypes: EBG.API.BrowserTypes,
- _platformTypes: EBG.API.PlatformTypes,
- _deviceTypes: EBG.API.DeviceTypes,
- set: function(a, b, c, d, e) {
- a = a ? a : this._platformTypes.NON_SUPPORTED;
- b = b ? b : this._browserTypes.NON_SUPPORTED;
- e = e ? e : this._browserTypes.NON_SUPPORTED;
- this._platform = a;
- this._browserType = b;
- this._browserVer = c ? c : 0;
- this._browserCode = e;
- this._deviceType = d ? d : 0
- },
- getVersion: function() {
- return this._browserVer
- },
- getDocumentMode: function() {
- return window.document.documentMode
- },
- isIE: function() {
- return this._browserType == this._browserTypes.IE || this._browserType == this._browserTypes.AOL
- },
- isEdge: function() {
- return this._browserType == this._browserTypes.EDGE
- },
- isStrictType: function(a) {
- var b = !1;
- this.isIE() && (b = a ? "CSS1Compat" == a.compatMode : "CSS1Compat" == document.compatMode);
- return b
- },
- isFF: function() {
- return this._browserType == this._browserTypes.FF
- },
- isSafari: function() {
- return this._browserType == this._browserTypes.SAFARI
- },
- isChrome: function() {
- return this._browserType == this._browserTypes.CHROME
- },
- isOpera: function() {
- return this._browserType == this._browserTypes.OPERA
- },
- isMac: function() {
- return this._platform == this._platformTypes.MAC || this._platform == this._platformTypes.MAC_NEW || this._platform == this._platformTypes.MAC_YOSEMITE
- },
- isMobile: function() {
- var a = !1;
- if (this._deviceType == this._deviceTypes.MOBILE || this._deviceType == this._deviceTypes.TABLET) a = !0;
- return a
- },
- isiOS: function() {
- for (var a in this._platformTypes)
- if (this._platformTypes[a] == this._platform && a.match(/mac|iphone|ipad|ipod/i)) return !0;
- return !1
- },
- isAndroid: function() {
- for (var a in this._platformTypes)
- if (this._platformTypes[a] == this._platform && 0 <= a.indexOf("ANDROID")) return !0;
- return !1
- },
- isAndroidNative: function() {
- return this.isAndroid() && this.isSafari()
- },
- isThirdPartyAllowed: function() {
- return !this.isSafari() || this.isMobile()
- },
- getEnvironment: function() {
- var a = navigator.userAgent || navigator.vendor || window.opera;
- if (EBG.adaptor.browser.isMobile()) {
- if (EBG.adaptor.browser.isiOS()) {
- var b = window.navigator && window.navigator.standalone;
- return !a.match(/safari/i) &&
- !b ? EBG.WebEnvironment.IOS_WEB_VIEW : EBG.WebEnvironment.IOS_MOBILE_BROWSER
- }
- 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
- }
- return EBG.WebEnvironment.BROWSER
- }
- };
- EBG.Adaptors.ServingMode = {
- SCRIPT: "SCRIPT",
- IFRAME: "IFRAME",
- FRIENDLY_IFRAME: "FRIENDLY_IFRAME",
- INNER_IFRAME: "INNER_IFRAME",
- TOPMOST_FRIENDLY_IFRAME: "TOPMOST_FRIENDLY_IFRAME"
- };
- EBG.Adaptors.IframeMode = {
- SERVE: "SERVE",
- VERIFY: "VERIFY",
- SERVEANDVERIFY: "SERVEANDVERIFY"
- };
- EBG.Adaptors.ServingMgr = function() {
- this.displayWin = window;
- this.servingMode = EBG.Adaptors.ServingMode.SCRIPT;
- this._supportPostMessage = !!window.postMessage
- };
- EBG.Adaptors.ServingMgr.prototype = {
- noInDapIFFlag: null,
- displayWin: null,
- pageWin: null,
- placementIframe: null,
- _placementIframeAttr: null,
- servingMode: null,
- ebO: null,
- addinEyeRef: null,
- aieServerRequestPrefix: "/BurstingPipe/adServer.bs?cn=chdm&referrer=",
- aieServerRequestPrefixVersion: "&cv=2",
- setDisplayWin: function(a) {
- this.displayWin = a
- },
- setPageWin: function() {
- var a = this.detectServingMode(!0);
- switch (this.servingMode) {
- case EBG.Adaptors.ServingMode.SCRIPT:
- switch (a) {
- case EBG.Adaptors.ServingMode.SCRIPT:
- this.pageWin =
- window;
- break;
- case EBG.Adaptors.ServingMode.FRIENDLY_IFRAME:
- this.pageWin = top;
- break;
- case EBG.Adaptors.ServingMode.IFRAME:
- case EBG.Adaptors.ServingMode.INNER_IFRAME:
- this.pageWin = this.displayWin
- }
- break;
- case EBG.Adaptors.ServingMode.FRIENDLY_IFRAME:
- this.pageWin = top;
- break;
- case EBG.Adaptors.ServingMode.IFRAME:
- case EBG.Adaptors.ServingMode.TOPMOST_FRIENDLY_IFRAME:
- case EBG.Adaptors.ServingMode.INNER_IFRAME:
- this.pageWin = this.displayWin
- }
- },
- setServingMode: function(a) {
- this.servingMode = a;
- var b = null;
- switch (a) {
- case EBG.Adaptors.ServingMode.TOPMOST_FRIENDLY_IFRAME:
- b =
- this._getTopFriendlyIframe();
- break;
- case EBG.Adaptors.ServingMode.INNER_IFRAME:
- b = top;
- break;
- case EBG.Adaptors.ServingMode.FRIENDLY_IFRAME:
- b = top;
- break;
- case EBG.Adaptors.ServingMode.SCRIPT:
- this.setDisplayWin(window);
- this.setPageWin();
- return
- }
- EBG.eventMgr.subscribeToEvent(new EBG.Events.EventSubscription(EBG.Events.EventNames.PAGE_UNLOAD, this._restorePlacementIframe, this));
- b && (EBG.isGlobalDef("gstrEbDisplayPos") && (b = eval("parent." + gstrEbDisplayPos)), this.setDisplayWin(b), this.setPageWin(), b !== window && this._findPlacementIframe())
- },
- isFIF: function(a) {
- if (this.noInDapIFFlag) return !1;
- var b = "inFIF" in a ? a.inFIF : !1;
- return ("inDapIF" in a ? a.inDapIF : !1) || b
- },
- detectServingMode: function(a) {
- try {
- for (var b = EBG.Adaptors.ServingMode.SCRIPT, c = window; c !== c.parent && c.self !== c.parent;) {
- var d = null;
- try {
- d = EBG.adaptor.getHostName(c.parent)
- } catch (e) {}
- 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;
- else {
- b =
- EBG.Adaptors.ServingMode.IFRAME;
- break
- }
- }
- if (a) return b;
- this.setServingMode(b)
- } catch (f) {}
- },
- detectServingEnvironment: function(a) {
- a = EBG.isDefinedNotNull(a) ? a : this.detectServingMode(!0);
- if (this.servingMode == EBG.Adaptors.ServingMode.INNER_IFRAME || this.servingMode == EBG.Adaptors.ServingMode.IFRAME && EBG.isDefinedNotNull(this.addinEyeRef)) a = EBG.Adaptors.ServingMode.INNER_IFRAME;
- var b = this._getTopFriendlyIframe(window);
- if (window != b && b != top) a = EBG.Adaptors.ServingMode.TOPMOST_FRIENDLY_IFRAME;
- return a
- },
- _getTopFriendlyIframe: function(a) {
- a =
- a ? a : window;
- if (EBG.adaptor.isSafeFrame()) return a;
- for (; a !== a.parent && a.self !== a.parent;) {
- var b = null;
- try {
- b = EBG.adaptor.getHostName(a.parent)
- } catch (c) {}
- 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;
- else break
- }
- return a
- },
- _restorePlacementIframe: function() {
- this._placementIframeAttr && (EBGInfra.mergeObj(this._placementIframeAttr, this.placementIframe, !0), EBGInfra.mergeObj(this._placementIframeAttr.style,
- this.placementIframe.style, !0))
- },
- hidePlacementIframe: function() {
- var a = this.placementIframe;
- if (!this._placementIframeAttr) this._placementIframeAttr = {
- width: a.width,
- height: a.height
- }, this._placementIframeAttr.style = {
- width: EBG.adaptor.getCurrentStyleAttr(a, "width"),
- height: EBG.adaptor.getCurrentStyleAttr(a, "height"),
- visibility: EBG.adaptor.getCurrentStyleAttr(a, "visibility"),
- border: EBG.adaptor.getCurrentStyleAttr(a, "border")
- };
- a.style.visibility = "hidden";
- a.width = a.height = 0;
- a.style.width = a.style.height = a.style.border =
- "0px"
- },
- rehidePlacementIframe: function() {
- this._placementIframeAttr && this.hidePlacementIframe()
- },
- handleAieServing: function(a) {
- this.ebO = EBG.cloneObj(a);
- if (EBG.adaptor.browser.isIE() && 9 > EBG.adaptor.browser.getVersion()) try {
- delete this.ebO.ut, delete this.ebO.fru
- } catch (b) {
- this.ebO.ut = "", this.ebO.fru = ""
- }
- if (EBG.iframeLocation) this._handleAddInEyeServerResponse('{"iflExists":1,"iflCheck":0}');
- else if (a.aiE && EBG.isDefined(a.aiE.iflExists)) this._handleAddInEyeServerResponse(JSON.stringify(a.aiE));
- else {
- var c =
- encodeURIComponent(document.referrer || document.location.href);
- 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)
- }
- },
- _handleAddInEyeServerResponse: function(a, b) {
- var c;
- try {
- c = !b && a ? JSON.parse(a) : {
- iflExists: 0,
- iflCheck: 1
- }
- } catch (d) {
- c = {
- iflExists: 0,
- iflCheck: 1
- }
- }
- this.ebO.aiE = c;
- if (!this.ebO.dmn) this.ebO.dmn =
- c.Domain ? c.Domain : this._ebGetHostName(document.referrer);
- if (c && c.iflExists) this.insertInnerIframe(this.ebO.phid, c.iflCheck ? EBG.Adaptors.IframeMode.SERVEANDVERIFY : EBG.Adaptors.IframeMode.SERVE);
- else {
- this.ebO.ifrm = 0;
- this.ebO.adConfig.showAieDefaultImage = 1;
- var e = new EBG.Events.Event(EBG.Events.EventNames.AIE_LOADED);
- e.eventData = {
- loadDefault: this.ebO.adConfig.showAieDefaultImage,
- currentResponse: this.ebO
- };
- e.timing = EBG.Events.EventTiming.BEFORE;
- EBG.eventMgr.dispatchEvent(e);
- c.iflCheck && this.insertInnerIframe(this.ebO.phid,
- EBG.Adaptors.IframeMode.VERIFY)
- }
- },
- insertInnerIframe: function(a, b) {
- this._supportPostMessage ? (this._initPmMessages(b), this.listenToMessages()) : this._startHashProtocol(b);
- var c = {
- tagName: EBG.Adaptors.TagNames.IFRAME,
- attributes: {
- id: "addineyeIframe",
- src: this._getAddineyeLocation(),
- style: {
- display: ebO.ffs.CFF_addineyeDispNone ? "none" : "block"
- },
- width: "0",
- height: "0"
- }
- };
- EBG.adaptor.addInlineDOM(c, a);
- this.addinEyeRef = EBG.adaptor.getElementById("addineyeIframe");
- this._supportPostMessage || this._sendMessageHashProtocol()
- },
- _getAddineyeLocation: function() {
- var a = "eyeblaster/addineyeV2" + ("https://" == EBG.protocol ? "-secure" : "") + ".html";
- this._getTopFriendlyIframe();
- if (EBG.iframeLocation) a = EBG.iframeLocation;
- if ("http" != a.substr(0, 4)) {
- var b = this.ebO.dmn;
- if (!b) return "";
- a = EBG.protocol + b + "/" + a
- }
- return a
- },
- _buildSecretTagsObj: function() {
- return {
- gstrEbPreLoadScripts: EBG.isGlobalDef("gstrEbPreLoadScripts") ? gstrEbPreLoadScripts : void 0,
- gnEbLowBWLimit: EBG.isGlobalDef("gnEbLowBWLimit") ? gnEbLowBWLimit : void 0,
- gstrEbPreLoadScripts: EBG.isGlobalDef("gstrEbPreLoadScripts") ?
- gstrEbPreLoadScripts : void 0,
- gfEbInlineBanner: EBG.isGlobalDef("gfEbInlineBanner") ? gfEbInlineBanner : void 0,
- gEbEyeDivRefElement: EBG.isGlobalDef("gEbEyeDivRefElement") ? gEbEyeDivRefElement : void 0,
- gstrEbDisplayPos: EBG.isGlobalDef("gstrEbDisplayPos") ? gstrEbDisplayPos : void 0,
- gnEbMinZIndex: EBG.isGlobalDef("gnEbMinZIndex") ? gnEbMinZIndex : void 0,
- gfEbForceStreaming: EBG.isGlobalDef("gfEbForceStreaming") ? gfEbForceStreaming : void 0,
- gfEbUseIntFlash: EBG.isGlobalDef("gfEbUseIntFlash") ? gfEbUseIntFlash : void 0,
- gEbfLoadAsAS2: EBG.isGlobalDef("gEbfLoadAsAS2") ?
- gEbfLoadAsAS2 : void 0,
- gEbURLTokens: EBG.isGlobalDef("gEbURLTokens") ? gEbURLTokens : void 0
- }
- },
- _startHashProtocol: function(a) {
- this._hashMessages = [];
- if (a == EBG.Adaptors.IframeMode.VERIFY || a == EBG.Adaptors.IframeMode.SERVEANDVERIFY) this._hashMessages.push(this._buildHashMessages({
- ebProtocol: ebPtcl,
- ebBs: this.ebO.bs,
- addineyeDomain: this.ebO.dmn
- }, EBG.INNERIFRAMEMessage.VERIFY, a == EBG.Adaptors.IframeMode.VERIFY ? EBG.INNERIFRAMEMessage.LASTMSG : EBG.INNERIFRAMEMessage.NOT_LASTMSG));
- if (a == EBG.Adaptors.IframeMode.SERVE ||
- a == EBG.Adaptors.IframeMode.SERVEANDVERIFY) {
- var a = {
- ebPtcl: ebPtcl,
- ebBigS: ebBigS,
- ebResourcePath: this.ebO && this.ebO.adConfig && this.ebO.adConfig.resourcePath ? this.ebO.adConfig.resourcePath : ebResourcePath,
- ebRand: ebRand,
- ebPli: ebPli,
- ebAdID: ebAdID
- },
- b = {
- ptcl: ebPtcl,
- bs: ebO.bs,
- adId: ebO.adConfig.adId
- },
- c = this._buildSecretTagsObj();
- this.ebO.adConfig = this.ebO.tn != EBG.adTypes.VisibilityAd ? null : {
- tn: ebO.adConfig.tn,
- rnd: ebO.adConfig.rnd,
- adId: ebO.adConfig.adId,
- uid: ebO.adConfig.adId + "_" + ebO.adConfig.rnd
- };
- this._hashMessages.push(this._buildHashMessages(b,
- EBG.INNERIFRAMEMessage.ADCONFIG_REQUEST));
- this._hashMessages.push(this._buildHashMessages(this.ebO, EBG.INNERIFRAMEMessage.EBO));
- this._hashMessages.push(this._buildHashMessages(a, EBG.INNERIFRAMEMessage.GLOBALPARAMS, EBG.INNERIFRAMEMessage.NOT_LASTMSG));
- this._hashMessages.push(this._buildHashMessages(c, EBG.INNERIFRAMEMessage.SECRET_TAGS, EBG.INNERIFRAMEMessage.LASTMSG))
- }
- EBG.msgProtocol.postMessage("", window.location.href, window);
- EBG.msgProtocol.receiveMessages(this._handleMessagesHashProtocol, 10)
- },
- _buildHashMessages: function(a,
- b, c) {
- a.typeObj = b;
- a.lastMsg = c ? c : EBG.INNERIFRAMEMessage.NOT_LASTMSG;
- a.parentURL = document.location.href;
- return escape(JSON.stringify(a))
- },
- _sendMessageHashProtocol: function() {
- EBG.msgProtocol.postMessage(EBG.adaptor.serving._hashMessages[0], EBG.adaptor.serving.addinEyeRef.src, EBG.adaptor.serving.addinEyeRef);
- EBG.adaptor.serving._hashMessages.splice(0, 1);
- 0 == EBG.adaptor.serving._hashMessages.length && EBG.msgProtocol.finishMessaging()
- },
- listenToMessages: function() {
- EBG.pm.bind(EBG.INNERIFRAMEMessage.LOADED,
- this._handlePostMessage, this)
- },
- _ebGetHostName: function(a) {
- var b = "",
- a = a.toLowerCase(),
- b = 7 <= a.length && "http://" == a.substr(0, 7) ? a.substr(7) : 8 <= a.length && "https://" == a.substr(0, 8) ? a.substr(8) : a,
- a = b.indexOf("/");
- 0 < a && (b = b.substr(0, a));
- return b
- },
- _findPlacementIframe: function() {
- try {
- var a = this.displayWin,
- b = window,
- c = null,
- d = -1;
- do {
- var d = -1,
- c = null,
- e = b.parent.frames;
- if (!EBG.isDefined(e.length))
- for (var f = b.parent.document.getElementsByTagName(EBG.Adaptors.TagNames.IFRAME), e = [], g = 0; g < f.length; g++) e.push(f[g].contentWindow);
- for (g = 0; g < e.length; g++) try {
- if (e[g] == b) {
- d = g;
- c = b;
- break
- }
- } catch (h) {}
- b = b.parent
- } while (b != a);
- if (!(0 <= d)) throw new exception("ServingMgr._findPlacementIframe", "Could not find placement iframe!");
- b = null;
- try {
- if ("undefined" != typeof c.frameElement) b = c.frameElement
- } catch (i) {}
- if (!b) {
- for (var j = a.document.getElementsByTagName(EBG.Adaptors.TagNames.IFRAME), g = 0; g < j.length; g++) j[g].contentWindow == c && (d = g);
- if (d >= j.length) throw new exception("ServingMgr._findPlacementIframe", EBG.format("frames List is too short ({0}). Needed frame is {1}",
- j.length, d));
- b = j[d]
- }
- this.placementIframe = b
- } catch (k) {}
- },
- _handleMessagesHashProtocol: function(a) {
- switch (a.data) {
- case EBG.INNERIFRAMEMessage.CONTINUE_SENDING:
- EBG.adaptor.serving._sendMessageHashProtocol()
- }
- },
- _handlePostMessage: function(a) {
- a && a == EBG.INNERIFRAMEMessage.LOADED && EBG.adaptor.serving._sendInitToInnerIframe()
- },
- _sendInitToInnerIframe: function() {
- for (var a = 0; a < EBG.adaptor.serving._pmMessages.length; a++) EBG.pm({
- target: this.addinEyeRef.contentWindow,
- type: EBG.adaptor.serving._pmMessages[a].msgType,
- data: EBG.adaptor.serving._pmMessages[a].data
- });
- EBG.adaptor.serving._pmMessages = {}
- },
- _initPmMessages: function(a) {
- this._pmMessages = [];
- (a == EBG.Adaptors.IframeMode.VERIFY || a == EBG.Adaptors.IframeMode.SERVEANDVERIFY) && this._pmMessages.push({
- msgType: EBG.INNERIFRAMEMessage.VERIFY,
- data: {
- ebProtocol: ebPtcl,
- ebBs: this.ebO.bs,
- addineyeDomain: this.ebO.dmn
- }
- });
- if ((a == EBG.Adaptors.IframeMode.SERVE || a == EBG.Adaptors.IframeMode.SERVEANDVERIFY) && EBG.adaptor.serving.ebO) a = {
- ebO: EBG.adaptor.serving.ebO,
- ebPtcl: ebPtcl,
- ebBigS: ebBigS,
- ebResourcePath: this.ebO && this.ebO.adConfig && this.ebO.adConfig.resourcePath ? this.ebO.adConfig.resourcePath : ebResourcePath,
- ebRand: ebRand,
- secretTagData: this._buildSecretTagsObj(),
- ebPli: ebPli,
- ebAdID: ebAdID
- }, this._pmMessages.push({
- msgType: EBG.INNERIFRAMEMessage.INIT,
- data: a
- })
- }
- };
- EBG.Adaptors.FlashDetector = function() {
- this._init();
- this._customScript = !!window.ebAdCS
- };
- EBG.Adaptors.FlashDetector.prototype = {
- version: 0,
- checkingBlock: !1,
- checkedBlock: !1,
- isBlocked: null,
- _flashPlayerVersion: null,
- _detectionPixelTimeout: null,
- _throttleTimeout: null,
- _detectionPixelTimeoutDuration: 2E3,
- _init: function() {
- var a = -1;
- try {
- a = (new ActiveXObject("Shockwaveflash.Shockwaveflash.7")).GetVariable("$version"), a = this._splitFlashMajorMinorVersions(a), a = Number(a)
- } catch (b) {}
- if (-1 == a) try {
- var c = 0,
- d = 0,
- e = 0;
- if (null != navigator.plugins && 0 < navigator.plugins.length) {
- var f = navigator.mimeTypes;
- if (f && f["application/x-shockwave-flash"] &&
- f["application/x-shockwave-flash"].enabledPlugin && f["application/x-shockwave-flash"].enabledPlugin.description) {
- var g = f["application/x-shockwave-flash"].enabledPlugin.description.split(" "),
- h = g[2].split("."),
- c = h[0],
- d = h[1],
- e = g[3];
- "" == e && (e = g[4]);
- isNaN(e[0]) && (e = e.substring(1));
- 0 < e.indexOf("d") && (e = e.substring(0, e.indexOf("d")))
- }
- a = Number(c + "." + d + e)
- }
- } catch (i) {}
- if (!isNaN(a)) this.version = a
- },
- _splitFlashMajorMinorVersions: function(a) {
- if (a) return a = a.split(" ")[1].split(","), EBG.format("{0}.{1}{2}", a[0],
- a[1], a[2])
- },
- _handlePixelMessage: function(a) {
- clearTimeout(this._detectionPixelTimeout);
- this._detectionPixelTimeout = null;
- this.flashPlayerVersion = a;
- this.isBlocked = !1;
- EBG.runTimed(this, this._dispatchFlashDetected, [], 10)
- },
- _handleDetectionPixelTimeout: function(a) {
- var b = EBG.adaptor.browser.isFF() || EBG.adaptor.isPageVisible(),
- c = EBG.adaptor.hasHiddenParent(EBG.adaptor.getElementById("ebFlashDetection"));
- if (b && a && !c) {
- this.checkedBlock = !0;
- this.checkingBlock = !1;
- a = EBG.adaptor.getDisplayWin();
- if (a.EBG && a.EBG !=
- EBG && a.EBG.adaptor.flash && EBG.isDefinedNotNull(a.EBG.adaptor.flash.flashPlayerVersion)) this.flashPlayerVersion = a.EBG.adaptor.flash.flashPlayerVersion;
- this.isBlocked = !this.flashPlayerVersion;
- this._dispatchFlashDetected();
- clearTimeout(this._detectionPixelTimeout);
- this._detectionPixelTimeout = null
- } else clearTimeout(this._detectionPixelTimeout), this._detectionPixelTimeout = EBG.runTimed(this, this._handleDetectionPixelTimeout, [b], this._detectionPixelTimeoutDuration)
- },
- _dispatchFlashDetected: function() {
- this.checkedBlock = !0;
- this.checkingBlock = !1;
- var a = new EBG.Events.Event(EBG.Events.EventNames.FLASH_DETECTED);
- a.dispatcher = this;
- a.eventData = {
- isBlocked: this.isBlocked,
- versionStr: this.flashPlayerVersion,
- versionInt: this.version
- };
- EBG.eventMgr.dispatchEvent(a);
- EBG.adaptor.removeElement("ebFlashDetectionDiv")
- },
- _buildRenderPixelJson: function() {
- var a = {
- play: "true",
- resId: "ebFlashDetection",
- resPath: ebBigS + "/Res/Assets/Pixel" + EBG.flashPixelVer + "/pixel.swf",
- unique: 0,
- wmode: "opaque",
- tagName: EBG.Adaptors.TagNames.OBJECT,
- attributes: {
- id: "ebFlashDetection",
- dir: "ltr",
- name: "ebFlashDetection",
- style: {
- position: "absolute",
- textAlign: "left",
- width: "1px",
- height: "1px"
- },
- codebase: EBG.format("{0}download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#", EBG.protocol),
- version: "9,0,0,0"
- },
- params: {
- play: "true",
- wmode: "opaque",
- menu: "false",
- flashVars: "id=ebFlashDetection",
- allowScriptAccess: "always",
- allowFullScreen: "true"
- }
- };
- this.isSupportShockwave() ? (a.attributes.type = "application/x-shockwave-flash", a.attributes.data = a.resPath) : (a.attributes.classid = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
- a.params.movie = a.resPath);
- return a
- },
- _createScriptTag: function() {
- var a = EBG.format("function {0}(args)", "DoFS_FlashDetectionPixel"),
- 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");
- return {
- tagName: EBG.Adaptors.TagNames.SCRIPT,
- text: a
- }
- },
- _handleThrottleEvent: function(a) {
- a && a.state && (a.state ==
- 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))
- },
- _verifyThrottleDetectLocation: function(a) {
- if (a.elemId && a.id) {
- var b = EBG.adaptor.getBoundingClientRect(EBG.adaptor.getElementById(a.elemId)),
- c = EBG.adaptor.getElementById(a.id),
- d = EBG.adaptor.getBoundingClientRect(c);
- if (b && d && EBG.isNumber(b.width) &&
- EBG.isNumber(d.width))
- if (0 == b.width || 0 == b.height) EBG.runTimed(this, this._verifyThrottleDetectLocation, [a], 30);
- else {
- if (EBG.serializeObject(b) != EBG.serializeObject(d)) {
- var e = parseInt(c.style.marginTop, 10),
- f = parseInt(c.style.marginLeft, 10);
- c.style.marginTop = EBG.px(e - (d.top - b.top));
- c.style.marginLeft = EBG.px(f - (d.left - b.left));
- c.style.width = EBG.px(b.width);
- c.style.height = EBG.px(b.height)
- }
- this._customScript && (b = (b = a.adUId && EBG.ads[a.adUId]) && b._CCs && b._CCs[a.elemId]) && EBG.RichFlashPanelCC && b instanceof
- EBG.RichFlashPanelCC && EBG.runTimed(this, this._verifyThrottleDetectLocation, [a], 250)
- }
- }
- },
- _setThrottleState: function(a) {
- if (a.adUId) {
- var b = new EBG.Events.Event(EBG.Events.EventNames.THROTTLED),
- c = a.adUId.split("_")[1];
- b.dispatcher = {
- _adConfig: {
- rnd: c,
- uid: a.adUId
- }
- };
- b.eventData = a;
- EBG.eventMgr.dispatchEvent(b)
- }
- },
- removeThrottleDetectionSwf: function(a) {
- EBG.adaptor.removeElement("ebFlashThrottleDetection_" + a)
- },
- isSupportShockwave: function() {
- var a = !0;
- if (EBG.adaptor.browser.isIE() && 11 > EBG.adaptor.browser.getVersion() ||
- 10 < EBG.adaptor.browser.getVersion() && 9 > EBG.adaptor.getDisplayWin().document.documentMode) a = !1;
- return a
- },
- doFlashBlockDetection: function(a) {
- this.checkingBlock = !0;
- var b = {
- tagName: EBG.Adaptors.TagNames.DIV,
- attributes: {
- id: "ebFlashDetectionDiv",
- style: {
- width: "0px",
- height: "0px"
- }
- },
- children: [this._buildRenderPixelJson(), this._createScriptTag()]
- };
- 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,
- a);
- this._detectionPixelTimeout = EBG.runTimed(this, this._handleDetectionPixelTimeout, [], this._detectionPixelTimeoutDuration)
- },
- getFlashVersionForBlockingDetection: function() {
- var a = 0;
- try {
- if (!(document.documentMode || navigator.appName && "Opera" == navigator.appName)) {
- var b = navigator.mimeTypes;
- if (b && b["application/x-shockwave-flash"] && b["application/x-shockwave-flash"].enabledPlugin && b["application/x-shockwave-flash"].enabledPlugin.version) {
- var c = b["application/x-shockwave-flash"].enabledPlugin.version,
- d = c.split(".");
- if (18 > d[0] || 18 == d[0] && 209 > d[3]) a = 20
- } 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
- }
- } catch (e) {}
- return a
- }
- };
- EBG.Adaptors.Wallpaper = function() {
- this._currentBg = this._getCurrentBackground()
- };
- EBG.Adaptors.Wallpaper.prototype = {
- SetBackgroundImage: function(a) {
- var b = EBG.adaptor.getPageWin().document;
- if (a.imgSrc) {
- if (!a.color) a.color = this._currentBg.color ? this._currentBg.color : "transparent";
- var c = a.color,
- c = c + (" url('" + a.imgSrc + "') ");
- 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";
- var c = c + (" " + a.tiling),
- c = a.scrolling ?
- c + " scroll" : c + " fixed",
- d = "";
- "center" == a.positionX.toLowerCase() || "right" == a.positionX.toLowerCase() || "left" == a.positionX.toLowerCase() ? d = a.positionX.toLowerCase() : a.positionX = "";
- "center" == a.positionY.toLowerCase() || "top" == a.positionY.toLowerCase() || "bottom" == a.positionY.toLowerCase() ? d += " " + a.positionY.toLowerCase() : a.positionY = "";
- if (!a.positionX || !a.positionY) d = b.body.style.backgroundPosition ? b.body.style.backgroundPosition : "center top";
- b.body.style.background = c + (" " + d)
- }
- },
- RemoveBackgroundImage: function() {
- this._currentBg.imgSrc ?
- this.SetBackgroundImage(this._currentBg) : EBG.adaptor.getPageWin().document.body.style.background = ""
- },
- _getCurrentBackground: function() {
- var a = new EBG.Adaptors.Wallpaper.BgData,
- b = EBG.adaptor.getPageWin().document.body;
- if ("" != b.style.backgroundImage) a.imgSrc = b.style.backgroundImage.substr(4, b.style.backgroundImage.length - 5);
- if ("" != b.style.backgroundColor) a.color = b.style.backgroundColor;
- if ("" != b.style.backgroundRepeat) a.tiling = b.style.backgroundRepeat;
- if ("" != b.style.backgroundAttachment) a.scrolling = "fixed" ==
- b.style.backgroundAttachment ? !1 : !0;
- if ("" != b.style.backgroundPosition) posArr = b.style.backgroundPosition.split(" "), a.positionX = posArr[0], a.positionY = posArr[1];
- return a
- }
- };
- EBG.Adaptors.Wallpaper.BgData = function() {};
- EBG.Adaptors.Wallpaper.BgData.prototype = {
- color: "",
- imgSrc: "",
- tiling: "",
- positionX: "",
- positionY: "",
- scrolling: !1,
- contentWidth: null
- };
- EBG.declareNamespace("Interactions");
- EBG.Interactions.SystemInts = {
- CLICK: "_eyeblaster",
- AD_DURATION: "ebAdDuration",
- REPLAY: "ebReplay",
- CLOSE: "ebClose",
- CLOSE_REM: "ebRemClose",
- DEFAULT_CLICK: "ebDefaultClick",
- USER_INTERACTION: "ebUserInteraction",
- UNIQUE_VIDEO_STARTED: "ebUniqueVideoStarted",
- DWELL_TIME: "ebDwellTime",
- DWELL_UNIQUE: "ebUniqueDwell",
- RICH_FLASH_PLAYED: "ebRichFlashPlayed",
- INT_DURATION: "ebIntDuration",
- VISIBILITY_RECORDABLE: "VsR",
- VISIBILITY_AGENCY_RECORDABLE: "VsRAg",
- VISIBILITY_ADVERTISER_RECORDABLE: "VsRAd",
- VISIBILITY_ADVERTISER: "VsAd",
- VISIBILITY_AGENCY: "VsAg",
- VISIBILITY_IAB: "VsIAB",
- VISIBILITY_ADVERTISER_DURATION: "VsAdDu",
- VISIBILITY_AGENCY_DURATION: "VsAgDu",
- VISIBILITY_AVG_AD_SURFACE: "VsAvSu",
- VISIBILITY_AVG_SCREEN_SHARE: "VsAvSc",
- REM_DURATION: "ebRemDuration",
- INTRO_FULL_PLAY: "ebFullPlay",
- REM_FULL_PLAY: "ebRemFullPlay",
- SWIPE: "ebSwipe",
- AD_START: "AdStart",
- AD_STACKING: "AdStacking",
- MULTI_BURN: "MultiBurn",
- AD_COLLISION: "AdCollision",
- AD_CAROUSEL: "AdCarousel",
- AD_PARAMS: "AdParams",
- PLAYER_PARAMS: "plparams",
- VER_URL: "verURL"
- };
- 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];
- EBG.Interactions.Categories = {
- SYSTEM: 2,
- VIDEO: 1,
- CUSTOM: 0
- };
- EBG.Interactions.InitiationTypes = {
- AUTO: "auto",
- USER: "user"
- };
- EBG.Interactions.InteractionTypes = {
- COUNTER: "Counter",
- TIMER: "Timer"
- };
- EBG.Interactions.checkURL = function(a) {
- 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);
- return a
- };
- EBG.Interactions.RemoteServersData = function() {};
- EBG.Interactions.RemoteServersData.prototype = {
- networkUrl: null,
- agencyUrl: null
- };
- EBG.declareClass(EBG.Interactions.RemoteServersData, null);
- EBG.Interactions.InteractionData = function(a, b, c) {
- this.reportingName = a;
- this.adUId = b;
- this.category = c
- };
- EBG.Interactions.InteractionData.prototype = {
- initiationType: EBG.Interactions.InitiationTypes.AUTO,
- category: EBG.Interactions.Categories.SYSTEM,
- isPanel: !1
- };
- EBG.declareClass(EBG.Interactions.InteractionData, null);
- EBG.Interactions.CounterInteractionData = function(a, b, c) {
- EBG.callSuperConstructor(EBG.Interactions.CounterInteractionData, this, [a, c, b]);
- this.remoteServers = new EBG.Interactions.RemoteServersData
- };
- EBG.Interactions.CounterInteractionData.prototype = {
- reportImmediately: !1,
- countAsClick: !1,
- remoteServers: null,
- clickURL: null,
- numLeftToReport: 10,
- state: null
- };
- EBG.declareClass(EBG.Interactions.CounterInteractionData, EBG.Interactions.InteractionData);
- EBG.Interactions.TimerInteractionData = function(a, b, c) {
- this.reportingName = a;
- EBG.callSuperConstructor(EBG.Interactions.TimerInteractionData, this, [a, c, b])
- };
- EBG.Interactions.TimerInteractionData.prototype = {
- value: 0,
- startTime: 0,
- idleDuration: 0
- };
- EBG.declareClass(EBG.Interactions.TimerInteractionData, EBG.Interactions.InteractionData);
- EBG.Interactions.AggregationInteractionData = function(a, b, c) {
- this.reportingName = a;
- EBG.callSuperConstructor(EBG.Interactions.AggregationInteractionData, this, [a, c, b])
- };
- EBG.Interactions.AggregationInteractionData.prototype = {
- value: 0,
- isPlaying: !1
- };
- EBG.declareClass(EBG.Interactions.AggregationInteractionData, EBG.Interactions.InteractionData);
- EBG.declareNamespace("Utilities.InteractionUtil");
- EBG.Utilities.InteractionUtil = function() {};
- EBG.Utilities.InteractionUtil.prototype = {
- getBannerRedirectUrl: function(a) {
- if (!a || !a.adConfig) return "";
- 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));
- EBGInfra.isDefinedNotNull(a.clickVal) && (b += "&clk=" + a.clickVal);
- !a.adConfig.isPreview && !a.isClickTag && (b += "&sct=1");
- if (a.adConfig.massVersioning) {
- if (a.adConfig.massVersioning.adVersions || a.adConfig.massVersioning.defaultAdVersion) a.sClickedVersion ?
- b += "&vid=" + a.sClickedVersion + "&vcl=1" : a.versionToReport && (b += "&vid=" + a.versionToReport);
- a.adConfig.massVersioning.targetAudienceId && (b += "&ta=" + a.adConfig.massVersioning.targetAudienceId);
- a.adConfig.massVersioning.deliveryGroupId && (b += "&dg=" + a.adConfig.massVersioning.deliveryGroupId);
- a.adConfig.massVersioning.versionTargetAudienceId && (b += "&tav=" + a.adConfig.massVersioning.versionTargetAudienceId);
- a.adConfig.massVersioning.dgTargetAudienceId && (b += "&tadg=" + a.adConfig.massVersioning.dgTargetAudienceId);
- a.adConfig.massVersioning.originalDeliveryGroupId && (b += "&dgo=" + a.adConfig.massVersioning.originalDeliveryGroupId)
- }
- a.sJumpUrl && (b += "&rtu=" + encodeURIComponent(a.sJumpUrl));
- a.cvurl && (b += EBG.format("&cvurl={0}", encodeURIComponent('"' + a.cvurl.split("|").join('","') + '"')));
- a.fIsDefClick = EBG.isBool(a.fIsDefClick) ? a.fIsDefClick : !1;
- a.fIsDefClick || (b += "&di=0");
- EBGInfra.isDefinedNotNull(a.adConfig.sPublisherPlacementId) && (b += "&pc=" + a.adConfig.sPublisherPlacementId);
- EBGInfra.isDefinedNotNull(a.adConfig.sID) &&
- (b += "&sessionid=" + a.adConfig.sID);
- a.adConfig.usercookie && (b += "&usercookie=" + a.adConfig.usercookie);
- EBGInfra.isDefinedNotNull(a.adConfig.optOut) && (b += "&OptOut=" + a.adConfig.optOut);
- EBGInfra.isDefinedNotNull(a.adConfig.ncu) && (b += "&ncu=" + encodeURIComponent(a.adConfig.ncu));
- EBGInfra.isDefinedNotNull(a.adConfig.ebReferrer) && (b += "&ebReferrer=" + encodeURIComponent(a.adConfig.ebReferrer));
- EBGInfra.isDefinedNotNull(a.adConfig.lineId) && (b += "&lineid=" + encodeURIComponent(a.adConfig.lineId));
- EBGInfra.isDefinedNotNull(a.adConfig.diAppId) &&
- (b += "&diappid=" + a.adConfig.diAppId);
- return b
- }
- };
- EBG.declareClass(EBG.Utilities.InteractionUtil, null);
- EBG.InteractionUtil = EBG.InteractionUtil || new EBG.Utilities.InteractionUtil;
- EBG.Interactions.Interaction = function() {};
- EBG.Interactions.Interaction.prototype = {
- unique: 1,
- _escapeInteractionName: function(a) {
- a = a.toString();
- a = a.replace(/\~/ig, "_");
- a = a.replace(/\^/ig, "_");
- a = a.replace(/\|/ig, "_");
- return escape(a)
- },
- _buildReportFormat: function(a, b, c, d) {
- d || (d = 0);
- 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,
- this.interactionData.isPanel ? 1 : 0)
- }
- };
- EBG.Interactions.CounterInteraction = function(a) {
- EBG.callSuperConstructor(EBG.Interactions.CounterInteraction, this);
- this.interactionData = a ? a : new EBG.Interactions.CounterInteractionData
- };
- EBG.Interactions.CounterInteraction.prototype = {
- type: EBG.Interactions.InteractionTypes.COUNTER,
- handle: function(a) {
- var b = this.interactionData,
- c = b.counterJumpUrlData,
- d = c && c.tmpData ? c.tmpData.isClick : !1,
- e = c && c.tmpData ? c.tmpData.isProductClick : !1,
- f = !1,
- g = !0,
- h = !1,
- h = "",
- i = (c && c.tmpData ? c.tmpData.clickUrl : null) || (c ? c.jumpUrl : ""),
- j = c && c.tmpData && c.tmpData.windowWasOpen ? !0 : !1,
- c = !j;
- this.interactionData.adConfig.ffs.CFF_openWindowParam && (c = c && this.interactionData.adConfig.openWindow);
- this.shouldReportInteraction() ?
- (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));
- return h
- },
- reportThirdPartyUrls: function() {
- var a = this.interactionData.reportingName.toLowerCase() == EBG.Interactions.SystemInts.DEFAULT_CLICK.toLowerCase(),
- b = this.interactionData.counterJumpUrlData,
- c = [];
- if (b && b.tmpData && b.tmpData.isClick && (c = this.interactionData.adConfig.clickTrackingUrls, a || this.interactionData.adConfig.showOnlyImage))
- for (a = 0; a < this.interactionData.adConfig.defaultClickTrackingUrls.length; a++) c[c.length] = this.interactionData.adConfig.defaultClickTrackingUrls[a];
- if (b && b.tmpData && b.tmpData.isProductClick && b.tmpData.clickedVerUrl) c[c.length] = b.tmpData.clickedVerUrl;
- for (a = 0; a < c.length; a++) EBG.adaptor.reportToRemoteServerUsingImage(c[a])
- },
- shouldReportInteraction: function() {
- var a = !0;
- 0 == this.interactionData.numLeftToReport || EBG.isPreview || EBG.isInWorkshop ? a = !1 : this.interactionData.numLeftToReport--;
- return a
- },
- handleBRDFlow: function() {
- var a = this.interactionData,
- b = this.interactionData.counterJumpUrlData,
- c = EBGInfra.isDefinedNotNull(b) && b.tmpData ? b.tmpData.clickUrl : null,
- d = c || EBGInfra.isDefinedNotNull(b) && b.jumpUrl;
- this._isEBClick() && (c || (d = ""));
- a = a.reportingName.toLowerCase() == EBG.Interactions.SystemInts.DEFAULT_CLICK.toLowerCase();
- c = 0;
- b.tmpData.isClick ?
- c = 1 : b.tmpData.isProductClick && (c = 2);
- d = "" == d ? "" : EBG.Interactions.checkURL(d);
- d = this._getBannerRedirectUrl(d, c, a, b.tmpData.clickedVersion);
- d = EBG.Interactions.checkURL(d);
- this._openOrRedirect(d)
- },
- _openOrRedirect: function(a) {
- -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)
- },
- getClickTagUrl: function(a) {
- var b =
- "",
- a = EBG.isDefined(a) && "" != a ? EBG.Interactions.checkURL(a) : void 0;
- 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() &&
- (a = 9 <= EBG.adaptor.browser.getVersion() ? 4096 : 2048, a -= b.length), a = this._getReportPageTrackingUrls(a), b += a);
- return b
- },
- _getReportPageTrackingUrls: function(a) {
- var b = "$$ebTURLs=[";
- if (-1 != a) {
- if (b.length >= a) return "";
- a -= b.length
- }
- for (var c = this.interactionData.adConfig.clickTrackingUrls, d = 0; d < c.length; d++) {
- var e = EBG.format('{0}"{1}"', 0 != d ? "," : "", c[d]);
- if (-1 != a) {
- if (e.length >= a) break;
- a -= e.length
- }
- b += e
- }
- return b + "]"
- },
- _openPage: function(a, b) {
- var c = b.tmpData.clickedVerUrl ? encodeURIComponent('"' + b.tmpData.clickedVerUrl.split("|").join('","') +
- '"') : "",
- d = b.tmpData.clickedVerUrl && !EBG.isPreview && !EBG.isInWorkshop ? a + "&cvurl=" + c : a;
- switch (EBG.adaptor.getRequestMethod(d)) {
- case "GET":
- EBG.adaptor.openPage(d, b);
- break;
- case "POST":
- var e = b.target;
- 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);
- EBG.runTimed(this, function() {
- function c(a, b) {
- var d = document.createElement("input");
- d.setAttribute("type",
- "hidden");
- d.setAttribute("name", a);
- d.setAttribute("value", b);
- return d
- }
- var g = document.createElement("form");
- g.setAttribute("method", "post");
- g.setAttribute("action", a.substring(0, d.indexOf("?")) + "?cn=brd&ebReferrer=" + encodeURIComponent(this.interactionData.adConfig.ebReferrer));
- g.setAttribute("target", b.target);
- b.target = e;
- var h = this._urlQueryStringToJSON(d),
- i;
- for (i in h) g.appendChild(c(i, unescape(h[i])));
- EBG.adaptor.getDisplayWin().document.body.appendChild(g);
- g.submit()
- }, [], 25);
- break;
- default:
- EBG.adaptor.openPage(d,
- b)
- }
- },
- _urlQueryStringToJSON: function(a) {
- var b = {},
- c = a.substring(a.indexOf("?") + 1);
- if (!c) return b;
- for (var a = [], d = 0, e = 0; e < c.length; e++) switch (c.charAt(e)) {
- case "&":
- a.push(c.substring(d, e));
- d = e + 1;
- break;
- case "$":
- if ("=" == c.charAt(e - 1) && "$" == c.charAt(e + 1))
- for (e += 2; !("$" == c.charAt(e) && "$" == c.charAt(e - 1));) e++
- }
- a.push(c.substring(d));
- for (e = 0; e < a.length; e++) c = a[e], b[c.substring(0, c.indexOf("="))] = c.substring(c.indexOf("=") + 1);
- return b
- },
- _getReportScript: function(a, b) {
- return '<script type="text/javascript">var clkURLs = ["' +
- 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>'
- },
- _getReportingData: function(a, b) {
- var c = 0,
- d = 0;
- b || (c = this.interactionData.counterJumpUrlData && this.interactionData.counterJumpUrlData.tmpData.isClick ? 1 : 0, d = this.interactionData.initiationType == EBG.Interactions.InitiationTypes.USER ? 1 : 0);
- var e = this.interactionData.value ? this.interactionData.value : 0;
- if (EBG.isObj(e) && this.interactionData.useInteractionsStrPipe) {
- if (this.interactionData.reportingName == EBG.Interactions.SystemInts.AD_PARAMS) e.idx = this.interactionData.numToReport - this.interactionData.numLeftToReport;
- e = EBG.serializeObject(e)
- }
- c = this._buildReportFormat(c, d, e, a);
- this.unique = 0;
- return c
- },
- _getBannerRedirectUrl: function(a, b, c, d, e) {
- var f = this.interactionData.adConfig,
- g;
- if (f.massVersioning && (f.massVersioning.adVersions || f.massVersioning.defaultAdVersion)) g = d ? d : EBG.Ads.Ad.Fn.getVersionToReport(f.massVersioning.adVersions);
- return EBG.InteractionUtil.getBannerRedirectUrl({
- adConfig: f,
- sJumpUrl: a,
- clickVal: b,
- fIsDefClick: c,
- sClickedVersion: d,
- isClickTag: e,
- versionToReport: g
- })
- },
- _handleRemoteServers: function() {
- if (!EBG.isPreview &&
- this.interactionData.remoteServers) {
- var a = this.interactionData.remoteServers,
- b = new EBG.Events.Event(EBG.Events.EventNames.INTERACTION_REPORT_REMOTE_SERVERS);
- b.dispatcher = this;
- b.timing = EBG.Events.EventTiming.BEFORE;
- b.eventData = {
- remoteServers: a
- };
- 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)))
- }
- },
- _replaceRSTokens: function(a) {
- try {
- a =
- a.replace(/\[ebInteraction\]/ig, this.interactionData.reportingName), a = a.replace(/\[ebInteractionNum\]/ig, EBG.intMgr.adsData[this.interactionData.adConfig.uid].numOfInteractions)
- } catch (b) {}
- return a
- },
- _getReportingPage: function() {
- var a = this.interactionData.adConfig.page,
- a = a.replace(/\~/ig, "_"),
- a = a.replace(/\^/ig, "_"),
- a = a.replace(/\|/ig, "_");
- return escape(a)
- },
- _isEBClick: function() {
- return this.interactionData && (EBG.strEQ(this.interactionData.reportingName, EBG.Interactions.SystemInts.CLICK) || EBG.strEQ(this.interactionData.reportingName,
- EBG.Interactions.SystemInts.DEFAULT_CLICK))
- }
- };
- EBG.declareClass(EBG.Interactions.CounterInteraction, EBG.Interactions.Interaction);
- EBG.Interactions.TimerInteraction = function(a) {
- EBG.callSuperConstructor(EBG.Interactions.TimerInteraction, this);
- this.interactionData = a ? a : new EBG.Interactions.TimerInteractionData
- };
- EBG.Interactions.TimerInteraction.prototype = {
- type: EBG.Interactions.InteractionTypes.TIMER,
- handle: function(a) {
- var b = this.interactionData.value;
- this.isRunning() && (this.stop(), this.start());
- var b = this.interactionData.value - b,
- b = 0 < b ? b : 0,
- c = this.interactionData.idleDuration / 1E3;
- this.interactionData.value -= c <= b ? c : b;
- this.interactionData.idleDuration = 0;
- b = EBG.Interactions.InteractionManager.MAX_AD_DURATION_SEC;
- this.interactionData.value = this.interactionData.value > b ? b : this.interactionData.value;
- this.interactionData.value =
- Math.floor(this.interactionData.value);
- return 0 >= this.interactionData.value ? !1 : this._buildReportFormat(0, 0, this.interactionData.value, a, 0)
- },
- start: function() {
- var a = new EBG.Events.Event(EBG.Events.EventNames.START_TIMER);
- a.dispatcher = this;
- a.timing = EBG.Events.EventTiming.BEFORE;
- a.eventData = {
- interaction: this
- };
- if (!EBG.eventMgr.dispatchEvent(a)) {
- if (!this.isRunning()) this.interactionData.startTime = (new Date).getTime(), a.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
- EBG.eventMgr.dispatchEvent(a)
- }
- },
- stop: function() {
- if (this.isRunning()) {
- var a =
- new EBG.Events.Event(EBG.Events.EventNames.STOP_TIMER);
- a.dispatcher = this;
- a.timing = EBG.Events.EventTiming.BEFORE;
- a.eventData = {
- interaction: this
- };
- 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)
- }
- },
- getElapsedTime: function() {
- return (new Date).getTime() - this.interactionData.startTime
- },
- update: function(a) {
- var b = new EBG.Events.Event(EBG.Events.EventNames.UPDATE_TIMER);
- b.dispatcher = this;
- b.timing = EBG.Events.EventTiming.BEFORE;
- b.eventData = {
- interaction: this
- };
- if (!EBG.eventMgr.dispatchEvent(b)) this.interactionData.value += a, b.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER, EBG.eventMgr.dispatchEvent(b)
- },
- clear: function() {
- this.interactionData.value = 0;
- this.interactionData.startTime = 0
- },
- increaseIdleDuration: function(a) {
- this.interactionData.idleDuration += a
- },
- isRunning: function() {
- return 0 < this.interactionData.startTime
- },
- isFinished: function() {
- return 0 === this.interactionData.startTime &&
- 0 < this.interactionData.value
- },
- getValue: function() {
- return this.interactionData.value
- },
- getType: function() {
- return EBG.DurationInteraction.TIMER
- }
- };
- EBG.declareClass(EBG.Interactions.TimerInteraction, EBG.Interactions.Interaction);
- EBG.Interactions.IdleManager = function() {
- this.currentIdleDuration = 0;
- this._startTime = (new Date).getTime();
- this.intervalId = EBG.setInterval(this, this._checkIfIdle, [], EBG.Interactions.IdleManager.IDLE_INTERVAL)
- };
- EBG.Interactions.IdleManager.IDLE_INTERVAL = 5E3;
- EBG.Interactions.IdleManager.prototype = {
- _totalIdleDuration: 0,
- _lastActiveTimeStamp: 0,
- updateIdleDuration: function() {
- this.currentIdleDuration = 0;
- var a = (new Date).getTime();
- 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))
- },
- _checkIfIdle: function() {
- this.updateIdleDuration();
- 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)
- }
- };
- EBG.declareClass(EBG.Interactions.IdleManager, null);
- EBG.Interactions.StdInteractionManager = function() {
- this.adsData = EBG.intMgr ? EBG.intMgr.adsData : {};
- this.adsIntQueues = EBG.intMgr ? EBG.intMgr.adsIntQueues : {}
- };
- EBG.Interactions.StdInteractionManager.prototype = {
- copy: function(a) {
- this.adsIntQueues = a.adsIntQueues;
- this.adsData = a.adsData
- },
- initAdData: function(a, b) {
- var c = a.uid;
- this.adsIntQueues[c] = this.adsIntQueues[c] ? this.adsIntQueues[c] : [];
- c = this.adsData[c] = {
- adConfig: a,
- isUserInteractionOccur: !1,
- isClickOccur: !1,
- isProductClicked: {},
- numOfInteractions: 0,
- delayIntReport: b,
- videoState: {},
- assetsTimers: {},
- clickReportScript: ""
- };
- c[EBG.Interactions.InteractionTypes.COUNTER] = {};
- c[EBG.Interactions.InteractionTypes.TIMER] = {};
- c.adConfig.isStdAd || this._addSystemInteractions(a)
- },
- allowInteractionReport: function(a) {
- if (this.adsData[a]) this.adsData[a].delayIntReport = !1
- },
- addInteraction: function(a, b) {
- var c = EBG.isDefinedNotNull(b) ? b.toLowerCase() : a.interactionData.reportingName.toLowerCase(),
- d = a.interactionData.adUId,
- e = new EBG.Events.Event(EBG.Events.EventNames.ADD_INTERACTION);
- e.eventData = a;
- e.dispatcher = {
- _adConfig: {
- rnd: this.adsData[d].adConfig.rnd
- }
- };
- e.timing = EBG.Events.EventTiming.BEFORE;
- var f = EBG.eventMgr.dispatchEvent(e),
- g =
- this.adsData[d];
- if (!f) {
- if (!g) return;
- g[a.type][c] = a;
- a.interactionData.adConfig = this.adsData[d].adConfig
- }
- e.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
- EBG.eventMgr.dispatchEvent(e)
- },
- getClickTag: function(a) {
- return (a = this._getCounterInteraction(EBG.Interactions.SystemInts.CLICK, a)) ? a.getClickTagUrl() : ""
- },
- getClickTarget: function(a) {
- var b = "_blank";
- if (!EBG.isPreview && EBG.isInWorkshop && (a = this._getCounterInteraction(EBG.Interactions.SystemInts.CLICK, a))) b = a.interactionData.counterJumpUrlData.target;
- return b
- },
- handleCloseAdParts: function(a, b) {
- if (a && 1 == a.fClose) {
- var c = new EBG.Events.Event(EBG.Events.EventNames.CLOSE_AD);
- c.dispatcher = {
- _adConfig: {
- rnd: EBG.Ads.Ad.Fn.getRandFromAdUId(b)
- }
- };
- c.eventData = {
- closeDueToClickthrough: !0
- };
- EBG.eventMgr.dispatchEvent(c)
- }
- },
- handleCounterInteraction: function(a, b, c, d, e, f) {
- var g = this._getCounterInteraction(a, b),
- h = g ? g.interactionData : null,
- i = h ? h.counterJumpUrlData : null,
- j = this.adsData[b],
- k = j.adConfig.isStdAd,
- m = "",
- f = EBGInfra.isDefined(f) ? f : !0,
- c = c || 0;
- if (!k && h) h.initiationType = d ? EBG.Interactions.InitiationTypes.USER :
- h.initiationType, this._handleUserInteraction(b, h), this._handleSpecialInteractions(a, b, c);
- if (g && (a = new EBG.Events.Event(EBG.Events.EventNames.HANDLE_COUNTER_INTERACTION), a.dispatcher = {
- _adConfig: {
- rnd: EBG.Ads.Ad.Fn.getRandFromAdUId(b)
- }
- }, a.timing = EBG.Events.EventTiming.BEFORE, a.eventData = {
- interaction: g
- }, !EBG.eventMgr.dispatchEvent(a))) {
- 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 =
- h.countAsClick && i.tmpData.clickedVersion && e && !j.isProductClicked["V_" + e], i.tmpData.isProductClick && (j.isProductClicked["V_" + e] = !0);
- else if (e && e.value) g.interactionData.value = e.value;
- m = f ? g.handle(c) : "";
- j.numOfInteractions++;
- m && (this._handleReportData(b, h, m), this._isReportDataInQueue(b, m) || this.reportInteractionQueues());
- this.handleCloseAdParts(i, b);
- a.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
- EBG.eventMgr.dispatchEvent(a)
- }
- },
- isInteractionExist: function(a, b, c) {
- if (this.adsData[c] && this.adsData[c][b]) return this.adsData[c][b][a] ?
- !0 : !1
- },
- _getCounterInteraction: function(a, b) {
- a = a.toLowerCase();
- 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]
- },
- getRepScr: function(a) {
- if (this.adsData[a] && this.adsData[a].clickReportScript) return this.adsData[a].clickReportScript
- }
- };
- EBG.declareClass(EBG.Interactions.StdInteractionManager, null);
- EBG.Interactions.InteractionManager = function(a) {
- EBG.callSuperConstructor(EBG.Interactions.InteractionManager, this);
- EBG.intMgr && EBG.intMgr.copy(this);
- 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=");
- this.idleManager = new EBG.Interactions.IdleManager;
- this._timedReport = EBG.isDefined(EBG.intReportTimeout) && null != EBG.intReportTimeout && 0 <= EBG.intReportTimeout ? EBG.intReportTimeout : this._timedReport;
- this._subscribeToEvents()
- };
- EBG.Interactions.InteractionManager.charAdFieldsDelimeter = "~";
- EBG.Interactions.InteractionManager.charIntDelimeter = "^";
- EBG.Interactions.InteractionManager.intStackLength = 7;
- EBG.Interactions.InteractionManager.MAX_AD_DURATION_SEC = 900;
- EBG.Interactions.InteractionManager.INTERACTION_THRESHOLD_SEC = 86400;
- EBG.Interactions.InteractionManager.HandleAllTimersOptions = {
- REPORT: 0,
- PAUSE: 1,
- HANDLE_IDLE: 2
- };
- EBG.Interactions.InteractionManager.prototype = {
- _isUnloadHandled: !1,
- _pausedTimers: null,
- _masterOrdinalNumber: null,
- _seqTimersReportData: {
- index: -1,
- intervals: [5, 10, 20, 40, 60, 120, 240]
- },
- _timedReport: 1E4,
- _interactionPipe: null,
- _interactionServer: null,
- startAggregate: function(a, b, c) {
- if (null == this._masterOrdinalNumber) this._masterOrdinalNumber = c;
- this.startTimer(a, b, c)
- },
- startTimer: function(a, b, c) {
- var d = this._getTimerInteraction(a, b);
- if (d) {
- d.start();
- if (EBGInfra.isDefined(c) && EBGInfra.notNull(c)) switch (d = this.adsData[b],
- d = d.assetsTimers[c] ? d.assetsTimers[c] : d.assetsTimers[c] = {}, a) {
- case EBG.VideoInteraction.VIDEO_PLAY_DURATION:
- this._startAssetTimer(d, EBG.VideoInteraction.VIDEO_ASSET_DURATION, b, c);
- break;
- case EBG.VideoInteraction.FULLSCREEN_DURATION:
- this._startAssetTimer(d, EBG.VideoInteraction.FULLSCREEN_ASSET_DURATION, b, c)
- }
- EBG.isGlobalDef("JSON")
- }
- },
- _handleVideoStarted: function(a, b) {
- var c = new EBG.Events.Event(EBG.Events.EventNames.DWELL_VIDEO_START);
- c.dispatcher = {
- _adConfig: {
- rnd: EBG.Ads.Ad.Fn.getRandFromAdUId(a)
- }
- };
- c.eventData = {
- assetId: b
- };
- EBG.eventMgr.dispatchEvent(c)
- },
- _startAssetTimer: function(a, b, c, d) {
- if (!a[b]) {
- var e;
- 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))
- }
- a[b].start();
- this._handleVideoStarted(c, d)
- },
- updateAggregation: function(a, b, c, d) {
- if (null == this._masterOrdinalNumber) this._masterOrdinalNumber =
- d;
- var e = this._getTimerInteraction(a, b);
- 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) {
- case EBG.VideoInteraction.VIDEO_PLAY_DURATION:
- this._updateAssetAggregation(e, EBG.VideoInteraction.VIDEO_ASSET_DURATION, b, c, d);
- break;
- case EBG.VideoInteraction.FULLSCREEN_DURATION:
- this._updateAssetAggregation(e, EBG.VideoInteraction.FULLSCREEN_ASSET_DURATION, b, c, d)
- }
- },
- _updateAssetAggregation: function(a,
- b, c, d) {
- a[b] || (c = new EBG.Interactions.AggregationInteractionData(b, EBG.Interactions.Categories.VIDEO, c), a[b] = new EBG.Interactions.AggregateInteraction(c));
- a[b].update(d)
- },
- stopAggregate: function(a, b, c) {
- this._masterOrdinalNumber = null;
- this.stopTimer(a, b, c)
- },
- stopTimer: function(a, b, c) {
- var d = this._getTimerInteraction(a, b),
- e = this.adsData[b].assetsTimers,
- f = !0;
- if (d) {
- if (EBGInfra.isDefined(c) && EBGInfra.notNull(c) && e[c]) switch (a) {
- case EBG.VideoInteraction.VIDEO_PLAY_DURATION:
- e[c][EBG.VideoInteraction.VIDEO_ASSET_DURATION].stop();
- f = !this._isRunningVideoAsset(b, !1);
- break;
- case EBG.VideoInteraction.FULLSCREEN_DURATION:
- e[c][EBG.VideoInteraction.FULLSCREEN_ASSET_DURATION].stop()
- }
- f && d.stop();
- if (EBGInfra.isDefined(c) && EBGInfra.notNull(c)) a = new EBG.Events.Event(EBG.Events.EventNames.DWELL_VIDEO_STOP), a.dispatcher = {
- _adConfig: {
- rnd: EBG.Ads.Ad.Fn.getRandFromAdUId(b)
- }
- }, a.eventData = {
- assetId: c
- }, EBG.eventMgr.dispatchEvent(a)
- }
- },
- clearTimer: function(a, b) {
- var c = this._getTimerInteraction(a, b);
- c && c.clear()
- },
- _isRunningAnyVideoAsset: function(a) {
- return this._isRunningVideoAsset(a, !1) || this._isRunningVideoAsset(a, !0)
- },
- _isRunningVideoAsset: function(a, b) {
- var c = this.adsData[a].assetsTimers,
- d;
- for (d in c)
- if (c.hasOwnProperty(d)) {
- var e = b ? "ebFSVideoAssetDuration" : "ebVideoAssetDuration";
- if (c[d][e] && c[d][e].isRunning()) return !0
- }
- return !1
- },
- updateTimer: function(a, b, c, d) {
- if (a = this._getTimerInteraction(a, b)) a.update(c), EBGInfra.isDefined(d) && EBGInfra.notNull(d) && this.adsData[b].assetsTimers[d].update(c)
- },
- getTimerValue: function(a, b) {
- var c = this._getTimerInteraction(a, b);
- return c ? c.getValue() :
- 0
- },
- isTimerRunning: function(a, b) {
- var c = this._getTimerInteraction(a, b);
- return c ? c.isRunning() : !1
- },
- _handleUserInteraction: function(a, b) {
- if (b.initiationType == EBG.Interactions.InitiationTypes.USER && !this.adsData[a].isUserInteractionOccur) {
- this.adsData[a].isUserInteractionOccur = !0;
- var c = new EBG.Events.Event(EBG.Events.EventNames.USER_INTERACTION);
- c.dispatcher = {
- _adConfig: {
- rnd: EBG.Ads.Ad.Fn.getRandFromAdUId(a)
- }
- };
- EBG.eventMgr.dispatchEvent(c);
- this._reportUserInteraction(a)
- }
- },
- _handlePanelsViewed: function(a,
- b) {
- b.isPanel && b.initiationType == EBG.Interactions.InitiationTypes.USER && this.handleCounterInteraction(EBG.ExpBaseInteractions.PANELS_VIEWED, a)
- },
- _handleReportData: function(a, b, c) {
- 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())
- },
- _handleDataParams: function(a,
- b, c) {
- b = this._getAdReportData(a);
- c = encodeURIComponent(c);
- a = this._getPipeParams(a, !1);
- this._reportServer(this._interactionsStrPipe + "$$" + b + c + "$$" + a, !0)
- },
- _handleSpecialInteractions: function(a, b, c) {
- var d = this._getCounterInteraction(a, b),
- a = d.interactionData;
- this._handleUserInteraction(b, a);
- switch (a.reportingName) {
- case EBG.VideoInteraction.STARTED:
- d.unique && this._reportUniqueVideoStarted(b);
- this.adsData[b].isUserInteractionOccur && this._reportUserInitatedVideo(b, c);
- break;
- case EBG.VideoInteraction.FULLSCREEN_START:
- if (this._isRunningVideoAsset(b, !1)) switch (d = this._getTimerInteraction(EBG.VideoInteraction.VIDEO_PLAY_DURATION, b), d = d.getType(), d) {
- case EBG.DurationInteraction.TIMER:
- this.startTimer(EBG.VideoInteraction.FULLSCREEN_DURATION, b, c);
- this.stopTimer(EBG.VideoInteraction.VIDEO_PLAY_DURATION, b, c);
- break;
- case EBG.DurationInteraction.AGGREGATE:
- this.startAggregate(EBG.VideoInteraction.FULLSCREEN_DURATION, b, c), this.stopAggregate(EBG.VideoInteraction.VIDEO_PLAY_DURATION, b, c)
- }
- break;
- case EBG.VideoInteraction.FULLSCREEN_END:
- if (this._isRunningVideoAsset(b, !0)) switch (d = this._getTimerInteraction(EBG.VideoInteraction.VIDEO_PLAY_DURATION, b), d = d.getType(), d) {
- case EBG.DurationInteraction.TIMER:
- this.startTimer(EBG.VideoInteraction.VIDEO_PLAY_DURATION, b, c);
- this.stopTimer(EBG.VideoInteraction.FULLSCREEN_DURATION, b, c);
- break;
- case EBG.DurationInteraction.AGGREGATE:
- this.startAggregate(EBG.VideoInteraction.VIDEO_PLAY_DURATION, b, c), this.stopAggregate(EBG.VideoInteraction.FULLSCREEN_DURATION, b, c)
- }
- break;
- case EBG.VideoInteraction.FULLPLAY:
- this.stopTimer(EBG.VideoInteraction.VIDEO_PLAY_DURATION,
- b, c)
- }
- this._handlePanelsViewed(b, a)
- },
- handleVideoInteraction: function(a, b, c, d, e) {
- if (EBGInfra.isDefined(c) && EBGInfra.notNull(c)) {
- var f = this.adsData[b].videoState;
- f[c] || (f[c] = 0);
- var g = !0,
- 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);
- g && this.handleCounterInteraction(a, b, c, d, e)
- }
- },
- handleAllTimers: function(a, b) {
- if (a == EBG.Interactions.InteractionManager.HandleAllTimersOptions.PAUSE) this._pausedTimers = [];
- var c = new EBG.Events.Event(EBG.Events.EventNames.COLLECT_TIMERS);
- c.dispatcher = this;
- c.timing = EBG.Events.EventTiming.BEFORE;
- EBG.eventMgr.dispatchEvent(c);
- for (var d in this.adsData)
- if (this.adsData.hasOwnProperty(d)) {
- var c = this.adsData[d],
- e = c[EBG.Interactions.InteractionTypes.TIMER];
- e && this._handleTimers(e, a, d);
- if (c.assetsTimers)
- for (var f in c.assetsTimers) c.assetsTimers.hasOwnProperty(f) && this._handleTimers(c.assetsTimers[f], a, d, f);
- c = new EBG.Events.Event(EBG.Events.EventNames.COLLECT_TIMERS);
- c.dispatcher =
- this;
- c.timing = EBG.Events.EventTiming.ONTIME;
- EBG.eventMgr.dispatchEvent(c);
- 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))
- }
- },
- _handleTimers: function(a, b, c, d) {
- for (var e in a)
- if (a.hasOwnProperty(e)) {
- var f = a[e];
- if (f.isRunning() || f.isFinished()) switch (b) {
- case EBG.Interactions.InteractionManager.HandleAllTimersOptions.REPORT:
- var g =
- new EBG.Events.Event(EBG.Events.EventNames.HANDLE_TIMER_INTERACTION);
- g.dispatcher = {
- _adConfig: {
- rnd: EBG.Ads.Ad.Fn.getRandFromAdUId(c)
- }
- };
- g.timing = EBG.Events.EventTiming.BEFORE;
- g.eventData = {
- interaction: f
- };
- if (EBG.eventMgr.dispatchEvent(g)) return;
- (f = f.handle(d)) && this.adsIntQueues[c].push(f);
- g.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
- EBG.eventMgr.dispatchEvent(g);
- break;
- case EBG.Interactions.InteractionManager.HandleAllTimersOptions.PAUSE:
- f.stop();
- this._pausedTimers.push(f);
- break;
- case EBG.Interactions.InteractionManager.HandleAllTimersOptions.HANDLE_IDLE:
- f.increaseIdleDuration(this.idleManager.currentIdleDuration)
- }
- }
- },
- pauseAllTimers: function() {
- return this.handleAllTimers(EBG.Interactions.InteractionManager.HandleAllTimersOptions.PAUSE, !0)
- },
- resumeAllTimers: function() {
- if (null != this._pausedTimers) {
- for (var a = 0; a < this._pausedTimers.length; a++) this._pausedTimers[a].start();
- this._pausedTimers = null
- }
- },
- reportInteractionQueues: function(a, b, c) {
- if (!(EBG.getTime() > EBG.Interactions.InteractionManager.INTERACTION_THRESHOLD_SEC)) {
- var a = EBG.isBool(a) ? a : !0,
- b = EBG.isBool(b) ? b : !1,
- d = "",
- e = this._interactionPipe,
- f;
- for (f in this.adsData)
- if (this.adsData.hasOwnProperty(f)) {
- var g =
- this.adsIntQueues[f];
- if (!this.adsData[f].delayIntReport)
- for (; g.length;) {
- 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++;
- for (k = 0; k < i; k++) g.shift();
- this._isUnloadHandled ? ("" != d && (d += "|"), d += h) : this._reportServer(e + h + this._getPipeParams(f, b), a, c)
- }
- }
- if (this._isUnloadHandled && "" != d) {
- for (f in this.adsData)
- if (this.adsData.hasOwnProperty(f)) {
- d = e + d + this._getPipeParams(f, b);
- break
- }
- this._reportServer(d,
- a, c)
- }
- }
- },
- _reportServer: function(a, b, c) {
- if (!EBG.isPreview || EBG.isGlobalDef("gfEbForceReportInt")) c ? EBG.adaptor.reportBeacon(a) : EBG.adaptor.reportToRemoteServer(a, b)
- },
- _isReportDataInQueue: function(a, b) {
- for (var c = !1, d = this.adsIntQueues[a], e = 0; e < d.length; e++)
- if (d[e] === b) {
- c = !0;
- break
- }
- return c
- },
- _getPipeParams: function(a, b) {
- var c = "",
- d = this.adsData[a].adConfig.usercookie;
- d && (c += EBG.format("&usercookie={0}", d));
- (d = this.adsData[a].adConfig.optOut) && (c += EBG.format("&OptOut={0}", d));
- b && (c += EBG.format("&iseq={0}",
- this._seqTimersReportData.index));
- EBG.isGlobalDef("gfEbForceReportInt") && (c += "&pr=1");
- c += EBG.format("&rnd={0}", Math.random());
- EBG.adaptor.flash && (c += EBG.format("&flv={0}", EBG.adaptor.flash.version));
- EBG.isDefined(EBG.adaptor.getResolution) && (c += EBG.format("&res={0}", EBG.adaptor.getResolution()));
- EBGInfra.isDefinedNotNull(this.adsData[a].adConfig.diAppId) && (c += "&diappid=" + this.adsData[a].adConfig.diAppId);
- return c
- },
- _getAdReportData: function(a) {
- var b = this.adsData[a].adConfig,
- c = EBG.Interactions.InteractionManager.charAdFieldsDelimeter;
- 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)
- },
- _addSystemInteractions: function(a) {
- var a = a.uid,
- b = new EBG.Interactions.CounterInteractionData(EBG.Interactions.SystemInts.USER_INTERACTION, EBG.Interactions.Categories.SYSTEM, a);
- b.numLeftToReport = 1;
- this.addInteraction(new EBG.Interactions.CounterInteraction(b));
- b = new EBG.Interactions.CounterInteractionData(EBG.Interactions.SystemInts.UNIQUE_VIDEO_STARTED, EBG.Interactions.Categories.VIDEO, a);
- b.numLeftToReport = 1;
- this.addInteraction(new EBG.Interactions.CounterInteraction(b));
- b = new EBG.Interactions.CounterInteractionData(EBG.Interactions.SystemInts.DWELL_UNIQUE, EBG.Interactions.Categories.SYSTEM, a);
- b.reportImmediately = !0;
- b.numLeftToReport = 1;
- this.addInteraction(new EBG.Interactions.CounterInteraction(b));
- b = new EBG.Interactions.CounterInteractionData(EBG.Interactions.SystemInts.REPLAY,
- EBG.Interactions.Categories.SYSTEM, a);
- this.addInteraction(new EBG.Interactions.CounterInteraction(b));
- a = new EBG.Interactions.CounterInteractionData(EBG.Interactions.SystemInts.RICH_FLASH_PLAYED, EBG.Interactions.Categories.SYSTEM, a);
- a.numLeftToReport = 1;
- this.addInteraction(new EBG.Interactions.CounterInteraction(a))
- },
- _reportUserInitatedVideo: function(a, b) {
- this.handleVideoInteraction(EBG.VideoInteraction.USER_INITIATED_VIDEO, a, b)
- },
- _reportUserInteraction: function(a) {
- this.handleCounterInteraction(EBG.Interactions.SystemInts.USER_INTERACTION,
- a)
- },
- _reportUniqueVideoStarted: function(a) {
- this.handleCounterInteraction(EBG.Interactions.SystemInts.UNIQUE_VIDEO_STARTED, a)
- },
- reportDwellUnique: function(a, b) {
- b && this.handleCounterInteraction(EBG.Interactions.SystemInts.DWELL_UNIQUE, a, null, !1)
- },
- reportRichFlashPlayed: function(a) {
- this.handleCounterInteraction(EBG.Interactions.SystemInts.RICH_FLASH_PLAYED, a)
- },
- reportReplay: function(a) {
- this.handleCounterInteraction(EBG.Interactions.SystemInts.REPLAY, a, 0, EBG.ActionType.USER)
- },
- _getTimerInteraction: function(a,
- b) {
- a = a.toLowerCase();
- 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]
- },
- _subscribeToEvents: function() {
- 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,
- 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)
- },
- _handleAllTimersSeq: function() {
- var a = EBG.adaptor.browser.isMobile();
- EBG.adaptor.supportsPageLoadEvents();
- this.reportInteractionQueues(!a);
- this._pausedTimers || (this.handleAllTimers(EBG.Interactions.InteractionManager.HandleAllTimersOptions.REPORT, !a), this.resumeAllTimers());
- this._setNextTimerSeq(!1)
- },
- _setNextTimerSeq: function(a) {
- a = "undefined" != typeof a && a ? this._seqTimersReportData.index = 0 : ++this._seqTimersReportData.index;
- a < this._seqTimersReportData.intervals.length && EBG.runTimed(this, this._handleAllTimersSeq, [], 1E3 * this._seqTimersReportData.intervals[a])
- },
- unLoadHandler: function() {
- if (!this._isUnloadHandled) this._isUnloadHandled = !0, this.handleAllTimers(EBG.Interactions.InteractionManager.HandleAllTimersOptions.REPORT, !1)
- },
- getAdDuration: function(a) {
- var b = 0;
- (a = this._getTimerInteraction(EBG.Interactions.SystemInts.AD_DURATION,
- a)) && (b = a.getElapsedTime());
- return b
- }
- };
- EBG.declareClass(EBG.Interactions.InteractionManager, EBG.Interactions.StdInteractionManager);
- EBG.DataProfile = {
- GENERAL: "general",
- SERVING: "serving",
- USERINFO: "userInfo",
- PLATFORM: "platform",
- FRAUD: "fraud",
- VISIBILITY: "visibility",
- ERROR: "error"
- };
- EBG.DataPipe = function(a, b) {
- this._profile = this._buildProfile(b || this._defaultProfile);
- this._duration = 0;
- this._firstTickDelay = 5E3;
- this._serverPipeUrl = a;
- EBG.setInterval(this, function() {
- this._duration++
- }, [], 1E3);
- EBG.setInterval(this, function() {
- this._observedHandler()
- }, [], 100);
- b && b.length && EBG.runTimed(this, this._tick, [], this._firstTickDelay)
- };
- EBG.DataPipe.prototype = {
- _data: {
- general: {}
- },
- _observedObjects: [],
- _tickCount: 0,
- _tickDelay: 1,
- _maxTicks: 1,
- _completeProfile: {
- general: {
- sid: !0,
- dur: !0,
- time: !1,
- adid: !1,
- frmt: !1,
- cs: !1
- },
- serving: {
- prtcl: !1,
- dmn: !1,
- url: !1,
- vurl: !1,
- srvmd: !1,
- aie: !1,
- imapp: !1
- },
- userInfo: {
- geo: !1,
- ip: !1
- },
- platform: {
- os: !1,
- osv: !1,
- ua: !1,
- brsrc: !1,
- brsrv: !1,
- brsrt: !1,
- flsv: !1,
- scrw: !1,
- scrh: !1,
- scrl: !1,
- fh: !1,
- fw: !1,
- env: !1,
- mraid: !1,
- mraidw: !1
- },
- fraud: {
- bot: !1,
- injct: !1,
- stack: !1
- },
- visibility: {
- vsbp: !1,
- pct: !1,
- scrsr: !1,
- loc: !1,
- vsr: !1,
- vsri: !1,
- uvsr: !1,
- vsiab: !1,
- uvsiab: !1
- },
- error: {
- errnum: !1,
- errmsg: !1,
- errfunc: !1,
- errpos: !1
- }
- },
- _defaultProfile: {
- general: {
- adid: !1,
- sid: !0,
- dur: !0
- }
- },
- _buildProfile: function(a) {
- for (var b = {}, c = 0; c < a.length; c++) b[a[c]] = EBG.cloneObj(this._completeProfile[a[c]]);
- EBG.mergeObj(this._defaultProfile, b, !1);
- return b
- },
- _clear: function() {
- for (var a in this._profile) {
- var b = this._profile[a],
- c = void 0;
- for (c in b) !this._profile[a][c] && this._data[a] && (this._data[a][c] = null, delete this._data[a][c])
- }
- },
- _post: function() {
- var a = {
- x: function() {
- if ("undefined" !== typeof XMLHttpRequest) return new XMLHttpRequest;
- 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 {
- c = new ActiveXObject(a[d]);
- break
- } catch (e) {}
- return c
- },
- post: function(b, c, d, e) {
- try {
- var f = a.x();
- f.open("POST", b, e);
- f.onreadystatechange = function() {
- 4 == f.readyState && d && d(f.responseText)
- };
- f.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
- f.send(JSON.stringify(c))
- } catch (g) {}
- }
- };
- return a.post
- }(),
- _tick: function() {
- ++this._tickCount;
- this.flush();
- this._tickCount <
- this._maxTicks && (EBG.runTimed(this, this._tick, [], 1E3 * Math.pow(2, this._tickDelay)), this._tickDelay++)
- },
- send: function(a, b, c) {
- c = c || {};
- if (this._profile[a]) {
- this._data[a] = this._data[a] || {};
- for (var d in b) d in this._profile[a] && (this._data[a][d] = encodeURIComponent(b[d]));
- if (c.constant)
- for (d in this._data[a]) this._profile[a][d] = !0;
- c.flush && this.flush()
- }
- },
- flush: function() {
- this._data.general.dur = this._duration;
- var a = {},
- b;
- for (b in this._data)
- for (var c in this._data[b]) a[c] = this._data[b][c];
- this._post(this._serverPipeUrl,
- a);
- this._clear()
- },
- watch: function(a, b, c, d, e) {
- if (this._profile[a] && c) {
- var f = this;
- Object.observe ? Object.observe(c, function(g) {
- for (var h = 0; h < g.length; h++)
- if (g[h].name === d) {
- var i = {};
- i[b] = c[d].toString();
- f.send(a, i, e)
- }
- }) : this._observedObjects.push({
- ns: a,
- key: b,
- value: c[d],
- obj: c,
- prop: d,
- options: e
- })
- }
- },
- _observedHandler: function() {
- for (var a = 0; a < this._observedObjects.length; a++) {
- var b = this._observedObjects[a];
- if (b.obj[b.prop] !== b.value) {
- b.value = b.obj[b.prop];
- var c = {};
- c[key] = b.obj[b.prop].toString();
- this.send(ns,
- c, b.options)
- }
- }
- }
- };
- EBG.DataPipeManager = function(a, b) {
- this._default = b;
- this._dpUrl = a
- };
- EBG.DataPipeManager.prototype = {
- _pipes: {},
- createPipe: function(a, b) {
- var c = new EBG.DataPipe(this._dpUrl, b || this._default);
- c.send(EBG.DataProfile.GENERAL, {
- sid: a
- });
- this._pipes[a] = c
- },
- getPipe: function(a) {
- this._pipes[a] || this.createPipe(a);
- return this._pipes[a]
- },
- send: function(a, b, c, d) {
- (a = this._pipes[a]) && a.send(b, c, d)
- }
- };
- EBG.declareNamespace("Positioning");
- EBG.Positioning.PositionManager = function() {};
- EBG.Positioning.PositionManager.prototype = {
- isVisibile: function(a, b, c) {
- try {
- return 0 < this.calculateVisibilityPercentage(a, b, c) ? !0 : !1
- } catch (d) {}
- },
- calculateVisibilityPercentage: function(a, b, c, d, e, f, g) {
- try {
- var h = 0,
- i = 0,
- j = 0,
- k = !(EBG.adaptor.getDisplayWin() != top && g == EBG.Adaptors.ServingMode.FRIENDLY_IFRAME),
- m = EBG.adaptor.getScrollLeftTop(k, g),
- l = EBG.adaptor.getViewPortMetrics(k, f, g),
- p = this.calculateRightBottowCoordinate(m, l.Width, l.Height),
- n = EBG.adaptor.getPositioningById(a, !k, g);
- if (null != n) {
- a = {
- X: 0,
- Y: 0
- };
- try {
- !k &&
- window.frameElement && (a = EBG.adaptor.getPositioningByElement(window.frameElement, !1, g))
- } catch (r) {
- a = {
- X: 0,
- Y: 0
- }
- }
- n.X += a.X;
- n.Y += a.Y;
- "undefined" != typeof d && (n.X += d);
- "undefined" != typeof e && (n.Y += e);
- var q = this.calculateRightBottowCoordinate(n, b, c),
- j = b * c,
- i = this.calculateVisibleArea(m, p, n, q),
- h = j ? i / j : 0
- }
- return h
- } catch (o) {}
- },
- calculateRightBottowCoordinate: function(a, b, c) {
- var d = {
- X: 0,
- Y: 0
- };
- d.X = a.X + b;
- d.Y = a.Y + c;
- return d
- },
- calculateVisibleArea: function(a, b, c, d) {
- try {
- var e = 0,
- f = 0;
- if (c.Y == d.Y && c.X == d.X || b.X <= a.X || b.Y <= a.Y) return 0;
- 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);
- 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);
- return e * f
- } catch (g) {}
- },
- getFullRectWithClip: function(a, b) {
- var c = null,
- c = EBG.adaptor.getDisplayWin() === EBG.adaptor.getPageWin(),
- d = null;
- if (a) {
- var c = EBG.adaptor.getPositioningByElement(a, !c, b),
- d = {
- width: a.offsetWidth,
- height: a.offsetHeight
- },
- e = a.style.clip,
- f = 0,
- g = 0,
- h = d.height,
- i = d.width;
- "" != e && (e = e.substring(e.indexOf("(") +
- 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]));
- d.left = c.X + f;
- d.top = c.Y + g;
- d.width -= d.width - i;
- d.width -= f;
- d.height -= d.height - h;
- d.height -= g;
- d.right = d.left + d.width;
- d.bottom = d.top + d.height
- }
- return d
- },
- isOverlapping: function(a, b, c) {
- if (!a || 0 == a.offsetWidth && 0 == a.offsetHeight || !b || 0 == b.offsetWidth && 0 == b.offsetHeight) return !1;
- a = EBG.posHelper.getFullRectWithClip(a, c);
- b = EBG.posHelper.getFullRectWithClip(b, c);
- return !a || !b || a.bottom < b.top ||
- a.top > b.bottom || a.right < b.left || a.left > b.right ? !1 : !0
- }
- };
- EBG.declareClass(EBG.Positioning.PositionManager, null);
- EBG.declareNamespace("RichModules");
- EBG.RichModules.BasicVisibilityProvider = function(a, b, c) {
- this._resObjId = a;
- this._res = EBG.adaptor.getElementById(a);
- this._adConfig = this.adConfig = b;
- this._options = c || {};
- this._subscribeToEvents();
- this._trackElementLocation()
- };
- EBG.RichModules.BasicVisibilityProvider._isAvailable = function() {
- return !1
- };
- EBG.RichModules.BasicVisibilityProvider.prototype = {
- name: "Basic",
- _isStarted: !1,
- _calculateVisibilityPercentage: function() {
- return 0
- },
- _getViewPortMetrics: function() {
- return null
- },
- _dispatchCheckVisibility: function(a) {
- if (this._isStarted) {
- var b = new EBG.Events.Event(EBG.Events.EventNames.VISIBILITY_CHECK);
- b.dispatcher = this;
- b.eventData = a;
- if (EBG.isObj(this._options.customData)) b.eventData.customData = this._options.customData;
- b.timing = EBG.Events.EventTiming.ONTIME;
- EBG.eventMgr.dispatchEvent(b)
- }
- },
- _dispatchVisibilityHidden: function() {
- var a =
- new EBG.Events.Event(EBG.Events.EventNames.VISIBILITY_HIDDEN);
- a.dispatcher = this;
- a.timing = EBG.Events.EventTiming.ONTIME;
- EBG.eventMgr.dispatchEvent(a)
- },
- _subscribeToEvents: function() {
- var a = new EBG.Events.EventSubscription(EBG.Events.EventNames.EXPAND, function(a) {
- a.eventData.props && a.eventData.props.asset.id == this._resObjId && this._trackElementLocation()
- }, this);
- a.timing = EBG.Events.EventTiming.ONTIME;
- a.dispatcherFilters = {
- "_adConfig.rnd": this.adConfig.rnd
- };
- EBG.eventMgr.subscribeToEvent(a)
- },
- updateResourceObjId: function(a) {
- this._resObjId =
- a;
- this._res = EBG.adaptor.getElementById(a);
- this._trackElementLocation()
- },
- _isVisible: function() {
- return !1
- },
- _calculateVisibilityResult: function() {
- var a = {};
- try {
- a.assetId = this._resObjId, a.percentage = this._calculateVisibilityPercentage(), a.viewPort = this._getViewPortMetrics()
- } catch (b) {}
- return a
- },
- start: function() {
- this._isStarted = !0
- },
- _trackElementLocation: function() {
- if (this._intervalHandler) clearInterval(this._intervalHandler), this._intervalHandler = null;
- if (this._res = EBG.adaptor.getElementById(this._resObjId)) {
- var a =
- this,
- b = EBG.adaptor.getBoundingClientRect(this._res, {
- clip: !0
- });
- if (b) this._intervalHandler = EBG.setInterval(this, function() {
- var c = EBG.adaptor.getBoundingClientRect(a._res, {
- clip: !0
- });
- if (b && !c) a.onElementMoved(), a._trackElementLocation();
- else
- for (var d in c)
- if (c[d] != b[d]) {
- b = c;
- a.onElementMoved();
- break
- }
- }, [], 200)
- } else EBG.runTimed(this, this._trackElementLocation, [], 500)
- },
- _triggerVisibilityCheck: function() {
- this._dispatchCheckVisibility(this._calculateVisibilityResult())
- },
- onElementMoved: function() {}
- };
- EBG.declareClass(EBG.RichModules.BasicVisibilityProvider, null);
- EBG.declareNamespace("RichModules");
- EBG.RichModules.GeometricVisibilityProvider = function(a, b, c) {
- EBG.callSuperConstructor(EBG.RichModules.GeometricVisibilityProvider, this, [a, b, c])
- };
- EBG.RichModules.GeometricVisibilityProvider.prototype = {
- name: "Geometric",
- _focusOnResourceElem: null,
- _justReceivedFocusOnPage: null,
- _reachedMaxAdDuration: !1,
- _calculateVisibilityPercentage: function(a) {
- try {
- if (!EBG.adaptor.isPageVisible(this.adConfig.isInstream)) return 0;
- var a = a || {},
- b = this._getAssetRect(a.resourceObjId || this._resObjId),
- c = this._getViewPortRect();
- b.top += ~~a.offsetY;
- b.bottom += ~~a.offsetY;
- b.left += ~~a.offsetX;
- b.right += ~~a.offsetX;
- if (EBG.isDefined(a.width)) b.width = a.width, b.right = b.left + a.width;
- if (EBG.isDefined(a.height)) b.height = a.height, b.bottom = b.top + a.height;
- if (this._intersect(b, c)) {
- var d = this._overlap(c, b);
- this._visibleRect = d;
- return ~~(100 * (d.width * d.height / (b.width * b.height)))
- }
- return 0
- } catch (e) {
- return 0
- }
- },
- _getAssetRect: function(a) {
- a = EBG.adaptor.isElementOrNode(a) ? a : EBG.adaptor.getElementById(a);
- (a = EBG.adaptor.getBoundingClientRect(a, {
- clip: !0,
- relativeToTop: !0
- })) || (a = {
- top: 0,
- bottom: 0,
- left: 0,
- right: 0,
- width: 0,
- height: 0
- });
- return a
- },
- _getViewPortMetrics: function() {
- var a = EBG.adaptor._getCurrentWindow(void 0,
- this.adConfig.actualServingMode),
- b = EBG.adaptor.getWindowViewPortMetrics(a);
- 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 &&
- 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);
- return b
- },
- _getViewPortRect: function() {
- var a = this._getViewPortMetrics();
- return {
- top: 0,
- left: 0,
- right: a.Width,
- bottom: a.Height
- }
- },
- _overlap: function(a, b) {
- var c = {
- top: -1,
- right: -1,
- bottom: -1,
- left: -1
- };
- if (!this._intersect(a, b)) return c;
- c.top = Math.max(a.top,
- b.top);
- c.left = Math.max(a.left, b.left);
- c.right = Math.min(a.right, b.right);
- c.bottom = Math.min(a.bottom, b.bottom);
- c.width = c.right - c.left;
- c.height = c.bottom - c.top;
- return c
- },
- _intersect: function(a, b) {
- return !(b.left > a.right || b.right < a.left || b.top > a.bottom || b.bottom < a.top)
- },
- _isVisible: function(a) {
- var a = a || {},
- b = EBG.adaptor.getBoundingClientRect(this._res, {
- clip: !0
- });
- return !!this._calculateVisibilityPercentage({
- resourceObjId: a.resourceObjId || this._resObjId,
- width: a.width || b.width,
- height: a.height || b.height,
- offsetX: a.offsetX ||
- this.adConfig.offsetX,
- offsetY: a.offsetY || this.adConfig.offsetY,
- isUIVZ: a.isUIVZ || this.adConfig.UiVz,
- actualServingMode: a.actualServingMode || this.adConfig.actualServingMode
- })
- },
- _subscribeToEvents: function() {
- try {
- EBG.callSuperFunction(EBG.RichModules.GeometricVisibilityProvider, this, "_subscribeToEvents");
- EBG.eventMgr.subscribeToEvent(new EBG.Events.EventSubscription(EBG.Events.EventNames.PAGE_RESIZE, this._pageResizeHandler, this));
- EBG.eventMgr.subscribeToEvent(new EBG.Events.EventSubscription(EBG.Events.EventNames.PAGE_SCROLL,
- this._pageScrollHandler, this));
- 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();
- var a = new EBG.Events.EventSubscription(EBG.Events.EventNames.PAGE_HIDDEN,
- this._pageHiddenHandler, this);
- a.isDocumentEvent = !0;
- EBG.eventMgr.subscribeToEvent(a);
- a = new EBG.Events.EventSubscription(EBG.Events.EventNames.PAGE_VISIBLE, this._pageVisibleHandler, this);
- a.isDocumentEvent = !0;
- EBG.eventMgr.subscribeToEvent(a);
- EBG.eventMgr.subscribeToEvent(new EBG.Events.EventSubscription(EBG.Events.EventNames.RICH_FLASH_PLAYED, this.onChange, this))
- } catch (b) {}
- },
- _subscribeToElementEvents: function() {
- var a = this,
- b = function() {
- a._resourceBlurHandler()
- },
- c = new EBG.Events.EventSubscription("focus",
- function() {
- a._resourceFocusHandler()
- }, this);
- c.isElementEvent = !0;
- c.elementId = this._resObjId;
- EBG.eventMgr.subscribeToEvent(c);
- 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)
- },
- updateResourceObjId: function(a) {
- EBG.callSuperFunction(EBG.RichModules.GeometricVisibilityProvider, this, "updateResourceObjId", [a]);
- EBG.adaptor._getVisibilityEventName() ||
- this._subscribeToElementEvents()
- },
- _pageVisibleHandler: function() {
- this._triggerVisibilityCheck()
- },
- _pageHiddenHandler: function() {
- this._dispatchVisibilityHidden();
- this.adConfig.visibility.mode == EBG.VisibilityMode.ENHANCED_MODE && this._dispatchCheckVisibility({
- percentage: 0,
- viewPort: this._getViewPortMetrics()
- })
- },
- _resourceFocusHandler: function() {
- this._focusOnResourceElem = !0;
- EBG.runTimed(this, function() {
- this._focusOnResourceElem = !1
- }, [], 60);
- this._pageFocusHandler()
- },
- _resourceBlurHandler: function() {
- EBG.runTimed(this,
- function() {
- !this._justReceivedFocusOnPage && !this._focusOnResourceElem && this._pageBlurHandler()
- }, [], 30)
- },
- _pageFocusHandler: function() {
- this._justReceivedFocusOnPage = !0;
- EBG.runTimed(this, function() {
- this._justReceivedFocusOnPage = !1
- }, [], 60);
- this._triggerVisibilityCheck()
- },
- _pageBlurHandler: function() {
- EBG.runTimed(this, function() {
- !this._justReceivedFocusOnPage && !this._getAdHasFocus() && this._pageHiddenHandler()
- }, [], 30)
- },
- _getAdHasFocus: function() {
- for (var a = this._getAllAdVisibilityProviders(), b = 0; b < a.length; b++)
- if (a[b]._focusOnResourceElem) return !0;
- return !1
- },
- _getAllAdVisibilityProviders: function() {
- var a = [],
- b = EBG.ads[this._adConfig.uid],
- c;
- for (c in b) b.hasOwnProperty(c) && b[c] instanceof EBG.RichModules.VisibilityManager && b[c]._visibilityProvider && a.push(b[c]._visibilityProvider);
- return a
- },
- _pageScrollHandler: function() {
- this._triggerVisibilityCheck()
- },
- _pageResizeHandler: function() {
- if (!this._resizeTimeOut) {
- var a = this;
- this._resizeTimeOut = setTimeout(function() {
- a._resizeTimeOut = null;
- a._triggerVisibilityCheck()
- }, 100)
- }
- },
- _maxAdDurationHandler: function() {
- this._reachedMaxAdDuration = !0
- },
- start: function() {
- EBG.callSuperFunction(EBG.RichModules.GeometricVisibilityProvider, this, "start");
- var a = 3;
- (function() {
- a-- && (this._triggerVisibilityCheck(), EBG.runTimed(this, arguments.callee, [], 1E3))
- }).apply(this)
- },
- onElementMoved: function() {
- EBG.callSuperFunction(EBG.RichModules.GeometricVisibilityProvider, this, "onElementMoved");
- this._triggerVisibilityCheck()
- },
- onChange: function() {
- this._triggerVisibilityCheck()
- },
- _calculateVisibilityResult: function() {
- var a = EBG.callSuperFunction(EBG.RichModules.GeometricVisibilityProvider,
- this, "_calculateVisibilityResult");
- a.visibleRect = this._visibleRect;
- return a
- }
- };
- EBG.declareClass(EBG.RichModules.GeometricVisibilityProvider, EBG.RichModules.BasicVisibilityProvider);
- EBG.RichModules.MouseVisibilityProvider = function(a, b, c) {
- EBG.callSuperConstructor(EBG.RichModules.MouseVisibilityProvider, this, [a, b, c]);
- try {
- this._subscribeToEvents();
- this._scrollWidth = EBG.adaptor.getScrollerWidth();
- var d = this.adConfig.displayWin || EBG.adaptor.getDisplayWin();
- this._screenResolution = {
- width: d.screen.availWidth,
- height: d.screen.availHeight
- };
- this._screenOriginalResolution = {
- width: d.screen.availWidth,
- height: d.screen.availHeight
- };
- if (!this._browserStateSupported()) this._resolutionBaseScreenSize =
- this._resolutionToScreenSize(this._screenResolution), this._resourceInitialPosition = {
- top: d.screenTop,
- left: d.screenLeft
- };
- this._resourceFullSize = this.adConfig.width * this.adConfig.height;
- this._mouseMoveEventInvoker()
- } catch (e) {}
- };
- EBG.RichModules.MouseVisibilityProvider.prototype = {
- name: "Mouse",
- _isStarted: !1,
- _resObj: null,
- _lastViewPort: null,
- _resourceRect: null,
- _resourceFullSize: null,
- _screenResolution: null,
- _screenOriginalResolution: null,
- _screenInitialPosition: {
- top: 0,
- left: 0
- },
- _resolutionBaseScreenSize: null,
- _intervalId: null,
- _calculateVisibilityPercentage: function() {
- if (!this._isReady) return -1;
- var a = this._getViewPortRect(),
- b = this._resourceRect;
- if (!a || !b) return -1;
- var c = 0;
- EBG.adaptor.isPageVisible() && (c = 100 * (EBG.posHelper.calculateVisibleArea({
- X: a.left,
- Y: a.top
- }, {
- X: a.right,
- Y: a.bottom
- }, {
- X: b.left,
- Y: b.top
- }, {
- X: b.right,
- Y: b.bottom
- }) / this._resourceFullSize));
- return c
- },
- _calcResourceRect: function(a) {
- var b;
- if (8 == EBG.adaptor.browser._browserVer && 8 == EBG.adaptor.browser.getDocumentMode()) {
- var c = (b = EBG.adaptor.getElementById(this._resObjId)) && b.getBoundingClientRect ? b.getBoundingClientRect() : {
- top: 0,
- left: 0
- };
- b = a.screenY - (a.clientY - c.top);
- a = a.screenX - (a.clientX - c.left)
- } else b = a.screenY - a.offsetY, a = a.screenX - a.offsetX;
- return {
- top: b,
- left: a,
- bottom: b + this.adConfig.height,
- right: a + this.adConfig.width
- }
- },
- _getViewPortRect: function() {
- var a = null,
- b = this._getWindowRect();
- b && (a = {
- top: 0 > b.top ? 0 : b.top,
- left: 0 > b.left ? 0 : b.left,
- bottom: b.bottom > this._screenResolution.height ? this._screenResolution.height : b.bottom,
- right: b.right > this._screenResolution.width ? this._screenResolution.width : b.right
- });
- return a
- },
- _getWindowRect: function() {
- var a = null,
- b = this.adConfig.displayWin || EBG.adaptor.getDisplayWin();
- if (this._browserStateSupported()) var a = this._isFullScreen(b),
- c = !a ? 6 : 0,
- d = b.screenX + c,
- e = b.screenY +
- 70,
- a = {
- top: e,
- left: d,
- bottom: e + b.outerHeight - this._scrollWidth - (!a ? 70 : 0),
- right: d + b.outerWidth - this._scrollWidth + c
- };
- else this._resolutionBaseScreenSize && (b = this._getUnsupportedWindowTopLeft(b), a = {
- top: b.top,
- left: b.left,
- bottom: b.top + this._resolutionBaseScreenSize.height,
- right: b.left + this._resolutionBaseScreenSize.width
- });
- return a
- },
- _getUnsupportedWindowTopLeft: function(a) {
- var b = {
- top: this._screenInitialPosition.top,
- left: this._screenInitialPosition.left
- },
- c = 0 < a.screenLeft ? a.screenLeft : 0,
- d = c - this._resourceInitialPosition.left,
- e = (0 < d ? this._screenOriginalResolution.width - this._resourceInitialPosition.left % this._screenOriginalResolution.width : this._resourceInitialPosition.left % this._screenOriginalResolution.width) + 1,
- f = 0;
- 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;
- a = 0 < a.screenTop ? a.screenTop : 0;
- d = a - this._resourceInitialPosition.top;
- e = (0 < d ? this._screenOriginalResolution.height -
- this._resourceInitialPosition.top % this._screenOriginalResolution.height : this._resourceInitialPosition.top % this._screenOriginalResolution.height) + 1;
- 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;
- return b
- },
- _isFullScreen: function(a) {
- return !this._browserStateSupported() ? !0 : a.screenX + a.outerWidth == this._screenOriginalResolution.width
- },
- _getViewPortMetrics: function() {
- var a =
- this._getViewPortRect();
- return a ? {
- Width: a.right - a.left,
- Height: a.bottom - a.top
- } : null
- },
- _isVisible: function() {
- return !!this._calculateVisibilityPercentage()
- },
- _mouseMoveEventInvoker: function() {
- if ((this._resObj = this._resObj ? this._resObj : EBG.adaptor.getElementById(this._resObjId)) && this._resObj.parentNode && this._resObj.parentNode.fireEvent) {
- var a = this;
- this._resObj.parentNode.attachEvent("onmousemove", function(b) {
- var c = a._calcResourceRect(b),
- d = a._getViewPortRect();
- if (!a._resourceRect) a._screenInitialPosition.left =
- 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;
- a._handleMultipleScreen(b);
- a._handleRecievedData(c, d)
- });
- this._intervalId = EBG.setInterval(this._resObj.parentNode, function() {
- this.fireEvent("onmousemove")
- }, [], 200)
- } else EBG.runTimed(this, this._mouseMoveEventInvoker, [], 100)
- },
- _handleMultipleScreen: function(a) {
- var b = this._getWindowRect();
- if (b) {
- if (a.screenY > this._screenOriginalResolution.height) {
- var c = b.bottom > a.screenY ? b.bottom : a.screenY;
- if (this._screenResolution.height < c) this._screenResolution.height = c
- }
- if (a.screenX > this._screenOriginalResolution.width && (a = b.right > a.screenX ? b.right : a.screenX, this._screenResolution.width < a)) this._screenResolution.width = a
- }
- },
- _handleRecievedData: function(a, b) {
- if (!this._resourceRect || this._checkRectanglesDifferent(this._resourceRect, a, 1) || this._checkRectanglesDifferent(this._lastViewPort, b, 1)) this._resourceRect =
- a, this._lastViewPort = b, this._triggerCalculation()
- },
- _checkRectanglesDifferent: function(a, b, c) {
- for (var d in a)
- if (a.hasOwnProperty(d) && Math.abs(a[d] - b[d]) > c) return !0;
- return !1
- },
- _subscribeToEvents: function() {
- EBG.callSuperFunction(EBG.RichModules.BasicVisibilityProvider, this, "_subscribeToEvents")
- },
- _resolutionToScreenSize: function(a) {
- var b = {
- width: a.width,
- height: a.height
- };
- 1680 == a.width && 1050 == a.height ? b = {
- width: 1444,
- height: 806
- } : 1366 == a.width && 768 == a.height ? b = {
- width: 1173,
- height: 562
- } : 1360 == a.width && 768 == a.height ?
- b = {
- width: 1167,
- height: 562
- } : 1280 == a.width && 1024 == a.height ? b = {
- width: 1097,
- height: 785
- } : 1280 == a.width && 960 == a.height ? b = {
- width: 1097,
- height: 730
- } : 1152 == a.width && 864 == a.height ? b = {
- width: 985,
- height: 645
- } : 1024 == a.width && 768 == a.height ? b = {
- width: 875,
- height: 562
- } : 800 == a.width && 600 == a.height && (b = {
- width: 680,
- height: 416
- });
- return b
- },
- _triggerCalculation: function() {
- if (this._isReady || this._isStarted && this._resourceRect) this._isReady = !0, this._dispatchCheckVisibility(this._calculateVisibilityResult())
- },
- _browserStateSupported: function() {
- return 9 <=
- EBG.adaptor.browser._browserVer && 9 <= EBG.adaptor.browser.getDocumentMode()
- },
- updateResourceObjId: function(a) {
- this._resObj = null;
- this._intervalId && EBG.clearInterval(this._intervalId);
- EBG.callSuperFunction(EBG.RichModules.MouseVisibilityProvider, this, "updateResourceObjId", [a]);
- this._mouseMoveEventInvoker()
- },
- start: function() {
- EBG.callSuperFunction(EBG.RichModules.MouseVisibilityProvider, this, "start");
- this._isStarted = !0;
- this._triggerCalculation()
- }
- };
- EBG.declareClass(EBG.RichModules.MouseVisibilityProvider, EBG.RichModules.BasicVisibilityProvider);
- EBG.declareNamespace("RichModules");
- EBG.RichModules.VisibilityManager = function(a, b, c) {
- this._adConfig = this.adConfig = a;
- this._resObjId = b;
- this._res = EBG.adaptor.getElementById(b);
- this.actualServingMode = this.adConfig.actualServingMode;
- this._averageLastCalcTime = (new Date).getTime();
- this._options = c || {};
- this._isPanel = this._options.isPanel;
- this._createIntMgrWrapper();
- this._dpm = EBG.dataPipeMgr.getPipe(this.adConfig.sID);
- 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, {
- uvsr: 3,
- vsbp: 0
- }))
- };
- EBG.RichModules.VisibilityManager.ThreholdType = {
- IAB: 0,
- Agency: 1,
- Advertiser: 2
- };
- EBG.RichModules.VisibilityManager.VisibilityPollingTimer = 1E3;
- EBG.RichModules.VisibilityManager.VisibilityCheckInterval = 200;
- EBG.RichModules.VisibilityManager.prototype = {
- adConfig: null,
- _resObjId: null,
- _visibilityData: null,
- _visRecordable: !1,
- _lastVisPercentage: 0,
- _lastVisViewPort: null,
- _averageVisibility: 0,
- _averageScreenShare: 0,
- _averageAdDuration: 0,
- _averageLastCalcTime: null,
- _adCoveragePercentage: 0,
- actualServingMode: EBG.Adaptors.ServingMode.SCRIPT,
- _visibilityProvider: null,
- _availableVisibilityProviders: "GeometricVisibilityProvider,SafeFrameVisibilityProvider,MouseVisibilityProvider,GridVisibilityProvider,FlashVisibilityProvider,FFVisibilityProvider,MraidVisibilityProvider".split(","),
- _visibilityProviderName: null,
- _providersAvailability: {
- GeometricVisibilityProvider: function(a) {
- var b = !0,
- c = a.actualServingMode == EBG.Adaptors.ServingMode.IFRAME,
- d = EBG.Initializer._getAdClass({
- tn: a.templateName
- }),
- e = !d.requiresIframeBust && !a.UiVz,
- d = d.requiresIframeBust && !EBG.iframeLocation && a.aiE && !a.aiE.iflExists;
- if (c && (e || d) || a.ffs.CFF_MRAIDVis && EBG.adaptor.isInApp()) b = !1;
- return b
- },
- FlashVisibilityProvider: function(a) {
- if (EBG.adaptor.flash && 9 <= EBG.adaptor.flash.version) {
- if (EBG.adaptor.browser.isChrome()) return a.ffs.CFF_EnableFlashProvider;
- if (EBG.adaptor.browser.isEdge() && !a.isInstream) return !0
- }
- return !1
- },
- FFVisibilityProvider: function(a) {
- return a.actualServingMode == EBG.Adaptors.ServingMode.IFRAME && EBG.isDefined(window.mozInnerScreenY) && EBG.isDefined(window.mozInnerScreenX)
- },
- GridVisibilityProvider: function() {
- var a = !1,
- b = EBG.adaptor.browser.getDocumentMode() || 5;
- EBG.adaptor.browser.isIE() && 10 < b && (a = !0);
- return a
- },
- MouseVisibilityProvider: function() {
- var a = !1,
- b = EBG.adaptor.browser.getDocumentMode() || 5;
- EBG.adaptor.browser.isIE() && 11 > b && 11 > EBG.adaptor.browser._browserVer &&
- (a = !0);
- return a
- },
- SafeFrameVisibilityProvider: function() {
- return !!EBG.adaptor.isSafeFrame()
- },
- MraidVisibilityProvider: function(a) {
- var b = a.actualServingMode == EBG.Adaptors.ServingMode.IFRAME;
- return a.ffs.CFF_MRAIDVis && EBG.adaptor.isInApp() && !b ? (a.UiVz = !1, !0) : !1
- }
- },
- _init: function() {
- this._visibilityProvider = new EBG.RichModules[this._visibilityProviderName](this._resObjId, this._adConfig, this._options);
- this._dpm.send(EBG.DataProfile.VISIBILITY, {
- vsr: 1,
- vsbp: this.getVisibilityProviderNum()
- });
- this._initializeVisibilityData();
- this._subscribeToEvents();
- this._visRecordable = !0;
- this._adConfig.ffs.VisInstantReportRec && this._reportVisibilityRecordable();
- var a = function() {
- this._adConfig.ffs.VisInstantReportRec || this._reportVisibilityRecordable();
- this._visibilityProvider.start()
- };
- 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))
- },
- _createIntMgrWrapper: function() {
- var a = function() {};
- this._intMgrWrapper = {};
- 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)
- },
- checkVisibility: function(a) {
- a = a ? EBG.cloneObj(a) : {};
- if (!EBG.isDefined(a.percentage) || !EBG.isNumber(a.percentage)) a.percentage = this.calculateVisibilityPercentage();
- if (EBG.isDefinedNotNull(a.percentage) && 0 <= a.percentage) {
- if (!("viewPort" in a)) a.viewPort = this.getViewPortMetrics();
- if (this._adCoveragePercentage) a.percentage =
- Math.max(a.percentage - this._adCoveragePercentage, 0);
- this._res = EBG.adaptor.getElementById(this._resObjId);
- this.adConfig.visibility.mode == EBG.VisibilityMode.ENHANCED_MODE && this._calculateAverages(a);
- 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,
- EBG.RichModules.VisibilityManager.ThreholdType[b])
- }
- },
- updateResourceObjId: function(a) {
- if (this._visibilityProvider && a) this._collectTimersHandler(), this._resObjId = a, this._res = EBG.adaptor.getElementById(a), this._visibilityProvider.updateResourceObjId(a)
- },
- _shouldInitialize: function() {
- var a = EBG.Initializer._getAdClass({
- tn: this.adConfig.templateName
- });
- return this.adConfig.actualServingMode == EBG.Adaptors.ServingMode.IFRAME && !a.requiresIframeBust && this.adConfig.UiVz && (!this.adConfig.ffs.CFF_MRAIDVis || !EBG.adaptor.isInApp()) ?
- (this.adConfig.visibility.mode == EBG.VisibilityMode.DEFAULT_MODE ? this._dpm.send(EBG.DataProfile.VISIBILITY, {
- uvsr: 1
- }) : this._dpm.send(EBG.DataProfile.VISIBILITY, {
- uvsr: 2
- }), !1) : !0
- },
- _getVisibilityProvider: function(a, b) {
- for (var c = 0; c < this._availableVisibilityProviders.length; c++) {
- var d = this._availableVisibilityProviders[c];
- if (this._providersAvailability[d] && this._providersAvailability[d](b)) return d
- }
- return null
- },
- calculateVisibilityPercentage: function(a, b, c, d, e, f, g) {
- var h = 0;
- EBG.adaptor.isPageVisible(this.adConfig.isInstream) ?
- this._visibilityProvider && (h = this._visibilityProvider._calculateVisibilityPercentage({
- resourceObjId: a,
- width: b,
- height: c,
- offsetX: d,
- offsetY: e,
- isUIVZ: f,
- actualServingMode: g
- })) : h = 0;
- return h
- },
- isVisibile: function(a, b, c) {
- var d = !1;
- if (EBG.adaptor.isPageVisible(this.adConfig.isInstream) && this._visibilityProvider) try {
- d = !!this._visibilityProvider._isVisible({
- resourceObjId: a,
- width: b,
- height: c
- })
- } catch (e) {}
- return d
- },
- getViewPortMetrics: function() {
- var a = null;
- this._visibilityProvider && (a = this._visibilityProvider._getViewPortMetrics());
- return a
- },
- _subscribeToEvents: function() {
- try {
- var a = new EBG.Events.EventSubscription(EBG.Events.EventNames.VISIBILITY_CHECK, this._visibilityCheckHandler, this);
- a.dispatcherFilters = {
- "adConfig.rnd": this.adConfig.rnd
- };
- a.timing = EBG.Events.EventTiming.ONTIME;
- EBG.eventMgr.subscribeToEvent(a);
- 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);
- var b = new EBG.Events.EventSubscription(EBG.Events.EventNames.PAGE_HIDDEN, this._stopTimersHandler, this);
- b.isDocumentEvent = !0;
- EBG.eventMgr.subscribeToEvent(b);
- b = new EBG.Events.EventSubscription(EBG.Events.EventNames.VISIBILITY_HIDDEN, this._stopTimersHandler, this);
- EBG.eventMgr.subscribeToEvent(b);
- b = new EBG.Events.EventSubscription(this._isPanel ? "P" : "" + EBG.Events.EventNames.AD_STACKING, this._adStackingHandler, this);
- b.dispatcherFilters = {
- "_adConfig.rnd": this.adConfig.rnd
- };
- EBG.eventMgr.subscribeToEvent(b);
- b = new EBG.Events.EventSubscription(EBG.Events.EventNames.EXPAND, function(a) {
- (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()
- }, this);
- b.dispatcherFilters = {
- "_adConfig.rnd": this.adConfig.rnd
- };
- b.timing = EBG.Events.EventTiming.AFTER;
- EBG.eventMgr.subscribeToEvent(b);
- b.timing = EBG.Events.EventTiming.BEFORE;
- EBG.eventMgr.subscribeToEvent(b);
- b = new EBG.Events.EventSubscription(EBG.Events.EventNames.COLLAPSE,
- function(a) {
- (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()
- }, this);
- b.timing = EBG.Events.EventTiming.BEFORE;
- b.dispatcherFilters = {
- "_adConfig.rnd": this.adConfig.rnd
- };
- EBG.eventMgr.subscribeToEvent(b)
- } catch (c) {}
- },
- _adStackingHandler: function(a) {
- this._adCoveragePercentage = a.eventData.percentage;
- this.checkVisibility()
- },
- _visibilityCheckHandler: function(a) {
- EBG.isDefined(a) &&
- EBG.isDefined(a.eventData) && a.dispatcher === this._visibilityProvider && this.checkVisibility(a.eventData)
- },
- _initializeVisibilityData: function() {
- this._visibilityData = [];
- this._visibilityData[EBG.RichModules.VisibilityManager.ThreholdType.IAB] = {
- minSurface: this.adConfig.visibility.iabMinSurface,
- minDuration: this.adConfig.visibility.iabMinDuration,
- minLargeSurface: this.adConfig.visibility.iabMinLargeSurface,
- minLargeDuration: this.adConfig.visibility.iabMinLargeDuration,
- visibilityInteraction: this._adjustPanelIntName(EBG.Interactions.SystemInts.VISIBILITY_IAB),
- durationInteraction: null,
- isActive: this.adConfig.visibility.mode != EBG.VisibilityMode.DEFAULT_MODE,
- durationNeeded: !1,
- timeOutFlag: null,
- reported: !1
- };
- this._visibilityData[EBG.RichModules.VisibilityManager.ThreholdType.Agency] = {
- minSurface: this.adConfig.visibility.agencyMinSurface,
- minDuration: this.adConfig.visibility.agencyMinDuration,
- visibilityInteraction: this._adjustPanelIntName(EBG.Interactions.SystemInts.VISIBILITY_AGENCY),
- durationInteraction: this._adjustPanelIntName(EBG.Interactions.SystemInts.VISIBILITY_AGENCY_DURATION),
- isActive: this.adConfig.visibility.mode != EBG.VisibilityMode.DEFAULT_MODE && !!this.adConfig.visibility.agencyMinDuration,
- durationNeeded: this.adConfig.visibility.mode == EBG.VisibilityMode.ENHANCED_MODE && !!this.adConfig.visibility.agencyMinDuration,
- timeOutFlag: null,
- reported: !1
- };
- this._visibilityData[EBG.RichModules.VisibilityManager.ThreholdType.Advertiser] = {
- minSurface: this.adConfig.visibility.advertiserMinSurface,
- minDuration: this.adConfig.visibility.advertiserMinDuration,
- visibilityInteraction: this._adjustPanelIntName(EBG.Interactions.SystemInts.VISIBILITY_ADVERTISER),
- durationInteraction: this._adjustPanelIntName(EBG.Interactions.SystemInts.VISIBILITY_ADVERTISER_DURATION),
- isActive: this.adConfig.visibility.mode == EBG.VisibilityMode.ENHANCED_MODE && !this._isPanel && !!this.adConfig.visibility.advertiserMinDuration,
- durationNeeded: this.adConfig.visibility.mode == EBG.VisibilityMode.ENHANCED_MODE && !!this.adConfig.visibility.advertiserMinDuration,
- timeOutFlag: null,
- reported: !1
- }
- },
- _adjustPanelIntName: function(a) {
- return this._isPanel ? "P" + a : a
- },
- _isLargeBanner: function() {
- var a = EBG.adaptor.getBoundingClientRect(this._res, {
- clip: !0
- });
- return 242500 <= a.width * a.height
- },
- _execCheckVisibility: function(a, b) {
- try {
- var c, d, e = this._visibilityData[b];
- e.minLargeSurface && this._isLargeBanner() ? (c = e.minLargeSurface, d = e.minLargeDuration) : (c = e.minSurface, d = e.minDuration);
- a >= c ? !e.reported && !e.timeOutFlag ? e.timeOutFlag = EBG.runTimed(this, function() {
- e.timeOutFlag = null;
- this._dpm.send(EBG.DataProfile.VISIBILITY, {
- vsiab: 1
- });
- this._intMgrWrapper.handleCounterInteraction(e.visibilityInteraction, this.adConfig.uid);
- e.durationNeeded && e.durationInteraction &&
- (this._intMgrWrapper.updateTimer(e.durationInteraction, this.adConfig.uid, d), this._intMgrWrapper.startTimer(e.durationInteraction, this.adConfig.uid));
- e.reported = !0
- }, [], 1E3 * d) : e.reported && e.durationNeeded && e.durationInteraction && this._intMgrWrapper.startTimer(e.durationInteraction, this.adConfig.uid) : (this._dpm.send(EBG.DataProfile.VISIBILITY, {
- uvsiab: 1
- }), this._stopDurationTimeout(b), e.durationInteraction && this._stopDurationCounting(b))
- } catch (f) {}
- },
- _stopDurationTimeout: function(a) {
- if (this._visibilityData[a].timeOutFlag) clearTimeout(this._visibilityData[a].timeOutFlag),
- this._visibilityData[a].timeOutFlag = null
- },
- _stopDurationCounting: function(a) {
- this._visibilityData[a].durationNeeded && this._visibilityData[a].durationInteraction && this._intMgrWrapper.stopTimer(this._visibilityData[a].durationInteraction, this.adConfig.uid)
- },
- _reportVisibilityRecordable: function() {
- var a = this.adConfig.visibility.mode == EBG.VisibilityMode.BASIC_MODE || this.adConfig.visibility.mode == EBG.VisibilityMode.ENHANCED_MODE;
- a && this.adConfig.visibility.iabMinDuration && (this._intMgrWrapper.handleCounterInteraction(this._adjustPanelIntName(EBG.Interactions.SystemInts.VISIBILITY_RECORDABLE),
- this.adConfig.uid), this._dpm.send(EBG.DataProfile.VISIBILITY, {
- vsri: 1
- }));
- a && this.adConfig.visibility.agencyMinDuration && this._intMgrWrapper.handleCounterInteraction(this._adjustPanelIntName(EBG.Interactions.SystemInts.VISIBILITY_AGENCY_RECORDABLE), this.adConfig.uid);
- 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),
- this.adConfig.uid)
- },
- _collectTimersHandler: function() {
- this._intMgrWrapper.clearTimer(this._adjustPanelIntName(EBG.Interactions.SystemInts.VISIBILITY_AVG_AD_SURFACE), this.adConfig.uid);
- this._intMgrWrapper.clearTimer(this._adjustPanelIntName(EBG.Interactions.SystemInts.VISIBILITY_AVG_SCREEN_SHARE), this.adConfig.uid);
- this._calculateAverages({
- percentage: this._lastVisPercentage,
- viewPort: this._visibilityProvider._getViewPortMetrics()
- });
- this._intMgrWrapper.updateTimer(this._adjustPanelIntName(EBG.Interactions.SystemInts.VISIBILITY_AVG_AD_SURFACE),
- this.adConfig.uid, this._averageVisibility);
- this._intMgrWrapper.updateTimer(this._adjustPanelIntName(EBG.Interactions.SystemInts.VISIBILITY_AVG_SCREEN_SHARE), this.adConfig.uid, this._averageScreenShare)
- },
- _stopTimersHandler: function() {
- 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 &&
- (this._stopDurationTimeout(EBG.RichModules.VisibilityManager.ThreholdType[a]), this._stopDurationCounting(EBG.RichModules.VisibilityManager.ThreholdType[a]))
- },
- stopMeasureVisibility: function() {
- this._collectTimersHandler();
- if (this._adConfig.ffs.CFF_PanelVisResetOnCollapse) this._lastVisPercentage = 0;
- this._stopTimersHandler()
- },
- getVisibilityProviderNum: function() {
- var a = {
- None: 0,
- Geometric: 1,
- SafeFrame: 2,
- Mouse: 3,
- Grid: 4,
- Flash: 5,
- FF: 6,
- Mraid: 7,
- AddingEye: 8,
- Basic: 9
- };
- return this._visibilityProvider ? a[this._visibilityProvider.name] ||
- -1 : a.None
- },
- _calculateAverages: function(a) {
- var b = (new Date).getTime() - this._averageLastCalcTime;
- if (1E3 < b && 0 < this._lastVisPercentage) {
- this._averageVisibility = (this._averageVisibility * this._averageAdDuration + this._lastVisPercentage * b) / (this._averageAdDuration + b);
- if (this._lastVisViewPort && this._lastVisViewPort.Width && this._lastVisViewPort.Height) {
- var c = this._lastVisViewPort.Width * this._lastVisViewPort.Height,
- d = EBG.adaptor.getBoundingClientRect(this._res, {
- clip: !0
- }) || {
- width: 0,
- height: 0
- };
- this._averageScreenShare =
- (this._averageScreenShare * this._averageAdDuration + 100 * (this._lastVisPercentage * (d ? d.width * d.height : 0) / 100 / c) * b) / (this._averageAdDuration + b)
- }
- this._averageAdDuration += b
- }
- this._lastVisPercentage = a.percentage;
- this._lastVisViewPort = a.viewPort;
- this._averageLastCalcTime = (new Date).getTime()
- }
- };
- EBG.declareClass(EBG.RichModules.VisibilityManager, null);
- EBG.declareNamespace("RichModules");
- EBG.RichModules.Animator = function(a) {
- this._adConfig = a
- };
- EBG.RichModules.Animator = function() {
- EBG.setInterval(this, this._watchElementPolling, [], 100)
- };
- EBG.RichModules.Animator.prototype = {
- _adaptiveProperties: "top,left,bottom,right,width,height,clip,opacity".split(","),
- _clipRegex: /rect\((.*?)px(.*?)px(.*?)px(.*?)px\)/g,
- _animatingElements: {},
- _watchedElementsList: [],
- EasingFunctions: {
- linear: function(a) {
- return a
- },
- easeInQuad: function(a) {
- return a * a
- },
- easeOutQuad: function(a) {
- return a * (2 - a)
- },
- easeInOutQuad: function(a) {
- return 0.5 > a ? 2 * a * a : -1 + (4 - 2 * a) * a
- },
- easeInCubic: function(a) {
- return a * a * a
- },
- easeOutCubic: function(a) {
- return --a * a * a + 1
- },
- easeInOutCubic: function(a) {
- return 0.5 >
- a ? 4 * a * a * a : (a - 1) * (2 * a - 2) * (2 * a - 2) + 1
- },
- easeInQuart: function(a) {
- return a * a * a * a
- },
- easeOutQuart: function(a) {
- return 1 - --a * a * a * a
- },
- easeInOutQuart: function(a) {
- return 0.5 > a ? 8 * a * a * a * a : 1 - 8 * --a * a * a * a
- },
- easeInQuint: function(a) {
- return a * a * a * a * a
- },
- easeOutQuint: function(a) {
- return 1 + --a * a * a * a * a
- },
- easeInOutQuint: function(a) {
- return 0.5 > a ? 16 * a * a * a * a * a : 1 + 16 * --a * a * a * a * a
- }
- },
- TransitionEasing: {
- ease: "ease",
- linear: "linear",
- easeIn: "ease-in",
- easeOut: "ease-out",
- easeInOut: "ease-in-out"
- },
- animate: function(a, b, c, d) {
- if (a && b) {
- if (EBG.isDefined(b.delay)) {
- var e =
- b.delay,
- b = EBG.cloneObj(b);
- delete b.delay;
- b.animationId = b.animationId || Date.now();
- EBG.runTimed(this, this.animate, [a, b, c, d], e);
- return b.animationId
- }
- if (EBG.isArray(a)) {
- for (var f = [], e = 0; e < a.length; e++) f.push(this.animate(a[e], b, c, d));
- return f
- }
- a.id && this._animatingElements[a.id] && b.abortPrevious && this.abortAllElementAnimations(a.id);
- var f = this._getOriginalValues(a),
- g = b.animationId || Date.now();
- if (b.init && EBG.isObj(b.init)) {
- var e = this._adaptProperties(f, b.init),
- h;
- for (h in e) f[h] = this._recalculateProperyValue(h,
- e[h], f, 1)
- }
- if (b.reverse)
- for (var i = EBG.cloneObj(f), j = this._adaptProperties(i, b), e = 0; e < this._adaptiveProperties.length; e++) {
- h = this._adaptiveProperties[e];
- var k = j[h];
- EBG.isDefined(k) && (f[h] = this._recalculateProperyValue(h, k, i, 1), b[h] = i[h])
- }
- if (EBG.isObj(f))
- for (h in f)
- if (EBG.isDefined(b[h]) || b.init && EBG.isDefined(b.init[h])) a.style[h] = this._adjustStyle(h, f[h]);
- this._shouldUseTransitionAnimation(a, f, b) ? this._CSSAnimate(g, a, f, b, c, d) : this._JSAnimate(g, a, f, b, c, d);
- return g
- }
- },
- _JSAnimate: function(a, b, c, d, e, f) {
- var g =
- this._createAnimationRecord(b.id, a, d),
- h, i, j = new EBG.Events.Event(EBG.Events.EventNames.ANIMATION);
- j.dispatcher = {
- animationId: a,
- module: this
- };
- j.eventData = {
- customData: d.customData || {},
- element: b,
- elementId: b.id,
- style: EBG.cloneObj(c),
- finished: !1,
- aborted: !1,
- time: 0,
- animationId: a,
- loop: !!d.loop
- };
- j.timing = EBG.Events.EventTiming.BEFORE;
- if (EBG.eventMgr.dispatchEvent(j)) this.abort(a, b.id);
- else {
- d.alignToElement && this._watchElement(d.alignToElement, g, function(a, e, f) {
- c.left += f.left - e.left;
- c.top += f.top - e.top;
- for (var e = ["top", "left"], f = {}, g = 0; g < e.length; g++) {
- var i = e[g];
- 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])
- }
- a.styleChange = f
- }, this);
- g.isRunning = !0;
- var k = Date.now(),
- m = EBG.isDefined(d.duration) ? d.duration : 1E3,
- 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,
- p = this,
- n = !!d.loop,
- r = 1E3 / (d.fps || 48),
- q = d.alignToElement,
- d = this._adaptProperties(c, d);
- g.styleProps = d;
- g.origin = c;
- (function() {
- i = Date.now() - k;
- h = i / (m || 1);
- var o = {};
- h = Math.min(h, 1);
- for (var s in d) o[s] = p._recalculateProperyValue(s, d[s], c, l(h)), b.style[s] = p._adjustStyle(s, o[s]);
- EBG.mergeObj(c, o, !1);
- j.eventData = {
- customData: d.customData || {},
- element: b,
- elementId: b.id,
- style: EBG.cloneObj(o),
- finished: 1 === h,
- aborted: !!g.abort,
- time: i,
- animationId: a,
- loop: !!d.loop,
- alignedStyle: g.alignedStyle
- };
- j.timing = EBG.Events.EventTiming.ONTIME;
- EBG.eventMgr.dispatchEvent(j) &&
- p.abort(a, b.id);
- 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() {
- e.apply(f || p, [b, o])
- }, 1)))
- })()
- }
- },
- _CSSAnimate: function(a, b, c, d, e, f) {
- var g = this._createAnimationRecord(b.id, a, d);
- g.isCSSAnimation = !0;
- var h = new EBG.Events.Event(EBG.Events.EventNames.ANIMATION);
- h.dispatcher = {
- animationId: a,
- module: this
- };
- h.eventData = {
- customData: d.customData || {},
- element: b,
- elementId: b.id,
- style: EBG.cloneObj(c),
- finished: !1,
- aborted: !1,
- time: 0,
- animationId: a,
- loop: !!d.loop
- };
- h.timing = EBG.Events.EventTiming.BEFORE;
- if (EBG.eventMgr.dispatchEvent(h)) this.abort(a, b.id);
- else {
- var i, j, k;
- d.alignToElement && this._watchElement(d.alignToElement, g, function(a, e, f) {
- b.style[this._getTransitionPropertyName()] = "";
- this.a = b.offsetHeight;
- c.left += f.left - e.left;
- c.top += f.top - e.top;
- k = this._adaptProperties(c, d);
- a.styleProps = k;
- for (var g in f) ~"topleftbottomright".indexOf(g) &&
- (~EBG.indexOfArray(k, g) || (b.style[g] = this._adjustStyle(g, parseInt(b.style[g] || "0", 10) + Math.round(f[g]) - Math.round(e[g]))));
- a = "";
- for (e = 0; e < l.length; e++) a += (e ? ", " : "") + l[e] + " " + (m - j) + "ms " + q;
- b.style[p] = a;
- this._setElementEndStyle(b, c, k)
- }, this);
- g.isRunning = !0;
- var m = EBG.isDefined(d.duration) ? d.duration : 1E3,
- l = EBG.filterArray(this._adaptiveProperties, function(a) {
- return EBG.isDefined(d[a])
- }),
- p = this._getTransitionPropertyName(),
- n = this,
- r = !!d.loop,
- q = d.easing ? this.TransitionEasing[d.easing] : this.TransitionEasing.ease,
- o = 1E3 / (d.fps || 48);
- this.a = b.offsetHeight;
- for (var s = "", t = 0; t < l.length; t++) s += (t ? ", " : "") + l[t] + " " + m + "ms " + q;
- b.style[p] = s;
- k = this._adaptProperties(c, d);
- g.styleProps = k;
- g.origin = c;
- this._setElementEndStyle(b, c, k);
- var u = Date.now();
- (function() {
- j = Date.now() - u;
- i = j / (m || 1);
- i = Math.min(i, 1);
- for (var k = {}, l = EBG.adaptor.getComputedStyle(b), p = 0; p < n._adaptiveProperties.length; p++) {
- var q = n._adaptiveProperties[p];
- k[q] = "clip" == q ? l[q] : 1 * l[q].replace(/[^\d\.\-]/g, "")
- }
- EBG.mergeObj(c, k, !1);
- h.eventData = {
- customData: d.customData || {},
- element: b,
- elementId: b.id,
- style: EBG.cloneObj(k),
- finished: 1 === i,
- aborted: !!g.abort,
- time: j,
- animationId: a,
- loop: r,
- alignedStyle: g.alignedStyle
- };
- h.timing = EBG.Events.EventTiming.ONTIME;
- EBG.eventMgr.dispatchEvent(h) && n.abort(a, b.id);
- if (1 > i && !g.abort) setTimeout(arguments.callee, o);
- 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() {
- e.apply(f ||
- n, [b, k])
- }, 1), r && !g.abort) {
- n.a = b.offsetHeight;
- for (q in c) q in d && (b.style[q] = n._adjustStyle(q, c[q]));
- EBG.runTimed(n, n._CSSAnimate, [a, b, c, d], 0)
- }
- })()
- }
- },
- _setElementEndStyle: function(a, b, c) {
- for (var d in c) a.style[d] = this._adjustStyle(d, this._recalculateProperyValue(d, c[d], b, 1))
- },
- _shouldUseTransitionAnimation: function(a, b, c) {
- a = this.supportsCSSTransitions();
- c = !c.easing || !EBG.isFunc(c.easing) && (c.easing in EBG.Animation.TransitionEasing || /cubic-bezier\(.*?,.*?,.*?,.*?\)/g.test(c.easing));
- return a && c
- },
- _transitionToJSEasing: function(a) {
- return {
- ease: EBG.Animation.Easing.easeInOutQuint,
- linear: EBG.Animation.Easing.linear,
- easeIn: EBG.Animation.Easing.easeInCubic,
- easeOut: EBG.Animation.Easing.easeInOutCubic,
- easeInOut: EBG.Animation.Easing.easeInOutCubic
- }[a]
- },
- _adjustStyle: function(a, b) {
- return -1 !== "topleftbottomrightwidthheight".indexOf(a) ? b + "px" : b
- },
- _isRectCSS: function(a) {
- this._clipRegex.lastIndex = 0;
- return this._clipRegex.test(a)
- },
- _getRectCSSValues: function(a) {
- this._clipRegex.lastIndex = 0;
- return this._clipRegex.exec(a)
- },
- _getOriginalValues: function(a) {
- var b = EBG.adaptor.getBoundingClientRect(a, {
- clip: !1,
- relativeToWindow: !0
- }),
- a = EBG.adaptor.getComputedStyle(a),
- c = window.scrollY || document.documentElement && document.documentElement.scrollTop || document.body && document.body.scrollTop || 0,
- d = window.scrollX || document.documentElement && document.documentElement.scrollLeft || document.body && document.body.scrollLeft || 0;
- b.top = c + b.top;
- b.left = d + b.left;
- b.bottom = c + b.bottom;
- b.right = d + b.right;
- b.clip = a.getPropertyValue("clip");
- b.opacity = 1 * (a.getPropertyValue("opacity") || 1);
- return b
- },
- _recalculateProperyValue: function(a,
- b, c, d) {
- switch (a) {
- case "clip":
- var e = function(a) {
- return 1 * a.trim().replace(",", "")
- };
- orignalClip = this._isRectCSS(c[a]) ? this._getRectCSSValues(c[a]) : this._getRectCSSValues("rect(0px," + c.width + "px," + c.height + "px,0px)");
- clip = this._getRectCSSValues(b);
- 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)";
- default:
- return c[a] + b * d
- }
- },
- _adaptProperties: function(a, b) {
- res = {};
- for (var c =
- EBG.filterArray(this._adaptiveProperties, function(a) {
- return EBG.isDefined(b[a])
- }), d = 0; d < c.length; d++) {
- var e = c[d],
- f = b[e];
- if ("clip" === e) {
- var g = function(a) {
- return 1 * a.trim().replace(",", "")
- },
- h = this._isRectCSS(a[e]) ? this._getRectCSSValues(a[e]) : this._getRectCSSValues("rect(0px," + a.width + "px," + a.height + "px,0px)"),
- f = this._isRectCSS(f) ? this._getRectCSSValues(f) : h;
- 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)"
- } else "string" === EBG.typeOf(f) ?
- 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]
- }
- return res
- },
- isAnimating: function(a) {
- if (a = this._animatingElements[a])
- for (var b in a)
- if (a[b].isRunning) return !0;
- return !1
- },
- abortAllElementAnimations: function(a) {
- var b = this._animatingElements[a];
- if (b)
- for (var c in b) this.abort(c, a)
- },
- getAnimationRecord: function(a, b) {
- if (!b)
- for (b in this._animatingElements)
- if (this._animatingElements[b][a]) break;
- return b ?
- this._animatingElements[b][a] : null
- },
- abort: function(a, b, c) {
- c = c || {};
- if (record = this.getAnimationRecord(a, b)) {
- record.abort = !0;
- if (a = EBG.adaptor.getElementById(record.elementId))
- if (record.isCSSAnimation) {
- if (b = this._getOriginalValues(a), a.style[this._getTransitionPropertyName()] = "", this.a = a.offsetHeight, !c.jumpToEndOnAbort && !record.properties.jumpToEndOnAbort)
- for (var d in b) EBG.isDefined(record.styleProps[d]) && (a.style[d] = this._adjustStyle(d, b[d]))
- } else(c.jumpToEndOnAbort || record.properties.jumpToEndOnAbort) &&
- this._setElementEndStyle(a, record.origin, record.styleProps);
- return !0
- }
- return !1
- },
- _createAnimationRecord: function(a, b, c) {
- this._animatingElements[a] = this._animatingElements[a] || {};
- var d = this._animatingElements[a];
- d[b] = {};
- d[b].properties = EBG.cloneObj(c);
- d[b].elementId = a;
- return d[b]
- },
- supportsCSSTransitions: function() {
- var a = document.createElement("p").style;
- return "transition" in a || "WebkitTransition" in a || "MozTransition" in a || "msTransition" in a || "OTransition" in a
- },
- _getTransitionPropertyName: function() {
- for (var a =
- document.createElement("div").style, b = ["webkitTransition", "transition"], c = 0; c < b.length; c++)
- if (b[c] in a) return b[c]
- },
- _watchElementPolling: function() {
- for (var a = 0; a < this._watchedElementsList.length; a++) {
- var b = this._watchedElementsList[a],
- c = EBG.adaptor.getBoundingClientRect(b.element, {
- clip: !0,
- relativeToWindow: !0
- });
- b.record.alignedStyle = c;
- 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
- }
- },
- _watchElement: function(a,
- b, c, d) {
- c && this._watchedElementsList.push({
- element: a,
- record: b,
- previousRect: EBG.adaptor.getBoundingClientRect(a, {
- clip: !0,
- relativeToWindow: !0
- }),
- callback: c,
- binding: d
- })
- },
- _unwatchElement: function(a) {
- for (var b = 0; b < this._watchedElementsList.length; b++)
- if (this._watchedElementsList[b].element == a) {
- this._watchedElementsList.splice(b, 1);
- break
- }
- }
- };
- EBG.declareNamespace("RichModules");
- EBG.RichModules.AdStackingDetector = function(a, b) {
- this._adConfig = a;
- this._isFriendlyIframe = this._adConfig.actualServingMode == EBG.Adaptors.ServingMode.FRIENDLY_IFRAME || this._adConfig.actualServingMode == EBG.Adaptors.ServingMode.TOPMOST_FRIENDLY_IFRAME && window.frameElement;
- this._isPanel = b;
- this._elementsIds = [];
- this._validElementParents = [];
- this._visibilityEvent = {};
- if (this._shouldInitialize()) {
- this._validElementParents.push(a.placeHolderId);
- EBG.Const.OUTER_DIV && this._validElementParents.push(EBG.Const.OUTER_DIV);
- var c = new EBG.Events.EventSubscription(EBG.Events.EventNames.VISIBILITY_CHECK, this._handleVisibilityEvent, this);
- c.dispatcherFilters = {
- "adConfig.rnd": this._adConfig.rnd
- };
- c.timing = EBG.Events.EventTiming.ONTIME;
- EBG.eventMgr.subscribeToEvent(c);
- this._adConfig.adStarted ? this._start() : (c = new EBG.Events.EventSubscription(EBG.Events.EventNames.AD_START, function() {
- this._start()
- }, this), c.timing = EBG.Events.EventTiming.ONTIME, EBG.eventMgr.subscribeToEvent(c))
- }
- };
- EBG.RichModules.AdStackingDetector.prototype = {
- _interactionThreshold: 100,
- _analyzeInterval: 200,
- _densityFactor: 5,
- _prevPercentage: 0,
- _minThresholdForAdStacking: 50,
- _generatePointsGrid: function(a) {
- for (var b = [], c = (a.height - 2) / this._densityFactor, a = (a.width - 2) / this._densityFactor, d = 0; d <= this._densityFactor; d++)
- for (var e = 0; e <= this._densityFactor; e++) b.push({
- x: Math.round(a * d),
- y: Math.round(c * e)
- });
- return b
- },
- _handleVisibilityEvent: function(a) {
- if (~EBGInfra.indexOfArray(this._elementsIds, a.dispatcher._resObjId)) this._visibilityEvent =
- EBG.cloneObj(a.eventData)
- },
- _shouldInitialize: function() {
- 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
- },
- _start: function() {
- EBG.setInterval(this, this._analyze, [], this._analyzeInterval)
- },
- _analyze: function() {
- var a = this._calculateConcealmentPercentage();
- if (!this._adStackingReported && a.visible >= this._interactionThreshold &&
- this._visibilityEvent.percentage >= this._minThresholdForAdStacking) EBG.intMgr.handleCounterInteraction((this._isPanel ? "P" : "") + EBG.Interactions.SystemInts.AD_STACKING, this._adConfig.uid), this._adStackingReported = !0;
- if (a.full != this._prevPercentage) {
- this._prevPercentage = a.full;
- var b = new EBG.Events.Event(this._isPanel ? "P" : "" + EBG.Events.EventNames.AD_STACKING);
- b.eventData = {
- intName: (this._isPanel ? "P" : "") + EBG.Interactions.SystemInts.AD_STACKING,
- percentage: a.full
- };
- b.dispatcher = this;
- b.timing = EBG.Events.EventTiming.BEFORE;
- if (!EBG.eventMgr.dispatchEvent(b)) b.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER, EBG.eventMgr.dispatchEvent(b)
- }
- },
- _calculateConcealmentPercentage: function() {
- var a = {
- full: 0,
- visible: 0
- };
- try {
- if (!this._elementsIds.length) return a;
- var b = EBG.adaptor.serving._getTopFriendlyIframe(this._adConfig.displayWin || EBG.adaptor.getDisplayWin()),
- c = EBG.adaptor.getElementById(this._assetId),
- d = EBG.adaptor.getBoundingClientRect(c, {
- clip: !0,
- relativeToTop: !0
- });
- if (!c || !c.offsetWidth || !c.offsetHeight || EBG.isDefined(this._visibilityEvent.assetId) &&
- this._visibilityEvent.assetId != this._assetId) return a;
- var e = this._visibilityEvent.visibleRect,
- c = e || d;
- if (!c || 0 == c.width || 0 == c.height) return a;
- this._grid = this._generatePointsGrid(c);
- for (var f = 0, g = 0; g < this._grid.length; g++) {
- var h = this._grid[g];
- h.x += Math.floor(c.left) + 1;
- h.y += Math.floor(c.top) + 1;
- var i = b.document.elementFromPoint(h.x, h.y);
- if (i && (!i.id || -1 == EBG.indexOfArray(this._elementsIds, i.id)))(!this._isFriendlyIframe || i != window.frameElement) && !this._hasValidParent(i) && !this._isElementTransparent(i) &&
- f++
- }
- var j = e ? e.width * e.height / (d.width * d.height) : 1,
- k = Math.round(100 * (f / this._grid.length));
- return {
- full: Math.ceil(k * j),
- visible: k
- }
- } catch (m) {
- return a
- }
- },
- addElementId: function(a, b) {
- if (-1 == EBGInfra.indexOfArray(this._elementsIds, a) && (this._elementsIds.push(a), b)) this._assetId = a, this._visibilityEvent = {}
- },
- _invisibleProperties: {
- visibility: "hidden",
- display: "none",
- opacity: function(a) {
- return 0 == 1 * a
- },
- "-moz-opacity": function(a) {
- return EBG.adaptor.browser.isFF() && 0 == 1 * a
- },
- "-khtml-opacity": function(a) {
- return EBG.adaptor.browser.isSafari() &&
- 0 == 1 * a
- },
- filter: function(a) {
- return EBG.adaptor.browser.isIE() && 10 > EBG.adaptor.browser.getVersion() && -1 != EBG.indexOfArray(["alpha(opacity=0)", "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"], a)
- },
- "background-color": function(a, b, c) {
- var d = function(a) {
- var b = a.replace(/^\s+|\s+$/g, "").match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);
- return b && 0 == 1 * b[4] || "transparent" == a
- },
- e = b.innerText || b.textContent,
- f = EBG.adaptor.browser.isIE() && 9 > EBG.adaptor.browser.getVersion(),
- c = c.getPropertyValue("color");
- return d(a) && -1 == EBG.indexOfArray("object,canvas,video,source,track,iframe,embed,img".split(","), b.tagName.toLowerCase()) && (!e || !f && d(c))
- }
- },
- _isElementTransparent: function(a) {
- var b = EBG.adaptor.getComputedStyle(a),
- c = this._invisibleProperties,
- d, e;
- for (e in c) {
- var f = b.getPropertyValue(e);
- if (f)
- for (var g = EBG.isArray(c[e]) ? c[e] : [c[e]], h = 0; h < g.length; h++)
- if (d = EBG.isFunc(g[h]) ? g[h](f, a, b) : f == g[h]) return !0
- }
- return !1
- },
- _hasValidParent: function(a) {
- if (!a) return !1;
- for (var b = a.id; a.parentElement;) {
- if (a.parentElement.id &&
- -1 != EBG.indexOfArray(this._validElementParents, a.parentElement.id)) return this.addElementId(b, !1), !0;
- a = a.parentElement
- }
- return !1
- }
- };
- EBG.declareClass(EBG.RichModules.AdStackingDetector, null);
- EBG.Interactions.DwellTimeManager = function(a) {
- this._adConfig = a;
- this._defaultPanelName = this._adConfig.panelName
- };
- EBG.Interactions.DwellTimeManager.prototype = {
- _state: {
- idle: 0,
- start: 1,
- stop: 2,
- panelOpenMouseOver: 3,
- videoPlay: 4,
- videoPlayMouseOut: 5,
- panelOpenMouseOut: 6,
- idlePanelOpen: 7,
- idleVideoPlay: 8
- },
- _idleTimeLimit: 700,
- _curState: 0,
- _numOfOpenPanels: 0,
- _isMouseOverAd: !1,
- _wasMouseOverAd: !1,
- _isUserInteractionOccur: !1,
- _isVideoPlay: !1,
- _isVideoAutoReplay: !1,
- _mouseTimeoutId: 0,
- _autoShownPanels: [],
- _videosToTrack: [],
- _defaultMovieNum: 1,
- _dwellUniqueNeedsToBeReported: !0,
- init: function() {
- this._subscribeToEvents()
- },
- _subscribeToAdEvent: function(a,
- b, c) {
- a = new EBG.Events.EventSubscription(a, b, this);
- if (c) a.dispatcherFilters = {
- "_adConfig.rnd": this._adConfig.rnd
- };
- EBG.eventMgr.subscribeToEvent(a)
- },
- _subscribeToEvents: function() {
- this._subscribeToAdEvent(EBG.Events.EventNames.MOUSE_OVER, this._handleMouseOverAd, !0);
- this._subscribeToAdEvent(EBG.Events.EventNames.MOUSE_OUT, this._handleMouseOutOfAd, !0);
- this._subscribeToAdEvent(EBG.Events.EventNames.DWELL_VIDEO_START, this._handleVideoPlay, !0);
- this._subscribeToAdEvent(EBG.Events.EventNames.DWELL_VIDEO_STOP,
- this._handleVideoStop, !0);
- this._subscribeToAdEvent(EBG.Events.EventNames.USER_INTERACTION, this._handleUserInteraction, !0);
- this._subscribeToAdEvent(EBG.Events.EventNames.EXPAND, this._handlePanelOpen, !0);
- this._subscribeToAdEvent(EBG.Events.EventNames.COLLAPSE, this._handlePanelClose, !0);
- this._subscribeToAdEvent(EBG.Events.EventNames.FULL_SCREEN_START, this._handlePanelOpen, !0);
- this._subscribeToAdEvent(EBG.Events.EventNames.FULL_SCREEN_END, this._handlePanelClose, !0)
- },
- _handleMouseThreshold: function() {
- this._mouseTimeoutId =
- null;
- EBG.intMgr.updateTimer(EBG.Interactions.SystemInts.DWELL_TIME, this._adConfig.uid, this._idleTimeLimit / 1E3);
- switch (this._curState) {
- case this._state.idle:
- this._isMouseOverAd ? this._start() : this._stop();
- break;
- case this._state.idleVideoPlay:
- this._isMouseOverAd ? this._videoPlay() : this._videoPlayMouseOut();
- break;
- case this._state.idlePanelOpen:
- this._isMouseOverAd ? this._panelOpenMouseOver() : this._panelOpenMouseOut()
- }
- },
- _handleUserInteraction: function() {
- if (this._wasMouseOverAd) switch (this._isUserInteractionOccur = !0, this._curState) {
- case this._state.idle:
- this._start();
- break;
- case this._state.idleVideoPlay:
- this._videoPlay();
- break;
- case this._state.idlePanelOpen:
- this._panelOpenMouseOver()
- }
- },
- _handleVideoPlay: function(a) {
- a = a.eventData.assetId || this._defaultMovieNum;
- if (this._isMouseOverAd) switch (this._videosToTrack.push(a), this._isVideoPlay = !0, this._reportUserInitatedVideo(a), this._curState) {
- case this._state.idle:
- this._idleVideoPlay();
- break;
- case this._state.idlePanelOpen:
- break;
- case this._state.idleVideoPlay:
- break;
- case this._state.start:
- this._videoPlay();
- this._reportUserInitatedVideo(a);
- break;
- case this._state.stop:
- this._isVideoAutoReplay || (this._videoPlayMouseOut(), this._reportUserInitatedVideo(a));
- break;
- case this._state.videoPlayMouseOut:
- this._stop();
- this._isVideoAutoReplay = !0;
- break;
- default:
- this._isVideoAutoReplay || this._reportUserInitatedVideo(a)
- }
- },
- _handleVideoStop: function(a) {
- a = EBGInfra.indexOfArray(this._videosToTrack, a.eventData.assetId);
- if (-1 !== a && (this._videosToTrack.splice(a, 1), !(0 < this._videosToTrack.length))) switch (this._isVideoPlay =
- this._isVideoAutoReplay = !1, this._curState) {
- case this._state.videoPlay:
- this._isMouseOverAd ? 0 < this._numOfOpenPanels ? this._panelOpenMouseOver() : this._start() : 0 < this._numOfOpenPanels ? this._panelOpenMouseOut() : this._stop();
- break;
- case this._state.videoPlayMouseOut:
- 0 < this._numOfOpenPanels ? this._panelOpenMouseOut() : this._stop();
- break;
- case this._state.idleVideoPlay:
- this._idle()
- }
- },
- _handleMouseOverAd: function() {
- this._wasMouseOverAd = this._isMouseOverAd = !0;
- this._isVideoAutoReplay = !1;
- this._checkRecentAutoPanelOpen();
- switch (this._curState) {
- case this._state.idle:
- case this._state.idlePanelOpen:
- case this._state.idleVideoPlay:
- this._startMouseTimer();
- break;
- case this._state.stop:
- this._isVideoPlay ? this._videoPlay() : this._start();
- break;
- case this._state.panelOpenMouseOut:
- this._panelOpenMouseOver();
- break;
- case this._state.videoPlayMouseOut:
- this._videoPlay()
- }
- },
- _checkRecentAutoPanelOpen: function() {
- if (this._curState == this._state.idle)
- for (var a = (new Date).getTime(), b = this._autoShownPanels.length - 1; 0 <= b; b--) {
- var c = this._autoShownPanels[b];
- 300 >= a - c.showtime && (this._autoShownPanels.splice(b, 1), this.handlePanelOpen(c.name))
- }
- },
- _handleMouseOutOfAd: function() {
- this._isMouseOverAd = !1;
- switch (this._curState) {
- case this._state.idle:
- case this._state.idleVideoPlay:
- case this._state.idlePanelOpen:
- this._clearMouseTimer();
- break;
- case this._state.start:
- this._stop();
- break;
- case this._state.videoPlay:
- this._videoPlayMouseOut();
- break;
- case this._state.panelOpenMouseOver:
- this._panelOpenMouseOut()
- }
- },
- _handlePanelOpen: function(a) {
- var b = a.eventData.props && a.eventData.props.panel.name ||
- this._defaultPanelName;
- if (!this._wasMouseOverAd || a.dispatcher.expandedBy == EBG.ActionType.AUTO) this._onAutoShowPanel(b);
- else switch (this._numOfOpenPanels++, this._curState) {
- case this._state.start:
- this._panelOpenMouseOver();
- break;
- case this._state.stop:
- this._panelOpenMouseOut();
- break;
- case this._state.idle:
- this._idlePanelOpen();
- break;
- case this._state.videoPlay:
- this._panelOpenMouseOver()
- }
- },
- _onAutoShowPanel: function(a) {
- this._addAutoShownPanel({
- name: a || this._defaultPanelName,
- showtime: (new Date).getTime()
- })
- },
- _addAutoShownPanel: function(a) {
- 0 <= this._getAutoShownPanelIdx(a.name) || (this._autoShownPanels[this._autoShownPanels.length] = a)
- },
- _getAutoShownPanelIdx: function(a) {
- for (var a = a || this._defaultPanelName, b = -1, c = 0; c < this._autoShownPanels.length; c++)
- if (this._autoShownPanels[c].name == a) {
- b = c;
- break
- }
- return b
- },
- _handlePanelClose: function(a) {
- var b = "",
- b = "FullScreen" == a.eventData ? a.eventData : a.eventData.props && a.eventData.props.panel ? a.eventData.props.panel.name : this._defaultPanelName,
- a = this._getAutoShownPanelIdx(b);
- if (0 <= a) this._autoShownPanels.splice(a, 1);
- else {
- this._numOfOpenPanels--;
- if (0 > this._numOfOpenPanels) this._numOfOpenPanels = 0;
- if (0 == this._numOfOpenPanels) switch (this._curState) {
- case this._state.panelOpenMouseOver:
- this._isVideoPlay ? this._videoPlay() : this._start();
- break;
- case this._state.panelOpenMouseOut:
- this._isVideoPlay ? this._videoPlayMouseOut() : this._stop();
- break;
- case this._state.idlePanelOpen:
- this._idle()
- }
- }
- },
- _startMouseTimer: function() {
- if (!this._mouseTimeoutId) {
- var a = this;
- this._mouseTimeoutId = setTimeout(function() {
- a._handleMouseThreshold()
- },
- this._idleTimeLimit)
- }
- },
- _clearMouseTimer: function() {
- clearTimeout(this._mouseTimeoutId);
- this._mouseTimeoutId = null
- },
- _isIdleMode: function() {
- return this._curState == this._state.idle || this._curState == this._state.idlePanelOpen || this._curState == this._state.idleVideoPlay
- },
- _idle: function() {
- if (this._isIdleMode()) this._curState = this._state.idle
- },
- _start: function() {
- this._curState = this._state.start;
- this._startTimer()
- },
- _stop: function() {
- this._curState = this._state.stop;
- this._endTimer()
- },
- _idlePanelOpen: function() {
- if (this._isIdleMode()) this._curState =
- this._state.idlePanelOpen
- },
- _panelOpenMouseOver: function() {
- this._curState = this._state.panelOpenMouseOver;
- this._startTimer()
- },
- _videoPlay: function() {
- this._curState = this._state.videoPlay;
- this._startTimer()
- },
- _videoPlayMouseOut: function() {
- this._curState = this._state.videoPlayMouseOut;
- this._startTimer()
- },
- _panelOpenMouseOut: function() {
- this._curState = this._state.panelOpenMouseOut;
- this._startTimer()
- },
- _idleVideoPlay: function() {
- if (this._isIdleMode()) this._curState = this._state.idleVideoPlay
- },
- _reportUserInitatedVideo: function(a) {
- var b =
- new EBG.Events.Event(EBG.Events.EventNames.USER_INITIATED_VIDEO);
- b.dispatcher = this;
- b.eventData = {
- assetId: a
- };
- EBG.eventMgr.dispatchEvent(b)
- },
- _isTimeOverLimit: function() {
- return this._isTimerStarted() ? (this._endTimer(), EBG.intMgr.getTimerValue(EBG.Interactions.SystemInts.DWELL_TIME, this._adConfig.uid) > this._idleTimeLimit / 1E3) : !1
- },
- _isTimerStarted: function() {
- return EBG.intMgr.isTimerRunning(EBG.Interactions.SystemInts.DWELL_TIME, this._adConfig.uid)
- },
- _resetTimer: function() {
- EBG.intMgr.updateTimer(EBG.Interactions.SystemInts.DWELL_TIME,
- this._adConfig.uid, 0)
- },
- _startTimer: function() {
- var a = new EBG.Events.Event(EBG.Events.EventNames.DWELL_UNIQUE);
- a.dispatcher = this;
- a.eventData = {
- firstTime: this._dwellUniqueNeedsToBeReported,
- adUId: this._adConfig.uid
- };
- EBG.eventMgr.dispatchEvent(a);
- this._dwellUniqueNeedsToBeReported = !1;
- EBG.intMgr.startTimer(EBG.Interactions.SystemInts.DWELL_TIME, this._adConfig.uid)
- },
- _endTimer: function() {
- EBG.intMgr.stopTimer(EBG.Interactions.SystemInts.DWELL_TIME, this._adConfig.uid)
- }
- };
- EBG.declareNamespace("RichModules");
- EBG.RichModules.PanelFrequencyManager = function() {};
- EBG.RichModules.PanelFrequencyManager.prototype = {
- _cookieName: "",
- _adsInfo: [],
- _adInfoIdx: -1,
- _frequencyTimes: -1,
- _frequencyPeriod: -1,
- _adId: -1,
- _maxLen: -1,
- _optOut: 0,
- _cff: {},
- init: function(a, b, c, d, e, f) {
- this.initialize({
- frequencyTimes: a,
- frequencyPeriod: b,
- adId: c,
- histLen: d,
- optOut: e,
- disableAutoExpand: f,
- isGeoStrict: 1
- })
- },
- initialize: function(a) {
- try {
- if (this._frequencyTimes = EBG.isDefinedNotNull(a.frequencyTimes) ? a.frequencyTimes : 6, this._frequencyPeriod = EBG.isDefinedNotNull(a.frequencyPeriod) ? a.frequencyPeriod : 4, this._adId =
- 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) {
- a = "";
- (this._isStorageSupported = this.isStorageSupported()) && (a = this._readStorage(this._cookieName));
- if ("" != a) this._adsInfo = a.split("&");
- if (0 < this._adsInfo.length) {
- for (a = 0; a < this._adsInfo.length; a++) {
- this._adsInfo[a] =
- this._adsInfo[a].split(":");
- for (var b = this._adsInfo[a], c = 0; c < b.length; c++) b[c] = parseInt(b[c]);
- if (b[0] == this._adId) this._adInfoIdx = a
- }
- this._deleteOldItems();
- 6 == this._frequencyTimes ? -1 != this._adInfoIdx && (this._deleteItem(this._adInfoIdx), this._updateCookie()) : this._adjustFreqPeriod()
- }
- }
- } catch (d) {
- this._adInfoIdx = -1
- }
- },
- shouldExpand: function() {
- var a = !0;
- this._optOut || !this._isStorageSupported ? a = !this._disableAutoExpand : -1 != this._adInfoIdx && this._adsInfo[this._adInfoIdx][2] >= this._frequencyTimes && (a = !1);
- return a
- },
- onExpand: function() {
- if (!this.onExpandCalled && (this.onExpandCalled = !0, !(6 == this._frequencyTimes || 0 == this._maxLen))) {
- if (-1 != this._adInfoIdx) {
- var a = this._adsInfo[this._adInfoIdx];
- a[2]++;
- 4 == this._frequencyPeriod && (a[3] = (new Date).getTime(), this._deleteItem(this._adInfoIdx), this._insertItem(a))
- } else this._adsInfo.length >= this._maxLen && this._deleteItem(0), this._insertNewItem();
- this._updateCookie()
- }
- },
- _adjustFreqPeriod: function() {
- if (!(-1 == this._adInfoIdx || 1 == this._frequencyPeriod)) {
- var a = this._adsInfo[this._adInfoIdx];
- if (this._frequencyPeriod > a[1]) {
- a[1] = this._frequencyPeriod;
- var b = new Date,
- c = a[3];
- 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());
- a[3] = c;
- this._deleteItem(this._adInfoIdx);
- this._insertItem(a);
- this._updateCookie()
- } else this._frequencyPeriod < a[1] && this._deleteItem(this._adInfoIdx)
- }
- },
- _deleteOldItems: function() {
- if (1 != this._frequencyPeriod) {
- for (var a = [], b = 0; b < this._adsInfo.length; b++) {
- var c =
- this._adsInfo[b];
- if (c[3] >= (new Date).getTime()) break;
- else 4 != c[1] && a.push(b)
- }
- for (b = a.length - 1; 0 <= b; b--) this._deleteItem(a[b])
- }
- },
- _insertNewItem: function() {
- var a = [];
- a[0] = this._adId;
- a[1] = this._frequencyPeriod;
- a[2] = 1;
- var b = new Date;
- switch (this._frequencyPeriod) {
- case 2:
- a[3] = b.getTime() + 864E5;
- break;
- case 3:
- var c = 0 == b.getDay() ? 0 : 7 - b.getDay(),
- b = b.getTime() + 864E5 * c,
- b = new Date(b);
- b.setHours(23, 59, 59);
- a[3] = b.getTime();
- break;
- case 4:
- a[3] = b.getTime()
- }
- this._insertItem(a)
- },
- _insertItem: function(a) {
- var b = 0;
- if (1 == this._frequencyPeriod) b =
- this._adsInfo.length;
- else if (0 != this._adsInfo.length) {
- for (; b < this._adsInfo.length && this._adsInfo[b][3] <= a[3];) b++;
- for (var c = this._adsInfo.length; c > b; c--) this._adsInfo[c] = this._adsInfo[c - 1]
- }
- this._adsInfo[b] = a;
- this._adInfoIdx = b
- },
- _deleteItem: function(a) {
- this._adsInfo.splice(a, 1);
- a == this._adInfoIdx ? this._adInfoIdx = -1 : this._adInfoIdx > a && this._adInfoIdx--
- },
- _updateCookie: function() {
- for (var a = [], b = 0; b < this._adsInfo.length; b++) a[b] = this._adsInfo[b].join(":");
- a = a.join("&");
- !this._optOut && this._isStorageSupported &&
- 6 > this._frequencyTimes && this._setStorage(this._cookieName, a)
- },
- isStorageSupported: function() {
- retval = !1;
- try {
- this._storageName = 1 == this._frequencyPeriod ? sessionStorage : localStorage, EBG.isDefinedNotNull(this._storageName) && (this._storageName.setItem("mmtest1", "mmtest2"), this._storageName.removeItem("mmtest1"), retval = !0)
- } catch (a) {}
- return retval
- },
- _readStorage: function(a) {
- a = this._storageName.getItem(a);
- return a = EBG.isDefinedNotNull(a) ? unescape(a) : ""
- },
- _setStorage: function(a, b) {
- var c = escape(b);
- this._storageName.setItem(a,
- c)
- }
- };
- EBG.declareNamespace("AdaptiveUtils");
- EBG.AdaptiveUtils = function(a) {
- this._adConfig = a;
- if (EBG.Algorithms.MaxWidthSelector) this._selector = new EBG.Algorithms.MaxWidthSelector;
- for (var b in this._adConfig.adHtmlOptions)
- if (this._adConfig.adHtmlOptions[b].path == this._adConfig.adHtmlPath && this._adConfig.adHtmlOptions[b].defaultImagePath == this._adConfig.defaultImagePath) {
- this._adConfig.defaultWidth = this._adConfig.defaultWidth ? this._adConfig.defaultWidth : this._adConfig.adHtmlOptions[b].width;
- this._adConfig.defaultHeight = this._adConfig.defaultHeight ?
- this._adConfig.defaultHeight : this._adConfig.adHtmlOptions[b].height;
- this._adConfig.adHtmlOptions[b].interaction = this._adConfig.adHtmlOptions[b].name = b;
- this._defaultAsset = EBG.cloneObj(this._adConfig.adHtmlOptions[b]);
- break
- }
- };
- EBG.AdaptiveUtils.prototype = {
- _adConfig: null,
- _shouldFireInteraction: !0,
- _selector: null,
- _chosenAsset: null,
- _defaultAsset: null,
- _preloadImageAsset: null,
- _bannerAsset: null,
- getAsset: function() {
- return this._chosenAsset
- },
- updateAdConfig: function() {
- if (!this._chosenAsset && this._defaultAsset) this._chosenAsset = this._defaultAsset;
- if (this._chosenAsset) this._adConfig.defaultImagePath = this._chosenAsset.defaultImagePath, this._adConfig.adHtmlPath = this._chosenAsset.path, this._adConfig.expansionParams = this._chosenAsset.expansionParams,
- this._adConfig.chosenWidth = this._chosenAsset.width, this._adConfig.chosenHeight = this._chosenAsset.height
- },
- subscribeToEvents: function() {
- this._subscribeToAdEvent(EBG.Events.EventNames.PAGE_RESIZE, this._handlePageResize);
- this._subscribeToAdEvent(EBG.Events.EventNames.SCREEN_ORIENTATION, this._handlePageResize);
- this._subscribeToAdEvent(EBG.Events.EventNames.SHOW_AD, this._handlePageResize, EBG.Events.EventTiming.BEFORE);
- this._subscribeToAdEvent(EBG.Events.EventNames.SHOW_AD, this._handlePageResize, EBG.Events.EventTiming.AFTER);
- this._subscribeToAdEvent(EBG.Events.EventNames.ADD_CREATIVES, this._handleCreative, EBG.Events.EventTiming.BEFORE)
- },
- _showAsset: function(a, b) {
- 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),
- a._addCreatives()) : (b--, 0 < b && EBG.runTimed(this, this._showAsset, [a, b], 25))
- },
- _handlePageResize: function() {
- var a = EBG.ads[this._adConfig.uid],
- b = this._selector.selectAsset(this._adConfig.adHtmlOptions, this._adConfig);
- if (!b && this._defaultAsset) b = this._defaultAsset;
- if (b != this._chosenAsset) EBG.isFunc(a._hideAllPanels) && a._hideAllPanels(), this._chosenAsset = b, this.updateAdConfig(), this._showAsset(a, 3)
- },
- _handleCreative: function(a) {
- if (a.eventData.creativeType == EBG.Events.EventNames.ADD_HTML5_MAIN_CREATIVE && this._shouldFireInteraction) EBG.intMgr.handleCounterInteraction(this.getBannerInteraction(),
- this._adConfig.adId + "_" + this._adConfig.rnd, null, !1, {}), this._shouldFireInteraction = !1;
- else if (a.eventData.creativeType == EBG.Events.EventNames.ADD_BANNER_DEFAULT_IMAGE_CREATIVE) {
- var b = EBG.adaptor.getElementById(this._adConfig.placeHolderId);
- b || EBG.adaptor.setElemStyle(b, "position", "relative");
- a.eventData.tagsObj.attributes.style.position = "absolute";
- a.eventData.tagsObj.attributes.style.margin = "auto";
- a.eventData.tagsObj.attributes.style.top = "0";
- a.eventData.tagsObj.attributes.style.left = "0";
- a.eventData.tagsObj.attributes.style.right =
- "0";
- a.eventData.tagsObj.attributes.style.bottom = "0"
- }
- },
- _subscribeToAdEvent: function(a, b, c) {
- a = new EBG.Events.EventSubscription(a, b, this);
- a.dispatcherFilters = {
- "_adConfig.rnd": this._adConfig.rnd
- };
- if (c) a.timing = c;
- EBG.eventMgr.subscribeToEvent(a)
- },
- getBannerInteraction: function() {
- return this._chosenAsset.interaction
- }
- };
- EBG.declareClass(EBG.AdaptiveUtils, null);
- EBG.declareNamespace("Algorithms");
- EBG.Algorithms.BaseSelector = function() {};
- EBG.Algorithms.BaseSelector.prototype = {
- selectAsset: function() {
- return null
- }
- };
- EBG.declareClass(EBG.Algorithms.BaseSelector, null);
- EBG.Algorithms.MaxWidthSelector = function() {
- EBG.callSuperConstructor(EBG.Algorithms.MaxWidthSelector, this)
- };
- EBG.Algorithms.MaxWidthSelector.prototype = {
- selectAsset: function(a, b) {
- var c = EBG.adaptor.getBoundingClientRect(EBG.adaptor.getElementById(b.placeHolderId));
- if (b.width) c.width = b.width;
- var d = null,
- e;
- for (e in a) {
- var f = a[e];
- f.interaction = f.name = e;
- 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)))
- if (d = f, d.width == c.width) break
- }
- return d
- },
- isAssetValid: function(a) {
- var b = !1;
- if (EBG.adaptor.getScreenOrientation() == a.orientation.toUpperCase() ||
- a.orientation.toUpperCase() == EBG.orientation.Both) b = !0;
- return b
- }
- };
- EBG.declareClass(EBG.Algorithms.MaxWidthSelector, EBG.Algorithms.BaseSelector);
- EBG.declareNamespace("AdChoice");
- EBG.AdChoice.AdChoiceManager = function(a) {
- this._adConfig = a;
- this._active = a.adChoice.includeMarker;
- this._iconAdded = !1
- };
- EBG.AdChoice.AdChoiceManager.ImageData = function() {
- this.iconSrc = "";
- this.id = ""
- };
- EBG.AdChoice.AdChoiceManager.IabIconData = {
- en: {
- icon: "OBA_DEFAULT.png",
- url: "http://www.youronlinechoices.com/uk/"
- },
- "de-at": {
- icon: "OBA_AUSTRIA.png",
- url: "http://www.youronlinechoices.com/at/"
- },
- "fr-be": {
- icon: "OBA_BELGIUM_FR.png",
- url: "http://www.youronlinechoices.com/be-fr/"
- },
- "nl-be": {
- icon: "OBA_BELGIUM_NL.png",
- url: "http://www.youronlinechoices.com/be-nl/"
- },
- bg: {
- icon: "OBA_BULGARIA.png",
- url: "http://www.youronlinechoices.com/bg/"
- },
- cs: {
- icon: "OBA_CZECH.png",
- url: "http://www.youronlinechoices.com/cs/"
- },
- da: {
- icon: "OBA_DENMARK.png",
- url: "http://www.youronlinechoices.com/den/"
- },
- fi: {
- icon: "OBA_FINLAND.png",
- url: "http://www.youronlinechoices.com/fi/"
- },
- fr: {
- icon: "OBA_FRANCE.png",
- url: "http://www.youronlinechoices.com/fr/"
- },
- de: {
- icon: "OBA_GERMANY.png",
- url: "http://www.youronlinechoices.com/de/"
- },
- el: {
- icon: "OBA_GREEK.png",
- url: "http://www.youronlinechoices.com/gr/"
- },
- hu: {
- icon: "OBA_HUNGARY.png",
- url: "http://www.youronlinechoices.com/hu/"
- },
- "en-ie": {
- icon: "OBA_IRELAND.png",
- url: "http://www.youronlinechoices.com/ie/"
- },
- it: {
- icon: "OBA_ITALY.png",
- url: "http://www.youronlinechoices.com/it/"
- },
- nl: {
- icon: "OBA_NETHERLANDS.png",
- url: "http://www.youronlinechoices.com/nl/"
- },
- no: {
- icon: "OBA_NORWAY.png",
- url: "http://www.youronlinechoices.com/nor/"
- },
- pl: {
- icon: "OBA_POLAND.png",
- url: "http://www.youronlinechoices.com/pl/"
- },
- ro: {
- icon: "OBA_ROMANIA.png",
- url: "http://www.youronlinechoices.com/ro/"
- },
- sl: {
- icon: "OBA_SLOVAKIA.png",
- url: "http://www.youronlinechoices.com/sl/"
- },
- es: {
- icon: "OBA_SPAIN.png",
- url: "http://www.youronlinechoices.com/es/"
- },
- sv: {
- icon: "OBA_SWEDEN.png",
- url: "http://www.youronlinechoices.com/se/"
- },
- "de-ch": {
- icon: "OBA_SWITZERLAND_DE.png",
- url: "http://www.youronlinechoices.com/ch-de/"
- },
- "fr-ch": {
- icon: "OBA_SWITZERLAND_FR.png",
- url: "http://www.youronlinechoices.com/ch-fr/"
- },
- "it-ch": {
- icon: "OBA_SWITZERLAND_IT.png",
- url: "http://www.youronlinechoices.com/ch-it/"
- },
- "en-gb": {
- icon: "OBA_UK.png",
- url: "http://www.youronlinechoices.com/uk/"
- },
- hr: {
- icon: "OBA_DEFAULT.png",
- url: "http://www.youronlinechoices.com/hr/"
- },
- is: {
- icon: "OBA_DEFAULT.png",
- url: "http://www.youronlinechoices.com/is/"
- },
- lt: {
- icon: "OBA_DEFAULT.png",
- url: "http://www.youronlinechoices.com/lt/"
- },
- lv: {
- icon: "OBA_DEFAULT.png",
- url: "http://www.youronlinechoices.com/lv/"
- },
- pt: {
- icon: "OBA_DEFAULT.png",
- url: "http://www.youronlinechoices.com/pt/"
- },
- sk: {
- icon: "OBA_DEFAULT.png",
- url: "http://www.youronlinechoices.com/sk/"
- }
- };
- EBG.AdChoice.AdChoiceManager.NaiIconData = {
- en: {
- icon: "OBA_DEFAULT.png",
- url: "http://www.aboutads.info/consumers"
- }
- };
- EBG.AdChoice.AdChoiceManager.IabClosedIconName = "OBA.png";
- EBG.AdChoice.AdChoiceManager.NaiClosedIconName = "OBA.png";
- EBG.AdChoice.AdChoiceManager.VisibilityState = {
- HIDDEN: "hidden",
- VISIBLE: "visible"
- };
- EBG.AdChoice.AdChoiceManager.Position = {
- ABSOLUTE: "absolute",
- RELATIVE: "relative"
- };
- EBG.AdChoice.AdChoiceManager.ImageLoadTimeout = 100;
- EBG.AdChoice.AdChoiceManager.DefaultOffset = -1E3;
- EBG.AdChoice.AdChoiceManager.prototype = {
- _imgData: null,
- _imgExpData: null,
- _iconLocalData: null,
- _acCloseIconName: null,
- _spanId: null,
- _iconsBaseUrl: null,
- _containerId: null,
- _assetObjId: null,
- init: function() {
- if (this._active) {
- this._iconsBaseUrl = this._getIconsDir(this._adConfig.adChoice.iconPosition);
- var a = new EBG.Events.EventSubscription(EBG.Events.EventNames.ADD_CREATIVES, this._handleAdChoice, this);
- a.timing = EBG.Events.EventTiming.AFTER;
- a.dispatcherFilters = {
- "_adConfig.rnd": this._adConfig.rnd
- };
- EBG.eventMgr.subscribeToEvent(a);
- a = new EBG.Events.EventSubscription(EBG.Events.EventNames.ADD_BANNER_DEFAULT_IMAGE_CREATIVE, this._handleAdChoice, this);
- a.timing = EBG.Events.EventTiming.AFTER;
- a.dispatcherFilters = {
- "_adConfig.rnd": this._adConfig.rnd
- };
- EBG.eventMgr.subscribeToEvent(a);
- a = new EBG.Events.EventSubscription(EBG.Events.EventNames.ADD_BANNER_DEFAULT_FLASH_CREATIVE, this._handleAdChoice, this);
- a.timing = EBG.Events.EventTiming.AFTER;
- a.dispatcherFilters = {
- "_adConfig.rnd": this._adConfig.rnd
- };
- EBG.eventMgr.subscribeToEvent(a);
- EBG.eventMgr.subscribeToEvent(new EBG.Events.EventSubscription(EBG.Events.EventNames.PAGE_RESIZE,
- this._pageResizeHandler, this));
- 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)
- }
- },
- _handleAdChoice: function(a) {
- if (a.eventData && !a.eventData.isPanel) this._assetObjId =
- a.eventData.assetId;
- if (this._iconAdded) {
- var a = EBG.adaptor.getElementById(this._containerId),
- b = EBG.adaptor.getElementById(this._spanId);
- EBG.adaptor.removeElement(b);
- EBG.adaptor.appendChildElement(a.id, b)
- } 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)
- },
- _getImageData: function() {
- var a =
- new EBG.AdChoice.AdChoiceManager.ImageData;
- a.iconSrc = this._iconsBaseUrl + this._acCloseIconName;
- a.id = "acImage_" + this._adConfig.uid;
- return a
- },
- _getExpImageData: function() {
- var a = new EBG.AdChoice.AdChoiceManager.ImageData;
- a.iconSrc = this._iconsBaseUrl + this._iconLocalData.icon;
- a.id = "acExpImage_" + this._adConfig.uid;
- return a
- },
- _getAdChoiceUrl: function() {
- var a = "";
- return a = this._adConfig.adChoice.customUrl ? unescape(this._adConfig.adChoice.customUrl) : this._iconLocalData.url
- },
- _getIconDataByLanguage: function(a) {
- var b =
- EBG.adaptor.getBrowserLanguage().toLowerCase(),
- c = a[b];
- c || (b = b.split("-")[0], c = a[b]);
- c || (c = a.en);
- return c
- },
- _getIconOffsets: function(a, b, c, d, e, f) {
- var g = {
- offsetLeft: EBG.px(EBG.AdChoice.AdChoiceManager.DefaultOffset),
- offsetTop: EBG.px(EBG.AdChoice.AdChoiceManager.DefaultOffset)
- };
- if (this._assetObjId && (adPos = EBG.adaptor.getPositioningById(this._assetObjId, !0, this._adConfig.actualServingMode))) {
- if (!e || !f) var h = EBG.adaptor.getElementById(this._assetObjId),
- h = EBG.adaptor.getBoundingClientRect(h),
- e = e ? e : h.width,
- f = f ? f : h.height;
- acPos = EBG.adaptor.getPositioningById(a, !0, this._adConfig.actualServingMode);
- h = EBG.adaptor.getStyleOfElem(EBG.adaptor.getElementById(a));
- a = parseInt(h.left) + adPos.X - acPos.X;
- h = parseInt(h.top) + adPos.Y - acPos.Y;
- switch (b) {
- case EBG.AcIconPosition.BottomLeft:
- g.offsetLeft = EBG.px(a);
- g.offsetTop = EBG.px(h + f - d);
- break;
- case EBG.AcIconPosition.BottomRight:
- g.offsetLeft = EBG.px(a + e - c);
- g.offsetTop = EBG.px(h + f - d);
- break;
- case EBG.AcIconPosition.TopLeft:
- g.offsetLeft = EBG.px(a);
- g.offsetTop = EBG.px(h);
- break;
- case EBG.AcIconPosition.TopRight:
- g.offsetLeft =
- EBG.px(a + e - c), g.offsetTop = EBG.px(h)
- }
- }
- return g
- },
- _getIconsDir: function(a) {
- var b = this._adConfig.imagesDir + "/AdChoice/";
- switch (a) {
- case EBG.AcIconPosition.BottomLeft:
- b += "BottomLeft/";
- break;
- case EBG.AcIconPosition.BottomRight:
- b += "BottomRight/";
- break;
- case EBG.AcIconPosition.TopLeft:
- b += "TopLeft/";
- break;
- case EBG.AcIconPosition.TopRight:
- b += "TopRight/"
- }
- return b
- },
- _addAdChoiceIcons: function(a, b, c) {
- var d = "acImgLinkWrapper_" + this._adConfig.uid;
- this._spanId = "acSpan_" + this._adConfig.uid;
- var e = EBG.adaptor.getElementById(this._containerId);
- if (e && (c = {
- tagName: EBG.Adaptors.TagNames.DIV,
- attributes: {
- id: this._spanId,
- style: {
- position: EBG.AdChoice.AdChoiceManager.Position.ABSOLUTE,
- zIndex: EBG.adaptor.getMaxZIndex(e) + 1
- }
- },
- children: [{
- tagName: EBG.Adaptors.TagNames.A,
- attributes: {
- id: d,
- target: "_blank",
- onClick: EBG.format("EBG.adaptor.openPage('{0}');", c),
- mmskipreplace: 1
- },
- children: null
- }]
- }, this._containerId == this._adConfig.placeHolderId ? EBG.adaptor.inject(c, EBG.Adaptors.InjectionMethod.APPEND, e) : EBG.adaptor.inject(c, EBG.Adaptors.InjectionMethod.INSERT_BEFORE,
- e), d = EBG.adaptor.getElementById(d))) {
- e = {
- tagName: EBG.Adaptors.TagNames.IMG,
- attributes: {
- id: a.id,
- style: {
- position: EBG.AdChoice.AdChoiceManager.Position.ABSOLUTE,
- visibility: EBG.AdChoice.AdChoiceManager.VisibilityState.VISIBLE,
- left: EBG.px(EBG.AdChoice.AdChoiceManager.DefaultOffset),
- top: EBG.px(EBG.AdChoice.AdChoiceManager.DefaultOffset)
- }
- },
- children: null
- };
- EBG.adaptor.inject(e, EBG.Adaptors.InjectionMethod.APPEND, d);
- e = {
- tagName: EBG.Adaptors.TagNames.IMG,
- attributes: {
- id: b.id,
- style: {
- position: EBG.AdChoice.AdChoiceManager.Position.ABSOLUTE,
- visibility: EBG.AdChoice.AdChoiceManager.VisibilityState.HIDDEN,
- left: EBG.px(EBG.AdChoice.AdChoiceManager.DefaultOffset),
- top: EBG.px(EBG.AdChoice.AdChoiceManager.DefaultOffset)
- }
- },
- children: null
- };
- EBG.adaptor.inject(e, EBG.Adaptors.InjectionMethod.APPEND, d);
- var d = EBG.adaptor.getElementById(a.id),
- e = EBG.adaptor.getElementById(b.id),
- f = this,
- g = function() {
- EBG.runTimed(f, f._handleImgOnloadEvent, [a.id, 0], EBG.AdChoice.AdChoiceManager.ImageLoadTimeout)
- },
- c = function() {
- EBG.runTimed(f, f._handleImgOnloadEvent, [b.id, 0],
- EBG.AdChoice.AdChoiceManager.ImageLoadTimeout)
- };
- 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;
- 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
- }
- },
- _subscribeIconToEvents: function(a, b) {
- var c = this,
- d = function() {
- c._handleMouseOverEvent(a, b)
- },
- e = new EBG.Events.EventSubscription("mouseover", d, this);
- e.isElementEvent = !0;
- e.elementId =
- a;
- EBG.eventMgr.subscribeToEvent(e);
- e = new EBG.Events.EventSubscription("mouseout", d, this);
- e.isElementEvent = !0;
- e.elementId = b;
- EBG.eventMgr.subscribeToEvent(e)
- },
- _handleMouseOverEvent: function(a, b) {
- var c = EBG.adaptor.getElementById(a),
- d = EBG.adaptor.getElementById(b),
- e = EBG.adaptor.getStyleOfElem(c),
- f = EBG.AdChoice.AdChoiceManager.VisibilityState.VISIBLE,
- g = EBG.AdChoice.AdChoiceManager.VisibilityState.HIDDEN;
- if (e.visibility == EBG.AdChoice.AdChoiceManager.VisibilityState.VISIBLE) f = EBG.AdChoice.AdChoiceManager.VisibilityState.HIDDEN,
- g = EBG.AdChoice.AdChoiceManager.VisibilityState.VISIBLE;
- e = {
- visibility: g
- };
- EBG.adaptor.setStyleToElem(c, {
- visibility: f
- });
- EBG.adaptor.setStyleToElem(d, e)
- },
- _pageResizeHandler: function() {
- this._handleImgOnloadEvent(this._imgData.id, 0);
- this._handleImgOnloadEvent(this._imgExpData.id, 0)
- },
- _handleImgOnloadEvent: function(a, b) {
- var c = EBG.adaptor.getElementById(a);
- imgPos = this._getIconOffsets(a, this._adConfig.adChoice.iconPosition, c.width, c.height, this._adConfig.width, this._adConfig.height);
- EBGInfra.isDefinedNotNull(b) &&
- 10 > b ? EBG.runTimed(this, this._rehandleImgOnloadEvent, [a, b], EBG.AdChoice.AdChoiceManager.ImageLoadTimeout) : EBG.adaptor.setStyleToElem(c, {
- left: imgPos.offsetLeft,
- top: imgPos.offsetTop
- })
- },
- _rehandleImgOnloadEvent: function(a, b) {
- this._handleImgOnloadEvent(a, b + 1)
- }
- };
- EBG.declareNamespace("Ads");
- EBG.Ads.Ad = function(a) {
- this._adConfig = a;
- this._adConfig.isStdAd = this._isStdAd();
- this.startTime = (new Date).getTime() / 1E3;
- this._fixPage();
- this._updateURLs();
- this._subscribeEventTriggeringURLs();
- EBG.ads[a.uid] = this;
- this._show();
- this.placeHolderElement ? this._handleMultiBurn() : this._subscribeToAdEvent(EBG.Events.EventNames.SHOW_AD, this._handleMultiBurn, EBG.Events.EventTiming.ONTIME);
- this._dpm = EBG.dataPipeMgr.getPipe(this._adConfig.sID);
- this._sendInitAdInformation()
- };
- EBG.Ads.Ad.prototype = {
- resizePlaceHolder: !0,
- checkingThrottle: !1,
- _throttleState: null,
- _adConfig: null,
- _adChoice: null,
- _cdiReason: 0,
- _showOnlyDefaultImg: !1,
- _banner: {
- divId: "",
- resId: "",
- width: 0,
- height: 0
- },
- _hasDefaultImageInteraction: !1,
- _isStdAd: function() {
- return !0
- },
- _subscribeEventTriggeringURLs: function() {
- if (this._adConfig.eventTrackingURLs) {
- this._adConfig.eventTrackingURLs = this._eventTrackingURLsAdapter(this._adConfig.eventTrackingURLs);
- for (var a in this._adConfig.eventTrackingURLs) this._subscribeToAdEvent(a,
- this._handleEventTrackingURLs, EBG.Events.EventTiming.ONTIME)
- }
- },
- _eventTrackingURLsAdapter: function(a) {
- function b(b) {
- c.ebVideoInteraction = c.ebVideoInteraction || [];
- c.ebVideoInteraction.push({
- filter: {
- "eventData.intName": b
- },
- urls: a[d]
- })
- }
- var c = {},
- d;
- for (d in a) switch (d) {
- case "vidStart":
- b(EBG.VideoInteraction.STARTED);
- break;
- case "vid25Played":
- b(EBG.VideoInteraction.PERCENT_25_PLAYED);
- break;
- case "vid50Played":
- b(EBG.VideoInteraction.PERCENT_50_PLAYED);
- break;
- case "vid75Played":
- b(EBG.VideoInteraction.PERCENT_75_PLAYED);
- break;
- case "vidFullyPlayed":
- b(EBG.VideoInteraction.FULLPLAY)
- }
- return c
- },
- _handleEventTrackingURLs: function(a) {
- for (var b = this._adConfig.eventTrackingURLs[a.name], c = 0; c < b.length; c++) {
- var d = b[c];
- if (d.filter)
- for (var e in d.filter) EBG.valueFromPath(a, e) == d.filter[e] && this._reportImpressionTrackingURLs(d.urls);
- else this._reportImpressionTrackingURLs(d.urls)
- }
- },
- _counterInteractionHandler: function(a) {
- try {
- var b = a.eventData.intName;
- if (!b) b = EBG.Interactions.SystemInts.CLICK;
- a.eventData.clickUrl = this._replaceURLTokens(a.eventData.clickUrl);
- a.eventData.clickedVerUrl = this._replaceURLTokens(a.eventData.clickedVerUrl);
- EBG.intMgr.handleCounterInteraction(b, this._adConfig.uid, 0, null, a.eventData, "undefined" != typeof a.eventData.handleClickInt ? a.eventData.handleClickInt : !0)
- } catch (c) {}
- },
- _versionTrackingImpressionHandler: function(a) {
- try {
- a.eventData.impTrackingUrls && this._reportImpressionTrackingURLs(a.eventData.impTrackingUrls)
- } catch (b) {}
- },
- _reportImpressionTrackingURLs: function(a) {
- if (!EBG.isPreview)
- for (var b = 0; b < a.length; b++) {
- var c = a[b];
- c && (c =
- this._replaceURLTokens(c), EBG.adaptor.reportToRemoteServerUsingImage(c))
- }
- },
- _show: function() {
- this._cdiReason = this._adConfig.showAieDefaultImage ? 4 : this._cdiReason;
- var a = !this._canShow() || this._adConfig.showOnlyImage || this._adConfig.showAieDefaultImage;
- this._adConfig.defaultImageDisplayed = !(!a || !this._adConfig.defaultImagePath);
- var b = this._adConfig.showOnlyImage;
- this._verifyPlaceHolder();
- var c = new EBG.Events.Event(EBG.Events.EventNames.SHOW_AD);
- c.dispatcher = this;
- c.timing = EBG.Events.EventTiming.BEFORE;
- c.eventData = {
- isDefaultImage: this._adConfig.defaultImageDisplayed
- };
- EBG.eventMgr.dispatchEvent(c);
- b !== this._adConfig.showOnlyImage && (a = !this._canShow() || this._adConfig.showOnlyImage || this._adConfig.showAieDefaultImage);
- this._subscribeToEvents();
- EBG.intMgr.initAdData(this._adConfig, this._adConfig.reportDelayedImpression ? !0 : !1);
- this._addSystemInteractions();
- if (EBG.AdChoice && EBG.AdChoice.AdChoiceManager) this._adChoice = new EBG.AdChoice.AdChoiceManager(this._adConfig), this._adChoice.init();
- (b = EBG.adaptor.getElementById(this._adConfig.placeHolderId)) &&
- this.resizePlaceHolder && "undefined" != typeof this._adConfig.display && EBG.adaptor.setElemStyle(b, "display", this._adConfig.display);
- if (a)
- if (this._adConfig.defaultImagePath) {
- if (!this._adConfig.imageOnly) a = new EBG.Events.Event(EBG.Events.EventNames.DEFAULT_IMPRESSION), a.eventData = {
- impTrackingUrls: this._adConfig.defaultImpTrackingUrls
- }, a.dispatcher = this, a.timing = EBG.Events.EventTiming.ONTIME, EBG.eventMgr.dispatchEvent(a);
- this._subscribeToAdEvent(EBG.Events.EventNames.ADD_BANNER_DEFAULT_IMAGE_CREATIVE, this._terminateShow,
- EBG.Events.EventTiming.AFTER);
- this._showOnlyDefaultImg = !0;
- this.checkAndShowDefaultImage(this.showDefaultImage)
- } else this._reportImpression(!0);
- 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()
- },
- _terminateShow: function(a) {
- var b = this.placeHolderElement =
- EBG.adaptor.getElementById(this._adConfig.placeHolderId);
- 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"));
- b = new EBG.Events.Event(EBG.Events.EventNames.SHOW_AD);
- b.dispatcher = this;
- b.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
- b.eventData = {
- isDefaultImage: a ? !0 : !1
- };
- EBG.eventMgr.dispatchEvent(b)
- },
- _verifyPlaceHolder: function() {
- !EBG.adaptor.getElementById(this._adConfig.placeHolderId) &&
- !document.body && document.write('<img style="width:0;height:0"></img>');
- return EBG.adaptor.getElementById(this._adConfig.placeHolderId)
- },
- _canShow: function() {
- return !0
- },
- _onPlayHandler: function() {
- this._adConfig.arrOnPlayEvents && this._executeEvents(this._adConfig.arrOnPlayEvents)
- },
- _onDownloadHandler: function() {
- this._adConfig.arrOnStartDnlEvents && this._executeEvents(this._adConfig.arrOnStartDnlEvents)
- },
- _collectUrl: function() {
- if (!EBG.isPreview && this._adConfig.shouldCollectUrl) try {
- EBG.adaptor.reportToRemoteServer(EBG.format("{0}{1}/BurstingPipe/adServer.bs?cn=curl&ai={2}&url=$${3}$$",
- EBG.protocol, this._adConfig.bsPath, this._adConfig.adId, top.document.URL))
- } catch (a) {}
- },
- _executeEvents: function(a) {
- for (var b, c, d = 0; d < a.length; d++) switch (c = this._replaceURLTokens(a[d].url), a[d].typeId) {
- case 3:
- b = "ebPlayScript" + d;
- EBG.adaptor.writeScript(EBG.adaptor.generateElementId(b, this._adConfig.uid), c, this._adConfig.placeHolderId);
- break;
- case 5:
- b = "ebDnlScript" + d;
- EBG.adaptor.writeScript(EBG.adaptor.generateElementId(b, this._adConfig.uid), c, this._adConfig.placeHolderId);
- break;
- case 4:
- b = "ebPlayIFR" + d;
- EBG.adaptor.writeReportingIFrame(EBG.adaptor.generateElementId(b, this._adConfig.uid), c, this._adConfig.placeHolderId);
- break;
- case 6:
- b = "ebDnlIFR" + d, EBG.adaptor.writeReportingIFrame(EBG.adaptor.generateElementId(b, this._adConfig.uid), c, this._adConfig.placeHolderId)
- }
- },
- _addSystemInteractions: function() {
- try {
- var a = this._adConfig.interactions[EBG.Interactions.SystemInts.CLICK];
- if (a) {
- var b = EBG.Interactions.Categories.SYSTEM;
- this._adConfig.interactions[EBG.Interactions.SystemInts.DEFAULT_CLICK] ? this._hasDefaultImageInteraction = !0 : this._adConfig.interactions[EBG.Interactions.SystemInts.DEFAULT_CLICK] = EBG.cloneObj(a);
- this._addCounterInteraction(EBG.Interactions.SystemInts.CLICK, b);
- this._addCounterInteraction(EBG.Interactions.SystemInts.DEFAULT_CLICK, b)
- }
- 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),
- 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)
- } catch (c) {}
- },
- _addCounterInteraction: function(a,
- b, c) {
- var d = this._adConfig.interactions[a],
- b = new EBG.Interactions.CounterInteractionData(a, b, this._adConfig.uid);
- b.initiationType = d.nInitiated ? EBG.Interactions.InitiationTypes.USER : EBG.Interactions.InitiationTypes.AUTO;
- b.countAsClick = d.fClick;
- if (d.agencyURL) b.remoteServers.agencyUrl = d.agencyURL;
- if (d.networkURL) b.remoteServers.networkUrl = d.networkURL;
- this._adjustClickTarget(a);
- b.counterJumpUrlData = d;
- b.reportImmediately = c ? !0 : !1;
- a = new EBG.Interactions.CounterInteraction(b);
- EBG.intMgr.addInteraction(a)
- },
- _addVideoInteractions: function() {},
- _addCustomInteractions: function() {},
- _adjustClickTarget: function(a) {
- var a = this._adConfig.interactions[a],
- b;
- switch (a.target) {
- case 0:
- b = EBG.WindowTarget.SELF;
- break;
- case 2:
- b = EBG.WindowTarget.TOP;
- break;
- default:
- b = EBG.WindowTarget.BLANK
- }
- a.target = b
- },
- _subscribeToEvents: function() {
- this._adConfig.interactionsToReport && this._subscribeToAdEvent(EBG.Events.EventNames.ADD_INTERACTION, this._handleInteractionsSubscription, EBG.Events.EventTiming.BEFORE);
- this._subscribeToAdEvent(EBG.EBMessage.CLICKTHROUGH,
- this._counterInteractionHandler);
- this._subscribeToAdEvent(EBG.EBMessage.VERSION_TRACKING_IMPRESSION, this._versionTrackingImpressionHandler);
- this._subscribeToAdEvent(EBG.Events.EventNames.DEFAULT_IMPRESSION, this._versionTrackingImpressionHandler, EBG.Events.EventTiming.ONTIME);
- this._subscribeToAdEvent(EBG.Events.EventNames.DEFAULT_CLICK, this._counterInteractionHandler);
- this._subscribeToAdEvent(EBG.Events.EventNames.ADD_CREATIVES, this._onAddCreativesHandler, EBG.Events.EventTiming.ONTIME);
- this._subscribeToAdEvent(EBG.Events.EventNames.SHOW_AD,
- this._onDownloadHandler, EBG.Events.EventTiming.ONTIME);
- this._subscribeToAdEvent(EBG.Events.EventNames.SHOW_AD, this._onPlayHandler, EBG.Events.EventTiming.AFTER);
- this._subscribeToAdEvent(EBG.Events.EventNames.SHOW_AD, this._collectUrl, EBG.Events.EventTiming.AFTER);
- this._adConfig.adParamsEnabled && this._subscribeToAdEvent(EBG.Events.EventNames.AD_START, this._reportAdParams, EBG.Events.EventTiming.AFTER);
- this._subscribeToAdEvent(EBG.EBMessage.NOTIFY_INTERACTION_MONITOR, this._notifyInteractionManager);
- var a =
- new EBG.Events.EventSubscription(EBG.Events.EventNames.ELEMENT_LOADED, function(a) {
- a.eventData.adUId == this._adConfig.uid && this._triggerAdStart()
- }, this);
- a.timing = EBG.Events.EventTiming.ONTIME;
- EBG.eventMgr.subscribeToEvent(a);
- this._subscribeToAdEvent(EBG.Events.EventNames.THROTTLED, this._handleCreativeThrottled)
- },
- _handleInteractionsSubscription: function(a) {
- try {
- var b = a.eventData.interactionData.reportingName;
- return this._adConfig.interactionsToReport && this._adConfig.interactionsToReport[b] ? !0 : !1
- } catch (c) {}
- },
- _onAddCreativesHandler: function(a) {
- this._adConfig.ffs.CFF_FlashThrottle && (!a || !a.eventData || !(a.eventData.creativeType && a.eventData.creativeType == EBG.Events.EventNames.ADD_BANNER_DEFAULT_IMAGE_CREATIVE)) && this._checkForCreativeThrottling();
- try {
- if (!EBG.Initializer._getAdClass({
- tn: this._adConfig.templateName
- }).requiresIframeBust || this._adConfig.actualServingMode == EBG.Adaptors.ServingMode.SCRIPT) {
- var b = a.dispatcher._adConfig.placeHolderId;
- if (b) {
- var c = (this._adConfig.displayWin || EBG.adaptor.getDisplayWin()).document.getElementById(b);
- if (c) c.style.backgroundImage = "", c.onclick = function() {}
- }
- }
- } catch (d) {}
- },
- _checkForCreativeThrottling: function() {
- 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))
- },
- _stopPollingForThrottle: function(a) {
- var b = !0;
- if (a && a.eventData && a.eventData.target && a.eventData.target.children) {
- for (var c in this._CCs) this._CCs.hasOwnProperty(c) &&
- (a.eventData.target.children[c] && this._CCs[c].stopPollingForThrottle && this._CCs[c].stopPollingForThrottle(), this._CCs[c].isPollingForThrottle && !0 == this._CCs[c].isPollingForThrottle && (b = !1));
- if (b) a = new EBG.Events.EventSubscription(EBG.Events.EventNames.MOUSE_OVER, this._stopPollingForThrottle, this), a.dispatcherFilters = {
- "_adConfig.rnd": this._adConfig.rnd
- }, a.timing = EBG.Events.EventTiming.ONTIME, EBG.eventMgr.unsubscribeFromEvent(a)
- }
- },
- _onAdCreativesAdded: function() {
- var a = new EBG.Events.Event(EBG.Events.EventNames.AD_CREATIVES_ADDED);
- a.dispatcher = this;
- EBG.eventMgr.dispatchEvent(a)
- },
- _fixPage: function() {
- var a = this._adConfig.page,
- a = a.replace(/\~/ig, "_"),
- a = a.replace(/\^/ig, "_"),
- a = a.replace(/\|/ig, "_"),
- a = escape(a);
- this._adConfig.page = a
- },
- _updateURLs: function() {
- for (var a = this._adConfig.clickTrackingUrls, b = 0; b < a.length; b++) a[b] = this._replaceURLTokens(a[b]);
- var a = this._adConfig.interactions,
- c;
- for (c in a)
- if (a.hasOwnProperty(c)) a[c].agencyURL = this._replaceURLTokens(a[c].agencyURL), a[c].networkURL = this._replaceURLTokens(a[c].networkURL),
- a[c].jumpUrl = this._replaceURLTokens(a[c].jumpUrl)
- },
- _handleMultiBurn: function() {
- this._reportMultiBurn(this._checkMultiBurn())
- },
- _checkMultiBurn: function() {
- var a = {
- isAdCarousel: !1,
- isAdCollision: !1,
- isMultiBurn: !1
- },
- b = this._adConfig.advertiserId,
- c = this._adConfig.placementId,
- d = this._adConfig.uid;
- try {
- var e = EBG.getTopAccessibleWindow(!1);
- e.ebAds = e.ebAds || {};
- for (var f in e.ebAds) {
- var g = e.ebAds[f];
- if (d != g._adConfig.uid && g.placeHolderElement) {
- if (!g.removed) try {
- if (0 == g.placeHolderElement.getClientRects().length) g.removed = !0
- } catch (h) {
- g.removed = !0
- }
- if (g.removed) {
- var i = (new Date).getTime() / 1E3 - g.startTime;
- if (!a.isAdCarousel && 10 < i && 150 > i) a.isAdCarousel = !0
- } else if (!a.isMultiBurn && c === g._adConfig.placementId) a.isMultiBurn = !0;
- else if (!a.isMultiBurn && !a.isAdCollision && b && b === g._adConfig.advertiserId) a.isAdCollision = !0
- }
- }
- } catch (j) {}
- return a
- },
- _reportMultiBurn: function(a) {
- a.isMultiBurn ? EBG.intMgr.handleCounterInteraction(EBG.Interactions.SystemInts.MULTI_BURN, this._adConfig.uid) : a.isAdCollision && EBG.intMgr.handleCounterInteraction(EBG.Interactions.SystemInts.AD_COLLISION,
- this._adConfig.uid);
- a.isAdCarousel && EBG.intMgr.handleCounterInteraction(EBG.Interactions.SystemInts.AD_CAROUSEL, this._adConfig.uid)
- },
- _reportAdParams: function() {
- if (EBG.intMgr.isInteractionExist(EBG.Interactions.SystemInts.AD_PARAMS.toLowerCase(), EBG.Interactions.InteractionTypes.COUNTER, this._adConfig.uid))
- if (EBG.adaptor.isPageLoaded()) {
- if (this._adConfig.adParamsEnabled) {
- var a = this._getServingModeNum(),
- b = this._getBannerLocation(),
- b = b && b.X + "x" + b.Y,
- c = !this.visibilityMgr ? 0 : this.visibilityMgr.getVisibilityProviderNum(),
- d = this._adConfig.width + "x" + this._adConfig.height,
- e = this._getAdCodeBase(),
- f = EBG.adaptor.browser.getEnvironment();
- EBG.intMgr.handleCounterInteraction(EBG.Interactions.SystemInts.AD_PARAMS, this._adConfig.uid, 0, !1, {
- value: {
- ifr: a,
- loc: b,
- vsbp: c,
- size: d,
- cb: e,
- env: f
- }
- })
- }
- } else this._subscribeToAdEvent(EBG.Events.EventNames.PAGE_LOAD, this._reportAdParams)
- },
- _getBannerLocation: function(a) {
- if (a && EBG.isNumber(a.X) && EBG.isNumber(a.Y) && this._adConfig.actualServingMode && this._adConfig.actualServingMode == EBG.Adaptors.ServingMode.FRIENDLY_IFRAME)
- for (var b =
- EBG.adaptor.getDisplayWin(); b !== b.parent && b.self !== b.parent;) {
- var c = EBG.adaptor.getPositioningByElement(b.frameElement);
- a.X += c.X;
- a.Y += c.Y;
- b = b.parent
- }
- return a
- },
- _getAdCodeBase: function(a) {
- a = EBG.isDefined(a) ? a : 0;
- this._showOnlyDefaultImg && (a = 0);
- 1 == a && this._adConfig.hasConverter && this._adConfig.useHtmlConvertor && (a = 3);
- return a
- },
- _getServingModeNum: function() {
- var a = {
- SCRIPT: 0,
- FRIENDLY_IFRAME: 1,
- IFRAME: 2,
- INNER_IFRAME: 3,
- TOPMOST_FRIENDLY_IFRAME: 4
- };
- if (!EBG.adaptor.serving) return -1;
- var b = EBG.adaptor.serving.detectServingEnvironment(this._adConfig.actualServingMode);
- return EBG.isDefined(a[b]) ? a[b] : -1
- },
- _getTemplateNameNum: function() {
- return {
- Html5StdBanner: 0,
- Html5Banner: 1,
- Html5SEBanner: 2,
- Html5ExpBanner: 3,
- Html5PoliteBanner: 4,
- StdBanner: 5,
- Banner: 6,
- SingleExpBanner: 7,
- ExpBanner: 8,
- Visibility: 9,
- FloatingAd: 10,
- FloatingAdWithReminder: 11,
- Tracking: 12
- }[this._adConfig.templateName] || -1
- },
- getAdId: function() {
- return this._adConfig.adId
- },
- _replaceURLTokens: function(a) {
- var b = this._adConfig;
- try {
- a && (a = a.replace(/\[%random%\]/ig, b.rnd), a = a.replace(/\[ebRandom\]/ig, b.rnd), a = a.replace(/\[timestamp\]/ig,
- 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));
- if (!a || !b.sUrlTokens) return a;
- if (!EBG.isObj(b.objURLTokens)) b.oURLTokens = this._pairsToObj(b.sUrlTokens, "$$");
- for (var c in b.oURLTokens) b.oURLTokens.hasOwnProperty(c) && (a = a.replace(RegExp("\\[%" + c + "%\\]", "ig"), b.oURLTokens[c]))
- } catch (d) {}
- return a
- },
- _pairsToObj: function(a, b) {
- for (var c = {}, d = unescape(a).split(b), e = 0; e < d.length; e++) try {
- if (d[e]) {
- var f = d[e].indexOf("="),
- g = d[e].substr(0, f),
- h = d[e].substr(f + 1);
- c[g] = escape(h)
- }
- } catch (i) {}
- return c
- },
- _subscribeToAdEvent: function(a, b, c) {
- a = new EBG.Events.EventSubscription(a, b, this);
- a.dispatcherFilters = {
- "_adConfig.rnd": this._adConfig.rnd
- };
- if (c) a.timing = c;
- EBG.eventMgr.subscribeToEvent(a);
- return a
- },
- _getCDIUrl: function(a) {
- var b = a && a.defaultImagePath ? a.defaultImagePath : null,
- 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,
- 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),
- c = this._adConfig.massVersioning.targetAudienceId;
- c && (b += EBG.format("&ta={0}", c));
- (c = this._adConfig.massVersioning.deliveryGroupId) && (b += EBG.format("&dg={0}",
- c));
- a && a.versionId ? b += EBG.format("&vid={0}", a.versionId) : this._adConfig.massVersioning.adVersions && (a = this._removePrefixFromVersions(), b += EBG.format("&vid={0}", a));
- EBGInfra.isDefinedNotNull(this._adConfig.diAppId) && (b += "&diappid=" + this._adConfig.diAppId);
- return b
- },
- _removePrefixFromVersions: function() {
- var a = "",
- b = this._adConfig.massVersioning.adVersions;
- if (b) {
- for (var a = [], b = b.split(","), c = 0; c < b.length; c++) {
- var d = b[c].indexOf("_");
- a.push(-1 == d ? b[c] : b[c].substring(0, d))
- }
- a = a.join()
- }
- return a
- },
- buildJSONImgObj: function(a,
- b) {
- var c = EBG.format(a + "_{0}", this._adConfig.uid);
- return {
- tagName: EBG.Adaptors.TagNames.IMG,
- attributes: {
- id: c,
- src: b,
- width: this._adConfig.width,
- height: this._adConfig.height,
- style: {
- width: this._adConfig.width,
- height: this._adConfig.height
- },
- title: this._adConfig.title ? this._adConfig.title : "",
- 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);',
- c, this._adConfig.uid)
- }
- }
- },
- setImageClick: function(a, b, c, d, e) {
- 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);
- EBG.mergeObj({
- cursor: "pointer; cursor: hand"
- }, a.attributes.style)
- },
- _addDefaultImgRequest: function() {
- this.checkAndShowDefaultImage(this.showDefaultImage)
- },
- checkAndShowDefaultImage: function(a) {
- var b = "",
- c = ".xml",
- d = !0;
- if (EBG.isDefinedNotNull(this._adConfig.svJSON) || EBG.isDefinedNotNull(this._adConfig.sv3CatalogMap) ||
- this._adConfig.massVersioning.versionFullPath) c = ".json", d = !1;
- if (EBG.isDefinedNotNull(this._adConfig.massVersioning) && "" != this._adConfig.massVersioning.defaultAdVersion && "" != this._adConfig.massVersioning.adBasePath) {
- b = this._adConfig.massVersioning.defaultAdVersion;
- b = 0 < this._adConfig.massVersioning.massVersionFolderDivider ? EBG.Ads.Ad.Fn.fixMVPathString(b, this._adConfig.massVersioning.massVersionFolderDivider) : b;
- if (this._adConfig.massVersioning.versionFullPath) b = b.p;
- b = EBG.combinePaths(this._adConfig.massVersioning.adBasePath,
- b + c);
- b = this._adConfig.massVersioning.versionFullPath ? EBG.combinePaths("//" + this._adConfig.sHost, b) : EBG.combinePaths(this._adConfig.resourcePath, b)
- }
- c = d ? this._readMassVersionInfo : this._readJsonVersionInfo;
- (!b || !EBG.adaptor.getDataFromRemoteServer(b, c, this, !0, d)) && a.apply(this)
- },
- subscribeToStandardElementEvents: function() {},
- showDefaultImage: function(a) {
- var b = !this._adConfig.imageOnly || this._hasDefaultImageInteraction,
- c = "";
- this._adConfig.showOnlyImage || this._adConfig.imageOnly || this._adConfig.reportDelayedImpression ?
- 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 = "");
- var c = this.buildJSONImgObj("ebDefaultImg", c),
- 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;
- d && this.setImageClick(c, b, d, a && a.isValid ? a.selectedVersion :
- "", a && a.isValid ? a.thirdPartyClks : "");
- a && a.thirdPartyImps && a.thirdPartyImps.length && this._reportImpressionTrackingURLs(a.thirdPartyImps);
- a = new EBG.Events.Event(EBG.Events.EventNames.ADD_CREATIVES);
- a.dispatcher = this;
- a.eventData = {
- tagsObj: c,
- assetId: c.attributes.id,
- isPanel: !1,
- creativeType: EBG.Events.EventNames.ADD_BANNER_DEFAULT_IMAGE_CREATIVE
- };
- a.timing = EBG.Events.EventTiming.BEFORE;
- d = EBG.eventMgr.dispatchEvent(a);
- if (!d && (b = new EBG.Events.Event(EBG.Events.EventNames.ADD_BANNER_DEFAULT_IMAGE_CREATIVE),
- b.eventData = {
- assetId: c.attributes.id
- }, b.dispatcher = this, b.timing = EBG.Events.EventTiming.BEFORE, d = EBG.eventMgr.dispatchEvent(b), !d)) {
- var d = EBG.adaptor._getTags(c),
- e = EBG.adaptor.getElementById(this._adConfig.placeHolderId);
- EBG.adaptor.setInnerHtml(e, d);
- this._defaultImgResId = c.attributes.id;
- this.subscribeToStandardElementEvents(this._defaultImgResId);
- b.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
- EBG.eventMgr.dispatchEvent(b);
- a.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
- EBG.eventMgr.dispatchEvent(a)
- }
- },
- _triggerAdStart: function(a) {
- if (!(this._shouldWaitForTriggerAdStart() && !(EBGInfra.isDefined(a) && a.name === EBG.EBMessage.TRIGGER_AD_START) || this._adConfig.adStarted))
- if (this._adConfig.adStarted = !0, a = new EBG.Events.Event(EBG.Events.EventNames.AD_START), a.eventData = {
- intName: EBG.Interactions.SystemInts.Ad_START
- }, 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),
- a.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER, EBG.eventMgr.dispatchEvent(a)
- },
- _shouldFireAdStart: function() {
- var a = !1;
- if (this._adConfig.isInstream) {
- if (this._adConfig.isInstreamVisibility || this._adConfig.isInstreamVerification) a = !0
- } else if (this._adConfig.displayVerification || this._adConfig.visibility.mode == EBG.VisibilityMode.BASIC_MODE || this._adConfig.visibility.mode == EBG.VisibilityMode.ENHANCED_MODE) a = !0;
- return a
- },
- _shouldWaitForTriggerAdStart: function() {
- return !1
- },
- _readJsonVersionInfo: function(a) {
- var b =
- JSON.parse(a),
- a = this._adConfig.massVersioning.defaultAdVersion.indexOf("_"),
- a = {
- isValid: !!b.DefaultImage,
- jumpUrl: b.ClickthroughURL ? b.ClickthroughURL : "",
- defaultImagePath: b.DefaultImage ? b.DefaultImage : "",
- selectedVersion: -1 == a ? this._adConfig.massVersioning.defaultAdVersion : this._adConfig.massVersioning.defaultAdVersion.substring(0, a),
- thirdPartyImps: b.ThirdPartyImpressionURL ? this._parseUrlValue(b.ThirdPartyImpressionURL) : [],
- thirdPartyClks: b.ThirdPartyClickthroughURL ? this._parseUrlValue(b.ThirdPartyClickthroughURL) : [],
- versionId: b.versionId ? b.versionId : 0
- };
- if (a.isValid && EBG.isNumber(b.DefaultImage)) {
- a.isValid = !1;
- var b = this._adConfig.assets,
- c = "ebMovie" + a.defaultImagePath;
- if (EBG.isDefinedNotNull(b[c].dsPath)) a.defaultImagePath = EBG.isInWorkshop ? b[c].dsPath : EBG.combinePaths(this._adConfig.resourcePath, b[c].dsPath), a.isValid = !0
- }(this._showOnlyDefaultImg ? this.showDefaultImage : this._showImgAsCreative).apply(this, [a])
- },
- _readMassVersionInfo: function(a) {
- var b = {
- isValid: !1,
- jumpUrl: "",
- defaultImagePath: "",
- selectedVersion: "",
- thirdPartyImps: [],
- thirdPartyClks: []
- };
- try {
- if (EBG.isDefined(a) && null != a) {
- var c = a.documentElement.attributes.getNamedItem("productClickThrough"),
- d = a.documentElement.attributes.getNamedItem("DefaultImage"),
- e = a.documentElement.attributes.getNamedItem("ThirdPartyImps"),
- f = a.documentElement.attributes.getNamedItem("ThirdPartyClickThrough"),
- g = this._adConfig.massVersioning.defaultAdVersion.indexOf("_"),
- b = {
- isValid: null != d && "" != d.value,
- jumpUrl: null != c ? c.value : "",
- defaultImagePath: null != d ? d.value : "",
- selectedVersion: -1 ==
- g ? this._adConfig.massVersioning.defaultAdVersion : this._adConfig.massVersioning.defaultAdVersion.substring(0, g),
- thirdPartyImps: e && e.value ? this._parseUrlValue(e.value) : [],
- thirdPartyClks: f && f.value ? this._parseUrlValue(f.value) : []
- };
- if (b.isValid && EBG.isNumber(b.defaultImagePath)) {
- b.isValid = !1;
- var h = this._adConfig.assets,
- i = "ebMovie" + b.defaultImagePath;
- if (EBG.isDefinedNotNull(h[i].dsPath)) b.defaultImagePath = EBG.isInWorkshop ? h[i].dsPath : EBG.combinePaths(this._adConfig.resourcePath, h[i].dsPath), b.isValid = !0
- }
- }(this._showOnlyDefaultImg ? this.showDefaultImage : this._showImgAsCreative).apply(this, [b])
- } catch (j) {
- this.showDefaultImage(b)
- }
- },
- _parseUrlValue: function(a) {
- for (var b = [], a = a.split("\u007f"), c = 0; c < a.length; c++)
- for (var d = a[c].split("|"), e = 0; e < d.length; e++) b.push(d[e]);
- return b
- },
- _sendInitAdInformation: function() {
- this._dpm.send(EBG.DataProfile.GENERAL, {
- frmt: this._getTemplateNameNum(),
- cs: this._adConfig.customScripts
- });
- if (EBG.adaptor.browser.isMobile()) {
- var a = {};
- if (this._adConfig.ffs.CFF_DataPipeUserAgent) a.ua =
- window.navigator.userAgent;
- 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);
- 0 < Object.getOwnPropertyNames(a).length && this._dpm.send(EBG.DataProfile.PLATFORM, a)
- }
- a = this._getServingModeNum();
- this._dpm.send(EBG.DataProfile.SERVING, {
- srvmd: a
- });
- this._adConfig.MRAID && this._dpm.send(EBG.DataProfile.PLATFORM, {
- mraid: 1
- });
- "undefined" != typeof mraid && this._dpm.send(EBG.DataProfile.PLATFORM, {
- mraidw: 1
- })
- },
- _switchAssetsAfterThrottle: function() {},
- _handleCreativeThrottled: function(a) {
- if (this._adConfig.ffs.CFF_FlashThrottle && a.eventData)
- if (a.eventData.state && a.eventData.state == EBG.ThrottleStates.RESUME) clearTimeout(this._throttleTimeout), this._throttleState = EBG.ThrottleStates.RESUME;
- else if (a.eventData.state && a.eventData.state == EBG.ThrottleStates.POLLED && a.dispatcher._adConfig.uid == this._adConfig.uid) this._switchAssetsAfterThrottle(),
- EBG.adaptor.flash.removeThrottleDetectionSwf(this._adConfig.uid);
- else if (this.visibilityMgr && a.eventData.id) {
- if (this.visibilityMgr.isVisibile()) {
- var b = EBG.adaptor.getElementById(a.eventData.id),
- b = b && EBG.adaptor.getBoundingClientRect(b);
- 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)
- } else this._subscribeToAdEvent(EBG.Events.EventNames.PAGE_SCROLL,
- this._checkIfStillThrottled);
- this._throttleState = EBG.ThrottleStates.THROTTLE
- }
- },
- _checkIfStillThrottled: function(a) {
- if (a) {
- if (this.visibilityMgr && !this._throttleTimeout && this._throttleState == EBG.ThrottleStates.THROTTLE && this.visibilityMgr.isVisibile()) this._throttleTimeout = EBG.runTimed(this, this._checkIfStillThrottled, [], 1E3)
- } else {
- if (this._throttleState == EBG.ThrottleStates.THROTTLE && this.visibilityMgr && this.visibilityMgr.isVisibile()) this._switchAssetsAfterThrottle(), EBG.adaptor.flash.removeThrottleDetectionSwf(this._adConfig.uid),
- a = new EBG.Events.EventSubscription(EBG.Events.EventNames.PAGE_SCROLL, this._checkIfStillThrottled, this), a.dispatcherFilters = {
- "_adConfig.rnd": this._adConfig.rnd
- }, a.timing = EBG.Events.EventTiming.ONTIME, EBG.eventMgr.unsubscribeFromEvent(a);
- clearTimeout(this._throttleTimeout);
- this._throttleTimeout = null;
- if (this._throttleState == EBG.ThrottleStates.RESUME) a = new EBG.Events.EventSubscription(EBG.Events.EventNames.PAGE_SCROLL, this._checkIfStillThrottled, this), a.dispatcherFilters = {
- "_adConfig.rnd": this._adConfig.rnd
- },
- a.timing = EBG.Events.EventTiming.ONTIME, EBG.eventMgr.unsubscribeFromEvent(a)
- }
- },
- dispatchCustomEvent: function(a, b, c, d) {
- a = new EBG.Events.Event(a);
- a.dispatcher = d;
- a.eventData = {
- assetId: b
- };
- a.timing = c;
- return EBG.eventMgr.dispatchEvent(a)
- },
- _notifyInteractionManager: function(a) {
- var b = {};
- if (a && a.eventData) b = a.eventData;
- b.elapsedTime = "";
- if (EBG.intMgr.getAdDuration) b.elapsedTime = EBG.intMgr.getAdDuration(this._adConfig.uid);
- EBG.adaptor.notifyIntMonitor(a.eventData)
- },
- onImageClick: function(a, b, c, d, e, f) {
- try {
- var g =
- b ? new EBG.Events.Event(EBG.Events.EventNames.DEFAULT_CLICK) : new EBG.Events.Event(EBG.EBMessage.CLICKTHROUGH);
- g.eventData = b ? {
- intName: EBG.Interactions.SystemInts.DEFAULT_CLICK
- } : {
- intName: EBG.Interactions.SystemInts.CLICK
- };
- if (EBG.isDefined(d)) g.eventData.clickUrl = d;
- if (EBG.isDefined(e)) g.eventData.clickedVersion = e;
- if (EBG.isDefined(f)) g.eventData.clickedVerUrl = f;
- g.dispatcher = EBG.ads[a];
- EBG.eventMgr.dispatchEvent(g);
- if (EBG.adaptor.intMonitorExist()) {
- var h = new EBG.Events.Event(EBG.EBMessage.NOTIFY_INTERACTION_MONITOR);
- h.eventData = {
- command: EBG.EBMessage.CLICKTHROUGH,
- args: "",
- objName: c,
- adId: EBG.Ads.Ad.Fn.getAdIdFromAdUId(a)
- };
- EBG.eventMgr.dispatchEvent(h)
- }
- } catch (i) {}
- }
- };
- EBG.declareClass(EBG.Ads.Ad, null);
- EBG.Ads.Ad.Fn = {
- getAdIdFromAdUId: function(a) {
- return a.split("_")[0]
- },
- getRandFromAdUId: function(a) {
- return a.split("_")[1]
- },
- getVersionToReport: function(a) {
- return -1 < a.indexOf(",") ? "m" : -1 < a.indexOf("_") ? a.substr(0, a.indexOf("_")) : a
- },
- getAdVersions: function(a) {
- for (var b = "", a = a.adVersions.split(","), c = 0; c < a.length; c++) b && (b += ","), b += a[c];
- return b
- },
- fixMVPathString: function(a, b) {
- if (0 < b)
- 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("_"))),
- h = parseInt(h), g = parseInt(h / b), h = g + f + "/" + h, d += e + h, "" == e && (e = ",");
- return d
- },
- _handlePageResizeOrScroll: function() {}
- };
- EBG.Ads.RichAd = function(a) {
- this._downloadMode = a.dlm;
- EBG.callSuperConstructor(EBG.Ads.RichAd, this, [a])
- };
- EBG.Ads.RichAd.prototype = {
- isInFullScreenMode: !1,
- visibilityMgr: null,
- videoLoaderDrivers: [],
- _wallpaper: null,
- _registeredToMouseMove: !1,
- _mouseMoveTimeOut: null,
- _creativeContainerReadyHandled: !1,
- _isStdAd: function() {
- return !1
- },
- _subscribeToEvents: function() {
- try {
- 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,
- 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,
- 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),
- 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,
- 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,
- 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,
- 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))
- } catch (a) {}
- },
- _handlePageLoaded: function() {},
- _handleDelayedImpressionReport: function() {
- 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)
- },
- _clearDelayedImpData: function() {
- this._adConfig.delayedImpParams = null
- },
- _reportImpression: function(a) {
- var b = EBGInfra.isDefined(this._adConfig.page) && "" != this._adConfig.page ? 1 : 0,
- 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}",
- 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);
- this._adConfig.delayedImpParams && (b += this._adConfig.delayedImpParams);
- a && (b += "&isBlank=1");
- EBG.adaptor.flash && (b += "&FlashVersion=" + EBG.adaptor.flash.version);
- this._adConfig.massVersioning.targetAudienceId && (b += "&ta=" + this._adConfig.massVersioning.targetAudienceId);
- this._adConfig.massVersioning.deliveryGroupId &&
- (b += "&dg=" + this._adConfig.massVersioning.deliveryGroupId);
- this._adConfig.massVersioning.subDeliveryGroupId && (b += "&sdg=" + this._adConfig.massVersioning.subDeliveryGroupId);
- this._adConfig.defaultImageDisplayed && (b += "&di=1");
- this._adConfig.defaultImageReason && (b += "&dir=" + this._adConfig.defaultImageReason);
- this._adConfig.massVersioning.adVersions && (b += "&vid=" + this._removePrefixFromVersions());
- EBGInfra.isDefinedNotNull(this._adConfig.diAppId) && (b += "&diappid=" + this._adConfig.diAppId);
- b += "&ord=" + Math.random();
- EBG.adaptor.reportToRemoteServer(b, !0)
- },
- _mouseMoveNeededHandler: function() {
- if (!this._registeredToMouseMove) {
- var a = new EBG.Events.EventSubscription(EBG.Events.EventNames.MOUSE_MOVE, this._mouseMoveHandler, this);
- a.isDocumentEvent = !0;
- EBG.eventMgr.subscribeToEvent(a);
- this._registeredToMouseMove = !0
- }
- },
- _mouseMoveHandler: function(a) {
- try {
- if (!this._mouseMoveTimeOut) {
- var b = this;
- b._mouseMoveTimeOut = setTimeout(function() {
- b._mouseMoveTimeOut = null;
- for (var c in b._CCs)
- if (b._CCs.hasOwnProperty(c) && b._CCs[c]._registeredToMouseMove) {
- var e = {},
- e = EBG.adaptor.getMouseCoordinates(a.eventData);
- b._CCs[c]._handleMouseMove(e)
- }
- }, 100)
- }
- } catch (c) {}
- },
- _dwellUniqueEventHandler: function(a) {
- EBG.intMgr.reportDwellUnique(this._adConfig.uid, a.eventData.firstTime)
- },
- _richFlashPlayedEventHandler: function() {
- EBG.intMgr.reportRichFlashPlayed(this._adConfig.uid)
- },
- addCreativesHandler: function(a) {
- try {
- this._adConfig.bgImgSrc && this._changeBackgroundImage(), this._updateVisibilityManagerData(a.eventData), this._updateAdStackingData(a.eventData)
- } catch (b) {}
- },
- _updateVisibilityManagerData: function(a) {
- if (a.isPanel) {
- this.visibilityMgrPanelCollection =
- this.visibilityMgrPanelCollection || {};
- var b = !(this._panels && this._panels[a.panelName] && this._panels[a.panelName].visibilityIntEnabled || 1 == EBG.adaptor.getObjKeys(this._adConfig.panels).length);
- this.visibilityMgrPanelCollection[a.assetId] || (this.visibilityMgrPanelCollection[a.assetId] = new EBG.RichModules.VisibilityManager(this._adConfig, a.assetId, {
- isPanel: !0,
- muteInteractions: b,
- customData: {
- panelName: a.panelName
- }
- }))
- } else this.visibilityMgr ? this.visibilityMgr.updateResourceObjId(a.assetId) : this.visibilityMgr =
- new EBG.RichModules.VisibilityManager(this._adConfig, a.assetId)
- },
- _updateAdStackingData: function(a) {
- if (a.isPanel) {
- if (this._panels && 1 == EBG.adaptor.getObjKeys(this._adConfig.panels).length) {
- if (!this._adStackingDetectorPanel) this._adStackingDetectorPanel = new EBG.RichModules.AdStackingDetector(this._adConfig, !0);
- this._adStackingDetectorPanel.addElementId(a.assetId, !0)
- }
- } else {
- if (!this._adStackingDetector) this._adStackingDetector = new EBG.RichModules.AdStackingDetector(this._adConfig, !1);
- this._adStackingDetector.addElementId(a.assetId, !0)
- }
- },
- _addPreloadImg: function() {
- 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)
- },
- _addImgAsCreative: function(a, b, c, d) {
- a = this.buildJSONImgObj(a, d && d.isValid ? d.defaultImagePath : b);
- (b = d && d.isValid ? d.jumpUrl : this._adConfig.interactions[EBG.Interactions.SystemInts.CLICK].jumpUrl) && this.setImageClick(a, !1, b, d &&
- d.isValid ? d.selectedVersion : "", d && d.isValid ? d.thirdPartyClks : "");
- b = new EBG.Events.Event(EBG.Events.EventNames.ADD_CREATIVES);
- b.dispatcher = this;
- b.eventData = {
- tagsObj: a,
- assetId: a.attributes.id,
- isPanel: !1,
- creativeType: c
- };
- b.timing = EBG.Events.EventTiming.BEFORE;
- var e = EBG.eventMgr.dispatchEvent(b);
- if (e || (e = this.dispatchCustomEvent(c, a.attributes.id, EBG.Events.EventTiming.BEFORE, this))) return a.attributes.id;
- var e = EBG.adaptor._getTags(a),
- f = EBG.adaptor.getElementById(this._adConfig.placeHolderId);
- if (this._richShown) return null;
- var g = EBG.adaptor.getElementById("emptyDiv" + this._banner.divId);
- d && g ? EBG.adaptor.setInnerHtml(g, e) : EBG.adaptor.setInnerHtml(f, e);
- this.subscribeToStandardElementEvents(a.attributes.id);
- b.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
- EBG.eventMgr.dispatchEvent(b);
- this.dispatchCustomEvent(c, a.attributes.id, EBG.Events.EventTiming.ONTIME_AND_AFTER, this);
- return a.attributes.id
- },
- _showImgAsCreative: function(a) {
- if (!this._richShown) this._defaultImgResId = this._addImgAsCreative("ebDefaultImg", EBG.isInWorkshop ?
- this._adConfig.defaultImagePath : EBG.combinePaths(this._adConfig.resourcePath, this._adConfig.defaultImagePath), EBG.Events.EventNames.ADD_BANNER_DEFAULT_IMAGE_CREATIVE, a)
- },
- adCreativesAddedHandler: function() {
- try {
- this._startTimer(EBG.Interactions.SystemInts.AD_DURATION)
- } catch (a) {}
- },
- getAdLocationOnPage: function() {
- var a = this.getAdOffset();
- if (null == a) return a;
- var b = EBG.adaptor.getWindowViewPortMetrics(this._adConfig.displayWin || EBG.adaptor.getDisplayWin());
- return {
- isAdOnLeft: a.X + this._adConfig.width / 2 < b.Width /
- 2,
- isAdOnTop: a.Y + this._adConfig.height / 2 < b.Height / 2
- }
- },
- getAdOffset: function() {
- return null
- },
- getVideoLoaderDriver: function(a, b) {
- for (var b = b.replace(/\./ig, "/"), c = 0; c < this.videoLoaderDrivers.length; c++) {
- var d = this.videoLoaderDrivers[c];
- if (d.data.res.id == a && d.data.apiPath == b) return this.videoLoaderDrivers[c]
- }
- return null
- },
- _initVideoLoaderHandler: function(a) {
- a.eventData.apiPath = a.eventData.apiPath.replace(/\./ig, "/");
- a.eventData.res = EBG.adaptor.getElementById(a.flashResId);
- a.eventData.ad = this;
- this.videoLoaderDrivers.push(new EBG.Video.VideoLoaderDriver(a.eventData))
- },
- _videoLoadHandler: function(a) {
- a.eventData.apiPath = a.eventData.apiPath.replace(/\./ig, "/");
- this.getVideoLoaderDriver(a.flashResId, a.eventData.apiPath).load(a.eventData)
- },
- _startAggregateHandler: function(a) {
- try {
- 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,
- EBG.Interactions.Categories.VIDEO));
- var b = a.eventData.intName,
- c = this._getAssetIdFromEvent(a);
- EBG.intMgr.startAggregate(b, this._adConfig.uid, c)
- } catch (d) {}
- },
- _updateAggregationTimeHandler: function(a) {
- try {
- var b = a.eventData.intName,
- c = parseInt(a.eventData.deltalDuration),
- d = this._getAssetIdFromEvent(a);
- EBG.intMgr.updateAggregation(b, this._adConfig.uid, c, d)
- } catch (e) {}
- },
- _stopAggregateHandler: function(a) {
- try {
- var b = a.eventData.intName,
- c = this._getAssetIdFromEvent(a);
- EBG.intMgr.stopAggregate(b, this._adConfig.uid,
- c)
- } catch (d) {}
- },
- _startTimerVideoHandler: function(a) {
- try {
- 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))
- } catch (b) {}
- this._startTimerHandler(a)
- },
- _startTimerHandler: function(a) {
- try {
- var b = a.eventData.intName,
- c = this._getAssetIdFromEvent(a);
- this._startTimer(b, c)
- } catch (d) {}
- },
- _stopTimerHandler: function(a) {
- try {
- var b = a.eventData.intName,
- c = this._getAssetIdFromEvent(a);
- this._stopTimer(b, c)
- } catch (d) {}
- },
- _getAssetIdFromEvent: function(a) {
- var b = EBGInfra.isDefined(a.eventData.assetId) ? a.eventData.assetId : null;
- if ((!EBGInfra.isDefined(b) || !EBGInfra.notNull(b)) && a.eventData.ebmovie)
- if (b = 0, "0" != a.eventData.ebmovie) {
- a = EBG.format("ebMovie{0}", a.eventData.ebmovie);
- if (this._adConfig.assets && this._adConfig.assets[a]) b = this._adConfig.assets[a].assetID;
- if (this._adConfig.bestAsset && this._adConfig.bestAsset[a]) b = this._adConfig.bestAsset[a].assetID
- }
- return b
- },
- _updateTimerHandler: function(a) {
- try {
- var b = a.eventData.intName,
- c = a.eventData.timerValue;
- if ("ebintduration" == b) b = EBG.Interactions.SystemInts.INT_DURATION, c /= 1E3;
- this._updateTimer(b, c)
- } catch (d) {}
- },
- _startTimer: function(a, b) {
- EBG.intMgr.startTimer(a, this._adConfig.uid, b)
- },
- _stopTimer: function(a, b) {
- EBG.intMgr.stopTimer(a, this._adConfig.uid, b)
- },
- _updateTimer: function(a, b) {
- EBG.intMgr.updateTimer(a, this._adConfig.uid,
- b)
- },
- _notifiedInteractionHandler: function(a) {
- try {
- if (a.eventData.name == EBG.Interactions.SystemInts.PLAYER_PARAMS) a.eventData.value.env = EBG.adaptor.browser.getEnvironment();
- EBG.intMgr.handleCounterInteraction(a.eventData.name, this._adConfig.uid, 0, !1, a.eventData)
- } catch (b) {}
- },
- _videoInteractionHandler: function(a) {
- try {
- var b = a.eventData,
- c = this._getAssetIdFromEvent(a),
- d = b.userInitiated ? b.userInitiated : !1;
- if (this._adConfig.ffs.CFF_QuartileViewability) {
- var e;
- if (b.intName == EBG.VideoInteraction.STARTED && this.visibilityMgr &&
- this.visibilityMgr.calculateVisibilityPercentage() >= this._adConfig.visibility.iabMinSurface) this._handleVideoVisibilityChangeSub = this._subscribeToAdEvent(EBG.Events.EventNames.VISIBILITY_CHECK, function(a) {
- if (a.eventData.percentage < this._adConfig.visibility.iabMinSurface) this._videoRemainedVisible = !1, EBG.eventMgr.unsubscribeFromEvent(this._handleVideoVisibilityChangeSub)
- }, EBG.Events.EventTiming.ONTIME), this._videoRemainedVisible = !0;
- EBGInfra.hasOwnValue(EBG.VideoQuartiles, b.intName, !0) && this._videoRemainedVisible &&
- (e = {
- value: 1
- });
- b.intName == EBG.VideoInteraction.FULLPLAY && this._handleVideoVisibilityChangeSub && EBG.eventMgr.unsubscribeFromEvent(this._handleVideoVisibilityChangeSub);
- EBG.intMgr.handleVideoInteraction(b.intName, this._adConfig.uid, c, d, e)
- } else EBG.intMgr.handleVideoInteraction(b.intName, this._adConfig.uid, c, d)
- } catch (f) {}
- },
- _videoFSOpenHandler: function(a) {
- this.isInFullScreenMode = !0;
- a = {
- eventData: {
- assetId: this._adConfig.FSMovie.assetID,
- userInitiated: !0,
- intName: "ebFSStart"
- }
- };
- this._videoInteractionHandler(a);
- a = new EBG.Events.Event(EBG.Events.EventNames.FULL_SCREEN_START);
- a.dispatcher = this;
- a.eventData = "FullScreen";
- EBG.eventMgr.dispatchEvent(a)
- },
- _videoFSCloseHandler: function() {
- this.isInFullScreenMode = !1;
- var a = {
- eventData: {
- assetId: this._adConfig.FSMovie.assetID,
- userInitiated: !0,
- intName: "ebFSEnd"
- }
- };
- a.eventData.assetId = this._adConfig.FSMovie.assetID;
- this._videoInteractionHandler(a);
- a = new EBG.Events.Event(EBG.Events.EventNames.FULL_SCREEN_END);
- a.dispatcher = this;
- a.eventData = "FullScreen";
- EBG.eventMgr.dispatchEvent(a)
- },
- _videoFSAutocloseHandler: function() {},
- _addSystemInteractions: function() {
- EBG.callSuperFunction(EBG.Ads.RichAd, this, "_addSystemInteractions");
- try {
- var a = EBG.Interactions.Categories.SYSTEM;
- this._addTimerInteraction(EBG.Interactions.SystemInts.INT_DURATION, a);
- this._addTimerInteraction(EBG.Interactions.SystemInts.AD_DURATION, a);
- this._addTimerInteraction(EBG.Interactions.SystemInts.DWELL_TIME, a);
- this._addCounterInteraction(EBG.Interactions.SystemInts.VISIBILITY_RECORDABLE, a, !1, 1);
- this._addCounterInteraction(EBG.Interactions.SystemInts.VISIBILITY_AGENCY_RECORDABLE,
- a, !1, 1);
- this._addCounterInteraction(EBG.Interactions.SystemInts.VISIBILITY_ADVERTISER_RECORDABLE, a, !1, 1);
- this._addCounterInteraction(EBG.Interactions.SystemInts.VISIBILITY_ADVERTISER, a, !1, 1);
- this._addCounterInteraction(EBG.Interactions.SystemInts.VISIBILITY_AGENCY, a, !1, 1);
- this._addCounterInteraction(EBG.Interactions.SystemInts.VISIBILITY_IAB, a, !1, 1);
- this._addTimerInteraction(EBG.Interactions.SystemInts.VISIBILITY_AGENCY_DURATION, a);
- this._addTimerInteraction(EBG.Interactions.SystemInts.VISIBILITY_ADVERTISER_DURATION,
- a);
- this._addTimerInteraction(EBG.Interactions.SystemInts.VISIBILITY_AVG_AD_SURFACE, a);
- EBG.adaptor.isInApp() || this._addTimerInteraction(EBG.Interactions.SystemInts.VISIBILITY_AVG_SCREEN_SHARE, a);
- this._adConfig.playerParamsEnabled && this._addCounterInteraction(EBG.Interactions.SystemInts.PLAYER_PARAMS, a, !1, 5, null, null, !0)
- } catch (b) {}
- },
- _addCounterInteraction: function(a, b, c, d, e, f, g) {
- var h = this._adConfig.interactions[EBG.isDefinedNotNull(f) ? f : a],
- i = new EBG.Interactions.CounterInteractionData(a, b, this._adConfig.uid);
- if (e) i.isPanel = !0;
- 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))
- },
- _addTimerInteraction: function(a, b, c) {
- a = new EBG.Interactions.TimerInteractionData(a, b, this._adConfig.uid);
- if (c) a.isPanel = c;
- c = new EBG.Interactions.TimerInteraction(a);
- EBG.intMgr.addInteraction(c)
- },
- _addAggregateInteraction: function(a, b, c) {
- a = new EBG.Interactions.AggregationInteractionData(a, b, this._adConfig.uid);
- if (c) a.isPanel = c;
- c = new EBG.Interactions.AggregateInteraction(a);
- EBG.intMgr.addInteraction(c)
- },
- _addVideoInteractions: function() {
- try {
- 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),
- 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)
- } catch (a) {}
- },
- _addVideoInteraction: function(a, b, c) {
- a = new EBG.Interactions.CounterInteractionData(a, EBG.Interactions.Categories.VIDEO, this._adConfig.uid);
- a.initiationType = b ? EBG.Interactions.InitiationTypes.USER : EBG.Interactions.InitiationTypes.AUTO;
- if (c) a.numLeftToReport = c;
- b = new EBG.Interactions.CounterInteraction(a);
- EBG.intMgr.addInteraction(b)
- },
- _addCustomInteractions: function() {
- try {
- var a = this._adConfig.interactions,
- b;
- for (b in a)
- if (a.hasOwnProperty(b)) {
- var c = EBG.intMgr.adsData[this._adConfig.uid];
- switch (a[b].type) {
- case 0:
- c.Counter.hasOwnProperty(b) || b !== EBG.Interactions.SystemInts.CLICK && b !== EBG.Interactions.SystemInts.DEFAULT_CLICK && this._addCounterInteraction(b, EBG.Interactions.Categories.CUSTOM);
- break;
- case 1:
- c.Timer.hasOwnProperty(b) || this._addTimerInteraction(b, EBG.Interactions.Categories.CUSTOM)
- }
- }
- } catch (d) {}
- },
- subscribeToStandardElementEvents: function(a) {
- var b = new EBG.Events.EventSubscription("mouseover", this._handleMouseEvent, this);
- b.isElementEvent = !0;
- b.elementId = a;
- EBG.eventMgr.subscribeToEvent(b);
- b = new EBG.Events.EventSubscription("mouseout", this._handleMouseEvent, this);
- b.isElementEvent = !0;
- b.elementId = a;
- EBG.eventMgr.subscribeToEvent(b)
- },
- _handleMouseEvent: function(a) {
- var b = a.currentTarget ? a.currentTarget : a.srcElement,
- c = a.relatedTarget ? a.relatedTarget : null,
- d = "",
- e = b.id,
- f = e.lastIndexOf("_") + 1,
- g = "",
- g = b.id.split("_"),
- h = g.length,
- g = g[h - 2] + "_" + g[h - 1],
- g = EBGInfra.isDefined(g) ? g : "";
- f && (d = e.substring(f));
- e = "mouseover" == a.type ? new EBG.Events.Event(EBG.Events.EventNames.MOUSE_OVER) : new EBG.Events.Event(EBG.Events.EventNames.MOUSE_OUT);
- if (!("mouseout" == a.type && EBGInfra.isDefined(EBG.ads[g]) && EBG.ads[g].isInFullScreenMode)) e.dispatcher = {
- _adConfig: {
- rnd: d
- }
- }, e.eventData = {
- target: b,
- relatedTarget: c
- }, EBG.eventMgr.dispatchEvent(e)
- },
- _verifyPlaceHolder: function() {
- EBG.callSuperFunction(EBG.Ads.RichAd, this, "_verifyPlaceHolder") || EBG.adaptor.addPlaceHolder({
- tagName: EBG.Adaptors.TagNames.DIV,
- attributes: {
- id: this._adConfig.placeHolderId,
- dir: "ltr"
- },
- children: null
- })
- },
- _changeBackgroundImage: function() {
- this._wallpaper = new EBG.Adaptors.Wallpaper;
- var a = new EBG.Adaptors.Wallpaper.BgData;
- a.imgSrc = EBG.combinePaths(this._adConfig.resourcePath, this._adConfig.bgImgSrc);
- a.tiling = this._adConfig.bgRepeat;
- a.scrolling = this._adConfig.bgIgnoreScrolling;
- a.positionX = this._adConfig.bgPosX;
- a.positionY = this._adConfig.bgPosY;
- this._wallpaper.SetBackgroundImage(a)
- },
- _removeBackgroundImage: function() {
- this._wallpaper &&
- this._wallpaper.RemoveBackgroundImage()
- },
- _setStateInCreativeState: function(a) {
- 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))
- }
- };
- EBG.declareClass(EBG.Ads.RichAd, EBG.Ads.Ad);
- EBG.Ads.RichBannerHtml5 = function(a) {
- this._updateAdConfig(a);
- if (EBG.AdaptiveUtils && a.adaptiveAd) {
- this._adConfig = a;
- this._verifyPlaceHolder();
- var b = EBG.adaptor.getElementById(a.placeHolderId),
- c = a.width && EBG.isNumber(a.width) ? a.width + "px" : "100%",
- d = a.height && EBG.isNumber(a.height) ? a.height + "px" : "100%";
- this.resizePlaceHolder = !1;
- EBG.adaptor.setElemStyle(b, "width", c);
- EBG.adaptor.setElemStyle(b, "height", d);
- this._adaptiveUtils = new EBG.AdaptiveUtils(a);
- this._adaptiveUtils.updateAdConfig();
- this._adaptiveUtils.subscribeToEvents()
- }
- EBG.callSuperConstructor(EBG.Ads.RichBannerHtml5,
- this, [a])
- };
- EBG.Ads.RichBannerHtml5.requiresIframeBust = !1;
- EBG.Ads.RichBannerHtml5.prototype = {
- _isClickOccur: !1,
- _CCs: {},
- _banner: {
- divId: "",
- resId: "",
- width: 0,
- height: 0
- },
- _canShow: function() {
- var a = !1;
- 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;
- return a
- },
- _updateAdConfig: function(a) {
- this._updateSVJSON(a)
- },
- _updateSVJSON: function(a) {
- var b = EBG.isGlobalDef("ebAdXmlPath") ? ebAdXmlPath :
- "";
- if (b && a.svJSON) a.svPreview = b;
- 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;
- if (a.massVersioning && a.massVersioning.versionFullPath && (a.versions = a.massVersioning.adVersions, b = EBG.isGlobalDef("ebAdJson") ? ebAdJson : null)) a.versionPreviewJson = b
- },
- _subscribeToEvents: function() {
- EBG.callSuperFunction(EBG.Ads.RichBannerHtml5,
- this, "_subscribeToEvents");
- this._subscribeToAdEvent(EBG.EBMessage.CLICKTHROUGH, this._updateAssetsWithClick);
- this._subscribeToAdEvent(EBG.EBMessage.SWIPE, function() {
- EBG.intMgr.handleCounterInteraction(EBG.Interactions.SystemInts.SWIPE, this._adConfig.uid)
- });
- this._subscribeToAdEvent(EBG.EBMessage.DISPOSE, function() {
- var a = new EBG.Events.Event(EBG.Events.EventNames.PAGE_UNLOAD);
- EBG.eventMgr.dispatchEvent(a)
- });
- this._adConfig.ffs.CFF_IFrameHidden && this._subscribeToAdEvent(EBG.Events.EventNames.CREATIVE_CONTAINER_READY,
- function(a) {
- this._bannerCC && 1 == this._downloadMode && this._bannerCC.iframeId == a.eventData && EBG.adaptor.removeElement(this._preloadImgResId || this._defaultImgResId)
- }, EBG.Events.EventTiming.BEFORE);
- this._shouldWaitForTriggerAdStart() && this._subscribeToAdEvent(EBG.EBMessage.TRIGGER_AD_START, this._triggerAdStart)
- },
- _updateAssetsWithClick: function(a) {
- this._isClickOccur = !0;
- clickedProductId = a && a.eventData && a.eventData.isProductClick && a.eventData.clickedVersion ? a.eventData.clickedVersion : null;
- var a = {
- clickOccur: !0,
- clickedProductId: clickedProductId
- },
- b;
- for (b in this._CCs) this._CCs.hasOwnProperty(b) && this._CCs[b].updateClick(a)
- },
- _writeCreativeElements: function() {
- var a = EBG.adaptor.generateElementId("BannerDiv", this._adConfig.uid),
- b = {
- tagName: EBG.Adaptors.TagNames.DIV,
- attributes: {
- id: a,
- dir: "ltr",
- style: {}
- },
- children: this._bannerCC.buildCreativeContainerJson()
- };
- if ("undefined" != typeof this._adConfig.display) b.attributes.style.display = this._adConfig.display;
- var c = new EBG.Events.Event(EBG.Events.EventNames.ADD_CREATIVES);
- c.dispatcher = this;
- c.eventData = {
- tagsObj: b,
- assetId: b.children[0] ? b.children[0].attributes.id : this._bannerCC.iframeId,
- isPanel: !1,
- creativeType: EBG.Events.EventNames.ADD_HTML5_MAIN_CREATIVE
- };
- c.timing = EBG.Events.EventTiming.BEFORE;
- 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),
- this.subscribeToStandardElementEvents(a), c.timing = EBG.Events.EventTiming.AFTER, EBG.eventMgr.dispatchEvent(c)
- },
- _addCreatives: function() {
- this._loadBanner()
- },
- _loadBanner: function() {
- this._bannerCC = new EBG.IFrameCC(this._adConfig, {
- clickOccur: this._isClickOccur
- });
- this._bannerCC.iframeId = EBG.adaptor.generateElementId("BannerIFrame", this._adConfig.uid);
- this._CCs[this._bannerCC.iframeId] = this._bannerCC;
- this._bannerCC.setAssetCreativeParams();
- this._writeCreativeElements()
- },
- _shouldWaitForTriggerAdStart: function() {
- if (!0 ===
- this._adConfig.isInstream) return !0
- },
- _addSystemInteractions: function() {
- EBG.callSuperFunction(EBG.Ads.RichBannerHtml5, this, "_addSystemInteractions");
- if (EBG.adaptor.browser.isMobile()) try {
- var a = new EBG.Interactions.CounterInteractionData(EBG.Interactions.SystemInts.SWIPE, EBG.Interactions.Categories.SYSTEM, this._adConfig.uid);
- a.initiationType = EBG.Interactions.InitiationTypes.USER;
- var b = new EBG.Interactions.CounterInteraction(a);
- EBG.intMgr.addInteraction(b, EBG.Interactions.SystemInts.SWIPE)
- } catch (c) {}
- },
- _getBannerLocation: function() {
- var a;
- if (this._bannerCC && this._bannerCC.iframeId) a = EBG.adaptor.getPositioningById(this._bannerCC.iframeId, !0, this._adConfig.actualServingMode);
- else if (this._preloadImgResId) a = EBG.adaptor.getPositioningById(this._preloadImgResId);
- else return null;
- return EBG.callSuperFunction(EBG.Ads.RichBannerHtml5, this, "_getBannerLocation", [a])
- },
- _getAdCodeBase: function() {
- return EBG.callSuperFunction(EBG.Ads.RichBannerHtml5, this, "_getAdCodeBase", [2])
- },
- _switchAssetsAfterThrottle: function() {},
- _shouldCheckIfFlashBlocked: function() {
- return !1
- }
- };
- EBG.declareClass(EBG.Ads.RichBannerHtml5, EBG.Ads.RichAd);
- EBG.Ads.PoliteBannerHtml5 = function(a) {
- EBG.callSuperConstructor(EBG.Ads.PoliteBannerHtml5, this, [a])
- };
- EBG.Ads.PoliteBannerHtml5.requiresIframeBust = !1;
- EBG.Ads.PoliteBannerHtml5.prototype = {
- _preloadImgResId: null,
- _richShown: !1,
- _addCreatives: function() {
- 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;
- if (3 == this._downloadMode) this._loadBanner(), this._richShown = !0
- },
- _handlePageLoaded: function() {
- if (1 == this._downloadMode)
- if (null != this._preloadImgResId) this._loadBanerAfterPreload(this._preloadImgResId);
- else if (null != this._defaultImgResId && !this._adConfig.showOnlyImage && !this._adConfig.imageOnly && !this._adConfig.defaultImageDisplayed) this._loadBanerAfterPreload(this._defaultImgResId);
- else if (null == this._defaultImgResId && !this._adConfig.showOnlyImage && !this._adConfig.imageOnly && !this._adConfig.defaultImageDisplayed) this._loadBanner(), this._richShown = !0
- },
- _loadBanerAfterPreload: function(a) {
- this._adConfig.ffs.CFF_IFrameHidden ||
- EBG.adaptor.removeElement(a);
- this._loadBanner();
- this._richShown = !0
- }
- };
- EBG.declareClass(EBG.Ads.PoliteBannerHtml5, EBG.Ads.RichBannerHtml5);
- EBG.Ads.ExpBaseHtml5 = function(a) {
- if (a.isSafeFrame && EBG.SFUtil) this._sfUtil = new EBG.SFUtil(a);
- EBG.callSuperConstructor(EBG.Ads.ExpBaseHtml5, this, [a])
- };
- EBG.Ads.ExpBaseHtml5.prototype = {
- _panelsName: [],
- _sfUtil: null,
- _wlxObj: null,
- _adLocForSkype: {
- isAdOnLeft: !1,
- isAdOnTop: !0
- },
- _expandTimeStamp: {},
- _show: function() {
- this._setPanels();
- if (this._sfUtil) this._sfUtil.register();
- else if (this._adConfig.isSafeFrame) try {
- $sf.ext.register(this._adConfig.width, this._adConfig.height)
- } catch (a) {}
- EBG.callSuperFunction(EBG.Ads.ExpBaseHtml5, this, "_show")
- },
- _addMouseListenerForSkype: function(a) {
- if (a && a.id) {
- $this = this;
- var b = new EBG.Events.EventSubscription("mouseenter", function(a) {
- a =
- a.screenX - a.clientX;
- EBG.isDefined($this._skypeExpansionCorrection) && EBG.isDefined($this._skypeExpansionCorrection.prevExpansionWasLeft) && EBG.isDefined($this._skypeExpansionCorrection.xOffset) && $this._skypeExpansionCorrection.prevExpansionWasLeft && (a += $this._skypeExpansionCorrection.xOffset);
- var b = EBG.adaptor.getDisplayWin();
- $this._adLocForSkype = {
- isAdOnLeft: a - b.screenX < b.outerWidth / 2 + 12,
- isAdOnTop: !0
- }
- });
- b.isElementEvent = !0;
- b.elementId = a.id;
- EBG.eventMgr.subscribeToEvent(b)
- }
- },
- _canShow: function() {
- var a =
- EBG.callSuperFunction(EBG.Ads.ExpBaseHtml5, this, "_canShow");
- if (a && this._sfUtil) {
- if (a = this._sfUtil.canExpand(), !a) this._cdiReason = 3
- } else if (this._adConfig.isSafeFrame && a) try {
- var b = this._getMaxExpansionBoundaries(),
- c = $sf.ext.geom().exp,
- d;
- for (d in b)
- if (c[d] = c[d] ? 1 * c[d] : 0, c[d] < b[d]) return this._cdiReason = 3, !1;
- a = !(!$sf.ext.supports()["exp-ovr"] && b.b + b.t + b.l + b.r)
- } catch (e) {
- this._cdiReason = 3, a = !1
- }
- return a
- },
- _getMaxExpansionBoundaries: function() {
- var a = {
- l: 0,
- r: 0,
- b: 0,
- t: 0
- },
- b = this._adConfig.panels || {};
- if ("Html5SEBanner" ==
- this._adConfig.templateName) b.banner = {
- xPos: -1 * this._adConfig.expansionParams.x,
- yPos: -1 * this._adConfig.expansionParams.y,
- width: this._adConfig.expansionParams.width,
- height: this._adConfig.expansionParams.height
- };
- for (var c in b) {
- var d = b[c],
- e = {
- l: 0,
- r: 0,
- b: 0,
- t: 0
- };
- e.l = Math.max(-1 * d.xPos, 0);
- e.r = Math.max(d.xPos + d.width - (this._bannerCC ? this._bannerCC.getWidth() : this._adConfig.width), 0);
- e.t = Math.max(-1 * d.yPos, 0);
- e.b = Math.max(d.yPos + d.height - (this._bannerCC ? this._bannerCC.getHeight() : this._adConfig.height), 0);
- for (var f in e) a[f] = Math.max(a[f], e[f])
- }
- return a
- },
- _subscribeToEvents: function() {
- EBG.callSuperFunction(EBG.Ads.ExpBaseHtml5, this, "_subscribeToEvents");
- this._subscribeToAdEvent(EBG.EBMessage.EXPAND, this._handleExpand);
- this._subscribeToAdEvent(EBG.EBMessage.COLLAPSE, this._handleCollapse);
- this._subscribeToAdEvent(EBG.EBMessage.RESET_COLLAPSE_TIMER, this._resetCollapseTimer);
- this._subscribeToAdEvent(EBG.Events.EventNames.EXPAND, this._resetCollapseTimer);
- EBG.eventMgr.subscribeToEvent(new EBG.Events.EventSubscription(EBG.Events.EventNames.PAGE_UNLOAD,
- this._unLoadHandler, this));
- this._adConfig.isSkype && this._adConfig.expandDynamic && this._adConfig.ffs.CFF_SkypeDynamic && this._subscribeToAdEvent(EBG.Events.EventNames.CREATIVE_CONTAINER_READY, function(a) {
- a.dispatcher == this._bannerCC && this._addMouseListenerForSkype(a.dispatcher._iframe)
- }, EBG.Events.EventTiming.AFTER)
- },
- _resetCollapseTimer: function(a) {
- var b = a && a.eventData && a.eventData.panelName ? a.eventData.panelName.toLowerCase() : this._defaultPanel;
- if (a.name == EBG.Events.EventNames.EXPAND) {
- var c = a.dispatcher.autoCollapse;
- if (!c && this._adConfig.expansionParams && this._adConfig.expansionParams.autoCollapse) c = this._adConfig.expansionParams.autoCollapse;
- a.eventData && "string" == typeof a.eventData && (b = a.eventData.toLowerCase());
- this._expandTimeStamp[b] = new Date;
- c && (a = EBG.cloneObj(a), EBG.runTimed(this, this._handleCollapse, [a, this._expandTimeStamp[b]], c))
- } else this._expandTimeStamp && this._handleCollapse && (this._expandTimeStamp[b] = new Date, 0 <= a.eventData.newTimerValue && EBG.runTimed(this, this._handleCollapse, [a, this._expandTimeStamp[b]],
- a.eventData.newTimerValue))
- },
- _cancelCollapseTimer: function(a) {
- a = a ? a.toLowerCase() : this._defaultPanel;
- this._expandTimeStamp[a] = 0
- },
- _addSystemInteractions: function() {
- EBG.callSuperFunction(EBG.Ads.ExpBaseHtml5, this, "_addSystemInteractions");
- this._addPanelInteraction(EBG.ExpBaseInteractions.PANELS_VIEWED, EBG.Interactions.Categories.SYSTEM, EBG.Interactions.InitiationTypes.AUTO, 1);
- for (var a = 0; a < this._panelsName.length; a++) panelName = this._panelsName[a], this._addPanelInteraction(panelName, EBG.Interactions.Categories.CUSTOM,
- 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);
- a = EBG.Interactions.Categories.SYSTEM;
- this._addCounterInteraction("P" + EBG.Interactions.SystemInts.VISIBILITY_RECORDABLE, a, !1, 1, !0);
- this._addCounterInteraction("P" +
- EBG.Interactions.SystemInts.VISIBILITY_AGENCY_RECORDABLE, a, !1, 1, !0);
- this._addCounterInteraction("P" + EBG.Interactions.SystemInts.VISIBILITY_ADVERTISER_RECORDABLE, a, !1, 1, !0);
- this._addCounterInteraction("P" + EBG.Interactions.SystemInts.VISIBILITY_ADVERTISER, a, !1, 1, !0);
- this._addCounterInteraction("P" + EBG.Interactions.SystemInts.VISIBILITY_AGENCY, a, !1, 1, !0);
- this._addCounterInteraction("P" + EBG.Interactions.SystemInts.VISIBILITY_IAB, a, !1, 1, !0);
- this._addTimerInteraction("P" + EBG.Interactions.SystemInts.VISIBILITY_AGENCY_DURATION,
- a, !0);
- this._addTimerInteraction("P" + EBG.Interactions.SystemInts.VISIBILITY_ADVERTISER_DURATION, a, !0);
- this._addTimerInteraction("P" + EBG.Interactions.SystemInts.VISIBILITY_AVG_AD_SURFACE, a, !0);
- EBG.adaptor.isInApp() || this._addTimerInteraction("P" + EBG.Interactions.SystemInts.VISIBILITY_AVG_SCREEN_SHARE, a, !0);
- this._addCounterInteraction("P" + EBG.Interactions.SystemInts.AD_STACKING, a, !1, 1, !0)
- },
- _addPanelInteraction: function(a, b, c, d, e) {
- a = new EBG.Interactions.CounterInteractionData(a, b, this._adConfig.uid);
- a.countAsClick = 0;
- a.initiationType = c;
- if (-1 !== d) a.numLeftToReport = d;
- if (e) a.isPanel = e;
- c = new EBG.Interactions.CounterInteraction(a);
- EBG.intMgr.addInteraction(c)
- },
- getAdOffset: function() {
- var a = {};
- return a = this._sfUtil ? this._sfUtil.getAdOffset() : EBG.adaptor.getPositioningById(this._bannerCC.iframeId, !0, this._adConfig.actualServingMode, !0)
- },
- _handleCloseAd: function() {},
- _getWlxObj: function() {
- var a = null;
- try {
- EBG.isGlobalDef("gEbDisableSmartServeAPI") || (a = window.$WLXRmAd || window.parent && window.parent.$WLXRmAd)
- } catch (b) {}
- return a
- },
- _wlxInit: function(a) {
- try {
- var b = !!this._wlxObj;
- this._wlxObj = this._getWlxObj();
- this._adConfig.ffs.CFF_SkypeDynamic && this._wlxObj.resetState();
- if (!b || this._adConfig.ffs.CFF_SkypeDynamic) a = a || this._getMaxExpansionBoundaries(), this._wlxObj.init({
- width: this._adConfig.width,
- height: this._adConfig.height,
- offsetLeft: a.l,
- offsetRight: a.r,
- offsetTop: a.t,
- offsetBottom: a.b
- })
- } catch (c) {}
- }
- };
- EBG.declareClass(EBG.Ads.ExpBaseHtml5, EBG.Ads.PoliteBannerHtml5);
- EBG.Ads.SEBannerHtml5 = function(a) {
- this.panelFrequencyMgr = new EBG.RichModules.PanelFrequencyManager;
- EBG.callSuperConstructor(EBG.Ads.SEBannerHtml5, this, [a]);
- this._updateSafeFramePanel()
- };
- EBG.Ads.SEBannerHtml5.requiresIframeBust = !0;
- EBG.Ads.SEBannerHtml5.prototype = {
- expansionParamsOrg: null,
- _skypeExpansionCorrection: {},
- _bannerMousePos: {
- X: null,
- Y: null
- },
- _handleExpand: function(a) {
- if (this._bannerCC && !this._bannerCC.isExpanded()) try {
- var b = !1;
- a.eventData && (this._onInitExpansionParams(a), a.eventData.actionType && (b = a.eventData.actionType === EBG.ActionType.AUTO));
- var c = this._adConfig.panelName;
- this._handleDynamicExpansion();
- a = new EBG.Events.Event(EBG.Events.EventNames.EXPAND);
- a.dispatcher = this;
- a.timing = EBG.Events.EventTiming.BEFORE;
- a.eventData =
- c;
- if (!EBG.eventMgr.dispatchEvent(a)) {
- if (this._sfUtil) this._sfUtil.expand({
- push: this._isPushDown
- });
- else if (this._adConfig.isSafeFrame || this._adConfig.isSkype) {
- var d = this._getMaxExpansionBoundaries();
- if (this._adConfig.isSafeFrame) {
- if (this._isPushDown) d.push = !0;
- try {
- $sf.ext.expand(d)
- } catch (e) {}
- } else if (this._adConfig.isSkype) try {
- this._wlxInit(), this._wlxObj.expand({
- left: d.l,
- right: d.r,
- top: d.t,
- bottom: d.b
- })
- } catch (f) {}
- }
- this._bannerCC.expand();
- if (this._adConfig.isSafeFrame) {
- var g = EBG.adaptor.getElementById(this._bannerCC.iframeId);
- g && (EBG.adaptor.setElemStyle(g, "position", "fixed"), EBG.adaptor.setElemStyle(g, "left", "0px"), EBG.adaptor.setElemStyle(g, "top", "0px"))
- }
- a.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
- EBG.eventMgr.dispatchEvent(a);
- 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);
- EBG.intMgr.startTimer(EBG.format("{0}_{1}", c, EBG.ExpBaseInteractions.DURATION),
- this._adConfig.uid)
- }
- } catch (h) {}
- },
- _handleDynamicExpansion: function() {
- 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())
- },
- _handleMoveMoveMsg: function(a) {
- this._bannerMousePos = {
- X: a.eventData.clientX,
- Y: a.eventData.clientY
- }
- },
- _getMaxExpansionBoundaries: function() {
- if (!this._adConfig.ffs.CFF_SkypeDynamic) return EBG.callSuperFunction(EBG.Ads.SEBannerHtml5,
- this, "_getMaxExpansionBoundaries", []);
- var a = {
- l: 0,
- r: 0,
- b: 0,
- t: 0
- },
- b = this._adConfig.panels || {};
- b.banner = {
- xPos: -1 * this._adConfig.expansionParams.x,
- yPos: -1 * this._adConfig.expansionParams.y,
- width: this._adConfig.expansionParams.width,
- height: this._adConfig.expansionParams.height
- };
- for (var c in b) {
- var d = b[c],
- e = {
- l: 0,
- r: 0,
- b: 0,
- t: 0
- };
- e.l = Math.max(-1 * d.xPos, 0);
- e.r = Math.max(d.xPos + d.width - (this._bannerCC ? this._bannerCC.getWidth() : this._adConfig.width), 0);
- e.t = Math.max(-1 * d.yPos, 0);
- e.b = Math.max(d.yPos + d.height - (this._bannerCC ?
- this._bannerCC.getHeight() : this._adConfig.height), 0);
- for (var f in e) a[f] = Math.max(a[f], e[f])
- }
- return a
- },
- _updateVisibilityManagerData: function(a) {
- 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)
- },
- _updateAdStackingData: function(a) {
- if (!a.isPanel) {
- if (!this._adStackingDetector) this._adStackingDetector = new EBG.RichModules.AdStackingDetector(this._adConfig, !1);
- (a = EBG.adaptor.getElementById(a.assetId)) &&
- a.children[0] && a.children[0].id && this._adStackingDetector.addElementId(a.children[0].id, !0)
- }
- },
- _updateExpansion: function(a) {
- this._adConfig.expansionParams.x = a.isAdOnLeft ? 0 : this._adConfig.expansionParams.width - this._bannerCC.getWidth();
- this._adConfig.expansionParams.y = a.isAdOnTop ? 0 : this._adConfig.expansionParams.height - this._bannerCC.getHeight();
- this._updateSafeFramePanel();
- if (this._adConfig.isSkype && this._adConfig.ffs.CFF_SkypeDynamic && this._adConfig.expandDynamic) this._skypeExpansionCorrection = {
- prevExpansionWasLeft: !a.isAdOnLeft,
- xOffset: this._adConfig.expansionParams.x
- }
- },
- _handleCollapse: function(a, b) {
- if (!(!this._bannerCC || !this._bannerCC.isExpanded() || b && this._expandTimeStamp[this._adConfig.panelName.toLowerCase()] != b)) try {
- var c = new EBG.Events.Event(EBG.Events.EventNames.COLLAPSE);
- c.dispatcher = this;
- c.timing = EBG.Events.EventTiming.BEFORE;
- c.eventData = this._adConfig.panelName;
- if (!EBG.eventMgr.dispatchEvent(c)) {
- var d = !1;
- if (this._bannerMousePos.X > this._bannerCC.getWidth() + this._adConfig.expansionParams.x || this._bannerMousePos.X <
- this._adConfig.expansionParams.x || this._bannerMousePos.Y > this._bannerCC.getHeight() + this._adConfig.expansionParams.y || this._bannerMousePos.Y < this._adConfig.expansionParams.y) d = !0;
- this._handleDynamicCollapse();
- if (this._sfUtil) this._sfUtil.collapse();
- else if (this._adConfig.isSafeFrame) try {
- $sf.ext.collapse()
- } catch (e) {} else if (this._adConfig.isSkype) try {
- this._wlxObj.collapse(), this._adConfig.ffs.CFF_SkypeDynamic && this._adConfig.expandDynamic && this._wlxObj.resetState()
- } catch (f) {}
- this._bannerCC.collapse();
- if (this._adConfig.isSafeFrame) {
- var g = EBG.cloneObj(this._adConfig.expansionParams);
- g.x *= -1;
- g.y *= -1;
- var h = EBG.adaptor.getElementById(this._bannerCC.iframeId);
- h && (EBG.adaptor.setElemStyle(h, "left", g.x + "px"), EBG.adaptor.setElemStyle(h, "top", g.y + "px"))
- }
- c.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
- EBG.eventMgr.dispatchEvent(c);
- if (d) {
- var i = new EBG.Events.Event(EBG.Events.EventNames.MOUSE_OUT);
- i.dispatcher = {
- _adConfig: {
- rnd: this._adConfig.rnd
- }
- };
- i.eventData = {
- target: this._bannerCC._iframe
- };
- EBG.eventMgr.dispatchEvent(i)
- }
- EBG.intMgr.stopTimer(EBG.format("{0}_{1}",
- this._adConfig.panelName, EBG.ExpBaseInteractions.DURATION), this._adConfig.uid)
- }
- } catch (j) {}
- },
- _handleDynamicCollapse: function() {
- 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))
- },
- _onInitExpansionParams: function(a) {
- try {
- if (a.eventData && EBG.isDefined(a.eventData.x) &&
- 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()
- } catch (b) {}
- },
- _subscribeToEvents: function() {
- EBG.callSuperFunction(EBG.Ads.SEBannerHtml5, this, "_subscribeToEvents");
- this._subscribeToAdEvent(EBG.EBMessage.INIT_EXPANSION_PARAMS, this._onInitExpansionParams);
- this._subscribeToAdEvent(EBG.EBMessage.MOUSE_MOVE, this._handleMoveMoveMsg);
- var a = new EBG.Events.EventSubscription(EBG.Events.EventNames.ELEMENT_LOADED, this._autoExpandPanel, this);
- a.timing = EBG.Events.EventTiming.AFTER;
- EBG.eventMgr.subscribeToEvent(a)
- },
- _unLoadHandler: function() {
- EBG.adaptor.removeElement(this._bannerCC._iframeDivId);
- this._bannerCC.resetExpanded()
- },
- _setPanels: function() {
- this._panelsName.push(this._adConfig.panelName)
- },
- _loadBanner: function() {
- this._bannerCC = new EBG.SEIFrameCC(this._adConfig, {
- clickOccur: this._isClickOccur
- });
- this._bannerCC.iframeId = EBG.adaptor.generateElementId("BannerIFrame", this._adConfig.uid);
- this._CCs[this._bannerCC.iframeId] = this._bannerCC;
- this._bannerCC.setAssetCreativeParams();
- EBG.callSuperFunction(EBG.Ads.SEBannerHtml5, this, "_writeCreativeElements");
- if (this._adConfig.ffs.CFF_SEHtml5Cliping) EBG.adaptor.getElementById(this._banner.divId).style.display = "inline-block";
- if (this._adConfig.isSkype &&
- !this._adConfig.isSafeFrame) {
- var a = EBG.adaptor.getElementById(this._adConfig.placeHolderId),
- b = EBG.adaptor.getBoundingClientRect(a).bottom - this._bannerCC.getHeight();
- a.style.position = "relative";
- a.style.top = EBG.px(-b)
- }
- },
- getAdOffset: function() {
- var a = EBG.callSuperFunction(EBG.Ads.SEBannerHtml5, this, "getAdOffset");
- a.X += this._adConfig.expansionParams.x;
- a.Y += this._adConfig.expansionParams.y;
- return a
- },
- _handleCloseAd: function() {
- this._handleCollapse()
- },
- _getBannerLocation: function() {
- var a = EBG.callSuperFunction(EBG.Ads.SEBannerHtml5,
- this, "_getBannerLocation");
- a.X -= this._adConfig.expansionParams.x;
- a.Y -= this._adConfig.expansionParams.y;
- return a
- },
- _updateSafeFramePanel: function() {
- if (this._sfUtil) {
- var a = {};
- a[this._adConfig.panelName] = {
- width: this._adConfig.expansionParams.width,
- height: this._adConfig.expansionParams.height,
- xPos: -1 * this._adConfig.expansionParams.x,
- yPos: -1 * this._adConfig.expansionParams.y
- };
- this._sfUtil.updatePanels(a)
- }
- },
- _autoExpandPanel: function() {
- this.panelFrequencyMgr.initialize(this._adConfig);
- 1 < this._adConfig.uponShow &&
- this.panelFrequencyMgr.shouldExpand() && this._handleExpand({
- type: EBG.EBMessage.EXPAND,
- eventData: {
- actionType: EBG.ActionType.AUTO
- }
- })
- }
- };
- EBG.declareClass(EBG.Ads.SEBannerHtml5, EBG.Ads.ExpBaseHtml5);
- EBG.declareNamespace("CreativeContainer");
- EBG.CreativeContainer = function(a) {
- this._adConfig = a
- };
- EBG.declareClass(EBG.CreativeContainer, null);
- EBGInfra.mergeObj({
- getCC: function(a, b, c) {
- var d = null;
- if ((a = EBG.ads[a]) && a._panels && a._panels[b]) d = a._panels[b].CC;
- else if (EBG.hasOwnValue(EBG.adParts, b) && !c)
- for (var e in a._CCs)
- if (-1 < e.toLowerCase().indexOf(b.toLowerCase())) {
- d = a._CCs[e];
- break
- }
- return d
- }
- }, EBGInfra, !1);
- EBGInfra.mergeObj(EBGInfra, EBG, !1);
- EBG.declareNamespace("API.CC");
- EBG.API.CC.getRes = function(a, b) {
- var c = EBGInfra.getCC(a, b),
- d = null;
- if (c)
- if (c._flashResID) d = EBG.adaptor.getElementById(c._flashResID);
- else if (c._iframe) d = c._iframe;
- return d
- };
- EBG.API.CC.getResID = function(a, b) {
- var c = EBGInfra.getCC(a, b),
- d = null;
- if (c)
- if (c._flashResID) d = c._flashResID;
- else if (c.iframeId) d = c.iframeId;
- return d
- };
- EBG.declareNamespace("IFrameCC");
- EBG.IFrameCC = function(a, b) {
- EBG.callSuperConstructor(EBG.IFrameCC, this, [a]);
- this._isClickOccur = b.clickOccur;
- this._isEBInitialized = !1;
- this._isDocLoaded = !1;
- this._iframe = null;
- this.iframeId = null;
- this._isReqInitReceived = !1;
- this._assetCreativeParams = null;
- this._subscribeToEvents();
- this.pm = EBG.pm;
- this.useFriendlyIframe = this._adConfig.isSafeFrame || this._adConfig.isSkype;
- this._registerToEvents();
- this._listenToMessages();
- this._videoAssetsActive = []
- };
- EBG.IFrameCC.prototype = {
- _isContentLoading: !1,
- _videoAssetsActive: null,
- isAssetFullyLoaded: function() {
- return this._isEBInitialized && this._isDocLoaded
- },
- _subscribeToEvents: function() {
- if (!EBG.adaptor.isReady()) {
- var a = new EBG.Events.EventSubscription(EBG.EBMessage.ADAPTOR_READY, this._checkSendInit, this);
- a.timing = EBG.Events.EventTiming.ONTIME;
- EBG.eventMgr.subscribeToEvent(a)
- }
- if (this._adConfig.ffs.CFF_IFrameHidden && (!this._adConfig.customJSVars || !this._adConfig.customJSVars.hasOwnProperty("mdBillboardPanelName"))) {
- var b =
- new EBG.Events.EventSubscription(EBG.Events.EventNames.CREATIVE_CONTAINER_READY, function(a) {
- if (this.iframeId && a.eventData == this.iframeId) this._iframe.style.display = this._iframeDisplay || "inline", EBG.eventMgr.unsubscribeFromEvent(b)
- }, this);
- b.timing = EBG.Events.EventTiming.ONTIME;
- EBG.eventMgr.subscribeToEvent(b)
- }
- },
- isEBInitialized: function() {
- return this._isEBInitialized
- },
- isDocLoaded: function() {
- return this._isDocLoaded
- },
- updateClick: function(a) {
- this._isClickOccur = a.clickOccur;
- this._sendMessage(EBG.EBMessage.UPDATE_CLICK,
- a)
- },
- setAssetCreativeParams: function() {
- if (this._adConfig.AdCreativeParams) this._assetCreativeParams = this._adConfig.AdCreativeParams
- },
- _handleMessage: function(a, b) {
- if (this._iframe)
- if (this._iframe.contentWindow) {
- if (b.source === this._iframe.contentWindow) {
- var c = JSON.parse(b.data);
- if (c) switch (c.type) {
- case EBG.EBMessage.REQ_INIT:
- this._isReqInitReceived = !0;
- (EBG.adaptor.isReady() || !EBG.adaptor.isSDKDefined()) && this._sendInitToCreative();
- break;
- case EBG.EBMessage.INITDONE:
- this._handleInitDone();
- break;
- case EBG.EBMessage.GET_ENVIROMENT:
- this._sendAdKitData(c.type);
- break;
- case EBG.EBMessage.CLOSE_AD:
- this._dispatchCloseAdEvent();
- break;
- default:
- this._handleGeneralMessage(c)
- }
- }
- } else EBG.runTimed(this, this._handleMessage, [a, b], 20);
- else this._getIframeElement(), EBG.runTimed(this, this._handleMessage, [a, b], 20)
- },
- _handleGeneralMessage: function(a) {
- var b = new EBG.Events.Event(a.type);
- b.dispatcher = this;
- if (a.data && (b.eventData = a.data, b.eventData && b.eventData.command)) this[b.eventData.command](b.eventData);
- EBG.eventMgr.dispatchEvent(b);
- this.handleIntMonitor(a)
- },
- handleIntMonitor: function(a) {
- if (EBG.adaptor.intMonitorExist()) {
- var b =
- new EBG.Events.Event(EBG.EBMessage.NOTIFY_INTERACTION_MONITOR);
- b.eventData = this._createIntMonitorObj(a);
- EBG.eventMgr.dispatchEvent(b)
- }
- },
- _handleInitDone: function() {
- this._isContentLoading = !1;
- this._isEBInitialized = !0;
- var a = new EBG.Events.Event(EBG.Events.EventNames.CREATIVE_CONTAINER_READY);
- a.dispatcher = this;
- a.eventData = this.iframeId;
- EBG.eventMgr.dispatchEvent(a);
- if (EBG.adaptor.isPageLoaded()) a = new EBG.Events.Event(EBG.Events.EbEventNames.PAGE_LOAD), a.dispatcher = this, this._handleEvents(a)
- },
- _saveAssetSrc: function(a) {
- a.src =
- this.iframeId
- },
- _registerVideo: function(a) {
- -1 == EBGInfra.indexOfArray(this._videoAssetsActive, a.assetId) && this._videoAssetsActive.push(a.assetId)
- },
- _unregisterVideo: function(a) {
- if (0 < this._videoAssetsActive.length) var b = EBGInfra.indexOfArray(this._videoAssetsActive, a.assetId);
- this._videoAssetsActive.splice(b, 1)
- },
- notifyDocLoaded: function(a) {
- this._isDocLoaded = !0;
- this._saveAssetSrc(a)
- },
- getWidth: function() {
- return EBG.isDefinedNotNull(this._adConfig.width) ? this._adConfig.width : this.getActualSize().width
- },
- getHeight: function() {
- return EBG.isDefinedNotNull(this._adConfig.height) ? this._adConfig.height : this.getActualSize().height
- },
- getActualSize: function() {
- var a = EBG.adaptor.getElementById(this.iframeId);
- return a ? EBG.adaptor.getBoundingClientRect(a) : {
- width: 0,
- height: 0
- }
- },
- getAdPartsData: function() {
- var a = {
- type: EBG.adParts.BANNER,
- adkitConfigUrl: this._adConfig.assets["config.js"] ? this._adConfig.resourcePath + this._adConfig.assets["config.js"].dsPath : ""
- };
- a.width = a.containerWidth = this.getWidth();
- a.height = a.containerHeight =
- this.getHeight();
- return a
- },
- _sendAdKitData: function(a) {
- var b = EBG.cloneObj(this._adConfig.adKitData),
- c = EBG.ads && this._adConfig && this._adConfig.uid && EBG.ads[this._adConfig.uid] ? EBG.ads[this._adConfig.uid]._adaptiveUtils : null;
- if (c) {
- b.adParts = b.adParts || {};
- b.adParts.type = EBG.adParts.BANNER;
- b.adParts.adkitConfigUrl = this._adConfig.assets["config.js"] ? this._adConfig.resourcePath + this._adConfig.assets["config.js"].dsPath : "";
- var c = c.getAsset(),
- d = this.getActualSize();
- if (c) b.adParts.name = c.name, b.adParts.width =
- c.width, b.adParts.height = c.height;
- if (d) b.adParts.containerWidth = d.width, b.adParts.containerHeight = d.height, b.actualWidth = d.width, b.actualHeight = d.height
- } else b.adParts = this.getAdPartsData();
- this._sendMessage(a, b)
- },
- _createIntMonitorObj: function(a) {
- var b = "";
- if (a) switch (a.type) {
- case EBG.EBMessage.VIDEO_INTERACTION:
- a.data && (b = EBG.format("'{0}',{1}", a.data.intName, a.data.ordinalNum));
- break;
- case EBG.EBMessage.EXPAND:
- case EBG.EBMessage.COLLAPSE:
- b = this._handleSpecialInt(a);
- break;
- default:
- b = a.data.intName
- }
- return {
- command: a.type,
- args: b,
- objName: this.iframeId,
- adId: this._adConfig.adId
- }
- },
- _handleSpecialInt: function(a) {
- var b = "";
- switch (a.type) {
- case EBG.EBMessage.EXPAND:
- b = a.data && EBGInfra.isDefinedNotNull(a.data.panelName) ? a.data.panelName : "";
- b += a.data && EBGInfra.isDefinedNotNull(a.data.actionType) && "" != a.data.actionType ? "," + a.data.actionType : ",User";
- break;
- case EBG.EBMessage.COLLAPSE:
- b = a.data && EBGInfra.isDefinedNotNull(a.data.panelName) ? a.data.panelName : ""
- }
- return b
- },
- _listenToMessages: function() {
- for (var a in EBG.EBMessage) EBG.EBMessage.hasOwnProperty(a) &&
- (a = EBG.EBMessage[a], EBG.pm.bind(a, this._handleMessage, this, this._adConfig.displayWin || EBG.adaptor.getDisplayWin()))
- },
- _sendMessage: function(a, b) {
- this._iframe && (this.useFriendlyIframe ? EBG.runTimed(this, function() {
- this._iframe.contentWindow.EBG.pm.dispatch(a, b, window, this._iframe.contentWindow)
- }, [], 1) : EBG.pm({
- target: this._iframe.contentWindow,
- type: a,
- data: b
- }))
- },
- _handleEvents: function(a) {
- this._isEBInitialized && this._sendMessage(a.name, a.eventData)
- },
- _registerToEvents: function() {
- for (var a in EBG.Events.EbEventNames) EBG.Events.EbEventNames.hasOwnProperty(a) &&
- EBG.eventMgr.subscribeToEvent(new EBG.Events.EventSubscription(EBG.Events.EbEventNames[a], this._handleEvents, this))
- },
- _dispatchCloseAdEvent: function() {
- var a = new EBG.Events.Event(EBG.Events.EventNames.CLOSE_AD);
- a.dispatcher = this;
- a.timing = EBG.Events.EventTiming.ONTIME;
- EBG.eventMgr.dispatchEvent(a)
- },
- _checkSendInit: function() {
- this._isReqInitReceived && this._sendInitToCreative()
- },
- _sendInitToCreative: function() {
- if (this._adConfig) {
- var a = {
- assetCreativeParams: this._assetCreativeParams,
- clickOccur: this._isClickOccur,
- clickedProductIds: this._getClickedProductIDs(),
- adConfig: this._adConfig,
- ffs: EBG.serverResponses[this._adConfig.uid].ffs,
- dsBasePath: this._adConfig.resourcePath,
- events: EBG.Events.EbEventNames,
- assetId: this.iframeId
- };
- this._sendMessage(EBG.EBMessage.INIT, a)
- }
- },
- _getIframeElement: function() {
- var a = EBG.adaptor.getElementById(this.iframeId);
- a ? (this._iframe = a, this.useFriendlyIframe && !this._isContentLoading && this._loadContentToIframe(this.getIframePath())) : EBG.runTimed(this, this._getIframeElement, [], 20)
- },
- _loadContentToIframe: function(a) {
- this._isContentLoading = !0;
- var b = a.split("/");
- b.pop();
- var b = b.join("/") + "/",
- c = a.match(/\?.*$/)[0],
- d = this._adConfig.adKitData;
- d.adParts = this.getAdPartsData();
- var e = this;
- this._getAssetHtmlContent(a, function(a) {
- a ? (a = '<base href="' + b + '"/>' + a, e._iframe.contentWindow.document.open("text/html", "replace"), e._iframe.contentWindow.ebSafeFrame = {
- pm: function(a) {
- a && EBG.runTimed(e, function() {
- e.pm.dispatch(a.type, a.data, e._iframe.contentWindow, a.target)
- }, [], 1)
- },
- getClickTagUrl: function() {
- return EBG.intMgr.getClickTag(e._adConfig.uid)
- },
- getAdKitData: function() {
- return {
- data: JSON.stringify({
- data: d,
- type: EBG.EBMessage.GET_ENVIROMENT
- }),
- source: window
- }
- }
- }, e._iframe.contentWindow.ebQueryString = c, e._iframe.contentWindow.document.write(a), setTimeout(function() {
- e._iframe.contentWindow.document.close()
- }, 200)) : e._isContentLoading = !1
- })
- },
- _getAssetHtmlContent: function(a, b) {
- EBG.adaptor.getDataFromRemoteServer(a, function(a) {
- b(a)
- }, this, !0, !1)
- },
- _buildIfrmSrc: function(a) {
- a = EBG.format("{0}?v={1}", EBG.combinePaths(this._adConfig.resourcePath, a), EBG.html5Ver);
- this._adConfig.ffs.CFF_EBLoaderNew && this._adConfig.useAsyncEBLoader &&
- (a += "&n=1");
- this._adConfig.ffs.CFF_EBVpaidVersion && (a += "&vpaidV=" + this._adConfig.moduleInfo.vpaidVersionHtml5);
- this._adConfig.pluId && (a += "&plu=" + this._adConfig.pluId, this._adConfig.sHost && (a += "&sHost=" + this._adConfig.sHost));
- this._adConfig.isInstream && (a += "&nonCached=" + this._adConfig.sms);
- this._adConfig.isClickTag && (a = EBG.format("{0}&clickTag={1}", a, escape(EBG.intMgr.getClickTag(this._adConfig.uid))));
- EBG.isPreview && (a = EBG.format("{0}&isPreview={1}", a, "1"));
- return a
- },
- buildCreativeContainerJson: function() {
- var a =
- this.useFriendlyIframe ? this.getFriendlyIframePath() : this.getIframePath(),
- a = {
- tagName: EBG.Adaptors.TagNames.IFRAME,
- attributes: {
- id: this.iframeId,
- src: a,
- 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),
- width: this._adConfig.width ? this._adConfig.width : "100%",
- height: this._adConfig.height ? this._adConfig.height : "100%",
- allowfullscreen: !0
- }
- };
- if (this._adConfig.ffs.CFF_IFrameHidden) a.attributes.style = {
- display: "none"
- };
- this._getIframeElement();
- return [a]
- },
- getIframePath: function() {
- return this._buildIfrmSrc(this._adConfig.adHtmlPath)
- },
- getFriendlyIframePath: function() {
- var a, b = "";
- if (EBG.adaptor.browser.isIE() && 11 > EBG.adaptor.browser.getVersion()) {
- try {
- if ((a = EBG.adaptor.inject({
- tagName: EBG.Adaptors.TagNames.IFRAME,
- attributes: {
- id: "ebSampleIFrame" + this._adConfig.rnd,
- src: "",
- width: 1,
- height: 1,
- allowfullscreen: !0,
- visibility: "hidden",
- display: "none"
- }
- }, EBG.Adaptors.InjectionMethod.APPEND, EBG.adaptor.getElementById(this._adConfig.placeHolderId))) && a.contentWindow) a.contentWindow.document.open("text/html", "replace"), a.contentWindow.document.stam = {}
- } catch (c) {
- b = "javascript:'<script>window.onload=function(){document.write(\\'<script>document.domain=\\\"" + document.domain + "\\\";<\\\\/script>\\');document.close();};<\/script>'"
- }
- a &&
- a.parentElement && a.parentElement.removeChild(a)
- }
- return b
- },
- _getClickedProductIDs: function() {
- return this._adConfig.uid && EBG.intMgr.adsData[this._adConfig.uid] && EBG.intMgr.adsData[this._adConfig.uid].isProductClicked ? EBG.intMgr.adsData[this._adConfig.uid].isProductClicked : {}
- }
- };
- EBG.declareClass(EBG.IFrameCC, EBG.CreativeContainer);
- EBG.declareNamespace("API.CC");
- EBG.API.CC.sendMessage = function(a, b, c, d) {
- (a = EBGInfra.getCC(a, b, !0)) && EBG.isFunc(a._sendMessage) && (ret = a._sendMessage(c, d))
- };
- EBG.declareNamespace("SEIFrameCC");
- EBG.SEIFrameCC = function(a, b) {
- EBG.callSuperConstructor(EBG.SEIFrameCC, this, [a, b])
- };
- EBG.SEIFrameCC.prototype = {
- _panelExpanded: !1,
- _handleSpecialInt: function(a) {
- var b = "";
- switch (a.type) {
- case EBG.EBMessage.EXPAND:
- b = this._adConfig.panelName;
- b += a.data && EBGInfra.isDefinedNotNull(a.data.actionType) && "" != a.data.actionType ? "," + a.data.actionType : ",User";
- break;
- case EBG.EBMessage.COLLAPSE:
- b = this._adConfig.panelName
- }
- return b
- },
- _dispatchEvent: function(a) {
- a = new EBG.Events.Event(a);
- a.dispatcher = this;
- EBG.eventMgr.dispatchEvent(a)
- },
- getWidth: function() {
- return this._adConfig.width ? this._adConfig.width :
- this._adConfig.chosenWidth
- },
- getHeight: function() {
- return this._adConfig.height ? this._adConfig.height : this._adConfig.chosenHeight
- },
- getAdPartsData: function() {
- var a = this._adConfig.assets["config.js"] ? this._adConfig.resourcePath + this._adConfig.assets["config.js"].dsPath : "",
- b = this.getActualSize();
- return {
- type: EBG.adParts.BANNER,
- width: this.isExpanded() ? this._adConfig.expansionParams.width : this.getWidth(),
- height: this.isExpanded() ? this._adConfig.expansionParams.height : this.getHeight(),
- containerWidth: b.width,
- containerHeight: b.height,
- adkitConfigUrl: a
- }
- },
- buildCreativeContainerJson: function() {
- var a = EBG.adaptor.generateElementId("BlankImg", this._adConfig.uid),
- b = EBG.adaptor.generateElementId("IframeDiv", this._adConfig.uid);
- this._adConfig.resourcePath = EBG.combinePaths(this._adConfig.resourcePath, "");
- var c = this._adConfig.expansionParams,
- d = {
- width: this.getWidth(),
- height: this.getHeight()
- },
- d = EBG.adaptor.getClipParams(c, d),
- a = {
- tagName: EBG.Adaptors.TagNames.IMG,
- attributes: {
- id: a,
- src: EBG.combinePaths(ebBigS, "Res/blank_1X1.gif"),
- width: this.getWidth(),
- height: this.getHeight()
- }
- },
- e = this.useFriendlyIframe ? this.getFriendlyIframePath() : this.getIframePath(),
- c = this._adConfig.ffs.CFF_SEHtml5Cliping ? {
- tagName: EBG.Adaptors.TagNames.DIV,
- attributes: {
- id: "parent_" + b,
- style: {
- display: "block",
- position: "relative",
- "z-index": 1
- }
- },
- children: [{
- tagName: EBG.Adaptors.TagNames.DIV,
- attributes: {
- id: b,
- style: {
- display: "block",
- width: EBG.px(c.width),
- height: EBG.px(c.height),
- left: EBG.px(-c.x),
- top: EBG.px(-c.y),
- clip: EBG.adaptor.getClipTag(d.top, d.right, d.bottom, d.left),
- position: "absolute"
- }
- },
- children: [{
- tagName: EBG.Adaptors.TagNames.IFRAME,
- attributes: {
- id: this.iframeId,
- src: e,
- allowTransparency: "true",
- allowfullscreen: !0,
- 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),
- style: {
- left: "0px",
- top: "0px",
- width: EBG.px(c.width),
- height: EBG.px(c.height),
- "z-index": EBG.minZIndex,
- visibility: this._adConfig.ffs.CFF_IFrameHidden && (!this._adConfig.customJSVars || !this._adConfig.customJSVars.hasOwnProperty("mdBillboardPanelName")) ? "hidden" : "visible"
- }
- }
- }]
- }]
- } : {
- tagName: EBG.Adaptors.TagNames.DIV,
- attributes: {
- id: b,
- style: {
- display: "block",
- position: "relative"
- }
- },
- children: [{
- tagName: EBG.Adaptors.TagNames.IFRAME,
- attributes: {
- id: this.iframeId,
- src: e,
- allowTransparency: "true",
- allowfullscreen: !0,
- 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),
- style: {
- left: EBG.px(-c.x),
- top: EBG.px(-c.y),
- width: EBG.px(c.width),
- height: EBG.px(c.height),
- "z-index": EBG.minZIndex,
- clip: EBG.adaptor.getClipTag(d.top,
- d.right, d.bottom, d.left),
- position: "absolute"
- }
- }
- }]
- };
- this._iframeDivId = b;
- EBG.callSuperFunction(EBG.SEIFrameCC, this, "_getIframeElement", [this.iframeId]);
- return [c, a]
- },
- resetExpanded: function() {
- this._panelExpanded = !1
- },
- isExpanded: function() {
- return this._panelExpanded
- },
- expand: function() {
- EBG.adaptor.expand(this._adConfig.ffs.CFF_SEHtml5Cliping ? this._iframe.parentElement : this._iframe, this._adConfig.expansionParams);
- this._panelExpanded = !0;
- this._dispatchEvent(EBG.EBMessage.EXPAND_DONE);
- this._requestMouseMove(!0)
- },
- collapse: function() {
- var a = {
- width: this.getWidth(),
- height: this.getHeight()
- };
- EBG.adaptor.collapse(this._adConfig.ffs.CFF_SEHtml5Cliping ? this._iframe.parentElement : this._iframe, this._adConfig.expansionParams, a);
- this._panelExpanded = !1;
- this._dispatchEvent(EBG.EBMessage.COLLAPSE_DONE);
- this._requestMouseMove(!1)
- },
- _requestMouseMove: function(a) {
- this._sendMessage(EBG.EBMessage.REQ_MOUSE_MOVE, {
- shouldStart: !!a
- })
- }
- };
- EBG.declareClass(EBG.SEIFrameCC, EBG.IFrameCC);
- EBG.declareNamespace("API.CC");
- EBG.API.CC.getPanelExpanded = function(a, b) {
- var c = EBGInfra.getCC(a, b, !0);
- ret = null;
- c && EBG.isFunc(c.isExpanded) && (ret = c.isExpanded());
- return ret
- };
- EBG.API.CC.setPanelExpanded = function(a, b, c) {
- 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
- };
- EBG.API.CC.expand = function(a, b) {
- var c = EBGInfra.getCC(a, b, !0);
- c && EBG.isFunc(c.expand) && c.expand()
- };
- EBG.API.CC.collapse = function(a, b, c) {
- (a = EBGInfra.getCC(a, b, !0)) && EBG.isFunc(a.collapse) && a.collapse(c)
- };
- EBG.API.CC.removeAsset = function(a, b, c, d) {
- (a = EBGInfra.getCC(a, b, !0)) && EBG.isFunc(a.removeAsset) && a.removeAsset(c, d)
- };
- EBG.API.CC.recalculatePanelPosition = function(a, b) {
- var c = EBGInfra.getCC(a, b, !0);
- c && EBG.isFunc(c.recalculatePanelPosition) && c.recalculatePanelPosition()
- };
- EBG.API.CC.getProps = function(a, b) {
- var c = EBGInfra.getCC(a, b, !0);
- ret = null;
- if (c)
- if (EBG.isDefined(c.panelUtil)) ret = c.panelUtil.props;
- else if (EBG.isObj(c.props)) ret = c.props;
- return ret
- };
- EBG.API.CC.setProps = function(a, b, c) {
- a = EBGInfra.getCC(a, b, !0);
- if ((a = EBG.isDefined(a.panelUtil) ? a.panelUtil : a) && EBG.isFunc(a.setProperties) && EBG.isObj(c))
- for (var d in c)
- if (c.hasOwnProperty(d)) {
- a.props.hasOwnProperty(d) || (a.props[d] = {});
- for (var e in c[d]) c[d].hasOwnProperty(e) && (a.props[d][e] = c[d][e])
- }
- };
- EBG.declareNamespace("SFUtil");
- EBG.SFUtil = function(a) {
- this.setExpandParams(a.panels, a.width, a.height)
- };
- EBG.SFUtil.prototype = {
- _isSafeFrameExpanded: !1,
- _panels: {},
- _width: 0,
- _height: 0,
- setExpandParams: function(a, b, c) {
- this._panels = a ? this.createPanels(a) : this._panels;
- this._width = b ? b : this._width;
- this._height = c ? c : this._height
- },
- register: function() {
- try {
- $sf.ext.register(this._width, this._height)
- } catch (a) {}
- },
- expand: function(a) {
- if (!this._isSafeFrameExpanded) {
- var b = this._calcBounderies();
- try {
- if (a && a.push && $sf.ext.supports()["exp-push"]) b.push = !0;
- $sf.ext.expand(b);
- this._isSafeFrameExpanded = !0
- } catch (c) {}
- }
- },
- canExpand: function() {
- try {
- var a =
- this._calcBounderies(),
- b = $sf.ext.geom().exp,
- c;
- for (c in a)
- if (b[c] = b[c] ? 1 * b[c] : 0, b[c] < a[c]) return !1;
- var d = $sf.ext.supports();
- return !(!d["exp-ovr"] && !d["exp-push"] && a.b + a.t + a.l + a.r)
- } catch (e) {
- return !1
- }
- },
- _calcBounderies: function() {
- var a = {
- l: 0,
- r: 0,
- b: 0,
- t: 0
- },
- b;
- for (b in this._panels) {
- var c = {
- l: 0,
- r: 0,
- b: 0,
- t: 0
- },
- d = this._panels[b];
- c.l = Math.max(-1 * d.xPos, 0);
- c.r = Math.max(d.xPos + d.width - this._width, 0);
- c.t = Math.max(-1 * d.yPos, 0);
- c.b = Math.max(d.yPos + d.height - this._height, 0);
- for (var e in a) a[e] = Math.max(c[e], a[e])
- }
- return a
- },
- collapse: function() {
- if (this._isSafeFrameExpanded) {
- var a = !0,
- b;
- for (b in this._panels) {
- if (this._panels[b].CC && this._panels[b].CC.isExpanded() && b != panelName) {
- a = !1;
- break
- }
- if (this._panels[b].CC && this._panels[b].CC._ExpandMethod == EBG.ExpandCollapseMethod.CLIP) {
- a = !1;
- break
- }
- }
- try {
- if (a) $sf.ext.collapse(), this._isSafeFrameExpanded = !1
- } catch (c) {}
- }
- },
- createPanels: function(a) {
- var b = {},
- c;
- 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;
- return b
- },
- updatePanels: function(a) {
- this._panels =
- a
- },
- getWindowViewPortMetrics: function() {
- var a = $sf.ext.geom();
- return {
- Height: a.par.h,
- Width: a.par.w
- }
- },
- getAdOffset: function() {
- var a = $sf.ext.geom();
- return {
- X: -a.exp.l,
- Y: -a.exp.t
- }
- }
- };
- EBG.declareClass(EBG.SFUtil, null);
- EBG.declareNamespace("BWDetection");
- EBG.BWDetection = {
- checked: !1,
- checking: !1,
- speed: 0,
- _adjustment: 0.75,
- _images: [{
- path: EBG.format("{0}{1}micro.gif", ebPtcl, ebO.sms),
- bytes: 51,
- start: null,
- end: null
- }, {
- path: EBG.format("{0}{1}micro.gif", ebPtcl, ebO.sms),
- bytes: 51,
- start: null,
- end: null
- }, {
- path: EBG.format("{0}{1}bw_image.png", ebPtcl, ebO.sms),
- bytes: 43677,
- start: null,
- end: null
- }],
- _loaded: 0,
- _loadImage: function(a) {
- this._images[a].start = (new Date).getTime();
- var b = new Image,
- c = Math.random();
- b.onload = function() {
- EBG.BWDetection._imageLoaded(a)
- };
- b.src = this._images[a].path +
- "?rnd=" + c
- },
- _imageLoaded: function(a) {
- this._images[a].end = (new Date).getTime();
- this._loaded++;
- this._loaded == this._images.length && this._calculateSpeed()
- },
- _dispatchEvent: function() {
- var a = new EBG.Events.Event(EBG.Events.EventNames.BANDWITH_DETECTED);
- a.dispatcher = this;
- a.eventData = this.speed;
- EBG.eventMgr.dispatchEvent(a)
- },
- _calculateSpeed: function() {
- var a = Math.min(this._images[0].end - this._images[0].start, this._images[1].end - this._images[1].start),
- b = this._images[2].end - this._images[2].start,
- c = b,
- d = this._images[2].bytes;
- b > a && (c = b - a, d -= this._images[0].bytes);
- this.speed = Math.round(8 * (d / (c / 1E3) / 1024)) * this._adjustment;
- if (Infinity == this.speed) this.speed = 25E3;
- this.checked = !0;
- this.checking = !1;
- this._dispatchEvent()
- },
- init: function() {
- this.checking = !0;
- this._loadImage(0);
- this._loadImage(1);
- this._loadImage(2);
- var a = this;
- setTimeout(function() {
- if (!a.checked) a.speed = 56, a.checked = !0, a.checking = !1, a._dispatchEvent()
- }, 5E3)
- }
- };
- var tempExtensionHook = ebO.extensionHooks;
- try {
- ebO.extensionHooks.splice(0, 0, function(a, b) {
- function c() {
- EBG.Interactions.checkURL = function(a) {
- if (a) {
- var b = a.toLowerCase();
- b.match("^[^?]*:.*") || (a = "http://" + b);
- return a
- }
- }
- }
- EBG.getFeatureFlagValue(b.ffs, "CFF_DeepLink") && c()
- })
- } catch (e$$104) {
- ebO.extensionHooks = tempExtensionHook
- }
- tempExtensionHook = ebO.extensionHooks;
- try {
- ebO.extensionHooks.splice(0, 0, function(a, b) {
- function c() {
- b.adConfig.UiVz = !1;
- if (EBG.Adaptors && EBG.Adaptors.ServingMgr && EBG.Adaptors.ServingMgr.prototype) EBG.Initializer._initServingMode = function(a) {
- var b = this._getAdClass(a);
- a.requiresIframeBust = b.requiresIframeBust;
- var c = EBGInfra.isDefined(EBG.adaptor.serving) ? EBG.adaptor.serving.detectServingMode(!0) : null;
- if (EBG.adaptor.isSafeFrame()) a.ifrm = 0, a.adConfig.UiVz = !1;
- else {
- if (b.requiresIframeBust) {
- if (!a.ifrm || a.soi) a.ifrm = 0;
- if (a.innerIframe) a.ifrm = EBG.Adaptors.ServingMode.INNER_IFRAME;
- EBG.adaptor.initServingMode(a.ifrm, !1, c)
- } 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 {
- document.close()
- } catch (d) {}
- 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())
- if (b.requiresIframeBust || a.IABBV || a.IABEV || a.invVis) a.ifrm =
- 1, b = new EBG.Events.EventSubscription(EBG.Events.EventNames.AIE_LOADED, this._handleAieLoad, this), b.dispatcherFilters = {
- "_adConfig.rnd": a.rnd,
- "_adConfig.templateName": a.tn
- }, b.timing = EBG.Events.EventTiming.BEFORE, EBG.eventMgr.subscribeToEvent(b), EBG.adaptor.serving.handleAieServing(a)
- }
- }, EBG.Adaptors.ServingMgr.prototype.checkAie = function(a, c, d) {
- EBG.serverResponses = EBG.serverResponses || {};
- EBG.serverResponses[a.adConfig.uid] || (EBG.serverResponses[a.adConfig.uid] = a);
- d.ebO = EBG.cloneObj(a);
- if (EBG.adaptor.browser.isIE() &&
- 9 > EBG.adaptor.browser.getVersion()) try {
- delete d.ebO.ut, delete d.ebO.fru
- } catch (h) {
- d.ebO.ut = "", d.ebO.fru = ""
- }
- 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)
- }, EBG.Adaptors.ServingMgr.prototype.handleAieServing = function(a) {
- this.checkAie(a, this._handleAddInEyeServerResponse, this)
- }, EBG.Adaptors.ServingMgr.prototype._handleAddInEyeServerResponse = function(a, b) {
- var c;
- try {
- c = !b && a ? JSON.parse(a) : {
- iflExists: 0,
- iflCheck: 1
- }
- } catch (d) {
- c = {
- iflExists: 0,
- iflCheck: 1
- }
- }
- EBG.serverResponses[this.ebO.adConfig.uid].aiE = c;
- this.ebO.aiE = c;
- if (!this.ebO.dmn) this.ebO.dmn = c.Domain ? c.Domain : this._ebGetHostName(document.referrer);
- if (this.ebO.requiresIframeBust &&
- c && c.iflExists) this.insertInnerIframe(this.ebO.phid, c.iflCheck ? EBG.Adaptors.IframeMode.SERVEANDVERIFY : EBG.Adaptors.IframeMode.SERVE);
- else {
- if (this.ebO.requiresIframeBust) this.ebO.adConfig.showAieDefaultImage = 1;
- this.ebO.ifrm = 0;
- var i = new EBG.Events.Event(EBG.Events.EventNames.AIE_LOADED);
- i.eventData = {
- loadDefault: !0,
- currentResponse: this.ebO
- };
- i.timing = EBG.Events.EventTiming.BEFORE;
- EBG.eventMgr.dispatchEvent(i);
- c.iflCheck && this.insertInnerIframe(this.ebO.phid, EBG.Adaptors.IframeMode.VERIFY)
- }
- };
- if (EBG.RichModules &&
- EBG.RichModules.VisibilityManager) {
- var a = function() {
- return !0
- };
- EBG.RichModules.BasicVisibilityProvider.prototype.shouldReportRecordable = a;
- EBG.RichModules.GeometricVisibilityProvider.prototype.shouldReportRecordable = a;
- EBG.RichModules.GeometricVisibilityProvider._isAvailable = function(a) {
- return (a.actualServingMode != EBG.Adaptors.ServingMode.IFRAME || EBG.adaptor.serving.servingMode == EBG.Adaptors.ServingMode.INNER_IFRAME) && !(a.ffs.CFF_MRAIDVis && EBG.adaptor.isInApp())
- };
- EBG.RichModules.MouseVisibilityProvider.prototype.shouldReportRecordable =
- a;
- EBG.RichModules.MouseVisibilityProvider.prototype.shouldReportRecordable = a;
- EBG.RichModules.GridVisibilityProvider.prototype.shouldReportRecordable = a;
- if (EBG.RichModules.MraidVisibilityProvider) EBG.RichModules.MraidVisibilityProvider.prototype.shouldReportRecordable = a;
- EBG.RichModules.FlashVisibilityProvider.prototype.shouldReportRecordable = a;
- EBG.RichModules.SafeFrameVisibilityProvider.prototype.shouldReportRecordable = a;
- EBG.RichModules.FFVisibilityProvider.prototype.shouldReportRecordable = a;
- 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];
- a = EBG.RichModules.VisibilityManager.prototype;
- EBG.RichModules.VisibilityManager = function(a, b, c) {
- this.adConfig = a;
- this._resObjId = b;
- this._res = EBG.adaptor.getElementById(b);
- this.actualServingMode =
- this.adConfig.actualServingMode;
- this._averageLastCalcTime = (new Date).getTime();
- this._isPanel = c;
- this._dpm = EBG.dataPipeMgr.getPipe(this.adConfig.sID);
- if (this._shouldInitialize())(this._visibilityProvider = this._getVisibilityProvider(this._resObjId, this.adConfig)) ? (this._dpm.send(EBG.DataProfile.VISIBILITY, {
- vsr: 1,
- vsbp: this.getVisibilityProviderNum()
- }), this._initializeVisibilityData(), this._subscribeToEvents(), a = function() {
- this._visibilityProvider.shouldReportRecordable() && this._reportVisibilityRecordable();
- this._visibilityProvider.start()
- }, 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, {
- uvsr: 3
- })
- };
- EBG.RichModules.VisibilityManager.ThreholdType = {
- IAB: 0,
- Agency: 1,
- Advertiser: 2
- };
- EBG.RichModules.VisibilityManager.VisibilityPollingTimer = 1E3;
- EBG.RichModules.VisibilityManager.prototype = a;
- EBG.RichModules.VisibilityManager.prototype._shouldInitialize =
- function() {
- EBG.Initializer._getAdClass({
- tn: this.adConfig.templateName
- });
- return this.adConfig.visibility.mode == EBG.VisibilityMode.DEFAULT_MODE ? !1 : !0
- }
- }
- }
- EBG.getFeatureFlagValue(b.ffs, "CFF_RemoveUivz") && c()
- })
- } catch (e$$107) {
- ebO.extensionHooks = tempExtensionHook
- }
- tempExtensionHook = ebO.extensionHooks;
- try {
- ebO.extensionHooks.splice(0, 0, function(a, b) {
- function c() {
- if (EBG.Interactions && EBG.Interactions.InteractionManager && EBG.Interactions.InteractionManager.prototype.reportInteractionQueues) EBG.Interactions.InteractionManager.prototype.reportInteractionQueues = function(a, b, c) {
- if (!(EBG.getTime() > EBG.Interactions.InteractionManager.INTERACTION_THRESHOLD_SEC)) {
- var a = EBG.isBool(a) ? a : !0,
- b = EBG.isBool(b) ? b : !1,
- g = {},
- h = {},
- i;
- for (i in this.adsData)
- if (this.adsData.hasOwnProperty(i)) {
- var j = this.adsIntQueues[i];
- if (!this.adsData[i].delayIntReport)
- for (; j.length;) {
- for (var k =
- 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++;
- for (n = 0; n < l; n++) j.shift();
- 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)
- }
- }
- for (var r in g) this._reportServer(r + g[r] + (h[r] ? h[r] : ""), a, c)
- }
- }, EBG.Interactions.InteractionManager.prototype._handleDataParams =
- function(a, b, c) {
- var b = this._getAdReportData(a),
- c = encodeURIComponent(c),
- g = this._getPipeParams(a, !1);
- this._reportServer(this.adsData[a].adConfig._interactionsStrPipe + "$$" + b + c + "$$" + g, !0)
- }
- }
- EBG.getFeatureFlagValue(b.ffs, "CFF_SupportMultiEnv") && c()
- })
- } catch (e$$108) {
- ebO.extensionHooks = tempExtensionHook
- }
- EBG.declareNamespace("API.Ad");
- EBG.API.Ad.setCustomVar = function(a, b, c, d) {
- d = !!d;
- a = EBG.ads[a];
- if (!EBGInfra.isDefinedNotNull(a)) throw "Ad doesn't exist";
- a._adConfig.customJSVars = a._adConfig.customJSVars || {};
- var e = a._adConfig.hasOwnProperty(b);
- e && !d && "undefined" === a._adConfig[b] && (d = !0, c = void 0);
- if (d || !e) a._adConfig[b] = c, a._adConfig.customJSVars[b] = c
- };
- EBG.API.Ad.getCustomVar = function(a, b, c) {
- a = EBG.ads[a];
- if (!EBGInfra.isDefinedNotNull(a)) throw "Ad doesn't exist";
- a._adConfig.hasOwnProperty(b) && (c = "undefined" == a._adConfig[b] ? void 0 : a._adConfig[b]);
- return c
- };
- EBG.API.Ad.recalcPosition = function(a) {
- (a = EBG.ads[a]) && a._handlePageResizeOrScroll && a._handlePageResizeOrScroll()
- };
- EBG.API.Ad.isExpanded = function(a, b) {
- var c, d = EBG.ads[a],
- e = !1;
- if (d && d._CCs)
- for (c in d._CCs)
- if ("undefined" != typeof d._CCs[c].isExpanded && d._CCs[c].isExpanded() && !(EBGInfra.isDefined(b) && "" != b && d._CCs[c].props.panel.name.toLowerCase() != b.toLowerCase())) {
- e = !0;
- break
- }
- return e
- };
- EBG.API.Ad.shouldExpand = function(a) {
- return (a = EBG.ads[a]) && a.panelFrequencyMgr && a.panelFrequencyMgr.shouldExpand()
- };
- EBG.declareNamespace("API.Banner");
- EBG.API.Banner.getElements = function(a) {
- var b = {},
- c = EBG.ads[a];
- if (!c) return null;
- a = c._banner && c._banner.resId || c._bannerCC && c._bannerCC.iframeId || c._preloadImgResId || c._defaultImgResId;
- c = c._banner && c._banner.divId || c._adConfig.placeHolderId;
- if (a) b.banner = EBG.API.Adaptor.getElementById(a);
- if (c) b.bannerDiv = EBG.API.Adaptor.getElementById(c);
- return b
- };
- EBG.API.Ad.getPlaceholder = function(a) {
- return !EBG.ads[a] ? null : EBG.API.Adaptor.getElementById(EBG.API.Ad.getAdData(a, "placeHolderId"))
- };
- EBG.API.Banner.callFunc = function(a, b, c) {
- return (a = EBG.API.Banner.getElements(a)) && a.banner && a.banner[b] ? a.banner[b](c) : null
- };
- EBG.API.Banner.setViewabilityElem = function(a, b) {
- var c = EBG.ads[a];
- if (c && EBG.Initializer._getAdClass({
- tn: c._adConfig.templateName
- }).requiresIframeBust) {
- if (c.visibilityMgr) c.visibilityMgr.updateResourceObjId(b);
- else if (c._adConfig.suppressBanner) c._updateVisibilityManagerData({
- assetId: b,
- isPanel: !1
- });
- else var d = c._subscribeToAdEvent(EBG.Events.EventNames.ADD_CREATIVES, function(a) {
- 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)) {
- var f =
- c.visibilityMgr;
- f && f.updateResourceObjId(b); - 1 < ["ADD_HTML5_MAIN_CREATIVE", "ADD_BANNER_RICH_FLASH_CREATIVE"].indexOf(a.eventData.creativeType) && EBG.eventMgr.unsubscribeFromEvent(d)
- }
- }, EBG.Events.EventTiming.AFTER);
- return !0
- }
- return null
- };
- EBG.API.Ad.getAdData = function() {
- var a = {},
- b = {
- bannerResId: "_banner.resId",
- bannerDivId: "_banner.divId",
- defaultPanelName: "_defaultPanel"
- };
- return function(c, d) {
- var e = EBG.ads[c];
- if (!e || !d) return {};
- var f = d = EBG.isArray(d) ? d : !d || "*" === d ? EBG.getObjKeys(a[c]) : [d];
- a[c] = a[c] || {};
- for (var g = a[c], h = 0; h < f.length; h++) {
- var i = f[h],
- j = b[i];
- j || (j = "_adConfig." + i);
- try {
- var k = g,
- m;
- if (EBG.isFunc(j)) m = j(e);
- else {
- for (var l = e, p = j.split("."), j = 0; j < p.length; j++) l = l[p[j]];
- m = EBG.isObj(l) ? EBG.cloneObj(l) : l
- }
- k[i] = m
- } catch (n) {}
- }
- return 1 ===
- d.length ? g[d[0]] : g
- }
- }();
- EBG.API.Ad.setAdData = function() {
- var a = function() {},
- b = {
- customJSVars: "_adConfig.customJSVars",
- _showOnlyDefaultImg: "_showOnlyDefaultImg",
- _downloadMode: "_downloadMode",
- doNotTouch: a
- };
- return function(c, d) {
- var e = EBG.ads[c];
- if (!e || !d) e = !1;
- else {
- var f = {},
- g;
- for (g in d) {
- var h = d[g],
- i = b[g];
- i || (i = "_adConfig." + g);
- try {
- if (EBG.isFunc(i)) i === a ? f[g] = "BLOCKED" : i(e, h);
- else {
- for (var j = e, k = i.split("."), i = 0; i < k.length - 1; i++) j[k[i]] = j[k[i]] || {}, j = j[k[i]];
- j[k[k.length - 1]] = h
- }
- } catch (m) {
- f[g] = "Error"
- }
- }
- e = f
- }
- return e
- }
- }();
- EBG.API.Ad.willCloseAdParts = function(a, b) {
- var c = null;
- "undefined" == typeof b && (b = "_eyeblaster");
- "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));
- return c
- };
- EBG.API.Ad.unload = function(a) {
- if (a = EBG.ads[a]) {
- if (EBG.isFunc(a._unLoadHandler)) return a._unLoadHandler(), !0;
- if (EBG.isFunc(a._handlePageUnload)) return a._handlePageUnload(), !0
- }
- return !1
- };
- EBG.API.Ad.getAssetUrl = function(a, b) {
- var c = EBG.ads[a],
- d = null;
- c && c._adConfig.assets.hasOwnProperty(b) && (d = EBG.combinePaths(c._adConfig.resourcePath, b));
- return d
- };
- EBG.declareNamespace("API.Expansion");
- EBG.API.Expansion.expand = function(a, b) {
- var c = EBG.ads[a];
- if (c && EBG.eventMgr) {
- var d = new EBG.Events.Event(EBG.EBMessage.EXPAND);
- d.dispatcher = c._bannerCC || EBGInfra.getCC(a, EBG.adParts.BANNER) || EBGInfra.getCC(a, EBG.adParts.RICHBANNER) || EBGInfra.getCC(a, EBG.adParts.PANEL) || c;
- d.eventData = b || {};
- EBG.eventMgr.dispatchEvent(d)
- }
- };
- EBG.API.Expansion.collapse = function(a, b) {
- var c = EBG.ads[a];
- if (c && EBG.eventMgr) {
- var d = new EBG.Events.Event(EBG.EBMessage.COLLAPSE);
- d.dispatcher = EBGInfra.getCC(a, EBG.adParts.PANEL) || c._bannerCC || EBGInfra.getCC(a, EBG.adParts.RICHBANNER) || EBGInfra.getCC(a, EBG.adParts.BANNER) || c;
- d.eventData = b || {};
- EBG.eventMgr.dispatchEvent(d)
- }
- };
- EBG.declareNamespace("API.EventManager");
- EBG.API.EventManager.FilterNames = {
- MY_AD: "myAd",
- MY_PANEL: "myPanel"
- };
- EBG.API.EventManager.subscribeToEvent = function(a, b, c, d, e) {
- a = new EBG.Events.EventSubscription(a, b, e);
- if (d) a.dispatcherFilters = EBG.API.EventManager.getFilters(d);
- if (c) a.timing = c;
- EBG.eventMgr.subscribeToEvent(a)
- };
- EBG.API.EventManager.subscribeToElementEvent = function(a, b, c, d, e, f) {
- b = new EBG.Events.EventSubscription(b, c, f);
- if (e) b.dispatcherFilters = EBG.API.EventManager.getFilters(e);
- if (d) b.timing = d;
- b.isElementEvent = !0;
- b.elementId = a;
- EBG.eventMgr.subscribeToEvent(b)
- };
- EBG.API.EventManager.unsubscribeFromEvent = function(a, b, c, d, e) {
- a = new EBG.Events.EventSubscription(a, b, e);
- if (d) a.dispatcherFilters = EBG.API.EventManager.getFilters(d);
- if (c) a.timing = c;
- EBG.eventMgr.unsubscribeFromEvent(a)
- };
- EBG.API.EventManager.unsubscribeFromElementEvent = function(a, b, c, d, e, f) {
- b = new EBG.Events.EventSubscription(b, c, f);
- if (e) b.dispatcherFilters = EBG.API.EventManager.getFilters(e);
- if (d) b.timing = d;
- b.isElementEvent = !0;
- b.elementId = a;
- EBG.eventMgr.unsubscribeFromEvent(b)
- };
- EBG.API.EventManager.getFilters = function(a) {
- var b = {};
- if (EBG.isObj(a) || EBG.isArray(a))
- for (var c in a)
- if (a.hasOwnProperty(c)) switch (c) {
- case EBG.API.EventManager.FilterNames.MY_AD:
- b["_adConfig.uid"] = a[c];
- break;
- case EBG.API.EventManager.FilterNames.MY_PANEL:
- b["props.panel.name"] = a[c].toLowerCase();
- break;
- default:
- b[c] = a[c]
- }
- return b
- };
- EBG.API.EventManager.dispatchEvent = function(a, b, c, d) {
- a = new EBG.Events.Event(a);
- a.dispatcher = b;
- a.eventData = c;
- a.timing = d;
- EBG.eventMgr.dispatchEvent(a)
- };
- EBG.declareNamespace("API.Adaptor");
- EBG.API.Adaptor.getElementById = function(a) {
- return EBG.adaptor.getElementById(a)
- };
- EBG.API.Adaptor.getDisplayWin = function() {
- return EBG.adaptor.getDisplayWin()
- };
- EBG.API.Adaptor.getPageWin = function() {
- return EBG.adaptor.getPageWin()
- };
- EBG.API.Adaptor.getViewPortMetrics = function(a) {
- return EBG.adaptor.getWindowViewPortMetrics(a)
- };
- EBG.API.Adaptor.getPageMetrics = function(a) {
- var a = a || EBG.API.Adaptor.getDisplayWin(),
- b = a.document.body,
- c = EBG.API.Adaptor.getScrollLeftTop(a == window),
- a = EBG.adaptor.getPageMetrics ? EBG.adaptor.getPageMetrics(a) : {
- Width: null,
- Height: null
- };
- a.height = a.Height;
- a.width = a.Width;
- a.scrollbarWidth = EBG.adaptor.getScrollerWidth ? EBG.adaptor.getScrollerWidth() : null;
- a.scrollbarsHidden = "hidden" == b.style.overflow;
- a.scrollHeight = b.scrollHeight;
- a.scrollWidth = b.scrollWidth;
- a.offsetHeight = b.offsetHeight;
- a.offsetWidth = b.offsetWidth;
- a.clientHeight = b.clientHeight;
- a.clientWidth = b.clientWidth;
- a.scrollLeft = c.X;
- a.scrollTop = c.Y;
- return a
- };
- EBG.API.Adaptor.showScrollBars = function(a) {
- EBG.adaptor.showScrollBars(a)
- };
- EBG.API.Adaptor.hideScrollBars = function(a) {
- EBG.adaptor.hideScrollBars(a)
- };
- EBG.API.Adaptor.restoreScrollBarsState = function(a) {
- EBG.adaptor.restoreScrollBarsState(a)
- };
- EBG.API.Adaptor.getEyeDiv = function() {
- return EBG.adaptor.getElementById(EBG.Const.OUTER_DIV)
- };
- EBG.API.Adaptor.inject = function(a, b, c) {
- return EBG.adaptor.inject(a, b, c)
- };
- EBG.API.Adaptor.setStyle = function(a, b, c) {
- c = EBG.isDefined(c) ? c : !0;
- EBG.adaptor.setStyleToElem(a, b, c)
- };
- EBG.API.Adaptor.getStyle = function(a, b, c) {
- if (a && b) {
- if (c) return EBG.adaptor.getStyleOfElem(a)[b];
- if (window.getComputedStyle) return window.getComputedStyle(a)[b]
- }
- };
- EBG.API.Adaptor.getBrowserData = function() {
- return {
- platform: EBG.adaptor.browser._platform,
- browser: EBG.adaptor.browser._browserType,
- browserVersion: EBG.adaptor.browser._browserVer,
- device: EBG.adaptor.browser._deviceType
- }
- };
- EBG.API.Adaptor.getScreenOrientation = function() {
- return EBG.adaptor.getScreenOrientation(!1)
- };
- EBG.API.Adaptor.getPositioningById = function(a, b, c) {
- return EBG.adaptor.getPositioningById(a, b, c)
- };
- EBG.API.Adaptor.getPositioningByElement = function(a, b, c) {
- return EBG.adaptor.getPositioningByElement(a, b, c)
- };
- EBG.API.Adaptor.setStyleToElems = function(a, b, c) {
- c = EBG.isDefined(c) ? c : !0;
- EBG.isArray(a) || (a = [a]);
- for (var d = 0; d < a.length; d++) a[d].style && EBG.adaptor.setStyleToElem(a[d], b, c)
- };
- EBG.API.Adaptor.getHostName = function(a) {
- return EBG.adaptor.getHostName(a)
- };
- EBG.API.Adaptor.getDomain = function(a) {
- return EBG.adaptor.getDomain(a)
- };
- EBG.API.Adaptor.getScrollLeftTop = function(a, b) {
- return EBG.adaptor.getScrollLeftTop(a, b)
- };
- EBG.API.Adaptor.removeElement = function(a) {
- EBG.adaptor.removeElement(a)
- };
- EBG.API.Adaptor.clip = function(a, b, c, d, e) {
- "function" == typeof EBG.adaptor.clip && EBG.adaptor.clip(a, b, c, d, e)
- };
- EBG.API.Adaptor.unclip = function(a) {
- "function" == typeof EBG.adaptor.unclip && EBG.adaptor.unclip(a)
- };
- EBG.API.Adaptor.getElementMetrics = function(a) {
- "string" == EBG.typeOf(a) && (a = EBG.adaptor.getElementById(a));
- if (!a) return null;
- var b = {},
- c = a.getBoundingClientRect();
- b.width = c.width ? c.width : c.right - c.left;
- b.height = c.height ? c.height : c.bottom - c.top;
- b.viewPortRelative = {
- top: c.top,
- bottom: c.bottom,
- left: c.left,
- right: c.right
- };
- a = EBG.API.Adaptor.getScrollLeftTop(a.ownerDocument.defaultView ? a.ownerDocument.defaultView : a.ownerDocument.parentWindow);
- b.pageRelative = {
- top: c.top + a.Y,
- bottom: c.bottom + a.Y,
- left: c.left + a.X,
- right: c.right + a.X
- };
- return b
- };
- EBG.API.Adaptor.setClass = function(a, b, c) {
- "array" !== EBG.typeOf(a) && (a = [a]);
- "array" !== EBG.typeOf(b) && (b = [b]);
- for (var d in a) {
- var e = "string" === EBG.typeOf(a[d]) ? EBG.adaptor.getElementById(a[d]) : a[d];
- if (e && EBG.isDefined(e.className))
- for (var f in b)
- if ("string" === EBG.typeOf(b[f]))
- if (c) e.className = b[f];
- else if (!EBG.API.Adaptor.hasClass(e, b[f])) {
- var g = " ";
- "" === e.className && (g = "");
- e.className += g + b[f]
- }
- }
- };
- EBG.API.Adaptor.removeClass = function(a, b) {
- "array" !== EBG.typeOf(a) && (a = [a]);
- "array" !== EBG.typeOf(b) && (b = [b]);
- for (var c in a) {
- var d = "string" === EBG.typeOf(a[c]) ? EBG.adaptor.getElementById(a[c]) : a[c];
- if (d && EBG.isDefined(d.className)) {
- for (var e in b)
- if ("string" === EBG.typeOf(b[e])) d.className = d.className.replace(RegExp("(^|\\s+)" + b[e] + "(\\s+|$)", "g"), " ");
- d.className = d.className.replace(/^||$/g, "")
- }
- }
- };
- EBG.API.Adaptor.hasClass = function(a, b, c) {
- var d = 0,
- c = EBG.isDefined(c) ? c : !0;
- "array" !== EBG.typeOf(a) && (a = [a]);
- "array" !== EBG.typeOf(b) && (b = [b]);
- for (var e in a) {
- var f = "string" === EBG.typeOf(a[e]) ? EBG.adaptor.getElementById(a[e]) : a[e];
- if (f && EBG.isDefined(f.className))
- for (var g in b) "string" === EBG.typeOf(b[g]) && null !== f.className.match(RegExp("(^|\\s+)" + b[g] + "(\\s+|$)")) && d++
- }
- return c ? d === a.length * b.length : 0 < d
- };
- EBG.API.Adaptor.getHighestZIndex = function() {
- return 2147483647
- };
- (function() {
- var a = function() {
- var a = navigator.userAgent.toLowerCase(),
- c = function(c) {
- "string" == typeof c && (c = [c]);
- for (var d = 0; d < c.length; d++)
- if (-1 < a.indexOf(c[d])) return !0;
- return !1
- },
- d = EBG.adaptor && EBG.adaptor.browser ? EBG.adaptor.browser : {};
- if (!(EBG.adaptor && EBG.adaptor.browser == d)) {
- d.ver = "unknown";
- d.isMobile = function() {
- return c("android,iphone,ipod,ipad,blackberry,windows phone,silk".split(","))
- };
- d.isMac = function() {
- return c("opera")
- };
- d.isAndroid = function() {
- return c("android")
- };
- d.isFF = function() {
- return c("firefox")
- };
- if (d.isFF()) d.ver = parseInt(a.slice(a.indexOf("firefox/") + 8));
- d.isIE = function() {
- return c(["msie", "trident"])
- };
- if (d.isIE()) d.ver = parseInt(c("msie") ? a.slice(a.indexOf("msie ") + 5) : a.slice(a.indexOf("rv:") + 3));
- d.isOpera = function() {
- return c("opera")
- };
- if (d.isOpera()) d.ver = parseInt(c("opera/9.80") ? a.slice(a.indexOf("version/") + 8) : a.slice(a.indexOf("opera/") + 6));
- d.isChrome = function() {
- return c("chrome")
- };
- if (d.isChrome()) d.ver = parseInt(a.slice(a.indexOf("chrome/") + 7));
- d.isSafari = function() {
- return c("safari") &&
- !c("chrome")
- };
- if (d.isSafari()) d.ver = parseInt(a.slice(a.indexOf("version/") + 8));
- d.isStrictType = function() {
- return d.isIE() && "CSS1Compat" == document.compatMode
- };
- d.getDocumentMode = function() {
- return document.documentMode
- };
- d.getVersion = function() {
- return d.ver
- }
- }
- var e = window.EBG && EBG.EBAPI && EBG.EBAPI.prototype || window.EBG && EBG.API;
- if (!e.os) {
- e.os = {};
- var f = e.os;
- f.ua = a;
- f.uahas = c;
- f.mobile = d.isMobile();
- f.mac = d.isMac();
- f.kindle = c(["silk/", "kindle"]);
- f.android = d.isAndroid();
- f.windows = c("windows");
- f.windowsphone =
- c("windows phone");
- f.windowsdesktop = f.windows && !f.windowsphone;
- f.linux = c("linux") && !f.android;
- f.ipod = c("ipod");
- f.ipad = c("ipad");
- f.iphone = c("iphone") && !f.ipad;
- f.ios = f.iphone || f.ipad || f.ipod;
- f.blackberry = c("blackberry");
- f.firefox = c("firefox") && c("mobile;") && !(f.ios || f.android || f.linux || f.blackberry);
- f.name = f.windowsphone ? "windowsphone" : f.windows ? "windows" : f.mac ? "mac" : f.linux ? "linux" : f.android ? "android" : f.ios ? "ios" : "unknown";
- var g = 0;
- switch (f.name) {
- case "windowsphone":
- f.verS = "windows";
- g = a.indexOf("windows phone ");
- if (-1 < g) {
- for (var g = a.slice(g + 14), h = 0; h < g.length; h++) {
- var i = g.charAt(h);
- if (isNaN(i) && "." !== i) break
- }
- 0 < h && (g = g.slice(0, h));
- f.verS = g
- }
- break;
- case "windows":
- f.verS = "windows";
- g = a.indexOf("windows nt ");
- if (-1 < g) {
- g = a.slice(g + 11);
- for (h = 0; h < g.length && !(i = g.charAt(h), isNaN(i) && "." !== i); h++);
- 0 < h && (g = g.slice(0, h));
- switch (g) {
- case "5.1":
- f.verS = "xp";
- break;
- case "5.2":
- f.verS = "server2003";
- break;
- case "6.0":
- f.verS = "vista";
- break;
- case "6.1":
- f.verS = "7";
- break;
- case "6.2":
- f.verS = "8";
- break;
- case "6.3":
- f.verS = "8.1";
- break;
- case "10.0":
- f.verS =
- "10"
- }
- }
- break;
- case "mac":
- g = a.indexOf("mac os x ") + 9;
- f.verS = a.slice(g);
- g = f.verS.indexOf(";");
- if (-1 < g) f.verS = f.verS.slice(0, g);
- f.verS = f.verS.replace(/_/g, ".");
- break;
- case "linux":
- f.verS = "linux";
- break;
- case "android":
- g = a.indexOf("android ") + 8;
- f.verS = a.slice(g);
- g = f.verS.indexOf(";");
- if (-1 < g) f.verS = f.verS.slice(0, g);
- break;
- case "ios":
- g = a.indexOf(" os ") + 4;
- f.verS = a.slice(g);
- for (h = 0; h < f.verS.length && !(i = f.verS.charAt(h), isNaN(i) && "_" !== i); h++);
- if (0 < h) f.verS = f.verS.slice(0, h);
- f.verS = f.verS.replace(/_/g, ".");
- break;
- case "unknown":
- f.verS = "unknown"
- }
- g = window.ebO && ebO.ffs && ebO.ffs.CFF_TrimOSVerS || window.EB && EB._adConfig && EB._adConfig.ffs && EB._adConfig.ffs.CFF_TrimOSVerS;
- if (f.verS.trim && g) f.verS = f.verS.trim();
- f.verN = parseFloat(f.verS);
- f.verI = f.ver = parseInt(f.verN);
- f[f.name + f.ver] = !0
- }
- if (!e.browser) {
- e.browser = {};
- g = e.browser;
- f = e.os;
- e = function(c) {
- return parseInt(a.slice(a.indexOf(c) + c.length))
- };
- g.strict = d.isStrictType();
- g.docmode = d.getDocumentMode();
- g.webkit = c("webkit");
- g.ver = d.getVersion();
- g.firefox = d.isFF();
- g.ie = d.isIE();
- g.opera = d.isOpera();
- g.chrome = d.isChrome();
- g.safari = d.isSafari();
- g.edge = c("edge/");
- if (g.edge) g.ver = e("edge/");
- g.silk = c("silk/");
- if (g.silk) g.ver = e("silk/");
- g.uc = c("ucbrowser/");
- if (g.uc) g.ver = e("ucbrowser/");
- g.android = c("android") && !(g.chrome || g.firefox || g.opera || g.uc || g.silk);
- 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";
- g[g.name + g.ver] = !0;
- g.checkCSSSupportability = function(a, b) {
- for (var c = !1,
- d = document.createElement("div"), e = ["", "webkit", "moz", "ms", "o"], f = 0; f < e.length; f++)
- if (a = "" === e[f] ? a : e[f] + EBG.capitalize(a), "" === d.style[a] && (d.style[a] = b, "" !== d.style[a])) {
- c = !0;
- break
- }
- return c
- };
- g.supportsViewportUnits = !/android[1-4]\.[0-3]/i.test(a);
- g.supportsFixedPositioning = !/android2/i.test(a);
- g.supportsCSSTransitions = g.checkCSSSupportability("transition", "width 2s");
- f[f.name + f.ver + g.name + g.ver] = !0
- }
- };
- EBG && EBG.EBAPI ? EBG.EBAPI.prototype.browserInit = a : a()
- })();
- EBG.declareNamespace("Initializer");
- EBG.Initializer = {
- initialize: function() {
- var a = null,
- b;
- 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));
- return a
- },
- _initManagers: function(a) {
- var b = new EBG.Events.Event(EBG.Events.EventNames.INIT_MANAGERS);
- b.eventData = {
- "_adConfig.rnd": a.rnd
- };
- b.timing = EBG.Events.EventTiming.BEFORE;
- EBG.eventMgr.dispatchEvent(b);
- EBG.Initializer._initInteractionManager(a);
- EBG.Initializer._initAnimationManager(a);
- EBG.Initializer._initDataPipeManager(a);
- (!~a.tn.toLowerCase().indexOf("html5") || !a.ffs.CFF_Html5Shrink) && EBG.Initializer._initPositioningHelper();
- b.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
- EBG.eventMgr.dispatchEvent(b)
- },
- _initDisplayAd: function(a) {
- EBG.Initializer._updateAdConfig(a);
- a.ffs.CFF_ClientDITest && a.diParams && EBG.adaptor.loadModule(ebBigS + "UserProviders" + ebO.uipv + "/SizmekDI.js", a.adConfig, function() {
- var b = a.diParams;
- b.cookie = a.adConfig.usercookie;
- b.userAgent = navigator.userAgent;
- (new EBGUIP.SizmekDI({}, b)).post("//datahub.serving-sys.com/samurai/collect/di")
- }, this);
- this._sendInitialDataPipeData(a);
- if (EBG.Initializer._shouldInitAd(a)) {
- if (EBG.isDefined(EBG.adaptor.getDisplayWin().EBG)) try {
- EBGInfra.mergeObj(EBG, EBG.adaptor.getDisplayWin().EBG, !1)
- } catch (b) {
- if (a.ffs.CFF_IEFreedScriptMerge) EBG.adaptor.getDisplayWin().EBG = EBG
- } else EBG.adaptor.getDisplayWin().EBG = EBG;
- EBG.Initializer._initAd(a)
- }
- },
- _InitAdPreGlobals: function(a) {
- try {
- var b = EBG.adaptor.getPageWin();
- if (!b.gEbPageGUID) b.gEbPageGUID = a.adConfig.rnd;
- EBG.pageGUID = b.gEbPageGUID
- } catch (c) {
- EBG.pageGUID = a.adConfig.rnd
- }
- },
- _shouldInitAd: function(a) {
- if (a.ffs.CFF_TopmostIframeBust) {
- var b = !1;
- 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);
- return b
- }
- return a.innerIframe ||
- 0 == a.ifrm || -1 == a.ifrm && EBG.adaptor.serving && EBG.adaptor.serving.servingMode != EBG.Adaptors.ServingMode.IFRAME
- },
- _getCurrentServerResponse: function() {
- for (var a = 0, b; a < ebOArr.length;) {
- if ((b = ebOArr[a]) && this._getAdClass(b)) {
- ebOArr.splice(a, 1);
- break
- }
- a++
- }
- return b
- },
- _initGlobals: function(a) {
- var b = navigator.userAgent.toLowerCase(),
- c = a.adConfig;
- EBG.isOfflineDemo = !!window.gEbfOfflineDemo;
- if ("/" == a.resPath.charAt(a.resPath.length - 1) && "/" == a.resPath.charAt(a.resPath.length - 2)) a.resPath = a.resPath.substring(0, a.resPath.length -
- 1);
- EBG.resourcePath = a.resPath;
- c.rnd = a.rnd;
- c.uid = EBG.format("{0}_{1}", c.adId, c.rnd);
- c.resourcePath = a.resPath;
- c.ffs = a.ffs;
- EBG.sms = c.sms = a.sms || "";
- EBG.fcsVirtualPath = a.fvp || "";
- EBG.pluId = a.pi;
- EBG.dataCapture = EBG.bs = a.bs;
- EBG.protocol = ebPtcl;
- EBG.reportPageVer = a.rpv;
- EBG.html5Ver = a.html5v;
- EBG.flashPixelVer = a.vfp;
- EBG.intReportTimeout = a.irt || null;
- EBG.isMSNMessenger = (-1 < b.indexOf("msn messenger") || -1 < b.indexOf("windows live messenger")) && window == parent;
- EBG.isIMBanner = window.gfEbExpBanerIM || window.gfEbExpBannerIM;
- EBG.isPreview = !!a.pr;
- EBG.isInWorkshop = window.gEbFlyLocal;
- EBG.iframeLocation = a.ifl || window.gstrEbIframeLocation;
- EBG.minZIndex = a.z || window.gnEbMinZIndex || 1E4;
- EBG.eyeDivRefElement = window.gEbEyeDivRefElement;
- EBG.eventMgr = EBG.eventMgr || new EBG.Events.EventManager;
- b = EBG.getTopAccessibleWindow(!1);
- b.ebAds = b.ebAds || {};
- EBG.ads = b.ebAds;
- EBG.serverResponses = EBG.serverResponses || {};
- if ((b = c.adHtmlPath) && a.h5mi) c.adKitData = {
- paths: {
- cachedScript: ebBigS,
- nonCachedScript: ebPtcl + a.sms,
- folderRoot: ebResourcePath + b.substring(0,
- b.lastIndexOf("/") + 1)
- },
- version: a.h5mi.adkitversion
- }
- },
- _initServingMode: function(a) {
- var b = this._getAdClass(a),
- c = a.adConfig;
- a.requiresIframeBust = b.requiresIframeBust;
- var d = EBG.adaptor.serving ? EBG.adaptor.serving.detectServingMode(!0) : null;
- if (EBG.adaptor.isSafeFrame()) a.ifrm = 0, c.UiVz = !1;
- else if (b.requiresIframeBust) {
- if (a.innerIframe) a.ifrm = EBG.Adaptors.ServingMode.INNER_IFRAME;
- if (!a.ifrm || a.soi) a.ifrm = 0;
- EBG.adaptor.initServingMode(a.ifrm, !1, d, a.ffs.CFF_TopmostIframeBust);
- if (EBG.adaptor.inPlacementIframe()) b =
- new EBG.Events.EventSubscription(EBG.Events.EventNames.AIE_LOADED, this._handleAieLoad, this), b.dispatcherFilters = {
- "_adConfig.rnd": a.rnd
- }, b.timing = EBG.Events.EventTiming.BEFORE, EBG.eventMgr.subscribeToEvent(b), EBG.adaptor.serving.handleAieServing(a)
- } else if (a.ifrm = 0, b != EBG.Ads.StdBanner && b != EBG.Ads.StdBannerHtml5) {
- EBG.adaptor.initServingMode(a.ifrm, !b.requiresIframeBust, d);
- if (d == EBG.Adaptors.ServingMode.FRIENDLY_IFRAME) {
- c.UiVz = !1;
- try {
- document.close()
- } catch (e) {}
- }
- if (d == EBG.Adaptors.ServingMode.SCRIPT) c.UiVz = !1
- } else c.UiVz = !1
- },
- _handleAieLoad: function(a) {
- a.eventData.loadDefault && a.eventData.currentResponse.tn != EBG.adTypes.VisibilityAd && (EBG.Initializer._initManagers(a.eventData.currentResponse), EBG.Initializer._initDisplayAd(a.eventData.currentResponse))
- },
- _callExtensionHooks: function(a) {
- if (a.extensionHooks)
- for (; 0 !== a.extensionHooks.length;) a.extensionHooks.pop().apply(null, [a.adConfig, a])
- },
- getRichestAdaptor: function() {
- return EBG.Adaptors.WebAdaptor || EBG.Adaptors.StdWebAdaptor
- },
- getRichestInteractionManager: function() {
- return EBG.Interactions.InteractionManager ||
- EBG.Interactions.StdInteractionManager
- },
- _initAdaptor: function(a) {
- var b = this.getRichestAdaptor(),
- c = new EBG.Events.Event(EBG.Events.EventNames.CREATE_ADAPTOR);
- c.eventData = {
- currentClass: b
- };
- c.timing = EBG.Events.EventTiming.BEFORE;
- EBG.eventMgr.dispatchEvent(c);
- if (!EBG.adaptor || EBG.adaptor.constructor.toString() !== c.eventData.currentClass.toString()) b = new c.eventData.currentClass, EBG.adaptor = b;
- c.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
- EBG.eventMgr.dispatchEvent(c);
- EBG.adaptor.initInnerModules(a.plt,
- a.bt, a.bv, a.dt, a.bc, !!a.adConfig.ffs.CFF_NoInDapIF);
- this._initServingMode(a);
- EBG.adaptor.registerSpecialBrowserEvents();
- EBG.eventMgr.attachToAdaptor()
- },
- _initInteractionManager: function(a) {
- newEvent = new EBG.Events.Event(EBG.Events.EventNames.CREATE_INT_MGR);
- newEvent.eventData = {
- currentClass: this.getRichestInteractionManager()
- };
- newEvent.timing = EBG.Events.EventTiming.BEFORE;
- EBG.eventMgr.dispatchEvent(newEvent);
- if (!EBG.intMgr || EBG.intMgr.constructor.toString() != newEvent.eventData.currentClass.toString()) a =
- new newEvent.eventData.currentClass(a), EBG.intMgr = a;
- newEvent.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
- EBG.eventMgr.dispatchEvent(newEvent)
- },
- _initAnimationManager: function(a) {
- try {
- if (EBG.RichModules && EBG.RichModules.AnimationManager) {
- newEvent = new EBG.Events.Event(EBG.Events.EventNames.CREATE_ANIM_MGR);
- newEvent.eventData = EBG.RichModules.AnimationManager;
- newEvent.timing = EBG.Events.EventTiming.BEFORE;
- EBG.eventMgr.dispatchEvent(newEvent);
- if (!EBG.animationMgr) EBG.animationMgr = new newEvent.eventData;
- if (!EBG.animator && EBG.RichModules && EBG.RichModules.Animator) EBG.animator = new EBG.RichModules.Animator(a.adConfig);
- newEvent.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
- EBG.eventMgr.dispatchEvent(newEvent)
- }
- } catch (b) {}
- },
- _initDataPipeManager: function(a) {
- var b, c = (1 == a.dt || 2 == a.dt) && a.ffs.CFF_DataPipeMobile,
- d = !1,
- e = !1;
- if ("https://" != EBG.protocol || a.ffs.CFF_DataPipeHttps) {
- if (a.ffs.CFF_DataPipeAlways) e = !0;
- else if (c || (d = this._getNumericDataFromFlag(a.ffs, "CFF_DataPipeGeneral"))) c = d || this._getNumericDataFromFlag(a.ffs,
- "CFF_DataPipeThreshold"), e = Math.floor(1E4 * Math.random()) + 1 <= 100 * c;
- e && (b = ["general", "platform", "serving", "visibility", "error"])
- }
- a.dpu = a.dpu || "//datahub.serving-sys.com/samurai/collect/events";
- EBG.dataPipeMgr = new EBG.DataPipeManager(a.dpu, b)
- },
- _getNumericDataFromFlag: function(a, b) {
- for (var c in a)
- if (0 == c.indexOf(b) && a[c]) {
- var d = parseFloat(c.substr(b.length).replace("_", "."));
- if (!isNaN(d)) return d
- }
- return 0
- },
- _initPositioningHelper: function() {
- try {
- if (EBG.Positioning && EBG.Positioning.PositionManager) {
- newEvent =
- new EBG.Events.Event(EBG.Events.EventNames.CREATE_POSITIONING_HELPER);
- newEvent.eventData = EBG.Positioning.PositionManager;
- newEvent.timing = EBG.Events.EventTiming.BEFORE;
- EBG.eventMgr.dispatchEvent(newEvent);
- if (!EBG.posHelper) EBG.posHelper = new newEvent.eventData;
- newEvent.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
- EBG.eventMgr.dispatchEvent(newEvent)
- }
- } catch (a) {}
- },
- _initAd: function(a) {
- try {
- var b = this._getAdClass(a),
- c = a.adConfig;
- newEvent = new EBG.Events.Event(EBG.Events.EventNames.CREATE_AD);
- newEvent.eventData = {
- currentClass: b,
- adConfig: c
- };
- newEvent.timing = EBG.Events.EventTiming.BEFORE;
- newEvent.dispatcher = {
- _adConfig: {
- rnd: c.rnd,
- uid: c.uid
- }
- };
- EBG.eventMgr.dispatchEvent(newEvent);
- EBG.Initializer._InitAdPreGlobals(a);
- new newEvent.eventData.currentClass(c);
- newEvent.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;
- EBG.eventMgr.dispatchEvent(newEvent);
- EBG.adaptor.getDisplayWin().EBG.ads[c.uid] || (EBG.adaptor.getDisplayWin().EBG.ads[c.uid] = EBG.ads[c.uid]);
- if (EBG.BWDetection && window.gEBMainWindow && gEBMainWindow.EBP)
- if (gEBMainWindow.EBP.ebBW &&
- gEBMainWindow.EBP.ebBW.checked) EBG.BWDetection.speed = gEBMainWindow.EBP.ebBW.speed, EBG.BWDetection.checked = !0;
- else if (gEBMainWindow.EBP.BW && gEBMainWindow.EBP.BW.checked) EBG.BWDetection.speed = gEBMainWindow.EBP.BW.speed, EBG.BWDetection.checked = !0;
- if (c.pckAssets) {
- var b = 0,
- d;
- for (d in c.pckAssets) c.pckAssets.hasOwnProperty(d) && b++;
- if (0 < b && !EBG.BWDetection.checked) c.bwApplied = !0, EBG.BWDetection.init();
- c.BWD = EBG.BWDetection
- }
- } catch (e) {
- if (a.ffs.CFF_DataPipeErrors) {
- a = "_initAd";
- c = "none";
- if (e.stack) c = e.stack.match(/((.*)@|at(.*)).*:(\d+:\d+)/),
- c.length = 5, a = c[2] || c[3], c = c[4];
- this._dpm.send(EBG.DataProfile.ERROR, {
- errmsg: e.message,
- errfunc: a,
- errpos: c
- })
- }
- }
- },
- _getAdClass: function(a) {
- var b;
- switch (a.tn) {
- case EBG.adTypes.RichBannerHtml5:
- b = EBG.Ads.RichBannerHtml5;
- break;
- case EBG.adTypes.PoliteBannerHtml5:
- b = EBG.Ads.PoliteBannerHtml5;
- break;
- case EBG.adTypes.SEBannerHtml5:
- b = EBG.Ads.SEBannerHtml5;
- break;
- case EBG.adTypes.ExpBannerHtml5:
- b = EBG.Ads.ExpBannerHtml5;
- break;
- case EBG.adTypes.StdBannerHtml5:
- b = EBG.Ads.StdBannerHtml5;
- break;
- case EBG.adTypes.StdBanner:
- b =
- a.IABBV || a.IABEV ? EBG.Ads.StdBannerEx : EBG.Ads.StdBanner;
- break;
- case EBG.adTypes.Banner:
- b = EBG.Ads.RichBanner;
- break;
- case EBG.adTypes.SingleExpBanner:
- b = EBG.Ads.SingleExpBanner;
- break;
- case EBG.adTypes.ExpBanner:
- b = EBG.Ads.ExpBanner;
- break;
- case EBG.adTypes.VisibilityAd:
- b = EBG.Ads.VisibilityAd;
- break;
- case EBG.adTypes.FloatingAd:
- b = EBG.Ads.Floating;
- break;
- case EBG.adTypes.FloatingAdWithRem:
- b = EBG.Ads.FloatingWithReminder;
- break;
- case EBG.adTypes.TrackingAd:
- b = EBG.Ads.TrackingAd;
- break;
- case EBG.adTypes.WallpaperAd:
- b = EBG.Ads.WallpaperAd
- }
- return b
- },
- _updateAdConfig: function(a) {
- var b = a.adConfig;
- b.sHost = window.sHost;
- EBG.serverResponses[b.uid] || (EBG.serverResponses[b.uid] = a);
- b.placeHolderId = a.phid;
- b.sUrlTokens = a.ut;
- if (a.element_id) b.element_id = a.element_id;
- var c = EBG.adaptor.getPageWin();
- if (c = EBG.getPageUrl(c)) b.ebReferrer = c;
- b.html5supported = a.html5Enabled;
- b.useHtmlConvertor = b.html5supported && window.ebUseHtml5;
- b.preloadCustomScript = window.ebAdCS;
- b.actualServingMode = EBG.adaptor.serving ? EBG.adaptor.serving.detectServingMode(!0) : null;
- if (a.ffs.CFF_RemoveUivz) EBG.adaptor.focused =
- b.focused ? b.focused : EBG.adaptor.focused;
- if (a.ffs.CFF_ServingMode) b.displayWin = EBG.adaptor.getDisplayWin(), b.pageWin = EBG.adaptor.getPageWin();
- 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=");
- if (b.expandDynamic) b.showSinglePanel = 1;
- if (!b.clickTrackingUrls) b.clickTrackingUrls = [];
- if (a.ncu) b.clickTrackingUrls.push(a.ncu), b.ncu = a.ncu;
- if (!b.defaultImpTrackingUrls) b.defaultImpTrackingUrls = [], b.defaultClickTrackingUrls = [];
- if (a.dctu) b.defaultClickTrackingUrls = a.dctu;
- if (a.ditu) b.defaultImpTrackingUrls = a.ditu;
- b.delayedImpParams = a.delayedImpParams;
- b.impressionTrackingURLs = [];
- if (a.itu && 0 < a.itu.length) b.impressionTrackingURLs = a.itu;
- window.gEbBAd && (gEbBAd.playRS && gEbBAd.playRS.strNUrl && b.impressionTrackingURLs.push(gEbBAd.playRS.strNUrl), gEbBAd.strNImpUrl && b.impressionTrackingURLs.push(gEbBAd.strNImpUrl));
- b.imageOnly = !1;
- b.page = a.p;
- b.massVersioning = {
- targetAudienceId: a.ta && "-1" != a.ta ? a.ta : "",
- deliveryGroupId: a.dg && "-1" != a.dg ? a.dg : "",
- subDeliveryGroupId: a.sdg && "-1" != a.sdg ? a.sdg : "",
- adVersions: a.av || "",
- defaultAdVersion: a.avd || "",
- adBasePath: a.abp || "",
- massVersionFolderDivider: a.mvfd || 0,
- versionTargetAudienceId: a.tav && "-1" != a.tav ? a.tav : "",
- dgTargetAudienceId: a.tadg && "-1" != a.tadg ? a.tadg : "",
- originalDeliveryGroupId: a.dgo && "-1" != a.dgo ? a.dgo : ""
- };
- if (0 <= b.massVersioning.adVersions.indexOf("/")) {
- if (b.massVersioning.defaultAdVersion) b.massVersioning.defaultAdVersion =
- JSON.parse(b.massVersioning.defaultAdVersion);
- b.massVersioning.versionFullPath = !0
- }
- if (a.soi) b.showOnlyImage = a.soi, b.massVersioning.adVersions = b.massVersioning.defaultAdVersion;
- if (EBGInfra.isDefinedNotNull(a.diAppId)) b.diAppId = a.diAppId;
- b.reportDelayedImpression = a.rdi || 0;
- b.defaultImageReason = a.dir || "";
- b.mobileSDK = a.sdk || "";
- b.isOfflineDemo = EBG.isOfflineDemo;
- if ("undefined" == typeof b.openWindow) b.openWindow = !0;
- this._updateAdConfigToHandleOpenWindow(a);
- b.bigSDir = unescape(ebBigS);
- b.imagesDir = unescape(ebBigS) +
- "Res/Images" + a.imgv + "/";
- b.modulesDir = unescape(ebBigS) + "Modules" + a.modv + "/";
- b.arrOnStartDnlEvents = a.osde;
- b.arrOnPlayEvents = a.ope;
- b.isGeoStrict = 0 != a.igs ? 1 : 0;
- b.geoData = a.geo ? a.geo : {};
- c = a.oo || 0;
- EBG.adaptor.optOut = b.optOut = window.gEbFOptOut || c;
- EBG.adaptor.histLen = b.histLen = a.hl || 30;
- b.sPublisherPlacementId = a.ppi || "";
- b.width = b.width || "";
- b.height = b.height || "";
- 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 =
- a.w || b.width, b.height = a.h || b.height);
- b.shouldCollectUrl = a.cu || 0;
- b.sID = a.sid || "";
- b.dlm = a.dlm || 3;
- b.testImp = !!a.t;
- b.usercookie = a.usercookie || "";
- b.visibility = {};
- c = b.visibility;
- c.mode = EBG.VisibilityMode.DEFAULT_MODE;
- if (a.IABEV || a.insVis) c.mode = EBG.VisibilityMode.ENHANCED_MODE;
- else if (a.IABBV) c.mode = EBG.VisibilityMode.BASIC_MODE;
- c.iabMinSurface = a.IABMS;
- c.iabMinDuration = a.IABMD;
- c.agencyMinSurface = a.AgMS;
- c.agencyMinDuration = a.AgMD;
- c.advertiserMinSurface = a.AdMS;
- c.advertiserMinDuration = a.AdMD;
- c.iabMinLargeSurface =
- 30;
- c.iabMinLargeDuration = a.IABMD;
- b.isInstreamVisibility = !!a.insVis;
- b.isInstreamVerification = !!a.insVer;
- b.displayVerification = !!a.disVer;
- if (b.panels) {
- c = !1;
- 1 == EBG.adaptor.getObjKeys(b.panels).length && (c = !0);
- for (var d in b.panels)
- if (b.panels.hasOwnProperty(d)) b.panels[d].visibilityIntEnabled = c
- }
- if (d = b.interactionsToReport)
- 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] =
- 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] =
- 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] =
- 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;
- b.adParamsEnabled = b.displayVerification || b.isInstreamVerification || !!a.ap;
- b.playerParamsEnabled = b.isInstreamVerification || !!a.pp;
- b.verUrlEnabled = b.isInstreamVerification || !!a.verUrl;
- if (b.defaultFlashName &&
- !b.defaultFlashPath) b.defaultFlashPath = b.imagesDir + "BannerAssets/" + b.defaultFlashName;
- b.offsetX = a.offsetX || 0;
- b.offsetY = a.offsetY || 0;
- b.adChoice = {};
- b.adChoice.certificationProgram = a.AcCP;
- b.adChoice.customUrl = a.CAcURL;
- b.adChoice.includeMarker = b.AcIncludeMarker;
- b.adChoice.iconPosition = parseInt(b.AcIconPosition);
- if (a.wm) b.wmode = a.wm.toLowerCase();
- if (!b.pushDownConfig && "none" != a.disp) b.display = a.disp || "inline";
- b.disableAutoExpand = a.dex || 0;
- b.aiE = a.aiE || {};
- b.appPool = a.appPool || "BurstingPipe";
- b.interactionServer =
- a.is || "BurstingPipe";
- b.advertiserId = a.advid;
- b.moduleInfo = a.h5mi || {};
- try {
- if (window.gEbBAd) {
- if (gEbBAd.panelsWMode) b.panelsWMode = gEbBAd.panelsWMode;
- if (gEbBAd.strWmode) b.wmode = gEbBAd.strWmode.toLowerCase()
- }
- } catch (e) {}
- if (EBG.adaptor.isSafeFrame()) {
- b.isSafeFrame = !0;
- b.expandDynamic = 0;
- for (var f in b.panels) {
- d = b.panels[f];
- try {
- var g = $sf.ext.geom();
- 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 /
- 100)), d.yPos = Math.round((g.win.h - d.height) * (d.yPos / 100));
- d.posType != EBG.PanelPositionType.BANNER_RELATIVE_PIXELS && (d.xPos -= g.self.l, d.yPos -= g.self.t)
- } catch (h) {
- d.xPos = 0, d.yPos = 0
- }
- d.posType = EBG.PanelPositionType.BANNER_RELATIVE_PIXELS
- }
- }
- if (EBG.adaptor.isSkype() && (b.isSkype = !0, !a.ffs.CFF_SkypeDynamic)) b.expandDynamic = 0;
- if (a.ffs.CFF_FireFoxFlash && !a.ffs.CFF_FlashBlockPixel) a = EBG.adaptor.flash.getFlashVersionForBlockingDetection(), b.minimalflashVer = a || b.minimalflashVer, b.flashVer = a || b.flashVer;
- b.isInApp =
- EBG.adaptor.isInApp();
- b.locationPolling = this._setLocationPolling(b.locationPolling)
- },
- _setLocationPolling: function(a) {
- 0 < a ? (a = Math.min(a, 100), a = Math.max(a, 10)) : a = 0;
- return a
- },
- _updateAdConfigToHandleOpenWindow: function(a) {
- var b = a.adConfig;
- b.bsPath = b.dataCapture = a.bs;
- b.pluId = EBG.pluId;
- b.protocol = EBG.protocol;
- if (EBGInfra.isDefined(a.lid)) b.lineId = a.lid;
- b.isPreview = !!a.pr
- },
- _sendInitialDataPipeData: function(a) {
- this._dpm = EBG.dataPipeMgr.getPipe(a.adConfig.sID);
- this._dpm.send(EBG.DataProfile.GENERAL, {
- adid: a.adConfig.adId,
- time: +new Date
- });
- this._dpm.send(EBG.DataProfile.PLATFORM, {
- os: EBG.adaptor.browser._platform,
- brsrc: EBG.adaptor.browser._browserCode,
- brsrv: EBG.adaptor.browser._browserVer,
- brsrt: EBG.adaptor.browser._browserType,
- env: EBG.adaptor.browser.getEnvironment()
- });
- a = window && window.location && window.location.href ? window.location.href.substr(0, 50) : "";
- this._dpm.send(EBG.DataProfile.SERVING, {
- url: a
- })
- }
- };
- try {
- var currentResponse = EBG.Initializer.initialize();
- if (currentResponse.adConfig.UiVz && !currentResponse.requiresIframeBust && (currentResponse.IABBV || currentResponse.IABEV) && !EBG.adaptor.isSafeFrame() && "Visibility" != currentResponse.tn) {
- var vizClone = EBG.cloneObj(currentResponse);
- vizClone.tn = vizClone.adConfig.templateName = "Visibility";
- vizClone.ifrm = 2;
- vizClone.soi = 0;
- ebOArr[ebOArr.length] = vizClone;
- var newEbSrc = ebSrc.replace(currentResponse.tn, vizClone.tn),
- newEbSrc = newEbSrc.replace(/ex(debug|_api|)\.js/ig,
- ".js"),
- newScript = document.createElement("SCRIPT");
- newScript.src = newEbSrc;
- vizClone.ebSrc = newEbSrc;
- if (currentResponse.adConfig.adStarted) {
- var target = document.getElementById(vizClone.phid);
- target && target.appendChild(newScript)
- } else {
- var sub = new EBG.Events.EventSubscription(EBG.Events.EventNames.AD_START, function() {
- var a = document.getElementById(vizClone.phid);
- a && a.appendChild(newScript)
- }, this);
- sub.timing = EBG.Events.EventTiming.ONTIME;
- EBG.eventMgr.subscribeToEvent(sub)
- }
- }
- } catch (e$$117) {};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement