(function(a){a.vast={}})(jwplayer);(function(b){var g=b.vast,a=b.utils,d=b.events,e=window,c=true,f=false;g.adcontroller=function(m,Y,V){var E,l=this,Q,q={},Z,r={},p="",T=f,O=f,A=0,h,G,L,F=null,D=[],u=[],I=-1;a.extend(l,new d.eventdispatcher());m.onReady(function X(){if(Y.debug){E=m.id}Q=m.getRenderingMode()==="flash";G=new g.staticplayer(m,V);L=new g.companion(E);var ah=e.location.href;var am=new a.key(b.key);var ai=am.edition();r.trackingbase=(ah.match(/^https/)?"https://s":"http://i")+".n.jwpltx.com/v1/adclient/ping.gif";r.account=am.token();r.domain=R();r.edition=["pro","premium","ads","invalid"].indexOf(ai)+1;r.hosting=b.defaults&&b.defaults.ph?b.defaults.ph:0;var ae=new g.configparser();ae.parse(Y);Z=ae.getSchedule();if(Z.isVMAP()){var aj=Z.getVMAP();if(aj){var ak;var ag=function ag(an){clearTimeout(ak);try{g.vmapparser(an.responseXML,Z);U(Z)}catch(ao){C({message:"Error parsing VMAP",code:1002,vmap:aj})}};var al=function al(an){clearTimeout(ak);a.log(an);C({message:"Error Loading VMAP Schedule",code:(an==="Timeout")?1007:1008,vmap:aj})};var af=a.ajax(aj,ag,al);if(af){ak=setTimeout(function(){af.onload=null;af.onreadystatechange=null;af.onerror=null;if(af.abort){af.abort()}al("Timeout")},5000)}}}q=ae.getOptParams();m.onBeforePlay(z);m.onPlay(x);m.onTime(M);m.onBeforeComplete(k);m.onPlaylistItem(W);m.onPlaylistComplete(W);m.onComplete(S)});function x(ae){l.sendEvent(d.state.PLAYING,ae)}function z(ae){var af=Z.getPreRoll();if(!T&&af){h=t(af);n(af,ae)}}function M(ae){var af=Z.getNextMidRoll(ae.position,ae.duration);if(af){h=t(af);P(af,ae)}}function k(ae){var af=Z.getPostRoll();if(!O&&af){h=t(af);ac(af,ae)}}function t(ae){if(ae._trackers){return new g.tracker(ae._trackers,E)}return null}function n(af,ae){af._position="pre";T=c;w(af,ae)}function P(af,ae){af._position="mid";w(af,ae)}function ac(af,ae){af._position="post";O=c;m.detachMedia();w(af,ae)}function w(af,ae){p=af._position;clearTimeout(I);I=-1;if(af._type!=="nonlinear"){if(!F){var ag=a.isMobile()&&(p==="pre"||m.isBeforePlay()||m.getPosition()===0);if(ag){if(ae&&ae.type===d.JWPLAYER_MEDIA_BEFOREPLAY){l.addEventListener(d.state.PLAYING,ad)}}else{ad()}}}if(af._adXML){af._adTag=af._adTag||"clientloadedtag_"+(A++);ab(af)}else{if(af._adTag){H(af)}else{a.log("scheduled ad has no url or xml",af)}}}function ad(){l.removeEventListener(d.state.PLAYING,ad);F=m.createInstream().init()}function W(){var af;for(af=D.length;af--;){var ae=D[af];D.length--;ae.destroy()}for(af=u.length;af--;){var ag=u[af];u.length--;ag.destroy()}v();O=f;T=f;U(Z);Z.reset()}function H(af){var ae=y(af._adTag);if(E){b._=b._||{};b._[E]=b._[E]||{};b._[E].actualTag=ae;b._[E].originalTag=af._adTag}B(af).load(ae)}function ab(ae){B(ae).parseXmlString(ae._adXML)}function B(af){var ae=new g.vloader(af,m);ae.addEventListener(d.COMPLETE,N);ae.addEventListener(d.ERROR,o);D.push(ae);return ae}function K(af){for(var ae=D.length;ae--;){if(D[ae]===af){D.splice(ae,1);af.destroy()}}}function y(af){if(!af){return af}var ai=m.getPlaylistItem(),ae=e.location.href;af=J(af,"__random-number__",Math.random()*Math.pow(10,18));af=J(af,"__timestamp__",new Date().getTime());af=J(af,"__page-url__",encodeURIComponent(ae));af=J(af,"__referrer__",encodeURIComponent(document.referrer));af=J(af,"__player-height__",m.getHeight());af=J(af,"__player-width__",m.getWidth());af=J(af,"__domain__",encodeURIComponent(R()));if(q.companion){af=J(af,"__companion-div__",q.companion.id)}else{af=J(af,"__companion-div__","")}var ak=af.match(new RegExp(/__item-[a-z 0-9 A-Z]*__/g));for(var ah=0;ak&&ah1000){aj=aj.substring(0,1000)}af=J(af,ag,encodeURIComponent(aj))}else{af=J(af,ag,"")}}return af}function J(ae,ag,af){return ae.replace(ag,af)}l.jwPauseAd=function(){if(u.length){var af=u[u.length-1];var ae=af.getState();if(ae==d.state.PLAYING||ae==d.state.BUFFERING){af.pause()}else{if(ae==d.state.PAUSED){af.play()}}}};l.jwPlayAd=function(af){var ae={_adTag:af,_offset:0};if(p==="post"||m.isBeforeComplete()){ac(ae)}else{if(p==="pre"||m.isBeforePlay()||m.getPosition()===0){n(ae)}else{if(m.getState()!==d.state.IDLE){P(ae)}}}};function N(af){l.removeEventListener(d.state.PLAYING,ad);clearTimeout(I);I=-1;v();K(af);var ag=new g.adplayer(af,m,G,L,r,q,E);ag.addEventListener(d.JWPLAYER_AD_ERROR,s);ag.addEventListener(d.JWPLAYER_AD_IMPRESSION,i);var ae=ag.init(F);if(!ae){ag.destroy();return}F=null;ag.addEventListener(d.JWPLAYER_AD_COMPLETE,j);u.push(ag)}function S(){v()}function s(ae){C(ae);I=setTimeout(function(){I=-1;if(D.length===0){if(p==="post"){m.attachMedia()}m.releaseState();aa()}},0)}function i(ae){if(h&&!h.started){h.breakStart()}m.dispatchEvent(d.JWPLAYER_AD_IMPRESSION,ae)}function j(){if(h){h.breakEnd()}if(D.length===0){if(p==="post"){m.attachMedia()}}}function v(){if(u.length){var ae=u[u.length-1];ae.clearNonlinear()}}function aa(){if(F){F.destroy();F=null}}function o(ae){l.removeEventListener(d.state.PLAYING,ad);var ag=ae.vloader;var af=ag.allAds();K(ag);if(af&&af.length){var ah=af[0];if(ah){var ak=ah.trackers;if(ak&&ak.error){var aj=new g.tracker(ak,E);aj.error(ae.code)}}}var ai={message:ae.message,code:ae.code,tag:ae.url};if(ae.wrappedUrl!==ae.url){ai.wrappedTag=ae.wrappedUrl}C(ai);if(I===-1){I=setTimeout(function(){I=-1;if(D.length===0){aa()}},0)}}function C(ae){if(h){h.error(ae.code)}m.dispatchEvent(d.JWPLAYER_AD_ERROR,ae)}function R(){var ae=e.location.href;ae=ae.match(new RegExp(/^https?:\/\/([^\/]*)/));if(ae.length>1){return ae[1]}return""}function U(ag){var af=ag.getMidRolls(),ae=[];if(af.length){a.foreach(af,function(ah,ai){ae.push({begin:ai._offSet,text:"Advertisement"})});m.callInternal("jwSetCues",ae)}}};if(!Array.prototype.indexOf){Array.prototype.indexOf=function(l,m){for(var k=(m||0),h=this.length;k=0?v.skipoffset:null;return{skipoffset:ag.skipoffset||ah,skipMessage:v.skipMessage,skipText:v.skipText}}function r(ah){if(O){var ag;if(O.length){ag=O[ah]}else{ag=O}if(ag.vastAd){return ag.vastAd}}else{if(!m&&G){return G[ah]}}return m}function s(ak,aj){a.log(ak);aj=aj||900;var ag=r(Y);var ai=ag.tracker;ai.error(aj);var ah=af();ah.code=aj;ah.message=ak;n.sendEvent(c.JWPLAYER_AD_ERROR,ah);k()}function ae(){if(q){q.resize()}}function A(ag){var ah=r(Y);var ai=ah.tracker;if(ag.fullscreen&&ai.started){ai.fullscreen()}ae()}function h(ag){if(q){q.setVolume(ag.volume)}}function Q(ag){if(q){q.setVolume(ag.mute?0:p.getVolume())}}function H(ag){if(D){Y=ag.index;var ah=r(Y);var ai=ah.clickthrough||"";D.setClick(ai)}}function S(ah){var ai=r(Y);var ak=ai.tracker;var aj;if(!ak.started){if(ai.companions){aj=af();aj.companions=f(ai.companions);p.dispatchEvent(c.JWPLAYER_AD_COMPANIONS,aj)}if(q){ak.linear=ah.linear;if(ah.linear&&q.blocking&&q.blocking!==D){q.blocking.hide()}}var al=V;var am=Z?ai.companions:d(ai.companions);if(v.companion&&am&&am.length){ak.hasComp=al.addCompanion(v.companion,am)}var ag=z(ai);ak.addUrl("impression",ag);if(N){b._[N].trackingURL=ag}ak.impression();aj=af();n.sendEvent(c.JWPLAYER_AD_IMPRESSION,aj);ak.start();ak.creativeView()}else{if(ah.oldstate=="PAUSED"){ak.resume()}}}function E(){var ag=r(Y);var ah=ag.tracker;ah.pause()}function C(an){var ap=r(Y);var al=an.position,ah=an.duration,ao=v.dynamicMessage||"",ak=v.podMessage||"",aj=ah-al,am=ap.tracker;if(am){am.time(al,ah)}if(D&&ao&&aj>0){ao=ao.replace(/xx/gi,""+Math.round(aj));if(O&&O.length){var ai=Y+1;ak=ak.replace(/__AD_POD_CURRENT__/g,""+ai);ak=ak.replace(/__AD_POD_LENGTH__/g,""+O.length);ao=ak+ao}D.setText(ao)}var ag=af();ag.position=al;ag.duration=ah;p.dispatchEvent(c.JWPLAYER_AD_TIME,ag)}function u(){t();ad()}function t(){var ag=r(Y);var ah=ag.tracker;if(!ah.firedError){ah.complete();ah.close();p.dispatchEvent(c.JWPLAYER_AD_COMPLETE,af())}}function ad(){k();n.sendEvent(c.JWPLAYER_AD_COMPLETE)}function W(ag){var ah=r(Y);var ai=ah.tracker;if(!ai){return}if(ag.mute){ai.mute();if(q){q.setVolume(0)}}else{ai.unmute();if(q){q.setVolume(p.getVolume()/100)}}}function o(){var ag=r(Y);p.pause(true);F(ag)}function U(){var ag=r(Y),ah=q.getState();if(ah!==c.state.PAUSED){q.pause();F(ag,true)}else{q.play()}}function x(ag){var ai=r(Y);if(Z){F(ai)}else{var ah=D.getState()===c.state.PAUSED;if((ag.hasControls&&ah)||(!ag.hasControls&&!ah)){if(!ah){D.pause()}F(ai)}}}function F(ag,ah){ag.tracker.click();p.dispatchEvent(c.JWPLAYER_AD_CLICK,af());if(ah||!Z){if(ag.clickthrough){e.open(ag.clickthrough)}}}function ab(){var ag=r(Y);ag.tracker.skip();p.dispatchEvent(c.JWPLAYER_AD_SKIPPED,af())}function X(ag){var ai="Error Playing ";var ah;if(ag.message&&ag.message.indexOf("File could not be played")!=-1){ai+="Creative";ah=405}else{ai+="Ad Tag";ah=400}s(ai,ah)}function B(){var ah="Unable to fetch NonLinear resource";var ag=502;s(ah,ag)}function K(ag){var ah=r(Y);var ai=ah.tracker;if(ag.expanded){ai.expand()}else{ai.collapse()}}function z(ai){var aj={d:w.domain,c:"vast",m:y,a:w.account,co:ai.tracker.hasComp,p:ac._position,ad:ai.adsystem,type:ai.tracker.linear,ph:w.hosting,ed:w.edition,n:Math.random().toFixed(16).substr(2,16)},ag=w.trackingbase,ak="?";for(var ah in aj){ag+=ak+ah+"="+encodeURIComponent(aj[ah]);ak="&"}return ag}};function f(l){var n=[];for(var m=0;m';m+='';m+='';m+='';m+='';m+='';m+='';m+="";j.innerHTML=m}else{var o=document.createElement("object");o.setAttribute("type","application/x-shockwave-flash");o.setAttribute("data",l.source);o.setAttribute("width","100%");o.setAttribute("height","100%");o.setAttribute("tabindex",0);h(o,"allowfullscreen","true");h(o,"allowscriptaccess","always");h(o,"seamlesstabbing","true");h(o,"wmode","opaque");j.appendChild(o)}g(l.trackers);return}var k=new Image();k.src=l.source;if(i.exists(l.clickthrough)){k.onclick=function(p){var q=window.open(l.clickthrough,"_blank");q.focus()}}j.innerHTML="";j.appendChild(k);g(l.trackers)}function d(k){return k.width==c.width&&k.height==c.height}}})(jwplayer);(function(b){var a=b.utils;b.vast.configparser=function(){var j,c,f,g="This ad will end in xx seconds.",i="Ad __AD_POD_CURRENT__ of __AD_POD_LENGTH__. ",h=-1,d="Skip ad in xx",e="Skip";this.parse=function(k){j=new b.vast.schedule();c={};c.dynamicMessage=k.admessage||g;c.podMessage=k.podmessage||i;c.skipoffset=k.skipoffset||h;c.skipMessage=k.skipmessage||d;c.skipText=k.skiptext||e;var l=k.companiondiv;if(l){c.companion={id:l.id,height:l.height,width:l.width}}if(k.tag&&typeof k.tag=="string"){j.setPreRoll({_offSet:"pre",_adTag:k.tag})}else{if(k.vastxml&&typeof k.vastxml=="string"){j.setPreRoll({_offSet:"pre",_adXML:k.vastxml})}else{if(k.schedule&&typeof k.schedule=="string"){j.setVMAP(k.schedule);return}else{a.foreach(k.schedule,function(o,m){var n=m.ad||m,p=m.offset,q={_offSet:p};if(typeof n.tag=="string"){q._adTag=n.tag}else{if(typeof n.vastxml=="string"){q._adXML=n.vastxml}else{a.log("Error: no ad tag provided");return}}if(n.type){q._type=n.type}switch(p){case"start":n._offSet="pre";case"pre":j.setPreRoll(q);break;case"end":n._offSet="post";case"post":j.setPostRoll(q);break;default:if(/^\d+%?$/.test(""+p)){j.addMidRoll(q)}else{a.log("Error: ad offset format not supported",p)}}})}}}j.sort()};this.getSchedule=function(){return j};this.getOptParams=function(){return c};this.getVMAP=function(){return f}}})(jwplayer);(function(a){a.vast.schedule=function(){var e,d=[],b=0,c,f;this.setPreRoll=function(g){e=g};this.getPreRoll=function(){return e};this.getPostRoll=function(){return f};this.getNextMidRoll=function(k,j){if(d.length>=b+1){var i=d[b],h=i._offSet.toString(),g=parseFloat(h);if(h.slice(-1)=="%"){g=j*(parseFloat(h.slice(0,-1))/100)}if(g0){D.addEventListener(d,J)}I(p.PLAY)}function J(K){var L=K.position-t;if(L>x){D.removeEventListener(d,J);D.stop()}}function E(){I(p.CLICK)}function C(){I(p.ERROR)}function I(K,L){L=L||{};L.tag=L.tag||F;D.sendEvent(K,L)}function z(L){if(!isNaN(L)){return L}var K=L.split(":");return Number(K[0]*3600+K[1]*60+K[2])}function H(K){return function(L){D.addEventListener(K,L)}}D.removeEvents=function(){D.resetEventListeners()};D.getState=function(){return f};D.stop=function(){if(t&&G){t=0;x=0;D.removeEventListener(d,J);G.removeListeners();G.stop();I(p.COMPLETE)}};D.pause=function(){};D.onPlay=H(p.PLAY);D.onComplete=H(p.COMPLETE);D.onClick=H(p.CLICK);D.onError=H(p.ERROR)}})(window.jwplayer);(function(b){var a=b.utils,c="[ERRORCODE]";b.vast.tracker=function(h,e){var f=0,l=this,m,q=[];if(e){b._=b._||{};b._[e]=b._[e]||{};b._[e].trackedvast=b._[e].trackedvast||{};m=b._[e].trackedvast}function p(u){if(h.hasOwnProperty(u)){return h[u]}return[]}for(var o in h){if(h.hasOwnProperty(o)){if(o.indexOf("progress")===0){var i=""+o.split("_")[1];var k={key:o,offset:i,tracked:false,percentage:false};if(/^\d+%$/.test(i)){k.percentage=true;k.offset=parseFloat(i)}else{k.offset=a.seconds(i)}q.push(k)}}}l.started=false;l.firedError=false;l.hasComp=false;l.addUrl=function(v,u){if(h.hasOwnProperty(v)){h[v].push(u)}else{h[v]=[];h[v].push(u)}};function r(x,w){var B=p(x),v,u,A;if(m){m[x]=m[x]||[]}for(v=0;v=y&&f=v&&f=u&&f=y){u.tracked=true;r(u.key)}}}}function s(v){l.firedError=true;v=v||900;var u={};u[c]=v;r("error",u)}function j(u){return function(){r(u)}}l.creativeView=j("creativeView");l.start=g;l.click=j("click");l.skip=j("skip");l.complete=j("complete");l.pause=j("pause");l.resume=j("resume");l.mute=j("mute");l.unmute=j("unmute");l.fullscreen=j("fullscreen");l.expand=j("expand");l.collapse=j("collapse");l.acceptInvitation=j("acceptInvitation");l.close=j("close");l.rewind=j("rewind");l.impression=j("impression");l.breakStart=d;l.breakEnd=j("breakEnd");l.time=t;l.error=s}})(window.jwplayer);(function(f){var d=f.jwplayer,e=d.events,a=d.utils,h=d.vast;h.vloader=function(y,j){var x=this,p,A=[],v=-1,n,o=[],u=false;a.extend(x,new e.eventdispatcher());x.load=function(C){A.push(C);u=false;var D=a.ajax(C,function(E){clearTimeout(v);z(E,C)},function(F){if(j.getRenderingMode()==="flash"&&F!=="Invalid XML"&&b(C)){d._=d._||{};d._[j.id]=d._[j.id]||{};d._[j.id]["_flashLoadSuccess"]=function E(H){clearTimeout(v);y._adXML=H;x.parseXmlString(H,C)};d._[j.id]["_flashLoadFail"]=function G(H){clearTimeout(v);a.log(H);m(H,C)};j.callInternal("jwLoadXML",C,'jwplayer._["'+j.id+'"]._flashLoadSuccess','jwplayer._["'+j.id+'"]._flashLoadFail');return}clearTimeout(v);m(F,C)});if(D){n=D;clearTimeout(v);v=setTimeout(function(){t(D);m("Timeout",C)},5000)}};x.destroy=function(){clearTimeout(v);t(n);j=null};x.scheduledAd=function(){return y};x.allAds=function(){return o};x.adPod=function(){var C=[];a.foreach(o,function(D,E){if(E.sequence){C.push(E)}});C.sort(function(E,D){return E.sequence-D.sequence});return C};x.adBuffet=function(){var C=[];a.foreach(o,function(D,E){if(!E.sequence){C.push(E)}});return C};x.history=function(){return A};x.parseXmlString=function(D,C){z({responseXML:c(D)},C)};function t(C){if(C){C.onload=null;C.onreadystatechange=null;C.onerror=null;if(C.abort){C.abort()}}}function z(D,C){p=p||new h.vparser();try{p.parse(D.responseXML)}catch(F){s(F.message,F.code||900,C);return}var E=p.parsedAds();if(E&&E.length){o=E;a.foreach(o,function(G,I){if(I.wrappedURI){var H=new h.vloader(y,j);H.addEventListener(e.COMPLETE,function(){B(I,H.allAds())});H.addEventListener(e.ERROR,function(J){s(J.message,J.code,J.url)});H.load(I.wrappedURI)}});i()}else{s("Ad Tag Empty",101,C)}}function B(D,C){var E=q(D,C);Array.prototype.splice.apply(o,[o.indexOf(D),1].concat(E));i()}function q(E,D){var C=[];a.foreach(D,function(F,G){if(E.companions){G.companions=(G.companions?G.companions:[]).concat(E.companions)}if(E.trackers){G.trackers=r(G.trackers,E.trackers)}C.push(G)});return C}function r(D,C){D=D||{};a.foreach(C,function(E,F){if(D[E]){D[E]=D[E].concat(F)}else{D[E]=F}});return D}function i(){var C=false;a.foreach(o,function(D,E){if(E.wrappedURI){C=true}});if(!C){l()}}function l(){var H=o.slice(0);var G=H.length;for(var D=H.length;D--;){var F=H[D];if(!F.media||!F.media.length){H.length--}}var E=G===0;var C=H.length!==G;if(E||C){s("Ad Tag Empty",101,A[A.length-1]);return}w(e.COMPLETE,x)}function m(D,C){if(D==="Invalid XML"){s(D,100,C)}else{s("VAST could not be loaded",301,C)}}function k(){if(A&&A.length){return A[0]}return""}function s(E,D,C){if(u){return}else{u=true}x.sendEvent(e.ERROR,{message:E,code:D,vloader:x,url:k()||C,wrappedUrl:C})}function w(C,D){return x.sendEvent(C,D)}};function c(i){if(g(i)){return i}return a.parseXML(i)}function g(i){return(typeof Node==="object"?i instanceof Node:i&&typeof i==="object"&&typeof i.nodeType==="number"&&typeof i.nodeName==="string")}function b(i){return(i&&i.indexOf("://")>=0)&&(i.split("/")[2]!=f.location.href.split("/")[2])}})(window);(function(a){a.vast.vpaidevents={AD_LOADED:"AdLoaded",AD_STARTED:"AdStarted",AD_STOPPED:"AdStopped",AD_LINEAR_CHANGE:"AdLinearChange",AD_EXPANDED_CHANGE:"AdExpandedChange",AD_REMAINING_TIME_CHANGE:"AdRemainingTimeChange",AD_VOLUME_CHANGE:"AdVolumeChange",AD_IMPRESSION:"AdImpression",AD_VIDEO_START:"AdVideoStart",AD_VIDEO_FIRST_QUARTILE:"AdVideoFirstQuartile",AD_VIDEO_MIDPOINT:"AdVideoMidpoint",AD_VIDEO_THIRD_QUARTILE:"AdVideoThirdQuartile",AD_VIDEO_COMPLETE:"AdVideoComplete",AD_CLICK_THRU:"AdClickThru",AD_USER_ACCEPT_INVITATION:"AdUserAcceptInvitation",AD_USER_MINIMIZE:"AdUserMinimize",AD_USER_CLOSE:"AdUserClose",AD_PAUSED:"AdPaused",AD_PLAYING:"AdPlaying",AD_LOG:"AdLog",AD_ERROR:"AdError"}})(jwplayer);(function(g){var d=g.jwplayer,a=d.vast,e="PLAYING",h="PAUSED",i="BUFFERING",b="IDLE",c=true,f=false;a.vpaidplayer=function(k,D,y,w){var E=this,q,j=f,n=-1,r=f,m=new d.events.eventdispatcher(),v=a.vpaidevents,J={TIME:"onTime",CLICK:"onClick",PLAY:"onPlay",PAUSE:"onPause",ERROR:"onError",COMPLETE:"onComplete",EXPANDED_CHANGE:"onExpandedChange"};E.type="vpaid";E.blocking=null;function s(){d._=d._||{};d._[k.id]=d._[k.id]||{};k.callInternal("jwLoadVPAID",D,K(O),K(M))}function O(){u(v.AD_LOADED,N);u(v.AD_STARTED,z);u(v.AD_LINEAR_CHANGE,B);u(v.AD_EXPANDED_CHANGE,I);u(v.AD_PAUSED,l);u(v.AD_PLAYING,o);u(v.AD_STOPPED,H);u(v.AD_REMAINING_TIME_CHANGE,G);u(v.AD_CLICK_THRU,p);u(v.AD_ERROR,M);A("initAd",k.getWidth(),k.getHeight(),k.getFullscreen()?"fullscreen":"normal",0,w)}function M(){C(J.ERROR)}function C(P,Q){Q=Q||{};if(!Q.tag){Q.tag=y}m.sendEvent(P,Q)}this.setVolume=function(P){F("adVolume",P)};function N(){B();F("adVolume",k.getMute()?0:k.getVolume()/100);A("startAd")}function z(){C(J.PLAY,{oldstate:i,newstate:e,linear:q?"linear":"nonlinear"})}function p(){C(J.CLICK)}function B(){var Q=k.getState();q=x("adLinear");if(q){if(Q==e||Q==i){j=c;k.pause();k.setControls(f)}}else{if(E.blocking){E.blocking.destroy();E.blocking=null}else{if(j){k.play(c);k.setControls(c)}}}if(!q){var P=k.getSafeRegion();A("resizeAd",k.getWidth(),P.height+P.y,k.getFullscreen()?"fullscreen":"normal")}else{A("resizeAd",k.getWidth(),k.getHeight(),k.getFullscreen()?"fullscreen":"normal")}}function I(){var P=x("adExpanded");C(J.EXPANDED_CHANGE,{expanded:P})}function H(){if(j){k.play(c);k.setControls(c)}C(J.COMPLETE)}function l(){if(!r){r=c;C(J.PAUSE,{newstate:h,oldstate:e})}}function o(){if(r){r=f;C(J.PLAY,{newstate:e,oldstate:h})}}function G(){var P=x("adRemainingTime");if(n<0){n=P}C(J.TIME,{position:n-P,duration:n})}function A(){var P=Array.prototype.slice.call(arguments);P.unshift("jwCallVPAID");setTimeout(function(){k.callInternal.apply(this,P)},0)}function x(P){return k.callInternal("jwGetVPAIDProperty",P)}function F(Q,P){k.callInternal("jwSetVPAIDProperty",Q,P)}function u(P,Q){k.callInternal("jwAddVPAIDListener",P,K(Q))}function K(Q){var P="_vpaidBridge"+Math.floor(Math.random()*10000);d._[k.id][P]=L(Q);return"jwplayer._['"+k.id+"']['"+P+"']"}function L(P){return function(){setTimeout(P,0)}}function t(P){return function(Q){m.addEventListener(P,Q)}}E.setVolume=function(P){F("adVolume",P/100)};E.onTime=t(J.TIME);E.onComplete=t(J.COMPLETE);E.onClick=t(J.CLICK);E.onPlay=t(J.PLAY);E.onPause=t(J.PAUSE);E.onError=t(J.ERROR);E.onExpandedChange=t(J.EXPANDED_CHANGE);E.play=function(){A("resumeAd")};E.pause=function(){A("pauseAd")};E.stop=function(){A("stopAd")};E.resize=function(P){if(!q){var Q=k.getSafeRegion();A("resizeAd",k.getWidth(),Q.height+Q.y,P?"fullscreen":"normal")}else{A("resizeAd",k.getWidth(),k.getHeight(),P?"fullscreen":"normal")}};E.removeEvents=function(){m.resetEventListeners()};E.destroy=function(){if(!E){return}E.removeEvents();E=null};E.getState=function(){if(!x("adLinear")){return b}else{return r?h:e}};s()}})(window);(function(d){var b=d.utils,c="vmap";d.vast.vmapparser=function(y,t){var p=h(y,"AdBreak",c);for(var o=0;o3||w<1){q(102,"Vast version not supported")}if(x){if(w>=2){y=k(x);i(x,"Impression",y.trackers);i(x,"Error",y.trackers)}else{y=l(x)}if(B){y.wrappedURI=a(h(B,"VASTAdTagURI")[0])||a(h(B,"VASTAdTagURL")[0])}y=n(v,y)}else{q(101,"Invalid VAST response")}return y}function n(x,w){var v=b.extend({},x);b.foreach(w,function(y,z){if(b.exists(v[y])){if(b.typeOf(z)=="array"){v[y]=v[y].concat(z)}else{if(b.typeOf(z)=="object"){v[y]=b.extend(v[y],w[y])}else{v[y]=z}}}else{v[y]=z}});return v}function q(w,v){u={code:w,message:v,toString:function(){return this.code+" "+this.message}};throw u}function i(y,x,z){var v=h(y,x),w;for(w=0;w