var EBGInfra=EBGInfra?EBGInfra:{declareNamespace:function(a){for(var b=window.EBG,a=a.split("."),c=0;c=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&&EBG.isFunc(a[d].toLowerCase)){if(a[d].toLowerCase()===b.toLowerCase())return!0}else if(a[d]===b)return!0;return!1},objMatch:function(a,b){var c=!1;if(a&&!b||!a&&b)return!1;for(var d in a){switch(!0){case !EBG.isDefined(b[d]):c=!1;break;case a[d]===b[d]:case EBG.isElementOrNode(a[d]):c=a[d]===b[d];break;case EBG.isObj(a[d]):case EBG.isArray(a[d]):c=EBG.objMatch(a[d],b[d]);break;default:c=!1}if(!c)return!1}return!0}, 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)},isNode:function(a){var b=a&&a.ownerDocument&&(a.ownerDocument.defaultView||a.ownerDocument.parentwindow);return b&&("object"===typeof b.Node||"function"===typeof b.Node)?a instanceof b.Node:a&&"object"===typeof a&&"number"===typeof a.nodeType&&"string"===typeof a.nodeName},isElement:function(a){var b= a&&a.ownerDocument&&(a.ownerDocument.defaultView||a.ownerDocument.parentwindow);return b&&("object"===typeof b.HTMLElement||"function"===typeof b.HTMLElement)?a instanceof b.HTMLElement:a&&"object"===typeof a&&null!==a&&1===a.nodeType&&"string"===typeof a.nodeName},isElementOrNode:function(a){return this.isElement(a)||this.isNode(a)},format:function(a){for(var b=1;b=c?EBG.cloneObj(a[e],null,c+1):a[e]);return d},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 0< a.toString().search("%")?a:EBG.format("{0}px",a)},indexOfArray:function(a,b){for(var c=0;c>>0;if("function"!=typeof b)throw new TypeError;for(var e=[],f=0;f"+i.responseText+"",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(!0)){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},isPercentage:function(a){return"string"==typeof a?/\d+%/.test(a)&&EBG.isNumber(parseInt(a)):!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;if(a.location.ancestorOrigins){for(var b=window,c=window,d=a.location.ancestorOrigins,e=!1,f=0;fthis._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); (function(a,b,c){b||(b={fn:{},extend:function(){for(var a=arguments[0],b=1,c=arguments.length;bb;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;ia?"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,o,p,r=f,q,n=d[a];n&&"object"===typeof n&&"function"===typeof n.toJSON&&(n=n.toJSON(a));"function"===typeof i&&(n=i.call(d,a,n));switch(typeof n){case "string":return b(n);case "number":return isFinite(n)?""+n:"null";case "boolean":case "null":return""+ n;case "object":if(!n)return"null";f+=g;q=[];if("[object Array]"===Object.prototype.toString.apply(n)){p=n.length;for(e=0;e",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.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){}},inject:function(a,b,c){if(c&&a){var d=c.ownerDocument,e=!1;if(EBG.isElementOrNode(a))d=a,e=!0;else if(d=d.createElement(a.tagName),a.attributes){this._setObjDefaultAttributes(a);for(var f in a.attributes)EBG.isObj(a.attributes[f])? this.setStyleToElem(d,a.attributes[f]):d.setAttribute(f,a.attributes[f])}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)}if(e)return d;e="";if(a.innerHTML)e=a.innerHTML;f=[];if(a.children)for(var g= 0;gvar e=document.createElement("form"),t="'+b+'".split("&");e.setAttribute("method","post"),e.setAttribute("action","'+a+'");for(var i=0;i'},getElementById:function(a, b){var c=null,b=b?b:this.getDisplayWin();if(EBG.isDefinedNotNull(a)&&(c=b.document.getElementById(a),!c))for(var d=this.findAllShadowRoots(b),e=0;ethis.browser.getVersion())&&!(this.browser.isIE()&&7>this.browser.getVersion())&&!EBG.isMRAID()},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},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},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;aEBG.adaptor.browser.getVersion()&&EBG.adaptor._removeEventListener(EBG.adaptor.getPageWin().document,"focusin",EBG.adaptor._updateFocused)}catch(d){}this._removeEventListener(this.getDisplayWin(), "resize",EBG.adaptor.updateScrollBarWidth)},_handleOrientationEvent:function(){},_handleDeviceMotionEvent:function(){},_handleDeviceOrientationEvent:function(){},_prepareLogicalEventData:function(a,b,c){try{a.eventData={};for(var d=0;d",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&&b&&c&&(a.style[b]=c)},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":2E3this.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},isSafeFrame:function(){return!(!window.$sf||!$sf.ext)},isInApp:function(){return!!window.mraid},isSkype:function(){try{return!!(window.$WLXRmAd||!window.location.ancestorOrigins&&window.parent&&window.parent.$WLXRmAd)}catch(a){return!1}},isAMP:function(){var a=!1;doIfAccessible=function(){a= a||!(!this.context||!this.context.reportRenderedEntityIdentifier)};this.walkUpIframes(doIfAccessible);return a},isReady:function(){return!0},hasLayoutViewport:function(){return document.documentElement.clientWidth>window.innerWidth},getBoundingClientRect:function(a,b){if(!a||a.id&&!this.getElementById(a.id))return null;var b=b||{},c=a.getBoundingClientRect(),c={width:Math.round(c.width),height:Math.round(c.height),top:Math.round(c.top),left:Math.round(c.left),bottom:Math.round(c.bottom),right:Math.round(c.right)}; c.width=EBG.isNumber(c.width)?c.width:c.right-c.left;c.height=EBG.isNumber(c.height)?c.height:c.bottom-c.top;this.browser.isAndroid()&&this.hasLayoutViewport()&&(c.top-=window.pageYOffset,c.left-=window.pageXOffset,c.bottom-=window.pageYOffset,c.right-=window.pageXOffset);if(b.clip)try{var d=/rect\((.*?)px(.*?)px(.*?)px(.*?)px\)/g.exec(this.getComputedStyle(a).getPropertyValue("clip"));if(d){for(var e=1;ethis.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(ebO.ffs.CFF_assignNewAdapter?this.serving._getTopFriendlyIframe(this.getDisplayWin()):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));this._setEvent(EBG.Events.EventNames.DEVICE_MOTION,"devicemotion",!1,["acceleration","accelerationIncludingGravity", "rotationRate","timeStamp"],!0);this._setEvent(EBG.Events.EventNames.DEVICE_ORIENTATION,"deviceorientation",!1,["absolute","alpha","beta","gamma"],!0)},initServingMode:function(a,b,c){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||EBG.isPreview&&EBG.isTestMode)&&c==EBG.Adaptors.ServingMode.FRIENDLY_IFRAME&&!b?this.serving.setServingMode(EBG.Adaptors.ServingMode.FRIENDLY_IFRAME): !EBG.isPreview&&c==EBG.Adaptors.ServingMode.IFRAME&&!b?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},inInnerIframe:function(){return this.serving&&this.serving.placementIframe},inPlacementIframe:function(){return this.serving&&this.serving.servingMode===EBG.Adaptors.ServingMode.IFRAME},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)},clipIframeParent:function(){return!(!EBG.adaptor.browser.isChrome()&&!EBG.adaptor.browser.isSafari())},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;this.serving.servingMode==EBG.Adaptors.ServingMode.INNER_IFRAME&&this.updateScrollBarWidth();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()||window.ebO&&ebO.ffs&&ebO.ffs.CFF_MobCSSPixels&&this.canHaveLayoutViewport())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||0c.Height||e>c.Height||0=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;this.isAMP()&&EBG.AMPUtil&&"undefined"!==typeof EBG.AMPUtil._AMPObj?a="amp:visibilitychange":"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}}; EBG.declareClass(EBG.Adaptors.WebAdaptor,EBG.Adaptors.StdWebAdaptor);EBG.Adaptors=EBG.Adaptors||{};EBG.Adaptors.Browser=function(a,b,c,d,e,f){this.set(a,b,c,d,e,f)}; 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,_browserInApp:0,set:function(a,b,c,d,e,f){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;this._browserInApp=f?f: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||this._platform==this._platformTypes.Mac_El_Capitan||this._platform==this._platformTypes.Mac_Sierra},isInApp:function(){var a=this.getEnvironment();return-1!=[2==this._browserInApp,1==this._browserInApp, a===EBG.WebEnvironment.ANDROID_WEB_VIEW,a===EBG.WebEnvironment.IOS_WEB_VIEW].indexOf(!0)},inAppEnv:function(){var a=this.getEnvironment();return[2==this._browserInApp,1==this._browserInApp,a===EBG.WebEnvironment.ANDROID_WEB_VIEW,a===EBG.WebEnvironment.IOS_WEB_VIEW].indexOf(!0)},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(/iphone|ipad|ipod/i))return!0;return!1},isiPad:function(){for(var a in this._platformTypes)if(this._platformTypes[a]==this._platform&&a.match(/ipad/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()},isSpotify:function(){var a=navigator.userAgent|| navigator.vendor||window.opera||"";return this.isChrome()&&a.match(/spotify/i)},getEnvironment:function(){var a=navigator.userAgent||navigator.vendor||window.opera;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(/wv/)||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.isMobile()?EBG.adaptor.browser.isIE()?EBG.WebEnvironment.OTHER_MOBILE_BROWSER:EBG.WebEnvironment.UNKNOWN: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.ServingMgr=function(){this.displayWin=window;this.servingMode=EBG.Adaptors.ServingMode.SCRIPT}; EBG.Adaptors.ServingMgr.prototype={displayWin:null,pageWin:null,placementIframe:null,_placementIframeAttr:null,servingMode:null,ebO:null,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: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())},detectServingMode:function(a){try{var b=EBG.Adaptors.ServingMode.SCRIPT,c=window;EBG.adaptor.walkUpIframes(function(){if(c!= this)b=EBG.Adaptors.ServingMode.FRIENDLY_IFRAME},function(){b=EBG.Adaptors.ServingMode.IFRAME});if(a)return b;this.setServingMode(b)}catch(d){}},detectServingEnvironment:function(a){a=EBG.isDefinedNotNull(a)?a:this.detectServingMode(!0);if(this.servingMode==EBG.Adaptors.ServingMode.INNER_IFRAME)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;var b;EBG.adaptor.walkUpIframes(function(){b=this},null,a);return b},_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()},_findPlacementIframe:function(){var a=function(){if(this==b){c=!0;var a=b.document.getElementsByTagName(EBG.Adaptors.TagNames.IFRAME);if("function"== typeof Array.from)for(var a=Array.from(a),g=EBG.adaptor.findAllShadowRoots(this),h,i=0;ithis._dispatchedEvents[a.name][a.timing].length&&this._dispatchedEvents[a.name][a.timing].push(a))},getDispatchedEvents:function(a){return this._dispatchedEvents[a.name]?this._dispatchedEvents[a.name][a.eventTiming]:null},_dispatchEventByTiming:function(a,b){this._trackEvent(a); var c=this._subscriptions[a.name];if(!c)return!1;for(var c=c[b],d=!1,e=0;e=a)return"";a-=b.length}for(var c=this.interactionData.adConfig.clickTrackingUrls,d=0;d=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 "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.Autolina&&EBG.Autolina.report(d,EBG.Autolina.reportType.CLICK),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;eb?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 0EBG.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.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:{};this.adDataParamsQueue=EBG.intMgr?EBG.intMgr.adDataParamsQueue:{}}; EBG.Interactions.StdInteractionManager.prototype={copy:function(a){this.adsIntQueues=a.adsIntQueues;this.adsData=a.adsData;this.adDataParamsQueue=a.adDataParamsQueue},initAdData:function(a,b){var c=a.uid;this.adsIntQueues[c]=this.adsIntQueues[c]?this.adsIntQueues[c]:[];this.adDataParamsQueue[c]=this.adDataParamsQueue[c]?this.adDataParamsQueue[c]:[];c=this.adsData[c]={adConfig:a,isUserInteractionOccur:!1,isClickOccur:!1,isProductClicked:{},numOfInteractions:0,delayIntReport:a.impressionSent?!1:b,videoState:{}, assetsTimers:{}};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,l="",f=EBGInfra.isDefined(f)? f:!0,c=c||h&&h.assetID||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;l=f?g.handle(c):"";j.numOfInteractions++;l&&(this._handleReportData(b,h,l),this._isReportDataInQueue(b,l)||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]}};EBG.declareClass(EBG.Interactions.StdInteractionManager,null); EBG.Interactions.InteractionManager=function(){EBG.callSuperConstructor(EBG.Interactions.InteractionManager,this);EBG.intMgr&&EBG.intMgr.copy(this);this.idleManager=new EBG.Interactions.IdleManager;this._timedReport=!EBG.adaptor.browser.isMobile()?1E4:9E4;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]},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()},_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){if(b.useInteractionsStrPipe)this._handleDataParams(a,b,c);else if(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)b=!b.sync,window.navigator&&navigator.sendBeacon&&!EBG.isMRAID()?this.reportInteractionQueues(b,!1,!0):this.reportInteractionQueues()},_handleDataParams:function(a,b,c){if(!this.adsData[a].adConfig.Purposes.Measurements){if(b.reportingName==EBG.Interactions.SystemInts.VER_URL)return!1;b.reportingName==EBG.Interactions.SystemInts.PLAYER_PARAMS&& (c=c.replace(/\&(bsc|ivp|fs)\=-?\d+(\.\d+)?/g,""))}var b=this._getAdReportData(a),c=encodeURIComponent(c),d=this._getPipeParams(a,!1),c=this.adsData[a].adConfig._interactionsStrPipe+"$$"+b+c+"$$"+d;this.adsData[a].delayIntReport?this.adDataParamsQueue[a].push(c):this._reportServer(c,!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=EBG.indexOfArray(EBG.VideoQuartiles,a);-1!=h&&(h==f[c]?f[c]++:g=!1);g&&this.handleCounterInteraction(a,b,c,d,e)}},handleAllTimers:function(a,b,c){if(a== EBG.Interactions.InteractionManager.HandleAllTimersOptions.PAUSE)this._pausedTimers=[];var d=new EBG.Events.Event(EBG.Events.EventNames.COLLECT_TIMERS);d.dispatcher=this;d.timing=EBG.Events.EventTiming.BEFORE;if(c&&this.adsData.hasOwnProperty(c))d.eventData={adUId:c};EBG.eventMgr.dispatchEvent(d);for(var e in this.adsData)if(this.adsData.hasOwnProperty(e)&&!(c&&c!=e||this.adsData[e].isUnloadHandled)){var d=this.adsData[e],f=d[EBG.Interactions.InteractionTypes.TIMER];f&&this._handleTimers(f,a,e);if(d.assetsTimers)for(var g in d.assetsTimers)d.assetsTimers.hasOwnProperty(g)&& this._handleTimers(d.assetsTimers[g],a,e,g);d=new EBG.Events.Event(EBG.Events.EventNames.COLLECT_TIMERS);d.dispatcher=this;d.timing=EBG.Events.EventTiming.ONTIME;if(c)d.eventData={adUId:c};EBG.eventMgr.dispatchEvent(d);a===EBG.Interactions.InteractionManager.HandleAllTimersOptions.REPORT&&(d=0<=this._seqTimersReportData.index,b=EBG.isBool(b)?b:!0,!b&&this.adsData[e].adConfig&&navigator&&navigator.sendBeacon&&!EBG.isMRAID()?this.reportInteractionQueues(b,d,!0):this.reportInteractionQueues(b,d))}}, _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.interactionData.isPanel&&f.interactionData.assetID?f.handle(f.interactionData.assetID): 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;aEBG.Interactions.InteractionManager.INTERACTION_THRESHOLD_SEC)){var a=EBG.isBool(a)?a:!0,b=EBG.isBool(b)?b:!1,d={},e={},f;for(f in this.adsData)if(this.adsData.hasOwnProperty(f)){var g=this.adsIntQueues[f];if(!this.adsData[f].delayIntReport&&this.adsData[f].adConfig.Purposes.Measurements){for(var h= this.adDataParamsQueue[f];h.length;)this._reportServer(h[0],!0),h.shift();for(;g.length;){for(var h=this._getAdReportData(f),i=this.adsData[f].adConfig._interactionPipe,j=0,k=this._isUnloadHandled?g.length:EBG.Interactions.InteractionManager.intStackLength,l=0;l=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.bottomb.bottom||a.rightb.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){EBG.elementWatcher&& EBG.elementWatcher.unwatch(null,this._res,this);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;this._triggerVisibilityCheck();var a=10;(function(){a--&&(this._triggerVisibilityCheck(),EBG.runTimed(this,arguments.callee, [],1E3))}).apply(this)},_trackElementLocation:function(){if(this._res=EBG.adaptor.getElementById(this._resObjId)){var a={clip:!0,relativeToWindow:!1};EBG.elementWatcher&&EBG.elementWatcher.watch(this._res,this._elemWatcherCallback,this,null,a)}else EBG.runTimed(this,this._trackElementLocation,[],500)},_elemWatcherCallback:function(a){this.onElementMoved();null==a&&this._trackElementLocation()},_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.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.outerHeight,EBG.isDefined(a.scrollMaxX)&&0a.right||b.righta.bottom||b.bottomEBG.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;bb.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=0e&&0<=c&&cd?b.left-f:b.left+ f;a=0e&&0<=a&&ad?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((50this._screenOriginalResolution.height){var c=b.bottom>a.screenY?b.bottom:a.screenY;if(this._screenResolution.heightthis._screenOriginalResolution.width&&(a=b.right>a.screenX?b.right:a.screenX,this._screenResolution.widthc)return!0;return!1},_subscribeToEvents:function(){EBG.callSuperFunction(EBG.RichModules.BasicVisibilityProvider,this,"_subscribeToEvents");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)},_pageVisibleHandler:function(){this._triggerVisibilityCheck()},_pageHiddenHandler:function(){this._dispatchVisibilityHidden();this.adConfig.visibility.mode==EBG.VisibilityMode.ENHANCED_MODE&&this._dispatchCheckVisibility({percentage:0,viewPort:this._getViewPortMetrics()})}, _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())},_getDimensions:function(){if(!this.adConfig.width||!this.adConfig.height||"100%"==this.adConfig.width||"100%"==this.adConfig.height){var a=EBG.adaptor.getElementById(this.adConfig.placeHolderId),a=EBG.adaptor.getBoundingClientRect(a)||{width:0,height:0};return{width:a.width,height:a.height}}return{width:this.adConfig.width, height:this.adConfig.height}},_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);this.checkVisibilityCounter=0;this._shouldInitialize()&&this._tryInitProvider()}; EBG.RichModules.VisibilityManager.ThreholdType={IAB:0,Agency:1,Advertiser:2};EBG.RichModules.VisibilityManager.VisibilityCheckInterval=100; EBG.RichModules.VisibilityManager.prototype={adConfig:null,_resObjId:null,_visibilityData:null,_visRecordable:!1,_lastVisPercentage:0,_lastVisViewPort:null,_lastVisRect:null,_averageVisibility:0,_averageScreenShare:0,_averageAdDuration:0,_averageLastCalcTime:null,_adCoveragePercentage:0,actualServingMode:EBG.Adaptors.ServingMode.SCRIPT,_visibilityProvider:null,_availableVisibilityProviders:"GeometricVisibilityProvider,SafeFrameVisibilityProvider,IntersectionObserverVisibilityProvider,MouseVisibilityProvider,GridVisibilityProvider,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,a=d.requiresIframeBust&&!EBG.iframeLocation&&a.aiE&&!a.aiE.iflExists;if(c&&(e||a)||EBG.adaptor.isInApp())b=!1;return b},IntersectionObserverVisibilityProvider:function(a){return window.IntersectionObserver||a.actualServingMode==EBG.Adaptors.ServingMode.IFRAME&& window.context&&context.observeIntersection&&EBG.isFunc(context.observeIntersection)&&"Html5ExpBanner"!=a.templateName},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()&&10b&&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 EBG.adaptor.isInApp()&&!b?(a.UiVz=!1,!0):!1}},_init:function(a){this._visibilityProvider=new (a||window).EBG.RichModules[this._visibilityProviderName](this._resObjId,this._adConfig,this._options);this._dpm.send(EBG.DataProfile.VISIBILITY, {vsbp:this.getVisibilityProviderNum()});this._initializeVisibilityData();this._subscribeToEvents();this._visRecordable=!0;this._reportVisibilityRecordable();a=function(){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=++this.checkVisibilityCounter&&(EBG.runTimed(this,this.checkVisibility,[],500),1==this.checkVisibilityCounter&&EBG.runTimed(this,function(){this.checkVisibilityCounter=0},[],3E3)))}catch(b){}this.adConfig.visibility.mode==EBG.VisibilityMode.ENHANCED_MODE&&this._calculateAverages(a); for(var c in EBG.RichModules.VisibilityManager.ThreholdType)EBG.RichModules.VisibilityManager.ThreholdType.hasOwnProperty(c)&&this._visibilityData[EBG.RichModules.VisibilityManager.ThreholdType[c]]&&this._visibilityData[EBG.RichModules.VisibilityManager.ThreholdType[c]].isActive&&this._execCheckVisibility(a.percentage,EBG.RichModules.VisibilityManager.ThreholdType[c])}},updateResourceObjId:function(a){if(this._visibilityProvider&&a)this._collectTimersHandler(),this._resObjId=a,this._res=EBG.adaptor.getElementById(a), this._visibilityProvider.updateResourceObjId(a);else if(a)this._resObjId=a,this._res=EBG.adaptor.getElementById(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&&!EBG.adaptor.isInApp()?!1:this.adConfig.ffs.CFF_DisableVisInit?this.adConfig.visibility.mode!=EBG.VisibilityMode.DEFAULT_MODE:!0},_tryInitProvider:function(){(this._visibilityProviderName= this._getVisibilityProvider(this._resObjId,this.adConfig))?(this._adConfig.visibility.isAvailable=!0,EBG.RichModules[this._visibilityProviderName]?this._init():EBG.adaptor.loadModule(this._visibilityProviderName,this._adConfig,this._init,this)):this._adConfig.visibility.isAvailable=!1},_getVisibilityProvider:function(a,b){for(var c=0;c=this.adConfig.visibility.iabMinSurface},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=!this._adConfig.isAMP;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.ELEMENT_SHOWN,function(){this.checkVisibility()},this);b.dispatcherFilters={"_adConfig.rnd":this.adConfig.rnd};b.timing=EBG.Events.EventTiming.AFTER;EBG.eventMgr.subscribeToEvent(b);b=new EBG.Events.EventSubscription(EBG.Events.EventNames.ELEMENT_HIDDEN, function(){this.checkVisibility()},this);b.dispatcherFilters={"_adConfig.rnd":this.adConfig.rnd};b.timing=EBG.Events.EventTiming.AFTER;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!!a&&242500<=a.width*a.height},_execCheckVisibility:function(a,b){try{var c,d,e=this._visibilityData[b],f=e.visibilityInteraction==EBG.Interactions.SystemInts.VISIBILITY_IAB; !EBG.adaptor.browser.isMobile()&&e.minLargeSurface&&this._isLargeBanner()?(c=e.minLargeSurface,d=e.minLargeDuration):(c=e.minSurface,d=e.minDuration);a>=c?(f&&!e.reported&&!this._visibilityProvider.isTimedBaseVisibility&&EBG.runTimed(this,this.checkVisibility,[],EBG.RichModules.VisibilityManager.VisibilityCheckInterval),!e.reported&&!e.timeOutFlag?e.timeOutFlag=EBG.runTimed(this,function(){e.timeOutFlag=null;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));f&&!e.reported&&this._handleIABVisibility();e.reported=!0},[],1E3*d):e.reported&&e.durationNeeded&&e.durationInteraction&&this._intMgrWrapper.startTimer(e.durationInteraction,this.adConfig.uid)):(this._stopDurationTimeout(b),e.durationInteraction&&this._stopDurationCounting(b))}catch(g){}},_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);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(a){if(!a|| !(a.eventData&&a.eventData.adUId!=this.adConfig.uid||a.dispatcher.adsData&&a.dispatcher.adsData[this.adConfig.uid]&&a.dispatcher.adsData[this.adConfig.uid].isUnloadHandled))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();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,IntersectionObserver:10}; return this._visibilityProvider?a[this._visibilityProvider.name]||-1:a.None},_calculateAverages:function(a){var b=(new Date).getTime()-this._averageLastCalcTime;if(1E3=f;f++){var g= c[f];switch(d[f]){case "top":case "bottom":EBG.isPercentage(g)&&(b&&EBG.isNumber(b.height)?(g=1*g.replace(/[^\d\.\-]/g,""),g=b.height*g/100):g=this.getPercentOfViewportHeight(g));break;case "left":case "right":EBG.isPercentage(g)&&(b&&EBG.isNumber(b.width)?(g=1*g.replace(/[^\d\.\-]/g,""),g=b.width*g/100):g=this.getPercentOfViewportWidth(g))}g=Math.round(g);e=e+g+"px";e=4>f?e+",":e+")"}return e}return null},_isRectCSS:function(a){this._clipPercentRegex.lastIndex=0;return this._clipPercentRegex.test(a)}, _getRectCSSValues:function(a){this._clipPercentRegex.lastIndex=0;return this._clipPercentRegex.exec(a)}};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={};this._placeholderDiv=EBG.adaptor.getElementById(this._adConfig.placeHolderId);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={_densityFactor:5,_prevPercentage:0,_minThresholdForAdStacking:50,_interactionThreshold:100,_generatePointsGrid:function(a){for(var b=[],c=(a.height-2)/this._densityFactor,d=(a.width-2)/this._densityFactor,e=0;e<=this._densityFactor;e++)for(var f=0;f<=this._densityFactor;f++){var g=d*e,h=c*f,g=Math.max(g,2),h=Math.max(h,2),g=Math.min(g,a.width-2),h=Math.min(h,a.height-2);b.push({x:Math.round(g),y:Math.round(h)})}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.runTimed(this,this._analyze,[],5);EBG.runTimed(this,this._analyze,[],EBG.RichModules.VisibilityManager.VisibilityCheckInterval/2);EBG.runTimed(this, this._analyze,[],EBG.RichModules.VisibilityManager.VisibilityCheckInterval)},_analyze:function(){if("hidden"!=this._placeholderDiv.style.visibility){var a=this._calculateConcealmentPercentage();if(!this._adStackingReported&&a.adStacked>=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.blocked!=this._prevPercentage){this._prevPercentage= a.blocked;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.blocked};b.dispatcher=this;b.timing=EBG.Events.EventTiming.BEFORE;if(EBG.eventMgr.dispatchEvent(b))return;b.timing=EBG.Events.EventTiming.ONTIME_AND_AFTER;EBG.eventMgr.dispatchEvent(b)}EBG.runTimed(this,this._analyze,[],EBG.RichModules.VisibilityManager.VisibilityCheckInterval)}},_calculateConcealmentPercentage:function(){var a= {blocked:0,adStacked: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,h=0;hEBG.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=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;cthis._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("Ads"); EBG.Ads.Ad=function(a){this._adConfig=a;this._dpm=EBG.dataPipeMgr.getPipe(this._adConfig.sID);this._adConfig.isStdAd=this._isStdAd();this.startTime=(new Date).getTime()/1E3;this.advertiserCounter=0;this._initReportImpression();this.impressionWaitingStatus={adRender:!1};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._sendInitAdInformation()}; EBG.Ads.Ad.prototype={resizePlaceHolder:!0,checkingThrottle:!1,_throttleState:null,_throttleTimeoutDuration:1E3,_adConfig:null,_adChoice:null,_cdiReason:0,_showOnlyDefaultImg:!1,_banner:{divId:"",resId:"",width:0,height:0},_hasDefaultImageInteraction:!1,_isStdAd:function(){return!0},_initReportImpression:function(){if(this._adConfig.reportImpressionType==EBG.ReportImpressionType.DELAYED)EBG.adaptor.loadModule("DelayedImpression",this._adConfig,function(a){this.delayedImpressionModule=new (a||window).EBG.Modules.DelayedImpression(this._adConfig); this._handleDelayedImpressionReport()},this);else if(this._adConfig.reportImpressionType==EBG.ReportImpressionType.CLIENT){var a=this._adConfig.inAppAdvertiserSupported&&this._adConfig.ffs.CFF_inAppImpression&&this._adConfig.sdkBridgeEnabled&&!this._adConfig.isInstream?this._handleClientImpressionWaiting:this._handleClientImpression,b=new EBG.Events.EventSubscription(EBG.Events.EventNames.INAPP_IMPRESSION,a,this);b.dispatcherFilters={ebRand:this._adConfig.rnd};b.timing=EBG.Events.EventTiming.ONTIME; EBG.eventMgr.subscribeToEvent(b);b=new EBG.Events.EventSubscription(EBG.Events.EventNames.ELEMENT_LOADED,a,this);b.dispatcherFilters={ebRand:this._adConfig.rnd};b.timing=EBG.Events.EventTiming.ONTIME;EBG.eventMgr.subscribeToEvent(b);b=new EBG.Events.EventSubscription(EBG.EBMessage.DOCUMENT_LOADED,a,this);b.dispatcherFilters={"_adConfig.rnd":this._adConfig.rnd};b.timing=EBG.Events.EventTiming.ONTIME;EBG.eventMgr.subscribeToEvent(b);b=new EBG.Events.EventSubscription(EBG.Events.EventNames.CREATIVE_CONTAINER_READY, a,this);b.dispatcherFilters={"_adConfig.rnd":this._adConfig.rnd};b.timing=EBG.Events.EventTiming.ONTIME;EBG.eventMgr.subscribeToEvent(b)}},_handleClientImpressionWaiting:function(a){if(a.name!==EBG.Events.EventNames.INAPP_IMPRESSION){if(this.ImpressionEvent&&a.name!==this.ImpressionEvent.name)return;this.ImpressionEvent=a;if(!this.impressionWaitingStatus.adRender){this.impressionWaitingStatus.adRender=!0;if(!this.adRenderReported&&this._adConfig.ffs.CFF_inAppOnRender)this.adRenderReported=1,this._dpm.sendNow(this._adConfig.dpUrlEvents, {ad_onRender:2,sdk_purpose:"sdk_debug"});(!this._adConfig.ffs.CFF_siteInApp||this._adConfig.inAppAdvertiserNoReport)&&this._handleClientImpression(a)}}else{if(a.eventData.hasOwnProperty("sdkTrigger"))this.impressionWaitingStatus.sdkTrigger=a.eventData.sdkTrigger;if(a.eventData.hasOwnProperty("supportsSDK"))this.impressionWaitingStatus.supportsSDK=a.eventData.supportsSDK;if(a.eventData.hasOwnProperty("isViewable"))this.impressionWaitingStatus.isViewable=a.eventData.isViewable}if(this._adConfig.hasOwnProperty("sdkBridgeLoaded")&& this.impressionWaitingStatus.hasOwnProperty("supportsSDK")&&this.impressionWaitingStatus.adRender){if(this.impressionWaitingStatus.supportsSDK&&!this.sdk_appSupported)this.sdk_appSupported=1,this._dpm.sendNow(this._adConfig.dpUrlEvents,{sdk_appSupported:1,sdk_siteSupported:~~this._adConfig.ffs.CFF_siteInApp,sdk_advertiserSupported:~~this._adConfig.inAppAdvertiserSupported,sdk_purpose:"sdk_debug"});if(!this._adConfig.sdkBridgeLoaded||!this.impressionWaitingStatus.supportsSDK||this.impressionWaitingStatus.isViewable){if(this._adConfig.ffs.CFF_siteInApp&& !this._adConfig.inAppAdvertiserNoReport&&!this.vwImpSent)this.vwImpSent=1,this._handleClientImpression(this.ImpressionEvent);if(!this.adViewReported&&this.impressionWaitingStatus.isViewable&&this._adConfig.dpUrlEvents){this.adViewReported=!0;a={ad_onview:1,sdk_purpose:"sdk_debug"};if(this.impressionWaitingStatus.sdkTrigger)a.sdk_trigger=this.impressionWaitingStatus.sdkTrigger;this._dpm.sendNow(this._adConfig.dpUrlEvents,a)}}}},_handleClientImpression:function(a){if(!this._adConfig.impressionSent){if(!this.adRenderReported&& this._adConfig.inAppAdvertiserSupported&&this._adConfig.ffs.CFF_inAppImpression&&this._adConfig.ffs.CFF_inAppOnRender)this.adRenderReported=1,this._dpm.sendNow(this._adConfig.dpUrlEvents,{ad_onRender:1,sdk_purpose:"sdk_debug"});if((a.eventData&&a.eventData.adUId?a.eventData.adUId:a.dispatcher&&a.dispatcher._adConfig?a.dispatcher._adConfig.uid:null)==this._adConfig.uid)if(a=a.eventData&&a.eventData.DOMEvent&&a.eventData.DOMEvent.target?a.eventData.DOMEvent.target:a.dispatcher&&a.dispatcher._iframe? a.dispatcher._iframe:a.dispatcher&&a.dispatcher._res?a.dispatcher._res:null,this._dispatchClientImpression(),this._adConfig.impressionTrackingURLs&&this._reportImpressionTrackingURLs(this._adConfig.impressionTrackingURLs),EBG.intMgr.allowInteractionReport(this._adConfig.uid),this._adConfig.ffs.CFF_ReportVPI&&this._adConfig.Purposes.Measurements&&this._adConfig.Purposes.Debug){this._adConfig.impData={inapp:0,ioexists:0,target:0,vpicheck:0};if(window.IntersectionObserver)this._adConfig.impData.ioexists= 1;if(a)this._adConfig.impData.target=1;if(EBG.adaptor.browser.isInApp())this._adConfig.impData.inapp=1;if(EBG.adaptor.browser.isInApp()||this._adConfig.ffs.CFF_ReportVPIAll)this._adConfig.impData.vpicheck=1,window.IntersectionObserver&&a?this._waitForViewportImpression(a):this._dispatchViewportImpression()}}},_waitForViewportImpression:function(a){this.observer=new IntersectionObserver(this._handleViewportImpression.bind(this),{threshold:[0]});this.observer.observe(a)},_handleViewportImpression:function(a){a= a[0];a.isIntersecting&&(this.observer.unobserve(a.target),this._dispatchViewportImpression())},_dispatchViewportImpression:function(){if(this._adConfig.ViewportImpressionSent)return!1;this._adConfig.ViewportImpressionSent=!0;this._adConfig.impData.vpimp=1;this._adConfig.dpUrlEvents&&this._dpm.sendNow(this._adConfig.dpUrlEvents,this._adConfig.impData)},_dispatchClientImpression:function(a){if(this._adConfig.impressionSent||EBG.isPreview)return!1;this._adConfig.impressionSent=!0;var b=EBG.format("{0}{1}/Serving?cn=display&c=40&sessionid={2}&ai={3}&usercookie={4}&oo={5}", EBG.protocol,this._adConfig.bsPath,this._adConfig.sID,this._adConfig.adId,this._adConfig.usercookie,this._adConfig.optOut);a&&(b+="&isBlank=1");a=this._adConfig.ffs&&this._adConfig.ffs.CFF_SendUndefined;if(!a&&"undefined"!==typeof this._adConfig.gdprpurposes||a)b+="&gdprpurposes="+this._adConfig.gdprpurposes;this._adConfig.defaultImageDisplayed&&this._cdiReason&&(b+="&di=1&dir="+this._cdiReason);if(this._adConfig.massVersioning.originalDeliveryGroupId||this._adConfig.massVersioning.deliveryGroupId)b+= "&dg="+(this._adConfig.massVersioning.originalDeliveryGroupId||this._adConfig.massVersioning.deliveryGroupId);this._adConfig.massVersioning.subDeliveryGroupId&&(b+="&sdg="+this._adConfig.massVersioning.subDeliveryGroupId);this._adConfig.diAppId&&(b+="&diappid="+this._adConfig.diAppId);this._adConfig.isNXT&&(b+="&ctick="+(+new Date-this._adConfig.handleStartTime));b+="&ord="+Math.random();EBG.adaptor.reportToRemoteServer(b,!0);this._dpm.send(EBG.DataProfile.SERVING,{cimp:1})},_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');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;di)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(),a={ifr:a,loc:b,size:d,cb:e,env:f};this._adConfig.Purposes.Debug&&(a.vsbp=c);if(this._adConfig.wurflValue)a.bi=this._adConfig.wurflValue;EBG.intMgr.handleCounterInteraction(EBG.Interactions.SystemInts.AD_PARAMS,this._adConfig.uid,0,!1,{value:a})}}else this._subscribeToAdEvent(EBG.Events.EventNames.PAGE_LOAD, this._reportAdParams)},_getBannerLocation:function(a){if(a&&EBG.isNumber(a.X)&&EBG.isNumber(a.Y)){var b,c=function(){b=EBG.adaptor.getPositioningByElement(this.frameElement);a.X+=b.X;a.Y+=b.Y};EBG.adaptor.walkUpIframes(function(){this.location.ancestorOrigins?this.location.ancestorOrigins[0]&&this.location.ancestorOrigins[0]==this.location.origin&&this.frameElement&&c.call(this):this.frameElement&&c.call(this)},null,EBG.adaptor.getDisplayWin())}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},_replaceURLTokens:function(a){var b=this._adConfig;try{if(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),b.gdpr&&(a=a.replace(/\[%gdpr%\]/ig,b.gdpr), a=a.replace(/\${gdpr}/ig,b.gdpr),a=a.replace(/{gdpr}/ig,b.gdpr)),b.gdprconsent)){var a=a.replace(/\[%gdpr_consent%\]/ig,b.gdprconsent),a=a.replace(/{gdpr_consent}/ig,b.gdprconsent),c=[2,6,8,9,12,15,18,23,25,33,36,37,41,42,44,45,47,50,52,53,58,59,61,65,66,68,72,78,80,88,89,90,93,94,100,109,114,115,120,126,127,128,129,130,133,136,137,138,144,147,153,163,164,167,174,177,192,199,203,205,206,210,213,215,218,223,224,226,228,235,240,243,248,256,262,272,273,277,278,279,280,281,285,294,302,303,304,314,315, 318,325,328,350,351,358,368,371,374,387,402,413,415,422,423,424,428,429,436,439,440,447,450,466,467,486,490,491,495,498,502,507,512,516,522,524,530,531,535,543,544,545,546,549,550,553,554,556,559,568,571,580,587,593,602,606,607,609,612,613,618,620,626,628,648,650,652,653,656,657,659,662,663,665,668,674,675,676,681,683,684,686,687,688,690,691,694,699,702,703,707,708,709,711,712,713,714,716,719,720,722,723,725,726,729,731,733,734,735,737,738,740,741,742,743,744,745];if(/\${gdpr_consent_(.*?)}/ig.test(a))try{var d= /\${gdpr_consent_(.*?)}/ig.exec(a)[1];d&&-1!=c.indexOf(1*d)&&(a=a.replace(/\${gdpr_consent_(.*?)}/ig,b.gdprconsent))}catch(e){}}if(!a||!b.sUrlTokens)return a;if(!EBG.isObj(b.objURLTokens))b.oURLTokens=this._pairsToObj(b.sUrlTokens,"$$");for(var f in b.oURLTokens)b.oURLTokens.hasOwnProperty(f)&&(a=a.replace(RegExp("\\[%"+f+"%\\]","ig"),b.oURLTokens[f]))}catch(g){}return a},_pairsToObj:function(a,b){for(var c={},d=unescape(a).split(b),e=0;e=this._adConfig.visibility.iabMinSurface)this._handleVideoVisibilityChangeSub=this._subscribeToAdEvent(EBG.Events.EventNames.VISIBILITY_CHECK,function(a){if(a.eventData.percentage'+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)},sendMessage:function(a){this.pm(a)},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}{1}v={2}",EBG.combinePaths(this._adConfig.resourcePath,a),-1EBG.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:'