var OADTS_InLine=function(a){var e=9;var b=10;var g=11;var d=12;var f=13;var c={zoneid:false,target:window,is_showing:false,frame:false,banner:false,marginBelow:false,frameWindow:false,is_playing:false,has_played:false,has_loaded:false,upLevel:3,videoHeight:350,videoWidth:620,ismute:false,trackingUrls:{},minWidth:parseInt("270"),toggleMute:!!parseInt("1"),startMute:!!parseInt("1"),defaultPosition:parseInt("150"),allowedNodes:"",allowedRegex:false,debugLog:parseInt("0"),cust:"",css:false,maxWidth:0,iOS:/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,cTrack:true,cContinue:false,dl:function(h){if(this.debugLog){if(this.debugLog>1){if(!this.debugArea){var h=this.debugArea=this.target.document.createElement("DIV");var h=h.style;h.position="fixed";h.top=h.left="0px";h.width="100%";h.height="100px";h.zIndex="9999999";h.overflow="scroll";h.border="2px solid red";h.backgroundColor="white";this.target.document.body.appendChild(this.debugArea)}try{this.debugArea.appendChild(this.target.document.createTextNode(h));this.debugArea.appendChild(this.target.document.createElement("BR"))}catch(i){}}try{console.log(h)}catch(i){}}},mark:function(h,i){if(this.debugLog){for(var k=0;kk.videoHeight){k.target.clearInterval(i);j=k.videoHeight}k.banner.style.height=""+j+"px";try{k.target.dispatchEvent(new Event("resize"))}catch(h){}},3);k.mouseoverFunction=function(){if(k.toggleMute){k.clearMute()}};k.mouseoutFunction=function(){if(k.toggleMute){k.setMute()}};this.addEvent(this.banner,"mouseover",k.mouseoverFunction);this.addEvent(this.banner,"mouseout",k.mouseoutFunction)},closeVideo:function(){var m=this,l=m.banner.style,k=(l.height!="0px")?parseInt(m.banner.style.height)||m.videoHeight:0;var j=function(){m.frame.src="about:_blank";if(m.marginBelow){l.margin="0px"}l.display="none";m.banner.className="";m.cleanup()};if(k){var i=this.target.setInterval(function(){if((k-=8)<0){m.target.clearInterval(i);j();k=0}l.height=""+k+"px";try{m.target.dispatchEvent(new Event("resize"))}catch(h){}},3)}else{j()}},onTouched:function(){if(this.is_showing&&this.has_loaded&&!this.has_played&&!this.hasTouched&&!this.iOS){this.hasTouched=true;this.dl("onTouch");this.playPauseVideo(true)}},playPauseVideo:function(h){if(this.frameWindow!==false){this.frameWindow.postMessage(h?"setPlay":"setPause","*")}},onMessage:function(k){var i=k.data;var h=k.origin;var j="//media.oadts.com";if(h.indexOf(j)<4){return}this.dl("onMessage: "+i);this.frameWindow=k.source;if(i.indexOf("videoEnds:")!==-1||i.indexOf("videoComplete")!==-1){this.closeVideo()}else{if(i.indexOf("loaded")!==-1){this.has_loaded=true}else{if(i.indexOf("NoVideo")!==-1){this.closeVideo()}else{if(i.indexOf("videoStart")!==-1){this.has_played=true;this.openVideo()}}}}},visibleHeight:function(h){return h.innerHeight||h.document.documentElement.clientHeight||h.document.body.clientHeight||0},fGetPageSize:function(){var l,h,i=this.target,m=i.document;if(i.innerHeight){l=i.innerWidth;h=i.innerHeight}else{if(m.documentElement&&m.documentElement["clientHeight"]){l=m.documentElement["clientWidth"];h=m.documentElement["clientHeight"]}else{if(m.body){l=m.body.clientWidth;h=m.body.clientHeight}}}var k=i.outerHeight,j=i.outerWidth;if(j&&j0){var i=this.getClipRect(k),j=k;if(i){if(!i.top&&!i.left&&!i.width&&!i.height){return -1}var q=i.top-l,n=i.top+m;var j=this.fGetPageSize();var t=this.getDocumentScrollTop();if(q>t+j.h||nt+j.h){n=t+j.h}if(n>=q){s=Math.round(100*(n-q)/m);if(s>100){s=100}}this.dl("fVisibility="+s+" y1="+q+" y2="+n);return s}}}}this.dl("fVisibility=0");return 0},isScrolledIntoView:function(){if(!this.is_showing){var h=this.fVisibility(this.frame,this.videoHeight);if(h<0){h=this.fVisibility(this.banner,this.videoHeight);if(h<0){if(this.banner.style.display=="none"){this.banner.style.display="block"}}}if(h>=70){this.dl("isScrolledIntoView: loading");this.loadVideo();this.track(d)}}else{if(this.fVisibility(this.banner)>50){this.track(f);if(!this.is_playing){this.playPauseVideo(true);this.is_playing=true}}else{if(!this.cContinue&&this.is_playing){this.playPauseVideo();this.is_playing=false}}}},delEvent:function(i,j,h){if(i.removeEventListener){i.removeEventListener(j,h)}else{if(i.detachEvent){i.detachEvent("on"+j,h)}}},addEvent:function(i,j,h){if(i.addEventListener){i.addEventListener(j,h,false)}else{if(i.attachEvent){i.attachEvent("on"+j,h)}}},makeNode:function(){var h=this.target.document.createElement("DIV");h.style.display="none";return h},nodeDescr:function(i){var h=i.innerText?i.innerText:(i.textContent?i.textContent:"");return i.nodeName+"("+h.substr(0,20)+")"},findNodeWithTopBetween:function(m,q,p,h){var k=this.makeNode();var u=(q+p)/2;var o="";for(var j=0;j=u&&l){return l}}else{if(s.top>p){return l}}}}}return l},getNodeIndex:function(h){if(h&&h.parentNode){for(var i=0;i=j.parentNode.childNodes.length){return false}}j=j.parentNode.childNodes[k]}return false},testLocation:function(l){var h=this.fGetPageSize().h;var k=this.getClipRect(l);var q=Math.floor(h*this.defaultPosition/100);if(k&&q>=l.clientHeight){q=k.top+(k.height/2)}var p=q-(h*0.25);var o=q+(h*0.75);var i=this.findNodeWithTopBetween(l,p,o,0);while(i){var j=this.allowedNode(i,-1);var m=this.allowedNode(i,1);if(!j&&!m){i=i.parentNode}else{if(j&&m){var n=this.getClipRect(j).top+(j.clientHeight/2);var r=this.getClipRect(m).top+(m.clientHeight/2);var s=(p+o)/2;return(Math.abs(s-n)=this.minWidth){var o=9999,q=this.getClipRect(r);if(q){o=Math.abs(p-q.top)}if(k===false||m>o){k=r;m=o}}}}if(k){this.mark([k],"green")}return k},setup:function(h,j){var i=this;this.dl("setup");this.videoWidth=h.offsetWidth||h.parentNode.offsetWidth;if(this.videoWidth/);var j=k[p].split(/=o.minWidth){i.push(s);break}s=s.parentNode}}}catch(m){}}return i},init:function(l){var i=this;if(i.allowedNodes!==""){try{i.allowedRegex=new RegExp(i.allowedNodes)}catch(k){}}if(!l){return 0}i.dl("inline");i.dl(l);i.zoneid=l.zoneid?parseInt(l.zoneid):false;this.track(b);var h=false;if(l.location){h=i.getLocation(l.location)}if(!h){var j=l.placement?i.getPlacement(l.placement):false;if(!j&&l.body!==false){j=i.getContainers();j.push(i.target.document.body)}if(j){h=i.findLocation(j)}}if(typeof(l.maxWidth)!="undefined"&&l.maxWidth>0){i.maxWidth=l.maxWidth}if(!i.zoneid||isNaN(i.zoneid)){return 0}if(!i.target){return 0}if(!h||!i.setup(h,!!l.behind)){return 0}if(typeof(l.cust)!="undefined"){try{i.cust=i.build_custom(l.cust)}catch(k){}i.dl("custom="+i.cust)}if(typeof(l.css)=="string"){i.css=l.css}this.track(g);i.messageFunction=function(m){i.onMessage(m)};i.scrollFunction=function(){i.isScrolledIntoView()};i.touchFunction=function(m){i.onTouched(m)};if(i.target!=window){i.addEvent(window,"message",i.messageFunction)}i.addEvent(i.target,"message",i.messageFunction);i.addEvent(i.target,"scroll",i.scrollFunction);i.addEvent(i.target,"touchmove",i.touchFunction)},contentLoaded:function(k,o){var j=false,n=true,q=k.document,p=q.documentElement,h=q.addEventListener,t=h?"addEventListener":"attachEvent",r=h?"removeEventListener":"detachEvent",i=h?"":"on",s=function(u){if(u.type=="readystatechange"&&q.readyState!="complete"){return}(u.type=="load"?k:q)[r](i+u.type,s,false);if(!j&&(j=true)){o.call(k,u.type||u)}},m=function(){try{p.doScroll("left")}catch(u){setTimeout(m,50);return}s("poll")};if(q.readyState=="complete"){o.call(k,"lazy")}else{if(!h&&p.doScroll){try{n=!k.frameElement}catch(l){}if(n){m()}}q[t](i+"DOMContentLoaded",s,false);q[t](i+"readystatechange",s,false);k[t](i+"load",s,false)}},domReady:function(j){var h=this;try{h.zoneid=j.zoneid?parseInt(j.zoneid):false}catch(i){}if(h.zoneid){this.track(e)}h.target=j.window?j.window:top;h.contentLoaded(h.target,function(){h.init(j)})}};c.domReady(a)};