EBG="undefined"!=typeof EBG?EBG:{};EBG.Semi=EBG.Semi||{};EBG.Semi.Infra=function(){};EBG.Semi.Infra.declareNamespace=function(a){for(var b=window.EBG.Semi,a=a.split("."),c=0;c",b=this.createFriendlyIframe();this.addChildToPage(b);document.documentMode&&7<\/script>"),a.close();else{var a=a||document,f=a.createElement("script");f.type="text/"+(b.type||"javascript");f.src=b.src||b;f.async=!0;var h=!1;f.onreadystatechange=f.onload=function(){var a=f.readyState;if(c&&!h&&(!a||/loaded|complete/.test(a)))h=!0,c.apply(e,[g])};f.onerror=function(){c.apply(e,[g])};EBG.Semi.Infra.addChildToPage(f,a.body||a.getElementsByTagName("head")[0])}}; EBG.Semi.Infra.executeTextByScriptElem=function(a,b,c,d,e){var a=a||document,g=a.createElement("script");g.type="text/javascript";g.text=b;EBG.Semi.Infra.addChildToPage(g,a.body||a.getElementsByTagName("head")[0]);c&&c.apply(d||window,[e])};EBG.Semi.Infra.getWindowLocation=function(){return window.location}; EBG.Semi.Infra.getCurrentScriptElement=function(){var a;if(document.currentScript)a=document.currentScript;else for(var b=document.getElementsByTagName("script"),c=0;!a&&cdocument.documentMode?(a.frameBorder=0,a.margin=0,a.marginWidth=0,a.marginHeight=0,a.scrolling="no"):(a.setAttribute("scrolling","no"),a.setAttribute("marginwidth","0"),a.setAttribute("marginheight","0"),a.setAttribute("frameborder","0"));return a}; EBG.Semi.Infra.isIframeScriptable=function(a){try{this.ifrmDocument=a.contentWindow.document}catch(b){return!1}return!0};EBG.Semi.Infra.enableIframeScriptable=function(a){if(a){a.setAttribute("data-isready","false");var b;b="javascript:document.write('\r"+('try{parent.document.domain;}catch(e){document.domain="'+document.domain+'";}\r');a.src=b+"parent.EBG.Semi.Infra.friendlyIframeIsReadyCallback(window);\r\r');"}}; EBG.Semi.Infra.friendlyIframeIsReadyCallback=function(a){for(var b=document.getElementsByTagName("iframe"),c=0;c')):(this.logger&&this.logger.info("Adding unfriendly iframe in async mode, url: "+a),b=document.createElement("iframe"),b.setAttribute("src",a),b.style.display="none",b.onload=c,EBG.Semi.Infra.addChildToPage(b))}; EBG.Semi.Infra.getTopLevelReferrer=function(a){var b=null;try{if(a.top&&a.top.document&&a.top.document.referrer)b=a.top.document.referrer.toString();else throw Error("Unfriendly iframe");}catch(c){this.isDefined(a)&&a.document&&a.document.referrer&&(b=a.document.referrer.toString())}return b};EBG.Semi.Infra.getTokenValueFromURL=function(a,b){var c=b.indexOf("?")?b.split("?")[1]:"";if(c)for(var c=c.split("&"),d=0;da)return!0}return!1}; EBG.Semi.Infra.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"null"; else if("function"==b&&"undefined"==typeof a.call)return"object";return b};EBG.Semi.declareNamespace=EBG.Semi.Infra.declareNamespace;EBG.Semi.declareNamespace("Logging");EBG.Semi.Logging.Logger=function(a){this._level=a;this.startNestingGroupNames=[];this.endNestingGroupNames=[]};EBG.Semi.Logging.Logger.DebugMode="mmdebug";EBG.Semi.Logging.Logger.LoggerLevels={NONE:0,ERROR:1,INFO:2,WARN:3,DEBUG:4}; EBG.Semi.Logging.Logger.prototype={setLevel:function(a){this._level=a},timestamp:!1,debug:function(a){this._reportToLog(EBG.Semi.Logging.Logger.LoggerLevels.DEBUG,arguments)},info:function(a){this._reportToLog(EBG.Semi.Logging.Logger.LoggerLevels.INFO,arguments)},warn:function(a){this._reportToLog(EBG.Semi.Logging.Logger.LoggerLevels.WARN,arguments)},error:function(a){this._reportToLog(EBG.Semi.Logging.Logger.LoggerLevels.ERROR,arguments)},exception:function(a,b){var c="string"!==b?this._format("Exception in {0}. message: {1}", a,b.message):this._format("Exception in: {0}. message: {1}",a,b);b.stack&&(c+=this._format(" stack: {0}",b.stack));this._reportToLog(EBG.Semi.Logging.Logger.LoggerLevels.ERROR,[c])},startGroup:function(a){this._supportNesting()&&this.startNestingGroupNames.push(a)},endGroup:function(){this._supportNesting()&&0=a&&this._consoleAvailable()){var c=b[0];"[object String]"!==Object.prototype.toString.call(c)?this._supportObjectView()||(c=c.toString()):c=this._format.apply(null,b);this.timestamp&&"[object String]"===Object.prototype.toString.call(c)&&(c=this._getTimestamp()+": "+c);if(void 0===window.opera){for(;this.startNestingGroupNames.length;)window.console.group(this.startNestingGroupNames[0]),this.endNestingGroupNames.push(this.startNestingGroupNames.shift()); this._callConsoleFunction(a,c)}else opera.postError(c)}}};EBG.Semi.Events=EBG.Semi.Events||{};EBG.Semi.Events.EventManager=function(){}; EBG.Semi.Events.EventManager.prototype={_subscriptions:{},subscribeToEvent:function(a,b,c,d){this._subscriptions[a]||(this._subscriptions[a]={});this._subscriptions[a][d]||(this._subscriptions[a][d]=[]);d&&this._subscriptions[a][d].push({callback:b,bindingCallback:c})},dispatchEvent:function(a,b,c){if(c)for(var d=this._subscriptions[a][c],e=0;ea&&(c=b-a,d-=this._images[0].bytes);this.speed=Math.round(8*(d/(c/1E3)/1024))*this._adjustment;if(Infinity==this.speed||this.speed>=this._maxSpeed)this.speed=this._maxSpeed;else{for(a=0;athis._tuneResults[a][0];a++);this.speed=Math.min(this._maxSpeed,Math.round(this.speed*this._tuneResults[a][1]))}this.checked=!0;gEBMainWindow.EBP.BW= gEBMainWindow.EBP.BW?gEBMainWindow.EBP.BW:{};gEBMainWindow.EBP.BW.speed=this.speed;gEBMainWindow.EBP.BW.checked=this.checked;this.checking=!1;this._dispatchEvent()},init:function(){this.checking=!0;this._loadImage(0);this._loadImage(1);this._loadImage(2);var a=this;setTimeout(function(){if(!a.checked)a.speed=56,a.checked=!0,a.checking=!1,gEBMainWindow.EBP.BW=gEBMainWindow.EBP.BW?gEBMainWindow.EBP.BW:{},gEBMainWindow.EBP.BW.speed=a.speed,gEBMainWindow.EBP.BW.checked=a.checked,a._dispatchEvent()},5E3)}}; EBG.BWDetection=EBG.Semi.BandWidthDetection;EBGUIP="undefined"!=typeof EBGUIP?EBGUIP:{};EBGUIP.Events=EBGUIP.Events||{};EBGUIP.Events.EventName={USER_ID_FOUND:"userIdFound",DOC_LOADED:"documentLoaded",EBUID_LOADED:"ebuidLoaded"};EBGUIP.Events.eventMgr=EBGUIP.Events.eventMgr||new EBG.Semi.Events.EventManager;EBGUIP="undefined"!=typeof EBGUIP?EBGUIP:{}; EBGUIP.UserIdProvider=function(){if("undefined"!=typeof gEBMainWindow&&gEBMainWindow.providersData)this._providersData=gEBMainWindow.providersData;else if("undefined"!=typeof gEBMainWindow)this._providersData={AdTruth:{data:null,providerCalled:!1},EBUidCache:{data:null,providerCalled:!1},Device9:{data:null,providerCalled:!1},SizmekDI:{data:null,providerCalled:!1}},gEBMainWindow.providersData=this._providersData}; EBGUIP.UserIdProvider.prototype={_filter:null,_currTagData:null,_arrProvidersNamesUsed:null,_providersEnum:["AdTruth","EBUidCache","Device9","SizmekDI"],_providers:{AdTruth:{isUsed:!1,shouldSendData:!0},EBUidCache:{isUsed:!1,shouldSendData:!0},Device9:{isUsed:!1,shouldSendData:!1},SizmekDI:{isUsed:!1,shouldSendData:!0}},_providersData:null,getUserIds:function(a){this._filter=a.filter;this._init();this._currTagData=a;if(!this._currTagData.currDoc)this._currTagData.currDoc=document;this._arrProvidersNamesUsed= this._getValidProviderNames(a.uip);for(a=0;athis.numTries&&this.initServerReq();EBP.log.endGroup()}catch(c){EBP.log.exception("DownloadManager.initServerReq",c)}},loadServerRequest:function(){var a=EBP.ebTags[0];if(this.ebSync.loadingCustomScript){EBP.log.debug("DownloadManager.initServerReq - Currently loading custom script"); var b=this;this._customScriptServerRequestCallBack=function(){try{b.initServerReq()}catch(a){EBP.log.exception("DownloadManager._customScriptServerRequestCallBack",a)}}}else if(a.uip&&0<\/script>"))}, setCurrTag:function(a){var b=EBP.Light.Infra.getRandomNumber();a.ebRand=b;a.partialRequest+="&rand="+b;a.bandWidth&&gEBMainWindow.EBP.BW&&gEBMainWindow.EBP.BW.checked&&56!=gEBMainWindow.EBP.BW.speed&&(a.partialRequest+="&BWVal="+(a.bwMult?a.bwMult*gEBMainWindow.EBP.BW.speed:gEBMainWindow.EBP.BW.speed)+"&BWDate=0");if(gEBMainWindow.EBservingMode&&gEBMainWindow.EBservingMode===EBG.Semi.ServingState.unfriendlyIframe)a.partialRequest=a.partialRequest.replace("ifrm=2","ifrm=1");a.partialRequest+="&secCall=1"; b="ebRD_"+a.placementId+"_"+a.ebRDRand;gEBMainWindow.ebRDGlobal&&gEBMainWindow.ebRDGlobal[b]&&(a.partialRequest+="&ebRD="+encodeURIComponent(JSON.stringify(gEBMainWindow.ebRDGlobal[b])));a.collectURL?(a.partialRequest+="&vurl="+this.getVerificationUrl(a),a.partialRequest+=a.ExtractMethod?"&vurlem="+a.ExtractMethod:""):a.vurl&&(a.partialRequest+="&vurlem="+EBPreServing.ExtractMethod.PUBLISHER);a.userIds&&""!=a.userIds&&(a.partialRequest+=a.userIds)},handleBandwidthDetection:function(a){var b=!1;if(!window.EBP.ebBW)EBP.log.debug("DownloadManager.initServerReq - Create bandWidthDetector object (ebBW)"), window.EBP.ebBW=new EBG.Semi.BandWidthDetection;if(gEBMainWindow.EBP&&gEBMainWindow.EBP.BW&&gEBMainWindow.EBP.BW.checked)return b;if(!window.EBP.ebBW.checked&&!window.EBP.ebBW.checking){b="https:"==a.currDoc.location.protocol?"https://":"http://";a.ebPtcl="undefined"==typeof a.ebPtcl?b:a.ebPtcl;window.EBP.ebBW.initImages(a.ebPtcl,a.sms);var c=this;window.EBP.ebBW.addListener(function(){c.initServerReq()});EBP.log.debug("DownloadManager.initServerReq - Start Band Width detection");window.EBP.ebBW.init(); b=!0}else window.EBP.ebBW.checking&&(EBP.log.debug("DownloadManager.initServerReq - Still detecting Band Width"),b=!0);return b},handleAsyncTag:function(a){this.ebSync.divId=a.containerId;EBP.log.debug("DownloadManager.initServerReq - Send Server Request");this._customScriptServerRequestCallBack=null;this.ebSync.donwloadServerReq=!0;var b={};b.currDoc=a.currDoc?a.currDoc:document;b.containerId=a.containerId;var c=this;this.scriptTag(a.partialRequest,function(){c.ebSync.donwloadServerReq=!1;c.initServerReq()}, b)},handleSyncTag:function(a){var b=this.setIfrmInRequest(a.partialRequest);if(b!==a.partialRequest&&b.length>a.partialRequest.length)a.partialRequest=b;b=EBP.Light.Infra.createFriendlyIframe(a.currDoc,a.ebRand,a.width,a.height);a.onLoadHandled=!1;var c={iframeContainer:b,myIfrmSrc:"