jwplayer.vast={},function(a){function b(b){var c;return a.utils.foreach(b,function(a,b){c=c||{},"_adQueue"===a?c[a]=b.slice():c[a]=b}),c}function c(a,b){return"%"===a.toString().slice(-1)?b*parseFloat(a.slice(0,-1))/100:parseFloat(a)}a.vast.schedule=function(){function d(a,b){for(var d=h.length;d--;)if(a>=c(h[d]._offSet,b))return d;return-1}var e,f,g,h=[],i=[];this.setPreRoll=function(a){e=a},this.getPreRoll=function(){return b(e)},this.getPostRoll=function(){return b(g)},this.getNextMidRoll=function(a,c){if(this.sort(c),h.length>i.length){var e=d(a,c);if(e>=0&&i.indexOf(e)<0){var f=h[e];return i.push(e),b(f)}}},this.getMidRolls=function(){var c=[];return a.utils.foreach(h,function(a,d){c.push(b(d))}),c},this.reset=function(){i=[]},this.addMidRoll=function(a){h.push(a)},this.setPostRoll=function(a){g=a},this.sort=function(a){(!a||a<1)&&(a=1),h.sort(function(b,d){return c(b._offSet,a)-c(d._offSet,a)})},this.setVMAP=function(a){f=a},this.isVMAP=function(){return!!f},this.getVMAP=function(){return f}}}(jwplayer),function(a){function b(a){return h.isString(a)?[a]:h.isArray(a)?a.slice(0):a}function c(a){if("start"===a||"0%"===a)return"pre";if("end"===a||"100%"===a)return"post";if("pre"===a||"post"===a||h.indexOf(a,"%")>-1)return a;var b=g.seconds(a);return!!h.isNumber(b)&&b}function d(a,d){var e=d.schedule||d.adschedule;h.each(e,function(e){e.ad&&(g.extend(e,e.ad),delete e.ad);var f=c(e.offset),i={_offSet:f,_type:e.type};f===!1&&g.log("Error: ad offset format not supported",f);var j=e.skipoffset||d.skipoffset;h.isUndefined(j)||(i.skipoffset=j);var k=e.adbreakid;k&&(i.adbreakid=k);var l=e.adtagid;if(l&&(i._adTagQueue=b(l)),e.tag)i._adQueue=b(e.tag),i._waterfallIndex=0;else{if(!h.isString(e.vastxml))return void g.log("Error: no ad tag provided");i._adXML=e.vastxml}switch(f){case"pre":a.setPreRoll(i);break;case"post":a.setPostRoll(i);break;default:a.addMidRoll(i)}})}function e(c){var e=new a.vast.schedule;if(c.tag)e.setPreRoll({_offSet:"pre",_adQueue:b(c.tag),_waterfallIndex:0});else if(h.isString(c.vastxml))e.setPreRoll({_offSet:"pre",_adXML:c.vastxml});else{if(h.isString(c.schedule))return e.setVMAP(c.schedule),e;if(h.isString(c.adschedule))return e.setVMAP(c.adschedule),e;d(e,c)}return e.sort(),e}function f(a){var b={cuetext:a.cuetext||l,dynamicMessage:a.admessage||i,podMessage:a.podmessage||j,skipoffset:a.skipoffset||k,skipMessage:a.skipmessage||m,skipText:a.skiptext||n},c=a.companiondiv;return c&&(b.companion={id:c.id,height:c.height,width:c.width}),b}var g=a.utils,h=a._,i="This ad will end in xx seconds.",j="Ad __AD_POD_CURRENT__ of __AD_POD_LENGTH__. ",k=-1,l="Advertisement",m="Skip ad in xx",n="Skip";a.vast.configparser={getSchedule:e,getOptParams:f}}(jwplayer),function(a){function b(a,b,c){return a.replace(b,c)}function c(a){var b=a.getConfig();return{playerHeight:a.getHeight()||b.height||"",playerWidth:a.getWidth()||b.width||"",itemDuration:d(a.getDuration(),3)||"",item:b.playlist[a.getPlaylistIndex()]||{}}}function d(a,b){var c=Math.pow(10,b);return Math.round(a*c)/c}a.vast.doReplacement=function(d,e,f,g){if(!d)return d;var h=c(e),i=h.item,j=window.location.href;d=b(d,"__random-number__",Math.random()*Math.pow(10,18)),d=b(d,"__timestamp__",(new Date).getTime()),d=b(d,"__page-url__",encodeURIComponent(j)),d=b(d,"__referrer__",encodeURIComponent(document.referrer)),d=b(d,"__player-height__",h.playerHeight),d=b(d,"__player-width__",h.playerWidth),d=b(d,"__item-duration__",h.itemDuration),d=b(d,"__domain__",encodeURIComponent(f)),d=g.companion?b(d,"__companion-div__",g.companion.id):b(d,"__companion-div__","");for(var k=d.match(new RegExp(/__item-[a-z 0-9 A-Z]*__/g)),l=0;k&&l1e3&&(o=o.substring(0,1e3)),d=b(d,m,encodeURIComponent(o))}else d=b(d,m,"")}return d}}(window.jwplayer),function(a){function b(a,b,c){var d=[];return a&&(d=a.getElementsByTagName(b),c&&d&&0===d.length&&(d=a.getElementsByTagName(c+":"+b))),d}function c(a,b){return a?a.getAttribute(b):null}function d(a){if(a){var b=a.textContent||a.text;if(b)return g.trim(b)}return""}function e(a,b){var e=c(b,"event");if("progress"===e){var g=c(b,"offset");e=e+"_"+g}var h=d(b);f(a,e,h)}function f(a,b,c){a[b]||(a[b]=[]),c&&a[b].push(c)}var g=a.utils,h="vmap";a.vast.vmapparser=function(a,f){for(var i=b(a,"AdBreak",h),j=0;j3||a<1)&&k(102,"Vast version not supported"),o?(a>=2?(g=m(o),l(o,"Impression",g.trackers),l(o,"Error",g.trackers)):g=n(o),i&&(g.wrappedURI=d(b(i,"VASTAdTagURI")[0])||d(b(i,"VASTAdTagURL")[0])),g=j(f,g)):k(101,"Invalid VAST response"),g}function j(a,b){var c=g.extend({},a);return g.foreach(b,function(a,d){g.exists(c[a])?"array"==g.typeOf(d)?c[a]=c[a].concat(d):"object"==g.typeOf(d)?c[a]=g.extend(c[a],b[a]):c[a]=d:c[a]=d}),c}function k(a,b){throw s={code:a,message:b,toString:function(){return this.code+" "+this.message}}}function l(a,c,e){var g,h=b(a,c);for(g=0;g1&&(f.wrapper=d.wrapper.slice(0,-1))}),r()):w("Ad Tag Empty",101,g)}function n(a,b){var c=g.indexOf(C,a);C.splice(c,1),b.destroy(),r()}function o(a,b){var c=p(a,b),d=g.indexOf(C,a);Array.prototype.splice.apply(C,[d,1].concat(c)),r()}function p(a,b){var c=[];return f.foreach(b,function(b,d){a.companions&&(d.companions=(d.companions?d.companions:[]).concat(a.companions)),a.trackers&&(d.trackers=q(d.trackers,a.trackers)),a.sequence&&(d.sequence=a.sequence),c.push(d)}),c}function q(a,b){return a=a||{},f.foreach(b,function(b,c){a[b]?a[b]=a[b].concat(c):a[b]=c}),a}function r(){var a=!1;f.foreach(C,function(b,c){c.wrappedURI&&(a=!0)}),a||s()}function s(){for(var a=C.slice(0),b=a.length,c=a.length;c--;){var d=a[c];d.media&&d.media.length||a.length--}var f=0===b,g=a.length!==b;return f||g?void w("Ad Tag Empty",101,B[B.length-1]):void x(e.COMPLETE,{vloader:A})}function t(a,b){"Invalid XML"===a?w(a,100,b):w("VAST could not be loaded",301,b)}function u(){return B&&B.length?B[0]:""}function v(a,b,c){return 1===C.length?void w(a,b,c):void A.trigger("adPodError",{message:a,code:b,vloader:A,url:u()||c,wrappedUrl:c})}function w(a,b,c){D||(D=!0,A.trigger(e.ERROR,{message:a,code:b,vloader:A,url:u()||c,wrappedUrl:c}))}function x(a,b){return A.trigger(a,b)}var y,z,A=this,B=[],C=[],D=!1;d=d||{},f.extend(A,c.Events),A.load=function(a){B.push(a),D=!1,z=k(a)},A.destroy=function(){l(z),c=null},A.scheduledAd=function(){return a},A.allAds=function(){return C},A.adPod=function(){var a=[];return f.foreach(C,function(b,c){c.sequence&&a.push(c)}),a.sort(function(a,b){return a.sequence-b.sequence}),a},A.adBuffet=function(){var a=[];return f.foreach(C,function(b,c){c.sequence||a.push(c)}),a},A.history=function(){return B},A.parseXmlString=function(a,c){m({responseXML:b(a)},c)}}}(window),function(a){a.vast.companion=function(b){function c(a){if(a=a.creativeView){for(var c=0;c';m+='',m+='',m+='',m+='',m+='',m+='',m+="",h.innerHTML=m}else{var n=document.createElement("object");n.setAttribute("type","application/x-shockwave-flash"),n.setAttribute("data",a.source),n.setAttribute("width","100%"),n.setAttribute("height","100%"),n.setAttribute("tabindex",0),d(n,"allowfullscreen","true"),d(n,"allowscriptaccess","always"),d(n,"seamlesstabbing","true"),d(n,"wmode","opaque"),h.appendChild(n)}return void c(a.trackers)}var o=new Image;o.src=a.source,j.exists(a.clickthrough)&&(o.onclick=function(){var b=window.open(a.clickthrough,"_blank");b.focus()}),h.innerHTML="",h.appendChild(o),c(a.trackers)}function f(a){return a.width==g.width&&a.height==g.height}var g,h,i=this,j=a.utils,k=a._;i.addCompanion=function(a,b){if(g=a,h=document.getElementById(g.id),!h)return!1;for(var c=0;co&&o<3;)o++,1===o?h("firstQuartile"):2===o?h("midpoint"):3===o&&h("thirdQuartile");l(a,b)}}function l(a,b){for(var c=q.length;c--;){var d=q[c];if(!d.tracked){var e=d.offset;d.percentage&&(e=b*e/100),a>=e&&(d.tracked=!0,h(d.key))}}}function m(a){p.firedError=!0,a=a||900;var b={};b[d]=a,h("error",b)}function n(a){return function(){h(a)}}var o=0,p=this,q=[];for(var r in a)if(a.hasOwnProperty(r)&&0===r.indexOf("progress")){var s=""+r.split("_")[1],t={key:r,offset:s,tracked:!1,percentage:!1};/^\d+%$/.test(s)?(t.percentage=!0,t.offset=parseFloat(s)):t.offset=b.seconds(s),q.push(t)}p.started=!1,p.firedError=!1,p.hasComp=!1,p.addUrl=function(b,c){a.hasOwnProperty(b)?a[b].push(c):(a[b]=[],a[b].push(c))},p.creativeView=n("creativeView"),p.start=i,p.click=n("click"),p.skip=n("skip"),p.complete=n("complete"),p.pause=n("pause"),p.resume=n("resume"),p.mute=n("mute"),p.unmute=n("unmute"),p.fullscreen=n("fullscreen"),p.expand=n("expand"),p.collapse=n("collapse"),p.acceptInvitation=n("acceptInvitation"),p.close=n("close"),p.rewind=n("rewind"),p.impression=n("impression"),p.breakStart=j,p.breakEnd=n("breakEnd"),p.time=k,p.error=m}}(window.jwplayer),function(a){var b=a.utils,c=b.UI,d=a.events,e=d.JWPLAYER_MEDIA_TIME,f={CLICK:"onClick",PLAY:"onPlay",PAUSE:"onPause",ERROR:"onError",COMPLETE:"onComplete"},g=document.createElement("img"),h=document.createElement("img"),i={cursor:"pointer",position:"absolute",margin:"auto",left:0,right:0,bottom:0,display:"block"},j="opacity 0.2s",k={"-webkit-transition":j,transition:j},l=function(a,d,e,i){function j(){clearTimeout(x),z.trigger(f.ERROR),v()}function k(){z.trigger(f.CLICK)}function l(){r(h)}function m(){r(h,.75)}function n(){r(g)}function o(){r(g,.5)}function p(a){y===-1&&(a.preventDefault(),i.onmouseover=i.onmouseout=null,s([w,h,g]),i.appendChild(g),y=setTimeout(function(){t(w),t(h),r(g,.5),i.onmouseover=n,i.onmouseout=o,y=-1},250))}function q(a){y===-1&&(a.preventDefault(),i.onmouseover=i.onmouseout=null,i.appendChild(w),i.appendChild(h),y=setTimeout(function(){r([w,h]),i.onmouseover=l,i.onmouseout=m,y=-1},50),s(g))}function r(a,c){b.style(a,{opacity:c||1})}function s(a){b.style(a,{opacity:0})}function t(a){i.contains(a)&&i.removeChild(a)}function u(){w.onload=w.onerror=null}function v(){u(),t(w)}var w,x=-1,y=-1,z=this;b.extend(this,a.Events),w=document.createElement("img"),w.className="jw-banner",w.id=a.id+"_vast_static",s([h,g]),t(g),i.appendChild(w),i.appendChild(h),x=setTimeout(j,5e3),w.onerror=j,w.onload=function(){return clearTimeout(x),0===w.naturalWidth?j():(u(),b.style(h,{top:-w.height-8,bottom:w.height-8,left:w.width},!0),b.style(g,{top:-16},!0),r([i,w]),r(h,.75),new c(w).on("click tap",k),b.isMobile()||(i.onmouseover=l,i.onmouseout=m),h.onclick=h.ontouchstart=p,g.onclick=g.ontouchstart=q,void z.trigger(f.PLAY))},w.src=d,z.removeListeners=function(){clearTimeout(x),clearTimeout(y),i.onmouseover=i.onmouseout=h.onclick=g.onclick=null,z.off(),u()},z.stop=function(){s([i,w,h,g]),setTimeout(v,400),t(h),t(g)}};g.src=h.src='data:image/svg+xml;charset=UTF-8,',a.vast.staticplayer=function(a,c){function j(a){v.trigger(e,a)}function m(){w=a.getPosition(),x>0&&(0===w?v.on(e,n):v.on(e,o)),r(f.PLAY)}function n(a){w=a.position,v.off(e,n),v.on(e,o)}function o(a){var b=a.position-w;b>x&&(v.off(e,o),v.stop())}function p(){r(f.CLICK)}function q(){r(f.ERROR)}function r(a,b){b=b||{},b.tag=b.tag||u,v.trigger(a,b)}function s(a){return function(b){v.on(a,b)}}var t,u,v=this,w=0,x=0;b.extend(this,a.Events),v.type="static",a.onTime(j),v.playAd=function(d,e,j,n){x=b.seconds(j),u=n,t&&(t.removeListeners(),t.stop()),c.style.opacity=0,c.style.visibility="visible";var o=b.isFF()?{}:k;b.style(c,b.extend({top:"",position:"absolute",width:"100%"},o)),b.style([h,g],b.extend({width:"18px",height:"18px",opacity:.75},i,o)),b.style(h,{transform:"rotate(45deg)"}),t=new l(a,d,e,c),t.on(f.PLAY,m),t.on(f.CLICK,p),t.on(f.ERROR,q)},v.removeEvents=function(){v.off()},v.getState=function(){return d.state.PLAYING},v.stop=function(){w&&t&&(w=0,x=0,v.off(e,n),v.off(e,o),t.removeListeners(),t.stop(),r(f.COMPLETE))},v.pause=function(){},v.onPlay=s(f.PLAY),v.onComplete=s(f.COMPLETE),v.onClick=s(f.CLICK),v.onError=s(f.ERROR)}}(window.jwplayer),function(a){var b=a.vast,c=a.events.state,d=a.utils,e=a._;b.vpaidplayer=function(a,b,f,g,h){function i(){j(R),G(S,o),G(U,p),G(T,q),G(W,t),G(X,u),G(ca,x),G(da,y),G(V,v),G(aa,w),G(Y,z),G(ba,r),G(ea,s),G(fa,l),G(Z,A),G($,B),G(_,C);var b=a.getSafeRegion(!1);E("initAd",b.width,b.height+b.y,k(),0,h)}function j(a){d.isIE()&&"PointerEvent"in window&&(b.style.pointerEvents=a)}function k(){return a.getFullscreen()?"fullscreen":"normal"}function l(){m(P.ERROR)}function m(a,b){O||(b=b||{},b.linear=L.linear?"linear":"nonlinear",b.tag=g,J.trigger(a,b))}function n(a){a&&(e.isBoolean(a.linear)&&(L.linear=a.linear),e.isBoolean(a.expanded)&&(L.expanded=a.expanded),e.isNumber(a.remainingTime)&&(L.remainingTime=a.remainingTime))}function o(b){t(b),F("adVolume",a.getMute()?0:a.getVolume()/100),E("startAd")}function p(a){n(a),a.linear&&J.blocking&&J.blocking.hide(),m(P.STARTED),m(P.PLAY,{oldstate:c.BUFFERING,newstate:c.PLAYING})}function q(a){n(a),m(P.IMPRESSION)}function r(a){n(a),m(P.CLICK)}function s(a){n(a),m(P.SKIPPED)}function t(b){n(b);var c,d,e;if(b.linear){if(J.blocking)J.blocking.hide();else{K=!0,a.setControls(!1);var f=a.getState();f!==f.PLAYING&&f!==f.BUFFERING||a.pause(!0)}e=a.getSafeRegion(!1),d=e.height+e.y,c=e.width}else J.blocking?(J.blocking.destroy(),J.blocking=null):K&&(a.play(!0),a.setControls(!0)),e=a.getSafeRegion(!0),d=e.height+e.y,c=e.width;E("resizeAd",c,d,k())}function u(a){n(a),m(P.EXPANDED_CHANGE,{expanded:L.expanded})}function v(b){n(b),K&&(a.play(!0),a.setControls(!0)),j(Q),m(P.STOPPED)}function w(){j(Q),m(P.COMPLETE)}function x(a){n(a),M||(M=!0,m(P.PAUSE,{newstate:c.PAUSED,oldstate:c.PLAYING}))}function y(a){n(a),M&&(M=!1,m(P.PLAY,{newstate:c.PLAYING,oldstate:c.PAUSED}))}function z(a){n(a),m(P.REMAINING_TIME,{remainingTime:a.remainingTime})}function A(a){D(1,a)}function B(a){D(2,a)}function C(a){D(3,a)}function D(a,b){n(b),m("quartile",{quartile:a,remainingTime:b.remainingTime})}function E(){var a=Array.prototype.slice.call(arguments);a.unshift("vast:callVpaid"),b.triggerFlash.apply(b,a)}function F(a,c){b.triggerFlash("vast:setVpaidProperty",a,c)}function G(a,c){b.triggerFlash("vast:addVpaidListener",a,H(c))}function H(c){var d=a.id+":vast:"+c.name+":"+Math.random().toString(16).substr(2);return b.on(d,c,J),d}function I(a){return function(b){this.on(a,b)}}var J=e.extend(this,a.Events),K=!1,L={linear:!1,expanded:!1,remainingTime:-1},M=!1,N=-1,O=!1,P={QUARTILE:"quartile",REMAINING_TIME:"remainingTimeChange",SKIPPED:"skipped",STARTED:"started",STOPPED:"stopped",CLICK:"click",PLAY:"play",IMPRESSION:"impression",PAUSE:"pause",ERROR:"error",COMPLETE:"complete",CLOSE:"close",EXPANDED_CHANGE:"expandedChange"},Q="none",R="auto",S="AdLoaded",T="AdImpression",U="AdStarted",V="AdStopped",W="AdLinearChange",X="AdExpandedChange",Y="AdRemainingTimeChange",Z="AdVideoFirstQuartile",$="AdVideoMidpoint",_="AdVideoThirdQuartile",aa="AdVideoComplete",ba="AdClickThru",ca="AdPaused",da="AdPlaying",ea="AdSkipped",fa="AdError";J.type="vpaid",J.blocking=null,J.setVolume=function(a){F("adVolume",a/100)},J.onQuartile=I(P.QUARTILE),J.onRemainingTimeChange=I(P.REMAINING_TIME),J.onSkipped=I(P.SKIPPED),J.onComplete=I(P.COMPLETE),J.onStopped=I(P.STOPPED),J.onClick=I(P.CLICK),J.onPlay=I(P.PLAY),J.onPause=I(P.PAUSE),J.onImpression=I(P.IMPRESSION),J.onError=I(P.ERROR),J.onStarted=I(P.STARTED),J.onClose=I(P.CLOSE),J.onExpandedChange=I(P.EXPANDED_CHANGE),J.play=function(){E("resumeAd")},J.pause=function(){E("pauseAd")},J.stop=function(){E("stopAd")},J.resize=function(){var b=a.getSafeRegion(!L.linear);E("resizeAd",b.width,b.height+b.y,k())},J.removeEvents=function(){J.off()},J.destroy=function(){J.removeEvents(),j(Q),b.off(null,null,J),J.blocking=null},J.getState=function(){return L.linear?M?c.PAUSED:c.PLAYING:c.IDLE},d.isChrome()&&b.on("throttle",function(a){clearTimeout(N),"resume"===a.state?(O=!1,y(L),j(Q),E("resumeAd")):N=setTimeout(function(){j(R),E("pauseAd"),x(L),O=!0},250)},this),b.triggerFlash("vast:loadVpaid",f,H(i),H(l))}}(window.jwplayer),function(a){var b=a.vast,c=a.events.state;b.vpaidplayerjs=function(a,b,d,e){function f(a,b){b=b||{},b.tag||(b.tag=d),o.trigger(a,b)}function g(a,b){f("quartile",{quartile:b,duration:a.getAdDuration()})}function h(a){return function(b){o.on(a,b)}}function i(b,c){var d=document.createElement("iframe");d.src="javascript:false",d.style.border="0px",d.style.width="100%",d.style.height="100%",d.style.position="relative",d.style.overflow="hidden",d.scrolling="no";var e=a.getContainer(),f=e.getElementsByClassName("jw-media")[0];f.appendChild(d),p.push(d);var g=d.contentWindow.document;return g.open().write(""),d.contentWindow.myCallback=c,g.close(),d}function j(){a.setMute(!o.vpaidAd.getAdVolume())}function k(b){return{AdLoaded:function(){b.startAd()},AdStarted:function(){b.getAdLinear()&&o.blocking&&o.blocking.hide(),f("started"),f("play",{oldstate:c.BUFFERING,newstate:c.PLAYING,linear:b.getAdLinear()?"linear":"nonlinear"}),b.subscribe(j,"AdVolumeChange")},AdStopped:function(){l(p),a.setControls(!0),f("stopped")},AdPaused:function(){r||(r=!0,f("pause",{newstate:c.PAUSED,oldstate:c.PLAYING}))},AdPlaying:function(){r&&(r=!1,f("play",{newstate:c.PLAYING,oldstate:c.PAUSED,linear:b.getAdLinear()?"linear":"nonlinear"}))},AdLinearChange:function(){if(b.getAdLinear())if(o.blocking)o.blocking.hide();else{a.setControls(!1);var c=a.getState();c!==c.PLAYING&&c!==c.BUFFERING||a.pause(!0)}else o.blocking?(o.blocking.destroy(),o.blocking=null):(a.play(!0),a.setControls(!0))},AdDurationChange:function(){f("remainingTimeChange",{duration:b.getAdDuration(),remainingTime:b.getAdRemainingTime()})},AdRemainingTimeChange:function(){f("remainingTimeChange",{duration:b.getAdDuration(),remainingTime:b.getAdRemainingTime()})},AdExpandedChange:function(){f("expandedChange",{expanded:b.getAdExpanded()})},AdSkipped:function(){f("skipped")},AdVideoFirstQuartile:function(){g(b,1)},AdVideoMidpoint:function(){g(b,2)},AdVideoThirdQuartile:function(){g(b,3)},AdVideoComplete:function(){f("complete")},AdUserClose:function(){f("close")},AdImpression:function(){f("impression",{linear:b.getAdLinear()?"linear":"nonlinear"})},AdClickThru:function(a,b,c){c&&window.open(a),f("click",{id:b})},AdError:function(a,b){l(p),f("error",{message:a,code:b})}}}function l(a){for(;a.length>0;){var b=a.pop();b.parentNode&&b.parentNode.removeChild(b)}}var m=a._,n=a.Events,o=this,p=[],q={linear:!1,expanded:!1,remainingTime:-1},r=!1;this.type="vpaid",this.blocking=null;var s=function(){var b=o.vpaidAd=t.contentWindow.getVPAIDAd(),c=b.handshakeVersion("2.0");if(parseFloat(c)<1)throw"Invalid vpaid version in handshake";o.Listeners=k(b),m.each(o.Listeners,b.subscribe,b);var d="normal",f=1e3,g={AdParameters:e},h=a.getContainer(),i=h.getElementsByClassName("jw-media")[0],j=i.getElementsByTagName("video")[0],l=t.contentWindow.document.createElement("div");l.className="jw-vpaid-wrapper",l.style.height="100%",t.contentWindow.document.body.appendChild(l),j?j.removeAttribute("preload"):(j=document.createElement("video"),j.setAttribute("webkit-playsinline",""),j.setAttribute("playsinline",""),i.insertBefore(j,t),p.push(j));var n={videoSlot:j,slot:l};b.initAd(i.clientWidth,i.clientHeight,d,f,g,n)},t=i(b,s);m.extend(this,n,{play:function(){o.vpaidAd.resumeAd()},pause:function(){o.vpaidAd.pauseAd()},stop:function(){if(o.vpaidAd)try{o.vpaidAd.stopAd()}catch(a){console.log("Unhandled exception from VPAID2 Creative stopAd",a)}},setVolume:function(a){o.vpaidAd.setAdVolume(a/100)},resize:function(){},destroy:function(){if(l(p),o.removeEvents(),o.vpaidAd)try{m.each(o.Listeners,o.vpaidAd.unsubscribe),o.vpaidAd.unsubscribe(j,"AdVolumeChange")}catch(a){console.log("Unhandled exception from VPAID2 Creative",a)}o.blocking=null},removeEvents:function(){o.off()},onTime:h("time"),onComplete:h("complete"),onClose:h("close"),onClick:h("click"),onPlay:h("play"),onPause:h("pause"),onError:h("error"),onImpression:h("impression"),onExpandedChange:h("expandedChange"),onSkipped:h("skipped"),onStopped:h("stopped"),onStarted:h("started"),onQuartile:h("quartile"),onRemainingTimeChange:h("remainingTimeChange"),getState:function(){return q.linear?r?c.PAUSED:c.PLAYING:c.IDLE}})}}(window.jwplayer),function(a){function b(a){for(var b=[],c=0;cza&&(ma&&g.isFunction(ma.destroy)&&ma.destroy(),za++,w())}function E(a){ra=setTimeout(function(){D("VPAID tag communication timeout")},i),xa=a;var b=u(a);if(xa.selectedMedia=b,pa=b.type,"flash"===t(b)){var c=r();ma=new e.vpaidplayer(k,c,b.file,ua._currentTag,xa.adParams)}else ma=new e.vpaidplayerjs(k,b.file,ua._currentTag,xa.adParams);ma.blocking=oa,ma.onPlay(R),ma.onPause(T),ma.onQuartile(V),ma.onRemainingTimeChange(U),ma.onClick(da),ma.onError(ha),ma.onImpression(Q),ma.onExpandedChange(ja),ma.onClose(Z),ma.onSkipped(ga),ma.onStopped(_),ma.onComplete(Y),ma.onStarted($)}function F(a,b){na=oa?oa:k.createInstream().init(),na.on("play",R),na.on("pause",T),na.on("time",W),na.on("playlistItem",O),na.on("complete",Y),na.on("playlistComplete",aa),na.on("mute",ba),na.on("instreamClick",ea),na.on("adSkipped",ga),na.on("error",ha),na.on("mediaError",ha),na.loadItem(a,b)}function G(a){var b,c=q();return b="flash"===c?g.where(d.api.availableProviders,{name:"flash"}):g.filter(d.api.availableProviders,function(a){return"flash"!==a.name}),g.filter(a,function(a){return g.some(b,function(b){return b.supports(a)})})}function H(a){a.tracker.linear="linear";var b=a.media[0],c=(""+b.adType).toLowerCase()||"instream",e={vastAd:a,sources:[],adType:c,mediaType:b.type};ua.skipoffset&&(e.skipoffset=ua.skipoffset);for(var f=a.media,g={},h=0;hg[j.file].width)&&(j=m),n.width>=i.width&&(!l||n.width=0?o.skipoffset:null;return{skipoffset:a.skipoffset||ua.skipoffset||b,skipMessage:o.skipMessage,skipText:o.skipText}}function J(a){if(qa){var b;if(b=qa.length?qa[a]:qa,b.vastAd)return b.vastAd}else if(wa&&wa.length)return wa[a];return xa}function K(a,b){clearTimeout(ra),b=b||900;var c=B();if(c.code=b,c.message=a,wa&&za9?e.companions:c(e.companions),o.companion&&j&&j.length&&(g.hasComp=l.addCompanion(o.companion,j)),g.start(),g.creativeView(),S(a)}}function S(a){if("static"!==la&&("vpaid"!==la||"linear"===a.linear)){var b=B();b.oldstate=a.oldstate,b.newstate=a.newstate,k.dispatchEvent(h.JWPLAYER_AD_PLAY,b)}}function T(a){var b=J(za),c=b.tracker;c.pause();var d=B();d.oldstate=a.oldstate,d.newstate=a.newstate,k.dispatchEvent(h.JWPLAYER_AD_PAUSE,d)}function U(a){ya=a.duration?a.duration:Math.max(1,ya,a.remainingTime);var b=a.remainingTime>=0?ya-a.remainingTime:0;W({position:b,duration:ya})}function V(a){if(a.duration)ya=a.duration;else{var b=4*a.remainingTime/(4-a.quartile);ya=Math.max(ya,1,b)}W({position:ya*a.quartile*.25,duration:ya})}function W(a){var b=J(za),c=a.position,d=a.duration,e=o.dynamicMessage||"",f=o.podMessage||"",g=d-c,i=b.tracker;if(i&&i.time(c,d),na&&e&&g>0){if(e=e.replace(/xx/gi,""+Math.ceil(g)),qa&&qa.length>1){var j=za+1;f=f.replace(/__AD_POD_CURRENT__/g,""+j),f=f.replace(/__AD_POD_LENGTH__/g,""+qa.length),e=f+e}na.setText(e)}var l=B();l.position=c,l.duration=d,k.dispatchEvent(h.JWPLAYER_AD_TIME,l)}function X(){Y(),aa()}function Y(){var a=J(za),b=a.tracker;b.firedError||(b.complete(),k.dispatchEvent(h.JWPLAYER_AD_COMPLETE,B()))}function Z(){var a=J(za),b=a.tracker;b.firedError||b.close()}function $(){k.dispatchEvent("adStarted",B())}function _(){return qa&&qa.length-1>za?(ma&&g.isFunction(ma.destroy)&&ma.destroy(),za++,void w()):void aa()}function aa(){z(),ta.trigger(h.JWPLAYER_AD_COMPLETE)}function ba(a){var b=J(za),c=b.tracker;c&&(a.mute?(c.mute(),ma&&ma.setVolume(0)):(c.unmute(),ma&&ma.setVolume(k.getVolume()/100)))}function ca(){var a=J(za);k.pause(!0),fa(a)}function da(){var a=J(za);fa(a)}function ea(){var a=J(za),b=na.getState()===h.state.PAUSED;b||fa(a)}function fa(b){b.tracker.click(),k.dispatchEvent(h.JWPLAYER_AD_CLICK,B());var c=a.jwcast&&a.jwcast.player.id;c||b.clickthrough&&a.open(b.clickthrough)}function ga(){var a=J(za);a.tracker.skip(),k.dispatchEvent(h.JWPLAYER_AD_SKIPPED,B())}function ha(a){var b=a.message||"Error Playing Ad Tag",c=a.code||400;ma&&g.isFunction(ma.off)?(ma.off(),D(b,c)):K(b,c)}function ia(){var a="Unable to fetch NonLinear resource",b=502;K(a,b)}function ja(a){var b=J(za),c=b.tracker;a.expanded?c.expand():c.collapse()}function ka(a){var b=q(),c={d:n.domain,c:"vast",m:b,a:n.account,co:a.tracker.hasComp,p:ua._position,ad:a.adsystem,type:a.tracker.linear,ph:n.hosting,ed:n.edition,n:Math.random().toFixed(16).substr(2,16)},d=n.trackingbase,e="?";for(var f in c)d+=e+f+"="+encodeURIComponent(c[f]),e="&";return d}var la,ma,na,oa,pa,qa,ra,sa,ta=this,ua=j.scheduledAd(),va=j.adBuffet(),wa=j.adPod(),xa=va.length?va[0]:null,ya=0,za=0,Aa=0;f.extend(ta,k.Events),this.init=function(a){ta.init=function(){throw"vast.adplayer can only be initialized once"},oa=a;var b=v();return!!b&&(w(),k.onFullscreen(L),k.onVolume(M),k.onMute(N),!0)},ta.getState=function(){return na?na.getState():ma?ma.getState():""},ta.clearNonlinear=function(){l.stop(),ma&&(x(),ma&&(ma.stop(),ma.destroy(),ma=null))},ta.destroy=function(){ta.off(),z(),null!==ta&&(na&&na.destroy(),ma&&(x(),ma&&ma.destroy()),ta.clearNonlinear(),ta=j=k=ma=na=n=ua=va=xa=wa=null)},ta.pause=function(){na?na.pause():ma&&ma.pause()},ta.play=function(){na?na.play():ma&&ma.play()}}}(window),function(a){function b(a){return a._adQueue&&a._waterfallIndex1?a[1]:""}function V(a){var b=a.getMidRolls(),c=[];b.length&&d.foreach(b,function(a,b){"nonlinear"!==b._type&&c.push({begin:b._offSet,text:aa.cuetext})}),h.setCues(c)}var W,X,Y,Z,$,_=this,aa={},ba=!1,ca=null,da={},ea="",fa=!1,ga=!1,ha=0,ia=null,ja=[],ka=[],la=!1,ma={},na=!1,oa=-1,pa=null,qa=h.getConfig(),ra=!!qa.sdkplatform,sa=null;d.extend(_,h.Events),i.debug&&i.trackFn&&(sa=i.trackFn),X=W=c.configparser.getSchedule(i),W.isVMAP()&&k(c.doReplacement(W.getVMAP(),h,U(),aa)),h.on("destroyPlugin",function(){_.destroy()},_),h.on({ready:l,beforePlay:o,cast:m,play:n,time:p,beforeComplete:q,playlistItem:x,playlistComplete:y,complete:J},_),function(a,b){a.jwplayerEntitlements=b(),"object"==typeof module&&module.exports?module.exports=b():"function"==typeof define&&define.amd&&define([],b)}(this,function(){return function(a,b,c){var d=new a.key(b).token(),e=["//entitlements.jwplayer.com/",d,".json"];"file:"===window.location.protocol&&e.unshift("https:");var f={canPlayAds:!0};a.ajax(e.join(""),function(a){f.canPlayAds=!a||!a.response||a.response.canPlayAds!==!1,c(f)},function(){c(f)},{timeout:1e4,responseType:"json"})}});var ta=qa.key;this.jwplayerEntitlements(d,ta,function(a){if(!a.canPlayAds){h.off(null,null,_),h.pauseAd=h.playAd=d.noop;var b={id:g,code:900,message:"Ad Limit Reached"};M(b),_.destroy()}}),_.destroy=function(){ca&&(G(ca),ca=null),K(),L(),P(),h.setCues([])},h.pauseAd=function(a){if(a=!f.isBoolean(a)||a,ka.length){var b=ka[ka.length-1];a?b.pause():b.play()}},h.playAd=function(a){na=!0,P();var b;b=f.isArray(a)?a.slice(0):[a];var c={_id:B(12),_adQueue:b,_waterfallIndex:0,_offset:0,_position:"api"};v(c)}},a().registerPlugin("vast","7.1",c.adcontroller,"vast.swf")}(window.jwplayer);