var __extends=(this&&this.__extends)||(function(){var aa=Object.setPrototypeOf||({__proto__:[]} instanceof Array&&function(d,b){d.__proto__=b;})||function(d,b){for(var p in b)if(b.hasOwnProperty(p))d[p]=b[p];};return function(d,b){aa(d,b);function __(){this.constructor=d;} d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __());};})();var VideoBase=(function(){function VideoBase(ba){this.muted=false;this.inViewState=undefined;this.inView=false;this.skipped=false;this.completed=false;this.customEventList={};this.inViewPlay=false;this.closed=false;this.inViewPlay=ba.inViewPlay;} VideoBase.prototype.addEvent=function(ca,da,ea,fa){if(ca.addEventListener){ca.addEventListener(da,ea,fa);} else if(ca.attachEvent){ca.attachEvent('on'+da,ea);}};VideoBase.prototype.removeEvent=function(e,n,o,u){if(e.removeEventListener){e.removeEventListener(n,o,u);} else if(e.detachEvent){e.detachEvent('on'+n,o);}};VideoBase.prototype.addCustomEventListener=function(ga,ha){if(this.customEventList[ga]){this.customEventList[ga].push(ha);} else{this.customEventList[ga]=[ha];}};VideoBase.prototype.dispatchCustomEvent=function(ia){if(this.customEventList[ia]){this.customEventList[ia].forEach(function(ja){ja();});}};VideoBase.prototype.init=function(){var ka=this;if(this.inViewPlay){this.checkInView();this.addEvent(window,'scroll',function(){ka.checkInView();},false);var la;if(typeof document.hidden!=="undefined"){this.documentHidden="hidden";la="visibilitychange";} else if(typeof document.mozHidden!=="undefined"){this.documentHidden="mozHidden";la="mozvisibilitychange";} else if(typeof document.msHidden!=="undefined"){this.documentHidden="msHidden";la="msvisibilitychange";} else if(typeof document.webkitHidden!=="undefined"){this.documentHidden="webkitHidden";la="webkitvisibilitychange";} this.addEvent(document,la,function(){ka.checkInView;},false);if(window.top!=window.self){this.isInView_iframe();}}};VideoBase.prototype.checkInView=function(){var ma=this;if(this.closed)return;var na=this.isInView(this.getVideoWrapper());if(this.inView!=na){this.inView=na;if(this.inView){this.play();} else{this.pause();}} setTimeout(function(){ma.checkInView();},200);};VideoBase.prototype.skip=function(){if(this.closed)return;this.pause();this.parent.innerHTML="";this.closed=true;this["delete"]();this.dispatchCustomEvent("skip");this.dispatchCustomEvent("closelinear");};VideoBase.prototype.setTrackEvents=function(oa){var pa=this;this.tracks=document.createElement('DIV');this.tracks.setAttribute('style','width:0px;height:0px;');this.getVideoWrapper().appendChild(this.tracks);oa.forEach(function(qa){switch(qa.type){case "creativeView":pa.sendEvent(qa.url);break;case "firstQuartile":var ra=function(){var sa=pa.getDuration()*0.25;if(pa.getCurrentTime()>=sa&&sa>=pa.getCurrentTime()-1){pa.removeEventListener("timeupdate",ra);pa.sendEvent(qa.url);}};pa.addEventListener("timeupdate",ra);break;case "midpoint":var ra=function(){var ta=pa.getDuration()*0.50;if(pa.getCurrentTime()>=ta&&ta>=pa.getCurrentTime()-1){pa.removeEventListener("timeupdate",ra);pa.sendEvent(qa.url);}};pa.addEventListener("timeupdate",ra);break;case "thirdQuartile":var ra=function(){var va=pa.getDuration()*0.75;if(pa.getCurrentTime()>=va&&va>=pa.getCurrentTime()-1){pa.removeEventListener("timeupdate",ra);pa.sendEvent(qa.url);}};pa.addEventListener("timeupdate",ra);break;case "complete":var ra=function(){pa.removeEventListener("ended",ra);if(!pa.skipped){pa.sendEvent(qa.url);pa.completed=true;}};pa.addEventListener("ended",ra);break;case "progress":var ra=function(){if(pa.getCurrentTime()>=qa.time&&qa.time>=pa.getCurrentTime()-1){pa.removeEventListener("timeupdate",ra);pa.sendEvent(qa.url);}};pa.addEventListener("timeupdate",ra);break;case "start":var ra=function(){pa.removeEventListener("play",ra);pa.sendEvent(qa.url);};pa.addEventListener("play",ra);break;case "resume":var ra=function(){pa.removeEventListener("play",ra);pa.addEventListener("play",function(){pa.sendEvent(qa.url);});};pa.addEventListener("play",ra);break;case "pause":pa.addEventListener("pause",function(){pa.sendEvent(qa.url);});break;case "fullscreen":case "expand":pa.addEventListener("beginfullscreen",function(){pa.sendEvent(qa.url);});break;case "exitFullscreen":case "collapse":pa.addEventListener("endfullscreen",function(){pa.sendEvent(qa.url);});break;case "mute":pa.addEventListener("volumechange",function(){if(pa.isMuted()&&!pa.muted){pa.muted=true;pa.sendEvent(qa.url);}});break;case "unmute":pa.addEventListener("volumechange",function(){if(!pa.isMuted()&&pa.muted){pa.muted=false;pa.sendEvent(qa.url);}});break;case "rewind":var wa=0,currentTime=0;pa.addEventListener("timeupdate",function(){wa=currentTime;currentTime=pa.getCurrentTime();if(currentTime1.0&&wa>0){pa.skipped=true;}});break;case "skip":pa.addCustomEventListener("skip",function(){if(!pa.completed){pa.sendEvent(qa.url);}});break;case "closeLinear":pa.addCustomEventListener("closelinear",function(){pa.sendEvent(qa.url);});break;}});};VideoBase.prototype.setImpressionEvents=function(xa){var ya=this;var za=function(){ya.removeEventListener("loadedmetadata",za);xa.forEach(function(Aa){ya.sendEvent(Aa);});};this.addEventListener("loadedmetadata",za);};VideoBase.prototype.setIcons=function(Ba){var Ca=this;Ba.forEach(function(Da){var Ea=document.createElement('DIV');Ea.setAttribute('style','position: absolute; display: none; width: '+Da.width+'px; height: '+Da.height+'px; z-index: 90000000; overflow: hidden');Ea.innerHTML=Da.html;var Fa=Ca.getIconPosition(Da,1);Ea.style[Fa.baseX]=Fa.x+'px';Ea.style[Fa.baseY]=Fa.y+'px';Ca.getVideoWrapper().appendChild(Ea);Ca.addEvent(Ea,"click",function(){Da.clickTracking.forEach(function(Ga){Ca.sendEvent(Ga);});},false);var Ha=Ca.parseTimeString(Da.offset);var Ia=Ha+Ca.parseTimeString(Da.duration);var Ja=false,lastState=false;var Ka=function(){var La=Ca.getCurrentTime();lastState=Ja;Ja=(La>=Ha&&La<=Ia);if(Ja!==lastState){if(Ja){Ea.style.display="block";while(Da.viewTracking.length>0){var Ma=Da.viewTracking.shift();Ca.sendEvent(Ma);}} else{Ea.style.display="none";}}};Ca.addEventListener("timeupdate",Ka);});};VideoBase.prototype.sendEvent=function(Na){var Oa=document.createElement("DIV");Na=Na.replace("[CACHEBUSTING]",String(10000000+Math.floor(Math.random()*89999999)));Oa.setAttribute("style","background-image:url("+Na+"); width:0px; height:0px;");this.tracks.appendChild(Oa);};VideoBase.prototype.getVisualViewportOffset=function(){var Pa=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop;var Qa=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft;return{top:Pa,left:Qa,bottom:Pa+window.innerHeight,right:Qa+window.innerWidth,height:window.innerHeight,width:window.innerWidth};};VideoBase.prototype.getVisualElementOffset=function(Ra){var Sa=document.documentElement.offsetTop+Ra.offsetTop;var Ta=document.documentElement.offsetLeft+Ra.offsetLeft;var Ua=Ra.offsetParent;while(Ua&&Ua.tagName.toLowerCase()!=='body'&&Ua.tagName.toLowerCase()!=='html'){Sa+=Ua.offsetTop;Ta+=Ua.offsetLeft;Ua=Ua.offsetParent;} return{top:Sa,left:Ta,bottom:Sa+Ra.offsetHeight,right:Ta+Ra.offsetWidth,height:Ra.offsetHeight,width:Ra.offsetWidth};};VideoBase.prototype.isInView=function(Va){if(document[this.documentHidden]){return false;} if(this.inViewState!==undefined){return this.inViewState;} var Wa=function(a,b,c){if(b=0.50;return ab;};VideoBase.prototype.isInView_iframe=function(){var bb=this;var ua=navigator.userAgent;if(window.IntersectionObserver!=undefined){var cb=document.createElement('div');cb.setAttribute('style','display:block;width:1px;height:1px;position:absolute;left:50%;top:50%;border:none;z-index:1000000;background-color:#FFF1');document.body.appendChild(cb);var db;var eb=new window.IntersectionObserver(function(fb,eb){bb.inViewState=fb[0].intersectionRatio>=0.5;},{threshold:0.5});eb.observe(cb);} else if((/iPhone OS (9|1[0-9])/.test(ua)||/iPad; CPU OS (9|1[0-9]) /.test(ua))&&/Safari\//.test(ua)){var gb=document.createElement('iframe');gb.setAttribute('style','width:1px;height:1px;position:absolute;left:50%;top:50%;border:none;z-index:10000000;background-color:#FFF1;');document.body.appendChild(gb);gb.contentWindow.document.open();gb.contentWindow.document.write('');gb.contentWindow.document.close();var hb=0;var ib;var jb=setInterval(function(){bb.inViewState=gb.contentWindow.inView;},200);}};VideoBase.prototype.parseTimeString=function(kb){var lb=/([0-9]{2}):([0-9]{2}):([0-9]{2})\.?([0-9]{3})?/;var mb=lb.exec(kb);if(mb){var h=parseInt(mb[1])*3600;var m=parseInt(mb[2])*60;var s=parseInt(mb[3])*1;var ms=mb[4]?parseInt(mb[4]):0;return h+m+s+ms;} return 0;};VideoBase.prototype.getIconPosition=function(nb,ob){var x,y,baseX='left',baseY='top',defaultPosition=15;if(nb.xPosition=='left'){x=defaultPosition*ob;} else if(nb.xPosition=='right'){x=defaultPosition*ob;baseX=nb.xPosition;} else{x=parseInt(nb.xPosition)*ob;} if(nb.yPosition=='top'){y=defaultPosition*ob;} else if(nb.yPosition=='bottom'){y=defaultPosition*ob;baseY=nb.yPosition;} else{y=parseInt(nb.yPosition)*ob;} if(isNaN(x)){x=defaultPosition;} if(isNaN(y)){y=defaultPosition;} return{'x':x,'y':y,'baseX':baseX,'baseY':baseY};};VideoBase.prototype.isFullscreen=function(){return document.fullscreenElement||document.webkitFullscreenElement?true:false;};return VideoBase;}());var Video=(function(pb){__extends(Video,pb);function Video(qb){var rb=pb.call(this,qb)||this;rb.eventList={};rb.videoWrapper=qb.videoWrapper;rb.videoElement=qb.videoElement;rb.videoRatio=qb.videoRatio;rb.parent=qb.parent;rb.setWidth(qb.width);rb.setHeight(qb.height);rb.videoWrapper.style.position="relative";rb.videoElement.style.width="100%";rb.addEventListener("loadedmetadata",function(){rb.init();});return rb;} Video.prototype.load=function(){if(this.closed)return;this.videoElement.load();};Video.prototype.play=function(){if(this.closed)return;this.videoElement.play();};Video.prototype.pause=function(){if(this.closed)return;this.videoElement.pause();};Video.prototype.fullscreen=function(){if(this.closed)return;var sb=this.videoElement;if(sb.requestFullscreen){sb.requestFullscreen();} else if(sb.webkitEnterFullscreen){sb.webkitEnterFullscreen();} else if(sb.mozRequestFullScreen){sb.mozRequestFullScreen();} else if(sb.msRequestFullscreen){sb.msRequestFullscreen();}};Video.prototype.setWidth=function(tb){this.width=tb;this.videoWrapper.style.width=this.width+"px";};Video.prototype.getWidth=function(){return this.width;};Video.prototype.setHeight=function(ub){this.height=ub;this.videoWrapper.style.height=this.height+"px";};Video.prototype.getHeight=function(){return this.height;};Video.prototype.setCurrentTime=function(vb){this.videoElement.currentTime=vb;};Video.prototype.getCurrentTime=function(){return this.videoElement.currentTime;};Video.prototype.isMuted=function(){return this.videoElement.muted;};Video.prototype.getDuration=function(){return this.videoElement.duration;};Video.prototype.addEventListener=function(wb,xb){var yb=this;if(this.eventList[wb]){this.eventList[wb].push(xb);} else{this.eventList[wb]=[xb];} if(wb==='beginfullscreen'){var zb=function(){if(yb.isFullscreen())xb();};this.addEvent(this.videoElement,"webkitbeginfullscreen",xb,false);this.addEvent(window,"webkitfullscreenchange",zb,false);this.addEvent(window,"mozfullscreenchange",zb,false);this.addEvent(window,"fullscreenchange",zb,false);} else if(wb==='endfullscreen'){var zb=function(){if(!yb.isFullscreen())xb();};this.addEvent(this.videoElement,"webkitendfullscreen",xb,false);this.addEvent(window,"webkitfullscreenchange",zb,false);this.addEvent(window,"mozfullscreenchange",zb,false);this.addEvent(window,"fullscreenchange",zb,false);} else{this.addEvent(this.videoElement,wb,xb,false);}};Video.prototype.removeEventListener=function(Ab,Bb){var Cb=this;this.eventList[Ab].some(function(v,i){if(v==Bb)Cb.eventList[Ab].splice(i,1);return false;});if(Ab==='beginfullscreen'){var Db=function(){if(Cb.isFullscreen())Bb();};this.removeEvent(this.videoElement,"webkitbeginfullscreen",Bb,false);this.removeEvent(window,"webkitfullscreenchange",Db,false);this.removeEvent(window,"mozfullscreenchange",Db,false);this.removeEvent(window,"fullscreenchange",Db,false);} else if(Ab==='endfullscreen'){var Db=function(){if(!Cb.isFullscreen())Bb();};this.removeEvent(this.videoElement,"webkitendfullscreen",Bb,false);this.removeEvent(window,"webkitfullscreenchange",Db,false);this.removeEvent(window,"mozfullscreenchange",Db,false);this.removeEvent(window,"fullscreenchange",Db,false);} else{this.removeEvent(this.videoElement,Ab,Bb,false);}};Video.prototype.getVideoWrapper=function(){return this.videoWrapper;};Video.prototype["delete"]=function(){for(var Eb in this.eventList){while(this.eventList[Eb].length>0){this.removeEventListener(Eb,this.eventList[Eb][0]);}} this.videoElement=undefined;};return Video;}(VideoBase));var Flip=(function(Fb){__extends(Flip,Fb);function Flip(Gb){var Hb=Fb.call(this,Gb)||this;Hb.eventList={};Hb.frameIndex=0;Hb.imageIndex=0;Hb.imageIndexPrev=0;Hb.firstTime=0;Hb.elapsedTime=0;Hb.duration=0;Hb.isPlayingInFullscreen=false;Hb.isEndInFullscreen=false;Hb.isLoadedMetaData=false;Hb.videoWrapper=Gb.videoWrapper;Hb.videoElement=Gb.videoElement;Hb.iDocument=Hb.videoElement.contentWindow.document;Hb.fullscreenVideo=document.createElement("video");Hb.fullscreenVideo.setAttribute("preload","none");Hb.fullscreenVideo.setAttribute("style","display:none; position:absolute; top:50%; left:50%; width:1px; height:1px; ");Hb.fullscreenVideo.setAttribute("src",Gb.videoURL);Hb.videoWrapper.appendChild(Hb.fullscreenVideo);Hb.videoRatio=Gb.videoRatio;Hb.parent=Gb.parent;Hb.setWidth(Gb.width);Hb.setHeight(Gb.height);Hb.videoWrapper.style.position="relative";Hb.videoElement.style.width="100%";Hb.imagesURL=Gb.imagesURL;Hb.config=Gb;Hb.frames=Gb.imageFrame;Hb.framesPerSecond=Gb.imageFPS/1;Hb.framesPerImage=Gb.fpi;Hb.milisecondsPerImage=Hb.framesPerImage/Hb.framesPerSecond*1000;Hb.milisecondsPerFrame=Hb.milisecondsPerImage/Hb.framesPerImage;Hb.timerFps=1000/Hb.framesPerSecond;Hb.duration=Hb.frames*(Hb.milisecondsPerFrame/1000);Hb.addEventListener("endfullscreen",function(){if(!Hb.isEndInFullscreen){Hb.setFlipCurrentTime(Hb.fullscreenVideo.currentTime);if(!Hb.fullscreenVideo.paused){Hb.fullscreenVideo.pause();Hb._play();Hb.createAndDispatchEvent("playing");}} else{Hb.elapsedTime=Hb.duration*1000;Hb.playloop(false);}});Hb.addEvent(Hb.fullscreenVideo,"timeupdate",function(){if(Hb.isFullscreen())Hb.createAndDispatchEvent("timeupdate");Hb.isEndInFullscreen=Hb.fullscreenVideo.currentTime>=Hb.fullscreenVideo.duration;if(Hb.isEndInFullscreen){}},false);Hb.addEvent(Hb.fullscreenVideo,"ended",function(){if(Hb.isFullscreen()){Hb.createAndDispatchEvent("ended");}},false);Hb.addEvent(Hb.fullscreenVideo,"play",function(){if(Hb.isFullscreen()&&!Hb.isPlayingInFullscreen)Hb.createAndDispatchEvent("play");Hb.isPlayingInFullscreen=true;},false);Hb.addEvent(Hb.fullscreenVideo,"pause",function(){if(Hb.isFullscreen()&&Hb.isPlayingInFullscreen)Hb.createAndDispatchEvent("pause");Hb.isPlayingInFullscreen=false;},false);Hb.addEvent(Hb.fullscreenVideo,"volumechange",function(){if(Hb.isFullscreen())Hb.createAndDispatchEvent("volumechange");},false);Hb.addEventListener("loadedmetadata",function(){Hb.init();});return Hb;};Flip.prototype.load=function(){var Ib=this;if(this.closed)return;this.mainWrapper=this.iDocument.getElementById("mainWrapper");this.flipWrapper=this.iDocument.createElement('DIV');this.videoFrames=new Array(this.imagesURL.length);this.videoFramesLoaded=new Array(this.imagesURL.length);for(var i=0;ithis.videoFrames.length-1){this.imageIndex=this.videoFrames.length-1;} if(Rb!=this.imageIndex){if(!this.videoFramesLoaded[this.imageIndex+2]){this.preloadImage(this.imageIndex+2,null);} if(!this.videoFramesLoaded[this.imageIndex+1]){this.preloadImage(this.imageIndex+1,null);} if(!this.videoFramesLoaded[this.imageIndex]){var Sb=this.isPlaying;this._pause();this.createAndDispatchEvent("waiting");var Tb=function(){if(!Pb.videoFramesLoaded[Pb.imageIndex]){Pb.timerLoop=setTimeout(Tb,Pb.timerFps);return;} if(!Pb.isFullscreen()&&Sb){Pb._play();Pb.createAndDispatchEvent("playing");} Pb.videoFrames[Pb.imageIndex].style.display='block';Pb.hideShownImages(Pb.imageIndex);Pb.playloop(Ob);};this.preloadImage(this.imageIndex,null);this.timerLoop=setTimeout(Tb,this.timerFps);return;} this.videoFrames[this.imageIndex].style.display='block';this.hideShownImages(this.imageIndex);} var Ub=Qb-this.firstTime-(this.milisecondsPerImage*this.imageIndex);this.frameIndex=Math.floor(Ub/this.milisecondsPerFrame)+1;var Vb=false;if(this.frames<=this.frameIndex+this.imageIndex*this.framesPerImage){this.frameIndex=this.frames-this.imageIndex*this.framesPerImage;this.elapsedTime=this.duration*1000;Vb=true;} this.createAndDispatchEvent("timeupdate");this.videoFrames[this.imageIndex].style.top="-"+((this.frameIndex-1)*this.height)+"px";this.videoFrames[this.imageIndex].style.width=this.width+"px";this.videoFrames[this.imageIndex].style.height=this.getImageHeight(this.imageIndex)+"px";if(Vb){this.isPlaying=false;this.firstTime=0;this.createAndDispatchEvent("ended");return;} if(Ob)this.timerLoop=setTimeout(function(){Pb.playloop(true);},this.timerFps);};Flip.prototype.play=function(){if(!this._play())return;this.createAndDispatchEvent("play");this.createAndDispatchEvent("playing");};Flip.prototype._play=function(){if(this.closed){return false;} if(this.isPlaying){return false;} if(!this.isLoadedMetaData&&!this.inViewPlay){return false;} if(this.firstTime>0){this.firstTime=Date.now()-this.elapsedTime;} this.isPlaying=true;this.playloop(true);return true;};Flip.prototype.pause=function(){if(!this._pause())return;this.createAndDispatchEvent("pause");};Flip.prototype._pause=function(){if(this.closed)return false;if(!this.isPlaying)return false;this.isPlaying=false;clearTimeout(this.timerLoop);return true;};Flip.prototype.fullscreen=function(){if(this.closed)return;var Wb=this.fullscreenVideo;var Xb=this.getCurrentTime();if(Wb.requestFullscreen){Wb.requestFullscreen();} else if(Wb.webkitRequestFullscreen){Wb.webkitRequestFullscreen();} else if(Wb.webkitEnterFullscreen){Wb.webkitEnterFullscreen();} else if(Wb.mozRequestFullScreen){Wb.mozRequestFullScreen();} else if(Wb.msRequestFullscreen){Wb.msRequestFullscreen();} if(Wb.requestFullscreen||Wb.webkitRequestFullscreen||Wb.webkitEnterFullscreen||Wb.mozRequestFullScreen||Wb.msRequestFullscreen){this.createAndDispatchEvent("beginfullscreen");if(this.isPlaying){this._pause();var Yb=Wb.play();if(Yb!==undefined){Yb.then(function(){Wb.currentTime=Xb;});} else{var Zb=function(){Wb.currentTime=Xb;};this.addEvent(Wb,'loadedmetadata',Zb,false);Wb.currentTime=Xb;}}}};Flip.prototype.setWidth=function($b){if(this.closed)return;this.width=$b;this.videoElement.style.width=this.width+"px";this.videoWrapper.style.width=this.width+"px";if(this.videoFrames&&this.videoFrames[this.imageIndex])this.videoFrames[this.imageIndex].style.width=this.width+"px";if(this.mainWrapper)this.mainWrapper.style.width=this.width+"px";if(this.flipWrapper)this.flipWrapper.style.width=this.width+"px";};Flip.prototype.getWidth=function(){return this.width;};Flip.prototype.setHeight=function(ac){if(this.closed)return;this.height=ac;this.videoElement.style.height=this.height+"px";this.videoWrapper.style.height=this.height+"px";if(this.videoFrames&&this.videoFrames[this.imageIndex])this.videoFrames[this.imageIndex].style.height=this.getImageHeight(this.imageIndex)+"px";if(this.videoFrames&&this.videoFrames[this.imageIndex])this.videoFrames[this.imageIndex].style.top="-"+((this.frameIndex-1)*this.height)+"px";if(this.mainWrapper)this.mainWrapper.style.height=this.height+"px";if(this.flipWrapper)this.flipWrapper.style.height=this.height+"px";};Flip.prototype.getHeight=function(){return this.height;};Flip.prototype.setCurrentTime=function(bc){if(this.isFullscreen()){this.fullscreenVideo.currentTime=bc;} else{this.setFlipCurrentTime(bc);}};Flip.prototype.setFlipCurrentTime=function(cc){this.elapsedTime=cc*1000;this.firstTime=Date.now()-this.elapsedTime;if(!this.isPlaying){this.playloop(false);}};Flip.prototype.getCurrentTime=function(){return this.isFullscreen()?this.fullscreenVideo.currentTime:this.elapsedTime/1000;};Flip.prototype.isMuted=function(){return this.fullscreenVideo.muted;};Flip.prototype.getDuration=function(){return this.duration;};Flip.prototype.addEventListener=function(dc,ec){var fc=this;if(this.eventList[dc]){this.eventList[dc].push(ec);} else{this.eventList[dc]=[ec];} if(dc==='endfullscreen'){var gc=function(){if(!fc.isFullscreen())ec();};this.addEvent(this.fullscreenVideo,"webkitendfullscreen",ec,false);this.addEvent(window,"webkitfullscreenchange",gc,false);this.addEvent(window,"mozfullscreenchange",gc,false);this.addEvent(window,"fullscreenchange",gc,false);}};Flip.prototype.removeEventListener=function(hc,ic){var jc=this;this.eventList[hc].some(function(v,i){if(v==ic)jc.eventList[hc].splice(i,1);return false;});};Flip.prototype.dispatchEvent=function(kc,mc){if(this.eventList[kc]){this.eventList[kc].concat().forEach(function(nc){nc(mc);});}};Flip.prototype.getVideoWrapper=function(){return this.videoWrapper;};Flip.prototype["delete"]=function(){for(var oc in this.eventList){while(this.eventList[oc].length>0){this.removeEventListener(oc,this.eventList[oc][0]);}} this.videoElement=undefined;};Flip.prototype.preloadImage=function(i,pc){var qc=this;if(this.videoFrames[i]==undefined)return;if(this.videoFramesLoaded[i]==false){if(this.config.imagesURL[i]==undefined){return;} this.createAndDispatchEvent('progress');this.videoFrames[i].setAttribute("src",this.config.imagesURL[i]);this.addEvent(this.videoFrames[i],"load",function(){qc.videoFramesLoaded[i]=true;if(pc!=undefined)pc(i);},false);} else{this.videoFrames[i].style.display="block";this.videoFrames[i].style.top="0px";if(pc!=undefined)pc(i);}};;return Flip;}(VideoBase));var VideoBuilder=(function(){function VideoBuilder(){} VideoBuilder.prototype.VideoBuilder=function(){};VideoBuilder.prototype.build=function(){switch(this.mode){default:case "Video":var rc=window.document.createElement('video');rc.src=this.videoURL;rc.autoplay=false;rc.controls=false;rc.preload="none";rc.muted=true;rc.setAttribute('playsinline','playsinline');var sc=document.createElement('div');sc.style.display='inline-block';sc.appendChild(rc);this.parent.appendChild(sc);var tc=new Video({videoElement:rc,videoWrapper:sc,videoURL:this.videoURL,parent:this.parent,width:this.width,height:this.height,inViewPlay:this.inViewPlay,videoRatio:null,imageFrame:null,imagesURL:null,imageWidth:null,imageHeight:null,imageFPS:null,fpi:null});return tc;case "Flip":var uc=window.document.createElement('iframe');uc.style.opacity="0.99";uc.style.margin="0";uc.style.padding="0";uc.style.verticalAlign="bottom";uc.setAttribute("scrolling","no");uc.setAttribute("frameborder","0");var sc=document.createElement('div');sc.style.display='inline-block';sc.appendChild(uc);this.parent.appendChild(sc);var vc=uc.contentWindow.document;vc.open();vc.write('
');vc.close();var wc=new Flip({videoElement:uc,videoWrapper:sc,videoURL:this.videoURL,parent:this.parent,width:this.width,height:this.height,videoRatio:this.videoRatio,inViewPlay:this.inViewPlay,imageFrame:this.imageFrame,imagesURL:this.imagesURL,imageWidth:this.imageWidth,imageHeight:this.imageHeight,imageFPS:this.imageFPS,fpi:this.fpi});return wc;}};return VideoBuilder;}());var DrawVideo=(function(){function DrawVideo(xc,yc){var zc=this;this.fillAlterImage=function(Ac,Bc){var ds=Ac.dataset;if(ds&&((ds.fillType==="icon"&&zc.crtv.icon)||(ds.fillType==="image"&&zc.crtv.image))){Bc.backgroundImage=ds.fillType==="icon"?'url('+zc.crtv.icon+')':'url('+zc.crtv.image+')';Bc.backgroundRepeat='no-repeat';Bc.backgroundPosition='center center';Bc.backgroundSize='contain';Bc.backgroundColor='#000';} return;};this.draw=function(){if(!zc.videoId||!zc.crtv)return;var Cc=document.getElementById(zc.videoId);if(!Cc)return;var Dc=Cc.style;var Ec;try{Ec=JSON.parse(zc.crtv.jsv);} catch(e){zc.fillAlterImage(Cc,Dc);return;} if(!Ec||Object.keys(Ec).length===0){zc.fillAlterImage(Cc,Dc);return;} if(!Dc.textAlign){Dc.textAlign='center';} var Fc=new VideoBuilder();Fc.parent=Cc;if(Cc.clientHeight*Ec.video_ratio<=Cc.clientWidth){Fc.height=Cc.clientHeight;Fc.width=Cc.clientHeight*Ec.video_ratio;} else{Fc.height=Cc.clientWidth/Ec.video_ratio;Fc.width=Cc.clientWidth;} Fc.videoURL=Ec.video.url;Fc.videoRatio=Ec.video_ratio;Fc.inViewPlay=true;Fc.mode='Flip';Fc.imagesURL=Ec.image.url;Fc.imageWidth=Ec.image.width;Fc.imageHeight=Ec.image.height;Fc.imageFrame=Ec.image.frame;Fc.imageFPS=Ec.image.fps;Fc.fpi=Ec.image.frame_per_image;var Gc=Fc.build();Gc.setImpressionEvents(Ec.impression);Gc.setTrackEvents(Ec.track);Gc.load();var Hc=function(){if(Cc.clientHeight*Ec.video_ratio<=Cc.clientWidth){Gc.setHeight(Cc.clientHeight);Gc.setWidth(Cc.clientHeight*Ec.video_ratio);} else{Gc.setHeight(Cc.clientWidth/Ec.video_ratio);Gc.setWidth(Cc.clientWidth);}};window.addEventListener('orientationchange',Hc);return Gc;};this.videoId=xc;this.crtv=yc;} return DrawVideo;}());var AdstirNext=(function(){function AdstirNext(Ic){var Jc=this;this.timeout=10000;this.inview_recursive_check_flag=false;this.URL={adtag:"//ad.ad-stir.com/ad",float:"//js.ad-stir.com/js/adstir_float_%%NUMBER%%.js?ver=6",ileffect:"//js.ad-stir.com/js/adstir_inline_effect_%%NUMBER%%.js",magnify:"//js.ad-stir.com/js/adstir_magnify.js",nativeTemplate:"//cdnn.ad-stir.com/native/template/",nativeNetworkTemplate:"//cdnn.ad-stir.com/network/template/",secureFrameHtml:"//tpf.adstirservice.com/secureframe/v1/container.html"};var Kc=window;var Lc=void 0;if(parseFloat(Ic.ver)>=5.0){} else if(parseFloat(Ic.ver)>=4.0){Ic.center=true;} else if(parseFloat(Ic.ver)>=3.0){Ic.center=true;} else{return;} if(Ic.type===Lc){Ic.type="html";} Ic.org_type=Ic.type;if(Ic.type==="interstitial"){var ua=navigator.userAgent;if(!(ua.indexOf('iPhone')>0||ua.indexOf('iPad')>0||ua.indexOf('Android')>0))return;if(/Android 2/.test(ua))return;if(Ic.frequency!=Lc&&Ic.frequency0||ua.indexOf('iPad')>0||ua.indexOf('Android')>0))return;if(!(/iPhone OS ([5-9]|10)/.test(ua)||/iPad; CPU OS ([5-9]|10)/.test(ua)||/Android ([4-9])/.test(ua)))return;var iw=window.innerWidth;var ih=window.innerHeight;var zv=((iw / 350) > (ih / 300)?(ih / 300) : (iw / 350));if(zv<1)return;if(Ic.frequency!=Lc&&Ic.frequency0||ua.indexOf('iPad')>0||ua.indexOf('iPod')>0||ua.indexOf('Android')>0))return;if(Ic.floating==true&&!(window.top==window.self&&Ic.iframe==Lc)){return;} if(!Ic.floating&&!(window.top==window.self&&Ic.iframe==Lc)){if(!(((/iPhone OS (9|1[0-9])/.test(ua)||/iPad; CPU OS (9|1[0-9])/.test(ua))&&/Safari\//.test(ua))||parseInt(ua.slice(ua.indexOf('Chrome/')+7,ua.indexOf('Chrome/')+10))>=51)){return;}} this.URL.adtag="//ad.ad-stir.com/vad";Ic.type="html";} if(Ic.debug!==Lc){if(Ic.debug.url!==Lc){for(var Sc in Ic.debug.url)this.URL[Sc]=Ic.debug.url[Sc];}} var Tc=this.getLocation();var Uc;if(Ic.secure==true||window.location.protocol=="https:"){Uc="https:";Ic.secure=true;} else{Uc="http:";} this.URL.adtag=Uc+this.URL.adtag;this.URL.float=Uc+this.URL.float;this.URL.magnify=Uc+this.URL.magnify;this.URL.ileffect=Uc+this.URL.ileffect;this.URL.secureFrameHtml=Uc+this.URL.secureFrameHtml;if(Ic.origin===Lc&&Tc!==Lc){var Vc=Tc.href;if(Vc.length>500)Vc=Vc.substring(0,500);if(Vc.substring(0,4)==='http')Ic.origin=Vc;} var Wc=false;this.addEvent(Kc,"load",function(){Wc=true;});var Xc;if(Ic.iframe||Ic.async){Xc=this.makeAsync();} else{Xc=this.makeSync();} if(Ic.type==="html"){Xc.prewrite(Ic);} Xc.connect(Ic,this.URL.adtag,this.getParam(Ic),function(Yc){if(Yc!==Lc&&(Yc.html!==""||Yc.crtv!==Lc||(Yc.med&&Jc.arrayContains(Ic.supported_functions,"awakeNative")))){var Zc=Yc.rattr;if(Zc!=null){var $c=Zc.window;if($c!=null){Ic.flags={};for(var Sc in $c){Ic.flags[Sc]=Number($c[Sc]);if(isNaN(Ic.flags[Sc]))Ic.flags[Sc]=0;}} var ad=Zc.adstir_vars;if(ad!=null){var bd=ad.line_vars;if(bd){if(!Ic.line_vars)Ic.line_vars={};for(var Sc in bd){Ic.line_vars[Sc]=bd[Sc];}} var cd=ad.down_vars;if(cd!=null){if(!Ic.down_vars)Ic.down_vars={};for(var Sc in cd){Ic.down_vars[Sc]=cd[Sc];}} var dd=ad.expand_vars;if(dd!=null){if(!Ic.expand_vars)Ic.expand_vars={};for(var Sc in dd){Ic.expand_vars[Sc]=dd[Sc];}} var fd=ad.commons;if(fd!=null){if(!Ic.commons)Ic.commons={};for(var Sc in fd){Ic.commons[Sc]=fd[Sc];}}}} if(Ic.debug&&Yc.adtype!=="iframe"&&Yc.html)Yc.html=''+Yc.id+''+Yc.html;if(Ic.use_sdk_ivw&&Yc.inview&&typeof Yc.inview==='object'&&Yc.inview.length>0){var gd;var hd=function(e){var jd=e.ratio;if(jd>=0.5){if(gd)return;gd=setTimeout(function(){for(var i=0;i0){for(var i=0;i");od.write(Yc.crtv.ext_h);od.write("");od.close();var pd="AdstirNT"+Math.round(Math.random()*10000000000)+"A"+Math.round(Math.random()*10000000000);cli="javascript:"+pd+"()";window[pd]=function(){nd.contentWindow.postMessage(Yc.crtv.ext_cl_js,"*");};} var qd=function(rd){var sd=""+Ic.native_html;var td="
\n
\n\n\n
\n
\n";sd=sd.replace(/%%OPTOUT_ICON_RIGHT%%/g,td.replace(/LEFT_RIGHT_CSS/g,"left: auto; right: 0px; direction: ltr;text-align: right;").replace(/LEFT_RIGHT/g,"right"));sd=sd.replace(/%%OPTOUT_ICON_LEFT%%/g,td.replace(/LEFT_RIGHT_CSS/g,"right: auto; left: 0px; direction: rtl;text-align: left;").replace(/LEFT_RIGHT/g,"left"));sd=sd.replace(/%%ICON%%/g,(rd.icon!==Lc?""+rd.icon:""));sd=sd.replace(/%%IMAGE%%/g,(rd.image!==Lc?""+rd.image:""));sd=sd.replace(/%%TITLE%%/g,(rd.title!==Lc?""+rd.title:""));sd=sd.replace(/%%DESCRIPTION%%/g,(rd.description!==Lc?""+rd.description:""));sd=sd.replace(/%%CTA%%/g,(rd.cta!==Lc?""+rd.cta:""));sd=sd.replace(/%%CLICK_URL%%/g,(rd.clickUrl!==Lc?""+rd.clickUrl:""));sd=sd.replace(/%%RATING%%/g,(rd.rating!==Lc?""+rd.rating:""));sd=sd.replace(/%%LANDING_PAGE_URL%%/g,(rd.landingPageUrl!==Lc?""+rd.landingPageUrl:""));sd=sd.replace(/%%ADVERTISER%%/g,(rd.advertiser!==Lc?""+rd.advertiser:""));sd=sd.replace(/%%OPTOUT_URL%%/g,rd.optoutUrl);return sd;};if(Yc.crtv){Yc.crtv.optout=(Yc.crtv.optout!==Lc&&Yc.crtv.optout!==null&&Yc.crtv.optout!==""?""+Yc.crtv.optout:"https://ad-stir.com/sp/optout.html");Yc.html=qd({optoutUrl:Yc.crtv.optout,advertiser:Yc.crtv.adv,cta:Yc.crtv.cta,rating:Yc.crtv.rate,icon:Yc.crtv.icon,image:Yc.crtv.img,clickUrl:cli,landingPageUrl:Yc.crtv.lp,title:Yc.crtv.title,description:Yc.crtv.desc});} else if(Yc.html){var ud="adstir_native_html_callback_"+Math.round(Math.random()*10000000000);Yc.html=Yc.html.replace(/<<>>/g,ud);if(Ic.native_html){Ic.native_html=""+Ic.native_html;Yc.html=Yc.html.replace(/<<>>/g,"decodeURIComponent(\""+encodeURIComponent(Ic.native_html)+"\")");Yc.html=Yc.html.replace(/<<>>/g,Ic.native_html);}} Yc.html="";if(Yc.cbcn!==Lc&&typeof Yc.cbcn==='object'&&Yc.cbcn.length>0){Jc.attachPixalateClickEvent(Yc.cbcn,ld,true);} if((Yc.crtv&&Yc.crtv.ivw&&typeof Yc.crtv.ivw==='object'&&Yc.crtv.ivw.length>0&&!Ic.use_sdk_ivw)||(Yc.inview&&typeof Yc.inview==='object'&&Yc.inview.length>0)){Jc.addEvent(Kc,"DOMContentLoaded",function(){var vd=document.getElementById(ld);if(vd){Jc.addEvent(vd,"load",function(){Jc.checkElementInView(vd,Yc,Ic);});}});if(!(window.top!=window.self)){Jc.addEvent(Kc,"DOMContentLoaded",function(){var wd=document.getElementById(ld);if(wd){Jc.addEvent(wd,"load",function(){Jc.addEvent(Kc,"scroll",function(){Jc.checkElementInView(wd,Yc,Ic);});});}});}}} if(Yc.adtype=="iframe"){var ld="AdstirIF"+Math.round(Math.random()*10000000000)+"A"+Math.round(Math.random()*10000000000);var xd=document.createElement("iframe");if(Yc.secure_frame&&xd.sandbox instanceof DOMTokenList){Yc.html+="";var yd=JSON.stringify(Jc.URL.secureFrameHtml+"#"+encodeURIComponent(Yc.html));Yc.html="";} else{Yc.html="";if(Yc.cbcn!==Lc&&typeof Yc.cbcn==='object'&&Yc.cbcn.length>0){Jc.attachPixalateClickEvent(Yc.cbcn,ld,true);}}} if(Yc.med&&Jc.arrayContains(Ic.supported_functions,"awakeNative")){var zd=Yc.med;zd.fallback=Yc.html;Yc.ck=false;Jc.sendMessage("awakeNative",[Jc.makeReload(Yc,Ic),zd]);} else{Xc.write(Yc,Ic);}} if(Ic.type==="interstitial"){var ua=navigator.userAgent.toLowerCase();var Ad=(Yc.magnify>=1||Ic.force_magnify)?Yc.w*2:Yc.w;var Bd=Jc.isLandscape()?0:-22;var Cd=Jc.supportsSVG()?"https://js.ad-stir.com/network/close.svg":"https://js.ad-stir.com/network/close.png";if(Yc.adtype=="iframe"){var ld="AdstirIF"+Math.round(Math.random()*10000000000)+"A"+Math.round(Math.random()*10000000000);Yc.html="";if(Yc.cbcn!==Lc&&typeof Yc.cbcn==='object'&&Yc.cbcn.length>0){Jc.attachPixalateClickEvent(Yc.cbcn,ld,true);}} var Dd=function(t){document.write(t);};Dd('
');Dd('
');Dd('
');Dd('
');Xc.write(Yc,Ic);Dd('
');Dd('
');Dd('');} if(Ic.type==="interstitialpc"){if(Yc.adtype=="iframe"){var ld="AdstirIF"+Math.round(Math.random()*10000000000)+"A"+Math.round(Math.random()*10000000000);Yc.html="";if(Yc.cbcn!==Lc&&typeof Yc.cbcn==='object'&&Yc.cbcn.length>0){Jc.attachPixalateClickEvent(Yc.cbcn,ld,true);}} var Dd=function(t){document.write(t);};Dd('
');Dd('');Dd('
');Dd('
');Xc.write(Yc,Ic);Dd('
');Dd('
');Dd("\n");} if(Ic.type==="native"){var Ed="adstir_inview_"+(Math.floor(Math.random()*100000000)).toString()+'A'+(Math.floor(Math.random()*100000000)).toString();var Fd;if(Yc.crtv&&Yc.crtv.ivw&&typeof Yc.crtv.ivw==='object'&&Yc.crtv.ivw.length>0&&!Ic.use_sdk_ivw){var Gd=function(Hd){var el=Hd;var Id=Hd.children;for(var i=0;iel.offsetHeight*el.offsetWidth){el=Jd;}} return el;};var Kd=function(){var Ld=document.getElementsByClassName(Ed);if(Ld.length===0){return Lc;} var Md=Ld[0];for(var i=0;i0){for(var i=0;i");od.write(Yc.crtv.ext_h);od.write("");od.close();var pd="AdstirNT"+Math.round(Math.random()*10000000000)+"A"+Math.round(Math.random()*10000000000);Fd="javascript:"+pd+"()";window[pd]=function(){nd.contentWindow.postMessage(Yc.crtv.ext_cl_js,"*");};} if(Ic.native_callback===Lc&&!Ic.async){Ic.native_callback=function(Od){var Pd="AdstirVideoSlot"+Math.round(Math.random()*10000000000)+"A"+Math.round(Math.random()*10000000000);var Qd=Ic.native_html;var Rd="
\n
\n\n\n
\n
\n";for(var Sd=0;Sd<10;Sd++)Qd=Qd.replace("%%OPTOUT_ICON_RIGHT%%",Rd.replace("LEFT_RIGHT_CSS","left: auto; right: 0px; direction: ltr;text-align: right;").replace("LEFT_RIGHT","right"));for(var Sd=0;Sd<10;Sd++)Qd=Qd.replace("%%OPTOUT_ICON_LEFT%%",Rd.replace("LEFT_RIGHT_CSS","right: auto; left: 0px; direction: rtl;text-align: left;").replace("LEFT_RIGHT","left"));for(var Sd=0;Sd<10;Sd++)Qd=Qd.replace("%%ICON%%",(Od.icon!==Lc?""+Od.icon:""));for(var Sd=0;Sd<10;Sd++)Qd=Qd.replace("%%IMAGE%%",(Od.image!==Lc?""+Od.image:""));for(var Sd=0;Sd<10;Sd++)Qd=Qd.replace("%%TITLE%%",(Od.title!==Lc?""+Od.title:""));for(var Sd=0;Sd<10;Sd++)Qd=Qd.replace("%%DESCRIPTION%%",(Od.description!==Lc?""+Od.description:""));for(var Sd=0;Sd<10;Sd++)Qd=Qd.replace("%%CTA%%",(Od.cta!==Lc?""+Od.cta:""));for(var Sd=0;Sd<10;Sd++)Qd=Qd.replace("%%CLICK_URL%%",(Od.clickUrl!==Lc?""+Od.clickUrl:""));for(var Sd=0;Sd<10;Sd++)Qd=Qd.replace("%%RATING%%",(Od.rating!==Lc?""+Od.rating:""));for(var Sd=0;Sd<10;Sd++)Qd=Qd.replace("%%LANDING_PAGE_URL%%",(Od.landingPageUrl!==Lc?""+Od.landingPageUrl:""));for(var Sd=0;Sd<10;Sd++)Qd=Qd.replace("%%ADVERTISER%%",(Od.advertiser!==Lc?""+Od.advertiser:""));for(var Sd=0;Sd<10;Sd++)Qd=Qd.replace("%%OPTOUT_URL%%",Od.optoutUrl);Qd=Qd.replace(/%%VIDEO_SLOT%%/,Pd);var Td=function(Ud,Vd,Wd,Xd,Sd){Sd--;if(Sd<=0){return;} var Yd=Vd.clientHeight;var Zd=Vd.clientWidth;if(Yd===0||Zd===0||Yd!==Wd||Zd!==Xd){setTimeout(function(){Td(Ud,Vd,Yd,Zd,Sd);},10);return;} Ud.draw();};if(Qd.indexOf("%%INVIEW_DETECTION_IDENTIFIER%%")!==-1){for(var Sd=0;Sd<10;Sd++)Qd=Qd.replace("%%INVIEW_DETECTION_IDENTIFIER%%",Od.inviewDetectionIdentifier);document.write(Qd);} else{Jc.inview_recursive_check_flag=true;var el=document.createElement('div');el.innerHTML=Qd;var $d=el.children;for(var i=0;i<$d.length;i++){var c=$d[i];c.className=c.className+" "+Od.inviewDetectionIdentifier;} document.write(el.innerHTML);} var ae=document.getElementById(Pd);if(ae){Td(new DrawVideo(Pd,Od),ae,ae.clientHeight,ae.clientWidth,100);}};} if(Yc.adtype=="native_html"){var ud="adstir_native_html_callback_"+Math.round(Math.random()*10000000000);for(var be=0;be<10;be++)Yc.html=Yc.html.replace("<<>>",ud);if(Ic.native_html)for(var be=0;be<10;be++)Yc.html=Yc.html.replace("<<>>","decodeURIComponent(\""+encodeURIComponent(Ic.native_html)+"\")");window[ud]=function(ce){if(ce){ce.optoutUrl=(ce.optoutUrl!==Lc&&ce.optoutUrl!==null&&ce.optoutUrl!==""?""+ce.optoutUrl:"https://ad-stir.com/sp/optout.html");Ic.native_callback(ce);}};document.write(Yc.html);} else if(Yc.crtv){Yc.crtv.optout=(Yc.crtv.optout!==Lc&&Yc.crtv.optout!==null&&Yc.crtv.optout!==""?""+Yc.crtv.optout:"https://ad-stir.com/sp/optout.html");var de=function(){for(var i=0;i=0.5;if(!Me){clearTimeout(Oe);} else{Oe=setTimeout(function(){if(Me){var Re=Le();if(Re)Pe.unobserve(Ne);}},1000);}},{threshold:0.5});Pe.observe(Ne);} else if((/iPhone OS (9|1[0-9])/.test(ua)||/iPad; CPU OS (9|1[0-9]) /.test(ua))&&/Safari\//.test(ua)){var Se=document.createElement('iframe');Se.setAttribute('style','width:1px;height:1px;position:absolute;left:50%;top:50%;border:none;z-index:10000000;background-color:#FFF1;');document.body.appendChild(Se);Se.contentWindow.document.open();Se.contentWindow.document.write('');Se.contentWindow.document.close();var Te=0;var Ue;var Ve=setInterval(function(){Me=Se.contentWindow.inView;if(Me!=undefined&&Ue==Me){Te++;} else{Te=0;} Ue=Me;if(Te>=4&&Me){var We=Le();if(We){clearInterval(Ve);} else{Te=0;}}},200);} return;};AdstirNext.prototype.checkElementInView=function(Xe,Ye,Ze){var $e="data-adstir-inview-beacon-exec";var af=Ye.inview;if((Ze.type==="native"||Ye.adtype==="native_banner")&&Ye.crtv&&Ye.crtv.ivw){af=Ye.crtv.ivw;} var bf=function(){if(window.top!=window.self){if(Ze.type==="native"){if(window.self.document.body.scrollHeight>Xe.offsetHeight*2.0||window.self.document.body.scrollWidth>Xe.offsetWidth*10.0||window.self.innerHeightwindow.screen.width*1.1)return;} else if(Ze.type==="interstitial"||Ze.type==="interstitialpc"){if(window.self.innerHeightXe.offsetHeight*1.05||window.self.document.body.scrollWidth>Xe.offsetWidth*5.0||window.self.innerHeightwindow.screen.width*1.1)return;}} if(Xe.hasAttribute($e))return;Xe.setAttribute($e,"1");if(Ze.debug){if(window.top!=window.self&&Ze.type!=="interstitial"&&Ze.type!=="interstitialpc"){window.self.document.body.style.backgroundColor='green';window.self.document.body.style.border='1px solid blue';} else{Xe.style.backgroundColor='green';Xe.style.border='1px solid blue';}} for(var i=0;i=1||kf.force_magnify;var mf=kf.center||nf;var of=(jf.ileffect&&typeof(jf.ileffect.length)==="number"?true:false);var pf=(jf.cbcn!==undefined&&typeof jf.cbcn==='object'&&jf.cbcn.length>0);if(nf){var t='';t=t+'
';t=t+lf;t=t+'
';df.addJS(df.URL.magnify);lf=t;} if(jf.render&&typeof jf.render==='object'&&jf.render.length>0){for(var i=0;i
';};} if(jf.adtype!=="native_banner"&&jf.inview&&typeof jf.inview==='object'&&jf.inview.length>0){var qf="adstir_inview_"+(Math.floor(Math.random()*100000000)).toString()+'A'+(Math.floor(Math.random()*100000000)).toString();if(pf&&jf.adtype&&jf.adtype!=="iframe"){lf='
'+lf+'
';} else{lf='
'+lf+'
';} if(!kf.use_sdk_ivw){df.addEvent(ef,"DOMContentLoaded",function(){var rf=document.getElementById(qf);if(rf)df.checkElementInView(rf,jf,kf);});if(!(window.top!=window.self)){df.addEvent(ef,"DOMContentLoaded",function(){df.addEvent(ef,"scroll",function(){var sf=document.getElementById(qf);if(sf)df.checkElementInView(sf,jf,kf);});});}} if(pf&&jf.adtype&&jf.adtype!=="iframe"&&jf.adtype!=="native_banner"){df.attachPixalateClickEvent(jf.cbcn,gf,false);}} if(of){for(var ei=0;ei
';t=t+lf;t=t+'
';lf=t;var vf=df.URL.ileffect.replace(/%%NUMBER%%/,tf+"");var wf=document.createElement("script");wf.src=vf;document.head.appendChild(wf);}} if(!nf&&mf){var t="";t=t+'
';t=t+lf;t=t+'
';lf=t;} return lf;};return{prewrite:function(xf){},connect:function(yf,zf,Af,Bf){var Cf=function(Df){if(typeof(Df)!=="undefined"&&typeof(Df.ntempid)==="number"){ef.adstir_native_templates=function(Ef){yf.native_html=Ef;Bf(Df);};document.write("");} else if(typeof(Df)!=="undefined"&&Df.adtype==="native_banner"){if(typeof(Df.nntmplid)!=="undefined"&&Df.nntmplid.length>0){ef.adstir_network_templates=function(Ff){yf.native_html=Ff;Bf(Df);};document.write("");}} else{Bf(Df);}};if(AdstirNext.RTUS){var Gf="adstir_crid";ef.AdstirCallbackCRTID=function(Hf){if(Hf.status==="OK"){document.cookie=Gf+'='+encodeURIComponent(Hf.userid)+';'+'max-age='+60*15;}};var st=document.cookie.indexOf(Gf+"=");if(st!=-1){st=st+Gf.length+1;var ed=document.cookie.indexOf(";",st);if(ed==-1)ed=document.cookie.length;Af.crtid=decodeURIComponent(document.cookie.substring(st,ed));} var If="https://gum.criteo.com/sync?c=47&r=2&j=AdstirCallbackCRTID";df.appendJS(true,If);} Af.callback=ff;ef[Af.callback]=Cf;document.write("");},write:function(Jf,Kf){var Lf=Jf.float>=1||Kf.force_floating;var Mf=Jf.magnify>=1||Kf.force_magnify;var Nf=Kf.center||Mf;var Of=(Kf.sdk_vendor==="adstir"&&Kf.sdk_version?parseInt(Kf.sdk_version):0);var Pf=Jf.w;var Qf=Jf.h;var Rf=Jf.ck;var Sf=Jf.html;var Tf=(Jf.cbcn!==undefined&&typeof Jf.cbcn==='object'&&Jf.cbcn.length>0);if(!Lf&&!Kf.floating){if(Kf.js_check!=false&&Of<20000&&Rf){var t='';t=t+'';t=t+Sf;t=t+'';t=t+'';Sf=t;} Sf=hf(Jf,Kf,Sf);if(Kf.js_check!=false&&Of<20000&&Rf){t='<'+(Nf?'div style="display:block"':'span style="display:inline-block"')+' id="'+ff+'DELETE">';t=t+Sf;t=t+'';Sf=t;}} if(Lf){var t="";t=t+'
';t=t+'
';t=t+Sf;t=t+'
';t=t+'
';Sf=t;if(Tf&&Jf.adtype&&Jf.adtype!=="iframe"&&Jf.adtype!=="native_banner"){df.attachPixalateClickEvent(Jf.cbcn,gf,false);}} document.write(Sf);},overlay:function(Uf,Vf){var Wf=void 0;var Xf=Uf.float>=1||Vf.force_floating;if(Xf){var Yf=function(){ef.adstir_float=document.getElementById("adstir_float");if(Vf.flags!==Wf){var Zf=JSON.stringify(Vf.flags);ef.adstir_float.setAttribute("data-flags",Zf);} if(Vf.line_vars!==Wf){var Zf=JSON.stringify(Vf.line_vars);ef.adstir_float.setAttribute("data-set",Zf);} if(Vf.down_vars!==Wf){var Zf=JSON.stringify(Vf.down_vars);ef.adstir_float.setAttribute("data-set2",Zf);} if(Vf.expand_vars!==Wf){var Zf=JSON.stringify(Vf.expand_vars);ef.adstir_float.setAttribute("data-set3",Zf);} if(Vf.commons!==Wf){var Zf=JSON.stringify(Vf.commons);ef.adstir_float.setAttribute("data-set-commons",Zf);}};var $f=df.URL.float.replace(/%%NUMBER%%/,Uf.float+"");if(document.getElementById("adstir_float")&&$f.indexOf("_10")>0){Yf();df.writeJS($f);} else{if(document.readyState==="complete"){Yf();df.addJS($f);} else{df.addEvent(window,"load",function(){Yf();df.addJS($f);});}} if(Vf.floating==true&&Uf.overlay_refresh_limit!==Wf&&Uf.overlay_refresh_time!==Wf){df.overlayRefresh(Uf,Vf,ff,0,function(ag){if(ag==Wf)return;var bg=document.getElementById("adstir_float");var Xf=ag.float>=1||Vf.force_floating===true;var cg=ag.magnify>=1||Vf.force_magnify===true;var dg=Vf.center!==false||cg;var eg=ag.ck;var fg=0,iframeHeight=0;var gg='';var t="";t=t+'
';t=t+'
';t=t+gg;t=t+'
';gg=t;var hg=bg.parentNode;hg.outerHTML=gg;var ig=document.getElementById(ff);var jg=ig.contentWindow.document;var kg=''+''+ag.html+'';jg.open();jg.write(kg);jg.close();ef.adstir_float=document.getElementById("adstir_float");if(Vf.flags!==Wf){var lg=JSON.stringify(Vf.flags);ef.adstir_float.setAttribute("data-flags",lg);} if(Vf.line_vars!==Wf){var lg=JSON.stringify(Vf.line_vars);ef.adstir_float.setAttribute("data-set",lg);} if(Vf.down_vars!==Wf){var lg=JSON.stringify(Vf.down_vars);ef.adstir_float.setAttribute("data-set2",lg);} if(Vf.expand_vars!==Wf){var lg=JSON.stringify(Vf.expand_vars);ef.adstir_float.setAttribute("data-set3",lg);} if(Vf.commons!==Wf){var lg=JSON.stringify(Vf.commons);ef.adstir_float.setAttribute("data-set-commons",lg);} var mg=document.createElement("script");mg.src=df.URL.float.replace(/%%NUMBER%%/,(ag.float<=1?"1":ag.float+""));document.body.appendChild(mg);});}}},overlayPC:function(ng,og){},loadedEnd:function(pg,qg){var rg;var id=pg.id;var sg=pg.gid;var tg=pg.fgid;ef.setTimeout(function(){var ug=document.createElement("div");ug.style.position="absolute";ug.style.top="0px";ug.style.left="0px";ug.style.height="3px";ug.style.width="3px";ug.style.background="black";ug.style.opacity="0.05";document.body.appendChild(ug);window.setTimeout(function(){document.body.removeChild(ug);},1000);},1000);var vg=4000;ef.setTimeout(function(){if(id!=rg&&sg!=rg&&qg.floating!=true){var wg=(qg.sdk_vendor==="adstir"&&qg.sdk_version?parseInt(qg.sdk_version):0);var xg=document.getElementById(ff);var yg=document.getElementById(ff+"DELETE");if(pg.ck&&wg>=20000){var zg=(function(){var d=document.documentElement.scrollHeight;return d;})();if(zg<30){df.sendMessage("reload",[df.makeReload(pg,qg)]);}} else if(xg){var Ag=(function(){if(xg&&xg.getBoundingClientRect)return xg.getBoundingClientRect().height;return 1000000;})();if(Ag<30){ef[ff]=function(Bg){if(Bg==rg)return;var Cg=Bg.w;var Dg=Bg.h;if(Cg!=rg&&Dg!=rg){while(yg.childNodes.length>0)yg.removeChild(yg.childNodes[0]);var Eg=ef.document.createElement("div");var Fg='';Eg.innerHTML=hf(Bg,qg,Fg);yg.parentNode.insertBefore(Eg,yg);yg.parentNode.removeChild(yg);setTimeout(function(){var Gg=document.getElementById(ff+"RE");var Hg=ef.document.createElement("iframe");Hg.style.height=Dg+"px";Hg.style.width=Cg+"px";Hg.style.border="none";Hg.style.verticalAlign="bottom";Hg.scrolling="no";Hg.setAttribute("frameBorder","0");Hg.setAttribute("allowTransparency","true");Gg.appendChild(Hg);if(Bg.secure_frame&&Hg.sandbox instanceof DOMTokenList){Hg.setAttribute("sandbox","allow-forms allow-popups allow-scripts allow-top-navigation-by-user-activation allow-popups-to-escape-sandbox allow-same-origin");Hg.src=df.URL.secureFrameHtml+"#"+encodeURIComponent(Bg.html);} else{var d=Hg.contentWindow.document;d.open();if(pg.adtype!=="iframe")d.write('');d.write(Bg.html);if(pg.adtype!=="iframe")d.write('');d.close();}},10);}};var Ig=df.getParam(qg);Ig.iframe='1';Ig.topframe='0';Ig.callback=ff;Ig.force_group=tg;Ig.exclude_network=id;Ig.delete_log_network=sg+','+id;var Jg=df.makeUrl(df.URL.adtag,Ig);var Kg=document.createElement("script");Kg.src=Jg;document.body.appendChild(Kg);}}}},vg);}};};AdstirNext.prototype.makeAsync=function(){var Lg=this;var Mg=window;var Ng="AdstirCB"+Math.round(Math.random()*10000000000)+"A"+Math.round(Math.random()*10000000000);var Og=0;var Pg=0;var Qg=false;var Rg=false;return{prewrite:function(Sg){Og=Sg.iframe.width;Pg=Sg.iframe.height;Qg=Sg.center;Rg=Sg.floating;var Tg='';if(Qg||Rg){var t="";t=t+'';t=t+'';t=t+'
';t=t+Tg;t=t+'
';Tg=t;} Mg.document.write(Tg);},connect:function(Ug,Vg,Wg,Xg){Wg.callback="AdstirCB"+Math.round(Math.random()*10000000000)+"A"+Math.round(Math.random()*10000000000);Mg[Wg.callback]=Xg;Lg.addJS(Lg.makeUrl(Vg,Wg));},write:function(Yg,Zg){var $g=Mg.document.getElementById(Ng);var d=$g.contentWindow.document;d.open();d.write(''+Yg.html+"");d.close();},overlay:function(ah,bh){var ch=void 0;Mg.adstir_float=document.getElementById("adstir_float");if(bh.flags!==ch){var dh=JSON.stringify(bh.flags);Mg.adstir_float.setAttribute("data-flags",dh);} if(bh.line_vars!==ch){var dh=JSON.stringify(bh.line_vars);Mg.adstir_float.setAttribute("data-set",dh);} if(bh.down_vars!==ch){var dh=JSON.stringify(bh.down_vars);Mg.adstir_float.setAttribute("data-set2",dh);} if(bh.expand_vars!==ch){var dh=JSON.stringify(bh.expand_vars);Mg.adstir_float.setAttribute("data-set3",dh);} if(bh.commons!==ch){var dh=JSON.stringify(bh.commons);Mg.adstir_float.setAttribute("data-set-commons",dh);} var eh=document.createElement("script");eh.src=Lg.URL.float.replace(/%%NUMBER%%/,(ah.float<=1?"1":ah.float+""));document.body.appendChild(eh);},overlayPC:function(fh,gh){},loadedEnd:function(hh,jh){}};};AdstirNext.prototype.makeUrl=function(kh,lh){var mh;var nh=kh;var oh=true;for(var ph in lh){var qh=lh[ph];if(qh!==mh){if(oh){nh+="?";oh=false;} else{nh+="&";} nh+=encodeURIComponent(ph)+"="+encodeURIComponent(qh);}} return nh;};AdstirNext.prototype.makeReload=function(rh,th){var uh=th.reload_parameter;if(typeof uh==='string'){var vh=uh.split("|");if(rh.fgid===undefined){uh=vh[0]+","+rh.id+"|"+rh.gid;} else{uh=vh[0]+","+rh.id+"|"+rh.gid+"|"+rh.fgid;}} else{if(rh.fgid===undefined){uh=rh.id+"|"+rh.gid;} else{uh=rh.id+"|"+rh.gid+"|"+rh.fgid;}} return uh;};AdstirNext.prototype.addEvent=function(wh,xh,yh){if(wh.addEventListener){wh.addEventListener(xh,yh,false);} else if(wh.attachEvent){wh.attachEvent("on"+xh,yh);}};AdstirNext.prototype.addJS=function(zh){var Ah=document;var Bh=Ah.createElement("script");Bh.async=true;Bh.src=zh;var Ch=Ah.getElementsByTagName("script")[0];Ch.parentNode.insertBefore(Bh,Ch);};AdstirNext.prototype.writeJS=function(Dh){document.write('');};AdstirNext.prototype.arrayContains=function(Eh,Fh){if(Eh&&Fh){for(var i=0;i');}};AdstirNext.prototype.isInView=function(Zh,$h,ai){var bi=this;var $h=$h||0;var ci=function(a,b,c){if(b=0.50;if(ii){if($h==1){ai();} else{setTimeout(function(){bi.isInView(Zh,1,ai);},500);}}};AdstirNext.prototype.getVisualViewportOffset=function(){var ji=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop;var ki=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft;return{top:ji,left:ki,bottom:ji+window.innerHeight,right:ki+window.innerWidth,height:window.innerHeight,width:window.innerWidth};};AdstirNext.prototype.getVisualElementOffset=function(li){var mi=document.documentElement.offsetTop+li.offsetTop;var ni=document.documentElement.offsetLeft+li.offsetLeft;var oi=li.offsetParent;while(oi&&oi.tagName.toLowerCase()!=='body'&&oi.tagName.toLowerCase()!=='html'){mi+=oi.offsetTop;ni+=oi.offsetLeft;oi=oi.offsetParent;} return{top:mi,left:ni,bottom:mi+li.offsetHeight,right:ni+li.offsetWidth,height:li.offsetHeight,width:li.offsetWidth};};AdstirNext.prototype.getWindowParams=function(){return{screenWidth:window.screen.width||undefined,screenHeight:window.screen.height||undefined,pixelRatio:window.devicePixelRatio||undefined};};AdstirNext.prototype.supportsSVG=function(){return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");};AdstirNext.prototype.isLandscape=function(){return window.innerWidth>window.innerHeight;};AdstirNext.prototype.overlayRefresh=function(pi,qi,ri,si,ti){var ui=this;var vi=window;if(pi.overlay_refresh_limit>si){setTimeout(function(){vi[ri]=ti;var wi=ui.getParam(qi);wi.iframe='1';wi.topframe='0';wi.callback=ri;wi.oref='1';var xi=ui.makeUrl(ui.URL.adtag,wi);if(qi.debug){console.log("Refresh. Reload.");console.log(xi);} var yi=document.createElement("script");yi.src=xi;document.body.appendChild(yi);ui.overlayRefresh(pi,qi,ri,si+1,ti);},pi.overlay_refresh_time*1000);}};AdstirNext.RTUS=false;return AdstirNext;}());(function(){var zi=window;if(zi.adstir_vars.platform!=="webview"){var ua=navigator.userAgent;if(ua.indexOf('iPhone')>0||ua.indexOf('iPad')>0){AdstirNext.RTUS=true;}} new AdstirNext(zi.adstir_vars);zi.adstir_vars=void 0;})()