var com = window.com || {}; if(!window.com){ window.com = com; }; try{ }catch(e){debugger;} var adtechAdConfig = { "canvasId": 424787, "liveStatsEnabled": false, "servicesUrl": "", "dynamic": false, "templateId": 415608, "productFamilyId": 0, "formatId": 16, "servicesHosts": { "http": "", "https": "", "post": "" }, "adServerVars": { "uid": "1586281083838", "id": "424787", "bannerId": "_ADBNID_", "bannerUid": "_ADBNUID_", "networkId": "_ADNETID_", "subNetworkId": "_ADSUBNETID_", "creativeId": "0", "pageId": "_ADFC_PAGEID_", "placementId": "_ADCUID_", "adSize": "_ADFC_ADSIZE_", "servingProto": "https", "servingHost": "localhost", "sequenceId32": "_ADREFSEQUENCEID32_", "sequenceId64": "_ADREFSEQUENCEID64_", "secureAssetHost": "https:\/\/richmedia.cdnservices.net\/adtech\/assets\/88e1399183dcc0ead0571a18d312ca91\/", "configBaseURL": "https:\/\/richmedia.cdnservices.net\/adtech\/assets\/88e1399183dcc0ead0571a18d312ca91\/", "assetBaseURL": "https:\/\/richmedia.cdnservices.net\/adtech\/assets\/88e1399183dcc0ead0571a18d312ca91\/", "baseURL": "https:\/\/richmedia.cdnservices.net\/adtech\/assets\/88e1399183dcc0ead0571a18d312ca91\/", "viewCounter": "", "campaignId": "_ADMCID_", "publisherId": "_ADWEBSITEID_", "externalId": "" }, "geoData": { "area": "_ADAREATEXT_", "city": "Amsterdam", "country": "_ADCOUNTRYTEXT_", "state": "Noord-Holland", "zip": "_ADZIPTEXT_" }, "tagVars": [], "preview": true, "pubVars": { "clickPixel": "", "iframeBusterPath": "", "clickRedirect": "", "overflowFixLevel": "0", "viewCountUrl": "", "overrideX": "", "overrideY": "", "closeTimeout": "0" }, "regs": { "gdpr": { "applies": "_ADGDPR_", "consent": "_ADCONSENT_" }, "ccpa": { "privacy": "_ADUSPRIVACY_" } }, "DeliveryServerTag": { "source": "_ADDCP(tag.srvsrc)_", "lineId": "_ADDCP(tag.srvlid)_", "creativeId": "_ADDCP(tag.srvcid)_", "variables": "_ADDCP(tag.vars:{})_" }, "clickRedirect": "", "assetContainers": { "main": { "type": "inlineDiv", "width": 1, "height": 1, "contentWidth": 1, "contentHeight": 1, "contentWidthUnit": "px", "contentHeightUnit": "px", "xRel": "adSlotLeft", "yRel": "adSlotTop", "x": 0, "y": 0, "renderEvent": "serve", "content": "index.html", "contentType": "html", "zIndex": 27001, "wmode": "opaque", "pluginVersion": 0, "contractedY": 0, "contractedX": 0, "contractedWidth": 1, "contractedHeight": 1, "isExpandable": true, "startContracted": true, "stickyX": false, "stickyY": false, "pushesContent": false, "expandAnimationDuration": 0, "contractAnimationDuration": 0, "closeTimeout": 0, "modal": false, "sequence": 1, "iframeBuster": "", "langVersion": 0 }, "floating": { "type": "floatingDiv", "width": 1, "height": 1, "contentWidth": 1, "contentHeight": 1, "contentWidthUnit": "px", "contentHeightUnit": "px", "xRel": "adSlotLeft", "yRel": "adSlotTop", "x": -100, "y": 100, "renderEvent": "serve", "content": "index2.html", "contentType": "html", "zIndex": 27002, "wmode": "transparent", "pluginVersion": 0, "contractedY": 0, "contractedX": 0, "contractedWidth": 1, "contractedHeight": 1, "isExpandable": true, "startContracted": true, "stickyX": false, "stickyY": false, "pushesContent": false, "expandAnimationDuration": 0, "contractAnimationDuration": 0, "closeTimeout": 0, "modal": false, "sequence": 1, "langVersion": 0 } }, "clickthroughs": { "default": { "id": 2579, "plid": "19820fb2c1c5cecacd4528a5bad3aa93", "dest": "https:\/\/www.adsolutions.com\/rich-media-gallery\/", "target": "_blank", "features": "" }, "backupImageClickthrough": { "id": 7703, "plid": "4d2c2cef5973417f3f03adc213a06d6d", "dest": "https:\/\/www.adsolutions.com\/rich-media-gallery\/", "target": "_blank", "features": "" }, "main": { "id": 16547, "plid": "37f1f67addb076058db521478e783928", "dest": "https:\/\/www.adsolutions.com\/rich-media-gallery\/", "target": "_blank", "features": "" } }, "contentVariables": { "Backup Alt Text": "Amex advertisement", "QRUrl": "" }, "contentProperties": { "initiallyStatic": false, "slotHeight": 520, "Backup image file": "", "Backup image clickthrough": "" }, "adrConfig": { "eventEndpoint": "https:\/\/delivery.adnuntius.com\/u?rt={{{rt}}}" }, "dataFeeds": [], "screenGrabs": [], "polls": [], "assets": [ { "id": "main", "name": "index.html", "url": "index.html" }, { "id": null, "name": "customAd.js", "url": "customAd.js" }, { "id": null, "name": "1x1.gif", "url": "1x1.gif" }, { "id": null, "name": "background.jpg", "url": "background.jpg" }, { "id": null, "name": "style.css", "url": "style.css" }, { "id": null, "name": "background_.jpg", "url": "background_.jpg" }, { "id": "main", "name": "index2.html", "url": "index2.html" }, { "id": null, "name": "logo_large.png", "url": "logo_large.png" }, { "id": null, "name": "hln.jpg", "url": "hln.jpg" } ], "events": [ { "id": 0, "plid": "850415b95f929ae311dc1d1d3f7f2bec", "name": "engagement", "cumulative": false, "interaction": true, "custom": false, "video": false, "isLoggable": true }, { "id": 0, "plid": "c35dcf63748b2faf210d23745a8726b4", "name": "interactiveImpression", "cumulative": false, "interaction": false, "custom": false, "video": false, "isLoggable": true }, { "id": 0, "plid": "c9f6fe2c78d93485fb24a1ef9bf6c7ef", "name": "viewableImpression", "cumulative": false, "interaction": false, "custom": false, "video": false, "isLoggable": true }, { "id": 0, "plid": "49fcf58513758b38fec25dcf95efa15d", "name": "indeterminableViewability", "cumulative": false, "interaction": false, "custom": false, "video": false, "isLoggable": true }, { "id": 0, "plid": "7f0b290802215582ce37ccee46549ad7", "name": "expand", "cumulative": true, "interaction": true, "custom": true, "video": false, "isLoggable": true }, { "id": 0, "plid": "96875f3fdd120a3a4d8905fc30b4649e", "name": "autoExpand", "cumulative": true, "interaction": false, "custom": true, "video": false, "isLoggable": true }, { "id": 0, "plid": "a61ed805bc03915a171c015f73358756", "name": "contract", "cumulative": true, "interaction": false, "custom": true, "video": false, "isLoggable": true }, { "id": 0, "plid": "c10258071c4eeb2cfe7888cdddf2c3e7", "name": "close", "cumulative": true, "interaction": false, "custom": true, "video": false, "isLoggable": true }, { "id": 0, "plid": "8d950c792a94bcfbb7bc6d9005b32410", "name": "show", "cumulative": true, "interaction": true, "custom": true, "video": false, "isLoggable": true }, { "id": 0, "plid": "0f29323080961ce49eed7c51eb377464", "name": "hide", "cumulative": true, "interaction": false, "custom": true, "video": false, "isLoggable": true }, { "id": 0, "plid": "86085c297e6923af029c92bd378e157f", "name": "reload", "cumulative": true, "interaction": true, "custom": true, "video": false, "isLoggable": true }, { "id": 0, "plid": "a0ec400fd7bfbb0234529c78e0d88f13", "name": "backupView", "cumulative": false, "interaction": false, "custom": false, "video": false, "isLoggable": true }, { "id": 0, "plid": "8afd9cf75017beeb04259947c2f58b45", "name": "backupViewableImpression", "cumulative": false, "interaction": false, "custom": false, "video": false, "isLoggable": true }, { "id": 0, "plid": "3259edcfc16006f28dc895ed8336d54e", "name": "allMostInScrollPosition", "cumulative": true, "interaction": false, "custom": true, "video": false, "isLoggable": true }, { "id": 0, "plid": "60e9b6005ed9c13420635a17533fbb68", "name": "inScrollPosition", "cumulative": true, "interaction": false, "custom": true, "video": false, "isLoggable": true }, { "id": 0, "plid": "212c5144d6f1d8401e6429f940a1a1c8", "name": "scrolling", "cumulative": true, "interaction": false, "custom": true, "video": false, "isLoggable": true }, { "id": 0, "plid": "ec86cc7ed30fe8aae01b3f933ed8a809", "name": "outOffScrollPosition", "cumulative": true, "interaction": false, "custom": true, "video": false, "isLoggable": true }, { "id": 0, "plid": "186f9f929481f4f7b7e4ea9440eda05f", "name": "partlyInView", "cumulative": true, "interaction": false, "custom": true, "video": false, "isLoggable": true }, { "id": 0, "plid": "cb973f7e98a664cc835a2caf5fbd2877", "name": "notPlaceraHomePage", "cumulative": true, "interaction": false, "custom": true, "video": false, "isLoggable": true } ], "timers": [ { "id": 0, "plid": "9e2cc5168834ac4024fd04d15301dd7d", "name": "displayTimer" }, { "id": 0, "plid": "a292c5fb89ef5b03a9fcdb861d430814", "name": "viewTimer" }, { "id": 0, "plid": "4156b82ad1b06efe75b026c5b9c8c361", "name": "engagementTimer" }, { "id": 0, "plid": "ac893edcdd42b26a64ce4d4ef9967b16", "name": "interactionTimer" } ], "eventHandlers": [ { "name": "close", "target": "floating", "source": "*", "action": "close" }, { "name": "show", "target": "floating", "source": "*", "action": "show" }, { "name": "contract", "target": "floating", "source": "*", "action": "contract" }, { "name": "hide", "target": "floating", "source": "*", "action": "hide" }, { "name": "reload", "target": "floating", "source": "*", "action": "reload" }, { "name": "expand", "target": "main", "source": "*", "action": "expand" }, { "name": "autoExpand", "target": "main", "source": "*", "action": "expand" }, { "name": "contract", "target": "main", "source": "*", "action": "contract" } ], "thirdPartyTracking": [ { "id": 1, "type": "1_PIXEL", "url": "https:\/\/delivery.adnuntius.com\/u?rt={{{rt}}}&customType=19820fb2c1c5cecacd4528a5bad3aa93", "secureUrl": "https:\/\/delivery.adnuntius.com\/u?rt={{{rt}}}&customType=19820fb2c1c5cecacd4528a5bad3aa93", "onEvent": "SPECIFIC_CLICK", "eventName": "default" }, { "id": 2, "type": "1_PIXEL", "url": "https:\/\/delivery.adnuntius.com\/u?rt={{{rt}}}&customType=4d2c2cef5973417f3f03adc213a06d6d", "secureUrl": "https:\/\/delivery.adnuntius.com\/u?rt={{{rt}}}&customType=4d2c2cef5973417f3f03adc213a06d6d", "onEvent": "SPECIFIC_CLICK", "eventName": "backupImageClickthrough" }, { "id": 3, "type": "1_PIXEL", "url": "https:\/\/delivery.adnuntius.com\/u?rt={{{rt}}}&customType=37f1f67addb076058db521478e783928", "secureUrl": "https:\/\/delivery.adnuntius.com\/u?rt={{{rt}}}&customType=37f1f67addb076058db521478e783928", "onEvent": "SPECIFIC_CLICK", "eventName": "main" }, { "id": 4, "type": "1_PIXEL", "url": "", "secureUrl": "", "onEvent": "SPECIFIC_EVENT", "eventName": "viewableImpression" } ], "contentHubConfig": { "mapping": [], "assets": [] }, "fallback": "1x1.gif", "defaultClick": "main" }; /*debugger;*/ if(window.adtechAdConfig){ if(window.adtechAdConfig.clickthroughs && window.adtechAdConfig.clickthroughs["main"] && window.adtechAdConfig.clickthroughs["main"].dest && window.adtechAdConfig.clickthroughs["main"].dest.length>0){ for(var i in window.adtechAdConfig.clickthroughs){ if(i == "main"){ continue; } if(window.adtechAdConfig.clickthroughs[i].dest.length == ""){ window.adtechAdConfig.clickthroughs[i].dest = window.adtechAdConfig.clickthroughs["main"].dest; } } } }; //document.write(''); /*mraid = { getState:function() { return 'ready'; }, getCurrentPosition:function() { return { x:parent.document.body.scrollLeft, y:parent.document.body.scrollTop }; }, getMaxSize:function() { return { width: 320, height: 600 }; }, getScreenSize:function() { return { width: 320, height: 480 }; } }; /** * Boilerplate code required to hook into the ADTECH rich media library. * * For API documentation, please contact canvas-help@adtech.com */ if(false){ ADTECH.event('close'); ADTECH.event('updatePercentage'); ADTECH.event('inviewPercentage'); ADTECH.getContent('initiallyStatic',false); ADTECH.getContent('slotHeight','0'); } adtechAdConfig.assetContainers.main.isExpandable = true;//to bust iframe adtechAdConfig.adServerVars.campFCInfo = "0"; if(adtechAdConfig.assetContainers.floating){ adtechAdConfig.assetContainers.floating.origRenderEvent = adtechAdConfig.assetContainers.floating.renderEvent; adtechAdConfig.assetContainers.floating.renderEvent = ""; } (function(adConfig) { var requiresBreakout = false; if (!adConfig.overrides || adConfig.overrides.displayWindowTarget != self) { for (var id in adConfig.assetContainers) { if (adConfig.assetContainers.hasOwnProperty(id)) { var container = adConfig.assetContainers[id]; if (container.type != 'inlineDiv' || container.isExpandable) { requiresBreakout = true; break; } } } } if (adConfig.overrides && adConfig.overrides.displayWindowTarget) { var displayWindowTarget = adConfig.overrides.displayWindowTarget; displayWindowTarget = (typeof adtechIframeHashArray != 'undefined' && self != top) ? displayWindowTarget.parent : displayWindowTarget; } else { var calculatedTarget = null; var currentWindow = parent; while (currentWindow != undefined) { try { var targetDoc = currentWindow.document; if (targetDoc) { calculatedTarget = currentWindow; } } catch(e) {} currentWindow = (currentWindow == top) ? null : currentWindow.parent; } var displayWindowTarget = calculatedTarget || top; } var targetIsFriendly = false; try { var targetDoc = displayWindowTarget.document; if (targetDoc) { targetIsFriendly = true; } } catch(e) {} var targetWindow = (requiresBreakout && (self != top && targetIsFriendly)) ? displayWindowTarget : self; targetWindow.com = targetWindow.com || {}; targetWindow.com.adtech = targetWindow.com.adtech || {}; targetWindow.com.adtech.AdtechCustomAd$AD_ID$ = function() { // Custom code class constructor. }; var win = targetWindow; var doc = win.document; var animSF = (win.requestAnimationFrame || win.webkitRequestAnimationFrame || win.mozRequestAnimationFrame || win.msRequestAnimationFrame || function(cb){setTimeout(cb,16);}); !(function(){ var tmoId = setTimeout(function(){ animSF=function(cb){setTimeout(cb,16);}; },50); animSF(function(){ clearTimeout(tmoId); }); })(); var isS = function(v){ if(typeof(v) != 'undefined' && v != null) return true; return false; } var getComputedStyle = function(el, cssprop,doc){ try{ if (document.defaultView && document.defaultView.getComputedStyle) return document.defaultView.getComputedStyle(el, "")[cssprop] else if (el.currentStyle) //IE return el.currentStyle[cssprop] }catch(e){ } return el.style[cssprop] } function Policies(){ this.policies = []; this.cachePolicy = null; this.defaultPolicy = {}; } !function(){ var pt = Policies.prototype; pt.addPolicy = function(pol){ pol.$owner = this; this.policies.push(pol); } pt.resolvePolicy = function(domain,prop){ if(arguments.length == 1 && isS(this.cachePolicy)){ return this.cachePolicy; } if(arguments.length == 1 || !prop) prop = 'domain'; for(var i=0;i0) animSF(arguments.callee); }); }, pageLoadHandler: function() { // The page has now loaded. Feel free to display an awesome advert. }, pageResizeHandler:function(){ if (this.closed) return; var dims = this.getViewportDims(); var dims2 = {}; for (var i in dims) { dims2[i] = dims[i]; } if (this.slotHeight != 0) { dims.h = this.slotHeight; } //this.container.style.width = dims.w+'px'; this.container.anchorDiv.style.minWidth = dims.w + 'px'; this.container.anchorDiv.style.height = this.slotHeight + 'px'; //dims.h+'px'; this.container.anchorDiv.style.minHeight = this.slotHeight + 'px'; this.container.anchorDiv.style.zIndex = 1; //this.container.anchorDiv.style.border = '1px solid green'; var pos; if (this.container.anchorDiv.getBoundingClientRect) { var tmpPos = this.container.anchorDiv.getBoundingClientRect(); var off = this.getPageOffsets(); pos = { x: tmpPos.left + off.x, y: tmpPos.top + off.y }; } else { pos = this.utils.calculateAbsolutePosition(this.container.anchorDiv); } /*var par = this.container.anchorDiv.parentNode; while(par){ if(par.style){ var pad = parseFloat(getComputedStyle(par,'paddingLeft')); var mar = parseFloat(getComputedStyle(par,'marginLeft')); if(!isNaN(mar)){ pad += mar; } if(!isNaN(pad)){ pos.x += pad; } } par = par.parentNode; }*/ //need policies //pos.x -= 15; this.callPolicies('processDims', [this, pos, dims]); this.abs = pos; this.abs.y -= this.getYOffset(); var changed = (!this.dims) ? true : false; for (var i in this.dims) { if (this.dims[i] != dims[i]) { changed = true; break; } } if (changed) { this.dims = dims; this.container.div.style.width = dims.w + 'px'; this.container.div.style.height = dims.h + 'px'; this.container.div.style.left = (-pos.x) + 'px'; this.container.div.style.right = 'auto'; this.container.div.style.top = '0px'; //this.container.anchorDiv.style.overflow = 'hidden'; //this.container.anchorDiv.style.zIndex = 0xFFFFFFFF; this.container.anchorDiv.style.zIndex = 1; if (this.container.content.contentObject.clientWidth > 0) { if (this.header) this.header.style.minWidth = this.container.content.contentObject.clientWidth + 'px'; if (this.footer) this.footer.style.minWidth = this.container.content.contentObject.clientWidth + 'px'; } this.container.div.style.position = 'absolute'; //this.container.div.style.clip = 'rect(auto, auto, auto, auto)'; //this.container.div.style.clip = 'rect(0px, '+dims.w+'px'+', '+(dims.h)+'px'+', '+(-pos.x)+'px'+')'; this.container.div.style.overflow = 'hidden'; //this.container.div.style.border = '1px solid black'; this.container.div.style.transfrom = 'translateZ(0)'; this.container.div.style.clipPath = 'inset(0px)'; //debugger; this.container.div.style.clip = 'rect(0px, ' + (dims.w) + 'px' + ', ' + (dims.h) + 'px' + ', ' + (-pos.x) + 'px' + ')'; //this.clickDiv.style.left = -pos.x+'px'; var absPos = this.utils.calculateAbsolutePosition(this.container.div); this.container.content.containerObject2.style.width = dims2.w + 'px'; this.container.content.containerObject2.style.height = (dims2.h+2)+'px'; //(absPos.y + this.slotHeight) + 'px'; // this.container.content.containerObject2.style.position = 'fixed'; //this.container.content.contentObject.style.position = 'absolute'; this.container.content.containerObject2.style.top = '1px'; //this.container.content.containerObject2.style.left = absPos.x+'px'; //this.container.content.contentObject.style.zIndex = 1; this.container.content.containerObject2.style.transfrom = 'translateZ(0)'; //this.container.content.contentObject.style.display = 'none'; this.container.content.containerObject.style.position = 'absolute'; this.container.content.containerObject.style.left = '0px'; this.container.content.containerObject.style.right = '0px'; this.container.content.containerObject.style.top = '0px'; this.container.content.containerObject.style.bottom = '0px'; this.container.content.containerObject.style.overflow = 'hidden'; this.container.content.containerObject2.style.webkitTransform = 'translate3d(0,0,0)'; this.container.content.containerObject2.style.transform = 'translate3d(0,0,0)'; this.container.content.containerObject2.style.msTransform = 'translate3d(0,0,0)'; this.container.content.contentObject.style.width = dims2.w + 'px'; this.container.content.contentObject.style.height = (dims2.h+2)+'px'; //(absPos.y + this.slotHeight) + 'px'; // if (this.layer && this.layer.div) { this.layer.div.style.width = dims2.w + 'px'; var t = this; var x = 0; ! function() { if (t.footer.clientHeight == 0 && x <= 25) { setTimeout(arguments.callee, 100); x += 1; } else { t.layer.div.style.height = (dims.h - (t.footer.clientHeight + t.header.clientHeight)) + 'px'; t.layer.div.style.top = t.header.clientHeight + 'px'; t.layer.div.style.left = -pos.x + 'px'; } }(); } else { } } this.callPolicies('pageResize'); }, pageScrollHandler:function(){ if(this.closed) return; /*requestAnimationFrame(function(){ var off = this.utils.getPageOffsets(); this.div.style.top = off.y+'px'; this.container.content.contentObject.style.top = ((off.y-this.abs.y))+'px'; }.bind(this));*/ ////console.log('scroll'); if(this.cancelHandle){ this.cancelHandle = false; return; } this.isScrolling = true; /*if(!this.isAutoScrolling && this.isUnLocked){ //this.clearAni(); }*/ var sdim = this.getViewportDims(); var off = this.getPageOffsets(); this.lastOff = this.off; this.off = off; var relOff = off.y-this.abs.y; var relOffA = Math.abs(relOff); var elmTop = this.abs.y; var elmBottom = this.abs.y+this.container.div.clientHeight; var windowTop = off.y; var windowBottom = windowTop+sdim.h; var totalHeight = Math.max(elmBottom, windowBottom) - Math.min(elmTop, windowTop); var wComp = totalHeight - sdim.h; var elementPx = this.container.div.clientHeight - wComp; var elementPercentage = Math.min(Math.max(0,((elementPx)/this.container.div.clientHeight)*100),100) if(elementPercentage > 50){ this.container.dispatchInViewportEvent(); }else{ this.container.dispatchOutViewportEvent(); } this.advert.eventBus.dispatchEvent(new this.richMediaEvent('updatePercentage').property('perc', off)); this.advert.eventBus.dispatchEvent(new this.richMediaEvent('inviewPercentage').property('adPerc', elementPercentage).property('fromTop',this.container.div.getBoundingClientRect().y<0)); if(this.container.content.containerObject2.style.position != 'fixed') this.container.content.containerObject2.style.position = 'fixed'; clearTimeout(this.stopScrlTmo); this.stopScrlTmo = setTimeout(this.utils.createClosure(this,function(){ this.pageResizeHandler(); this.stoppedScrolling(); }),230); this.pageResizeHandler(); if(relOffA<260){ /*if(off.y>this.abs.y && this.off.y>this.lastOff.y){ this.container.div.style.top = (relOff)+'px'; this.container.div.style.height = (this.dims.h+(relOffA))+'px'; }else if(off.ythis.abs.y+relOffA+this.dims.h){ ////console.log("reset"); //this.container.div.style.top = '0px'; //this.container.div.style.height = (this.dims.h)+'px'; } this.callPolicies('pageScroll'); var browser = window.navigator.userAgent; var msie = browser.indexOf('MSIE '); var trident = browser.indexOf('Trident/'); var edge = browser.indexOf('Edge/'); var t=this; if(msie > 0 || trident > 0 || edge > 0){ t.container.content.containerObject.style.cssText += ';transform:rotateZ(0deg)' t.container.content.containerObject.offsetHeight t.container.content.containerObject.style.cssText += ';transform:none' this.container.content.containerObject.style.cssText += ';transform:rotateZ(0deg)' this.container.content.containerObject.offsetHeight this.container.content.containerObject.style.cssText += ';transform:none' setTimeout(function(){ t.container.content.containerObject.style.cssText += ';transform:rotateZ(0deg)' t.container.content.containerObject.offsetHeight t.container.content.containerObject.style.cssText += ';transform:none' }(),4000) } }, stoppedScrolling:function(){ if(this.closed) return; this.isScrolling = false; var off = this.getPageOffsets(); var sdim = this.getViewportDims(); var relOff = off.y-this.abs.y; ////console.log(relOff+' '+off.y+' '+this.abs.y); var relOffA = Math.abs(relOff); if(relOffA<150){ this.advert.eventBus.dispatchEvent('allMostInScrollPosition'); clearTimeout(this.scrollAniTmo); if(((this.abs.y<150 && off.y>150) || this.abs.y>=150)){ this.scrollSpeed = relOffA*.13; this.isAutoScrolling = true; this.scrollAniTmo = setTimeout(this.utils.createClosure(this,function(){this.handleScrollAni()}),20); this.isInScrollPosition = true; clearTimeout(this.inScrollTmo); }else{ if((sdim.h-relOffA)/sdim.h>.99){ this.advert.eventBus.dispatchEvent('inScrollPosition'); this.beenInScrollPosition = true; if(this.advert.getContent('initiallyStatic')){ this.container.content.containerObject2.style.position = 'fixed'; } } } }else if(relOffA/2<=sdim.h*.6){ this.advert.eventBus.dispatchEvent(new this.richMediaEvent('partlyInView').property('perc',(sdim.h-relOffA)/sdim.h).property("fromTop",relOff<0)); this.inScrollTmo = setTimeout(this.utils.createClosure(this,function(){this.isInScrollPosition = false;}),15); }else{ this.advert.eventBus.dispatchEvent('outOffScrollPosition'); this.inScrollTmo = setTimeout(this.utils.createClosure(this,function(){this.isInScrollPosition = false;}),15); } this.callPolicies('stoppedScrolling'); }, handleScrollAni:function(){ var off = this.getPageOffsets(); var spd = Math.max(2.5,this.scrollSpeed); var relOff = off.y-this.abs.y; if(relOff>0){ spd*=-1; } var relOffA = Math.abs(relOff); if(relOffA>150){ return; } var res = off.y+spd; if(relOffA<=2){ res = this.abs.y; } if(relOff>0 && resthis.abs.y){ res = this.abs.y; } var del = this.utils.createClosure(this,function(){if(!this.callPolicies('updateScroll',[this, res])){win.scrollTo(0,res);}}); if(res != this.abs.y){ clearTimeout(this.scrollAniTmo); this.container.content.containerObject2.style.position = 'fixed'; this.scrollAniTmo = setTimeout(this.utils.createClosure(this,function(){this.handleScrollAni()}),20); }else{ this.advert.eventBus.dispatchEvent('inScrollPosition'); this.isInScrollPosition = true; this.beenInScrollPosition = true; //this.container.content.contentObject.style.position = 'absolute'; setTimeout(function(){del();animSF(del)},5); this.isAutoScrolling = false; } del(); this.scrollSpeed*=.95; this.callPolicies('handleScrollAni'); } }; targetWindow.adtechCallbackInstances = targetWindow.adtechCallbackInstances || []; var instanceIndex = targetWindow.adtechCallbackInstances.length; targetWindow.adtechCallbackInstances[instanceIndex] = new targetWindow.com.adtech.AdtechCustomAd$AD_ID$(); targetWindow.adtechAdCallbacks = targetWindow.adtechAdCallbacks || {}; targetWindow.adtechAdCallbacks[adConfig.adServerVars.uid] = targetWindow.adtechAdCallbacks[adConfig.adServerVars.uid] || []; targetWindow.adtechAdCallbacks[adConfig.adServerVars.uid].push( targetWindow.adtechCallbackInstances[instanceIndex]); })(adtechAdConfig); (function (D) { if (!D.initOverride) { var B = "https://richmedia.cdnservices.net/adtech/lib/"; var H = (D.mraidCompatible) ? "MRAID" : ""; var F = B + "adtechRichMediaLib" + H + "_3_3_0.js"; D.rmLibUrl = F; if (!window.adtechAdManager_3_3_0) { adtechAdQueue = window.adtechAdQueue || []; adtechAdQueue.push(D); if (!window.adtechAdManagerReqs || !window.adtechAdManagerReqs["3_3_0"]) { adtechAdManagerReqs = window.adtechAdManagerReqs || {}; adtechAdManagerReqs["3_3_0"] = true; var A = "scr"; document.write("<" + A + 'ipt type="text/javascript" src="' + F + '">"); } } else { adtechAdManager_3_3_0.registerAd(D); } } })(adtechAdConfig);