/*
 * popcorn.js version 1.0
 * http://popcornjs.org
 *
 * Copyright 2011, Mozilla Foundation
 * Licensed under the MIT license
 */

(function(q,r){function L(a,b){return function(){if(c.plugin.debug)return a.apply(this,arguments);try{return a.apply(this,arguments)}catch(d){c.plugin.errors.push({plugin:b,thrown:d,source:a.toString()});this.trigger("error",c.plugin.errors)}}}function C(a){a=typeof a==="string"?a:[a.language,a.region].join("-");var b=a.split("-");return{iso6391:a,language:b[0]||"",region:b[1]||""}}if(r.addEventListener){var v=Array.prototype,D=Object.prototype,E=v.forEach,F=v.slice,z=D.hasOwnProperty,G=D.toString,
M=q.Popcorn,A=/^(#([\w\-\_\.]+))$/,y=[],H=false,w={events:{hash:{},apis:{}}},I=function(){return q.requestAnimationFrame||q.webkitRequestAnimationFrame||q.mozRequestAnimationFrame||q.oRequestAnimationFrame||q.msRequestAnimationFrame||function(a){q.setTimeout(a,16)}}(),J=function(a){var b=a.media.currentTime,d=a.options.frameAnimation,e=a.data.disabled,f=a.data.trackEvents,g=f.animating,i=f.startIndex,m=c.registryByName,k=0,l,h;for(i=Math.min(i+1,f.byStart.length-2);i>0&&f.byStart[i];){k=f.byStart[i];
h=(l=k._natives)&&l.type;if(!l||m[h]||a[h])if(k.start<=b&&k.end>b&&e.indexOf(h)===-1){if(!k._running){k._running=true;l.start.call(a,null,k);d&&k&&k._running&&k.natives.frame&&l.frame.call(a,null,k,b)}}else if(k._running===true){k._running=false;l.end.call(a,null,k);if(d&&k._natives.frame){k=g.indexOf(k);k>=0&&g.splice(k,1)}}i--}},c=function(a,b){return new c.p.init(a,b||null)};c.version="1.0";c.isSupported=true;c.instances=[];c.p=c.prototype={init:function(a,b){var d;if(typeof a==="function")if(r.readyState===
"interactive"||r.readyState==="complete")a(r,c);else{y.push(a);if(!H){H=true;var e=function(){r.removeEventListener("DOMContentLoaded",e,false);for(var g=0,i=y.length;g<i;g++)y[g].call(r,c);y=null};r.addEventListener("DOMContentLoaded",e,false)}}else{this.media=(d=A.exec(a))&&d.length&&d[2]?r.getElementById(d[2]):a;this[this.media.nodeName&&this.media.nodeName.toLowerCase()||"video"]=this.media;c.instances.push(this);this.options=b||{};this.isDestroyed=false;this.data={timeUpdate:c.nop,disabled:[],
events:{},hooks:{},history:[],state:{volume:this.media.volume},trackRefs:{},trackEvents:{byStart:[{start:-1,end:-1}],byEnd:[{start:-1,end:-1}],animating:[],startIndex:0,endIndex:0,previousUpdateTime:-1}};var f=function(g){var i;if(g.media.readyState>=2){i=g.media.duration;i=i!=i?Number.MAX_VALUE:i+1;c.addTrackEvent(g,{start:i,end:i});if(g.options.frameAnimation){g.data.timeUpdate=function(){c.timeUpdate(g,{});g.trigger("timeupdate");!g.isDestroyed&&I(g.data.timeUpdate)};!g.isDestroyed&&I(g.data.timeUpdate)}else{g.data.timeUpdate=
function(m){c.timeUpdate(g,m)};g.isDestroyed||g.media.addEventListener("timeupdate",g.data.timeUpdate,false)}}else q.setTimeout(function(){f(g)},1)};f(this);return this}}};c.p.init.prototype=c.p;c.forEach=function(a,b,d){if(!a||!b)return{};d=d||this;var e,f;if(E&&a.forEach===E)return a.forEach(b,d);if(G.call(a)==="[object NodeList]"){e=0;for(f=a.length;e<f;e++)b.call(d,a[e],e,a);return a}for(e in a)z.call(a,e)&&b.call(d,a[e],e,a);return a};c.extend=function(a){var b=F.call(arguments,1);c.forEach(b,
function(d){for(var e in d)a[e]=d[e]});return a};c.extend(c,{noConflict:function(a){if(a)q.Popcorn=M;return c},error:function(a){throw Error(a);},guid:function(a){c.guid.counter++;return(a?a:"")+(+new Date+c.guid.counter)},sizeOf:function(a){var b=0,d;for(d in a)b++;return b},isArray:Array.isArray||function(a){return G.call(a)==="[object Array]"},nop:function(){},position:function(a){a=a.getBoundingClientRect();var b={},d=r.documentElement,e=r.body,f,g,i;f=d.clientTop||e.clientTop||0;g=d.clientLeft||
e.clientLeft||0;i=q.pageYOffset&&d.scrollTop||e.scrollTop;d=q.pageXOffset&&d.scrollLeft||e.scrollLeft;f=Math.ceil(a.top+i-f);g=Math.ceil(a.left+d-g);for(var m in a)b[m]=Math.round(a[m]);return c.extend({},b,{top:f,left:g})},disable:function(a,b){var d=a.data.disabled;d.indexOf(b)===-1&&d.push(b);J(a);return a},enable:function(a,b){var d=a.data.disabled,e=d.indexOf(b);e>-1&&d.splice(e,1);J(a);return a},destroy:function(a){var b=a.data.events,d,e,f;for(e in b){d=b[e];for(f in d)delete d[f];b[e]=null}if(!a.isDestroyed){a.data.timeUpdate&&
a.media.removeEventListener("timeupdate",a.data.timeUpdate,false);a.isDestroyed=true}}});c.guid.counter=1;c.extend(c.p,function(){var a={};c.forEach("load play pause currentTime playbackRate volume duration preload playbackRate autoplay loop controls muted buffered readyState seeking paused played seekable ended".split(/\s+/g),function(b){a[b]=function(d){if(typeof this.media[b]==="function"){if(d!=null&&/play|pause/.test(b))this.media.currentTime=c.util.toSeconds(d);this.media[b]();return this}if(d!=
null){this.media[b]=d;return this}return this.media[b]}});return a}());c.forEach("enable disable".split(" "),function(a){c.p[a]=function(b){return c[a](this,b)}});c.extend(c.p,{roundTime:function(){return-~this.media.currentTime},exec:function(a,b){c.addTrackEvent(this,{start:a,end:a+1,_running:false,_natives:{start:b||c.nop,end:c.nop,type:"exec"}});return this},mute:function(a){a=a==null||a===true?"muted":"unmuted";if(a==="unmuted"){this.media.muted=false;this.media.volume=this.data.state.volume}if(a===
"muted"){this.data.state.volume=this.media.volume;this.media.muted=true}this.trigger(a);return this},unmute:function(a){return this.mute(a==null?false:!a)},position:function(){return c.position(this.media)},toggle:function(a){return c[this.data.disabled.indexOf(a)>-1?"enable":"disable"](this,a)},defaults:function(a,b){if(c.isArray(a)){c.forEach(a,function(d){for(var e in d)this.defaults(e,d[e])},this);return this}if(!this.options.defaults)this.options.defaults={};this.options.defaults[a]||(this.options.defaults[a]=
{});c.extend(this.options.defaults[a],b);return this}});c.Events={UIEvents:"blur focus focusin focusout load resize scroll unload",MouseEvents:"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave click dblclick",Events:"loadstart progress suspend emptied stalled play pause loadedmetadata loadeddata waiting playing canplay canplaythrough seeking seeked timeupdate ended ratechange durationchange volumechange"};c.Events.Natives=c.Events.UIEvents+" "+c.Events.MouseEvents+" "+c.Events.Events;
w.events.apiTypes=["UIEvents","MouseEvents","Events"];(function(a,b){for(var d=w.events.apiTypes,e=a.Natives.split(/\s+/g),f=0,g=e.length;f<g;f++)b.hash[e[f]]=true;d.forEach(function(i){b.apis[i]={};for(var m=a[i].split(/\s+/g),k=m.length,l=0;l<k;l++)b.apis[i][m[l]]=true})})(c.Events,w.events);c.events={isNative:function(a){return!!w.events.hash[a]},getInterface:function(a){if(!c.events.isNative(a))return false;var b=w.events,d=b.apiTypes;b=b.apis;for(var e=0,f=d.length,g,i;e<f;e++){i=d[e];if(b[i][a]){g=
i;break}}return g},all:c.Events.Natives.split(/\s+/g),fn:{trigger:function(a,b){var d;if(this.data.events[a]&&c.sizeOf(this.data.events[a])){if(d=c.events.getInterface(a)){d=r.createEvent(d);d.initEvent(a,true,true,q,1);this.media.dispatchEvent(d);return this}c.forEach(this.data.events[a],function(e){e.call(this,b)},this)}return this},listen:function(a,b){var d=this,e=true,f=c.events.hooks[a],g;if(!this.data.events[a]){this.data.events[a]={};e=false}if(f){f.add&&f.add.call(this,{},b);if(f.bind)a=
f.bind;if(f.handler){g=b;b=function(i){f.handler.call(d,i,g)}}e=true;if(!this.data.events[a]){this.data.events[a]={};e=false}}this.data.events[a][b.name||b.toString()+c.guid()]=b;!e&&c.events.all.indexOf(a)>-1&&this.media.addEventListener(a,function(i){c.forEach(d.data.events[a],function(m){typeof m==="function"&&m.call(d,i)})},false);return this},unlisten:function(a,b){if(this.data.events[a]&&this.data.events[a][b]){delete this.data.events[a][b];return this}this.data.events[a]=null;return this}},
hooks:{canplayall:{bind:"canplaythrough",add:function(a,b){var d=false;if(this.media.readyState){b.call(this,a);d=true}this.data.hooks.canplayall={fired:d}},handler:function(a,b){if(!this.data.hooks.canplayall.fired){b.call(this,a);this.data.hooks.canplayall.fired=true}}}}};c.forEach(["trigger","listen","unlisten"],function(a){c.p[a]=c.events.fn[a]});c.addTrackEvent=function(a,b){if(b&&b._natives&&b._natives.type&&a.options.defaults&&a.options.defaults[b._natives.type])b=c.extend({},a.options.defaults[b._natives.type],
b);if(b._natives){b._id=!b.id?c.guid(b._natives.type):b.id;a.data.history.push(b._id)}b.start=c.util.toSeconds(b.start,a.options.framerate);b.end=c.util.toSeconds(b.end,a.options.framerate);var d=a.data.trackEvents.byStart,e=a.data.trackEvents.byEnd,f;for(f=d.length-1;f>=0;f--)if(b.start>=d[f].start){d.splice(f+1,0,b);break}for(d=e.length-1;d>=0;d--)if(b.end>e[d].end){e.splice(d+1,0,b);break}if(b._natives&&(c.registryByName[b._natives.type]||a[b._natives.type])){e=a.media.currentTime;if(b.end>e&&
b.start<=e&&a.data.disabled.indexOf(b._natives.type)===-1){b._running=true;b._natives.start.call(a,null,b);if(a.options.frameAnimation&&b._natives.frame){a.data.trackEvents.animating.push(b);b._natives.frame.call(a,null,b,e)}}}f<=a.data.trackEvents.startIndex&&b.start<=a.data.trackEvents.previousUpdateTime&&a.data.trackEvents.startIndex++;d<=a.data.trackEvents.endIndex&&b.end<a.data.trackEvents.previousUpdateTime&&a.data.trackEvents.endIndex++;this.timeUpdate(a,null,true);b._id&&c.addTrackEvent.ref(a,
b)};c.addTrackEvent.ref=function(a,b){a.data.trackRefs[b._id]=b;return a};c.removeTrackEvent=function(a,b){var d=a.data.history.length,e=0,f=[],g=[],i=[],m=[];c.forEach(a.data.trackEvents.byStart,function(l,h){if(!l._id){f.push(a.data.trackEvents.byStart[h]);g.push(a.data.trackEvents.byEnd[h])}if(l._id){if(l._id!==b){f.push(a.data.trackEvents.byStart[h]);g.push(a.data.trackEvents.byEnd[h])}if(l._id===b){e=h;l._natives._teardown&&l._natives._teardown.call(a,l)}}});a.data.trackEvents.animating.length&&
c.forEach(a.data.trackEvents.animating,function(l,h){l._id||i.push(a.data.trackEvents.animating[h]);l._id&&l._id!==b&&i.push(a.data.trackEvents.animating[h])});e<=a.data.trackEvents.startIndex&&a.data.trackEvents.startIndex--;e<=a.data.trackEvents.endIndex&&a.data.trackEvents.endIndex--;a.data.trackEvents.byStart=f;a.data.trackEvents.byEnd=g;a.data.trackEvents.animating=i;for(var k=0;k<d;k++)a.data.history[k]!==b&&m.push(a.data.history[k]);a.data.history=m;c.removeTrackEvent.ref(a,b)};c.removeTrackEvent.ref=
function(a,b){delete a.data.trackRefs[b];return a};c.getTrackEvents=function(a){var b=[];a=a.data.trackEvents.byStart;for(var d=a.length,e=0,f;e<d;e++){f=a[e];f._id&&b.push(f)}return b};c.getTrackEvents.ref=function(a){return a.data.trackRefs};c.getTrackEvent=function(a,b){return a.data.trackRefs[b]};c.getTrackEvent.ref=function(a,b){return a.data.trackRefs[b]};c.getLastTrackEventId=function(a){return a.data.history[a.data.history.length-1]};c.timeUpdate=function(a,b){var d=a.media.currentTime,e=
a.data.trackEvents.previousUpdateTime,f=a.data.trackEvents,g=f.animating,i=f.endIndex,m=f.startIndex,k=0,l=c.registryByName,h,j;if(e<=d){for(;f.byEnd[i]&&f.byEnd[i].end<=d;){h=f.byEnd[i];j=(e=h._natives)&&e.type;if(!e||l[j]||a[j]){if(h._running===true){h._running=false;e.end.call(a,b,h)}i++}else{c.removeTrackEvent(a,h._id);return}}for(;f.byStart[m]&&f.byStart[m].start<=d;){h=f.byStart[m];j=(e=h._natives)&&e.type;if(!e||l[j]||a[j]){if(h.end>d&&h._running===false&&a.data.disabled.indexOf(j)===-1){h._running=
true;e.start.call(a,b,h);a.options.frameAnimation&&h&&h._running&&h._natives.frame&&g.push(h)}m++}else{c.removeTrackEvent(a,h._id);return}}if(a.options.frameAnimation)for(;k<g.length;){l=g[k];if(l._running){l._natives.frame.call(a,b,l,d);k++}else g.splice(k,1)}}else if(e>d){for(;f.byStart[m]&&f.byStart[m].start>d;){h=f.byStart[m];j=(e=h._natives)&&e.type;if(!e||l[j]||a[j]){if(h._running===true){h._running=false;e.end.call(a,b,h)}m--}else{c.removeTrackEvent(a,h._id);return}}for(;f.byEnd[i]&&f.byEnd[i].end>
d;){h=f.byEnd[i];j=(e=h._natives)&&e.type;if(!e||l[j]||a[j]){if(h.start<=d&&h._running===false&&a.data.disabled.indexOf(j)===-1){h._running=true;e.start.call(a,b,h);a.options.frameAnimation&&h&&h._running&&h._natives.frame&&g.push(h)}i--}else{c.removeTrackEvent(a,h._id);return}}if(a.options.frameAnimation)for(;k<g.length;){l=g[k];if(l._running){l._natives.frame.call(a,b,l,d);k++}else g.splice(k,1)}}f.endIndex=i;f.startIndex=m;f.previousUpdateTime=d};c.extend(c.p,{getTrackEvents:function(){return c.getTrackEvents.call(null,
this)},getTrackEvent:function(a){return c.getTrackEvent.call(null,this,a)},getLastTrackEventId:function(){return c.getLastTrackEventId.call(null,this)},removeTrackEvent:function(a){c.removeTrackEvent.call(null,this,a);return this},removePlugin:function(a){c.removePlugin.call(null,this,a);return this},timeUpdate:function(a){c.timeUpdate.call(null,this,a);return this},destroy:function(){c.destroy.call(null,this);return this}});c.manifest={};c.registry=[];c.registryByName={};c.plugin=function(a,b,d){if(c.protect.natives.indexOf(a.toLowerCase())>=
0)c.error("'"+a+"' is a protected function name");else{var e=["start","end"],f={},g=typeof b==="function",i=["_setup","_teardown","start","end","frame"],m=function(h,j){h=h||c.nop;j=j||c.nop;return function(){h.apply(this,arguments);j.apply(this,arguments)}};c.manifest[a]=d=d||b.manifest||{};i.forEach(function(h){b[h]=L(b[h]||c.nop,a)});var k=function(h,j){if(!j)return this;var p=j._natives={},n="",s,u;c.extend(p,h);j._natives.type=a;j._running=false;p.start=p.start||p["in"];p.end=p.end||p.out;p._teardown=
m(function(){var o=F.call(arguments);o.unshift(null);o[1]._running&&p.end.apply(this,o)},p._teardown);s=this.options.defaults&&this.options.defaults[j._natives&&j._natives.type];j.compose=j.compose&&j.compose.split(" ")||[];j.effect=j.effect&&j.effect.split(" ")||[];j.compose=j.compose.concat(j.effect);j.compose.forEach(function(o){n=c.compositions[o]||{};i.forEach(function(t){p[t]=m(p[t],n[t])})});j._natives.manifest=d;if(!("start"in j))j.start=j["in"]||0;if(!("end"in j))j.end=j.out||this.duration()||
Number.MAX_VALUE;u=s?c.extend({},s,j):j;if(!u.target){s="options"in d&&d.options;u.target=s&&"target"in s&&s.target}j._natives._setup&&j._natives._setup.call(this,u);c.addTrackEvent(this,c.extend(u,j));c.forEach(h,function(o,t){t!=="type"&&e.indexOf(t)===-1&&this.listen(t,o)},this);return this};f[a]=function(h){return k.call(this,g?b.call(this,h):b,h)};c.extend(c.p,f);var l={fn:f[a],definition:b,base:b,parents:[],name:a};c.registry.push(c.extend(f,l,{type:a}));c.registryByName[a]=l;return f}};c.plugin.errors=
[];c.plugin.debug=false;c.removePlugin=function(a,b){if(!b){b=a;a=c.p;if(c.protect.natives.indexOf(b.toLowerCase())>=0){c.error("'"+b+"' is a protected function name");return}var d=c.registry.length,e;for(e=0;e<d;e++)if(c.registry[e].name===b){c.registry.splice(e,1);delete c.registryByName[b];delete c.manifest[b];delete a[b];return}}d=a.data.trackEvents.byStart;e=a.data.trackEvents.byEnd;var f=a.data.trackEvents.animating,g,i;g=0;for(i=d.length;g<i;g++)if(d[g]&&d[g]._natives&&d[g]._natives.type===
b&&e[g]&&e[g]._natives&&e[g]._natives.type===b){d[g]._natives._teardown&&d[g]._natives._teardown.call(a,d[g]);d.splice(g,1);e.splice(g,1);g--;i--;if(a.data.trackEvents.startIndex<=g){a.data.trackEvents.startIndex--;a.data.trackEvents.endIndex--}}g=0;for(i=f.length;g<i;g++)if(f[g]&&f[g]._natives&&f[g]._natives.type===b){f.splice(g,1);g--;i--}};c.compositions={};c.compose=function(a,b,d){c.manifest[a]=d||b.manifest||{};c.compositions[a]=b};c.plugin.effect=c.effect=c.compose;c.parsers={};c.parser=function(a,
b,d){if(c.protect.natives.indexOf(a.toLowerCase())>=0)c.error("'"+a+"' is a protected function name");else{if(typeof b==="function"&&!d){d=b;b=""}if(!(typeof d!=="function"||typeof b!=="string")){var e={};e[a]=function(f,g){if(!f)return this;var i=this;c.xhr({url:f,dataType:b,success:function(m){var k,l,h=0;m=d(m).data||[];if(k=m.length){for(;h<k;h++){l=m[h];for(var j in l)z.call(l,j)&&i[j]&&i[j](l[j])}g&&g()}}});return this};c.extend(c.p,e);return e}}};c.player=function(a,b){b=b||{};var d=function(e,
f,g){g=g||{};var i=new Date/1E3,m=i,k=0,l=1,h=false,j={},p=r.getElementById(A.exec(e)&&A.exec(e)[2])||r.getElementById(e)||e,n={},s;for(s in p)if(typeof p[s]==="object")n[s]=p[s];else if(typeof p[s]==="function")n[s]=function(o){return"length"in p[o]&&!p[o].call?p[o]:function(){return p[o].apply(p,arguments)}}(s);else c.player.defineProperty(n,s,{get:function(o){return function(){return p[o]}}(s),set:c.nop,configurable:true});var u=function(){i=new Date/1E3;if(!n.paused){n.currentTime+=i-m;n.dispatchEvent("timeupdate");
setTimeout(u,10)}m=i};n.play=function(){this.paused=false;if(n.readyState>=4){m=new Date/1E3;n.dispatchEvent("play");u()}};n.pause=function(){this.paused=true;n.dispatchEvent("pause")};c.player.defineProperty(n,"currentTime",{get:function(){return k},set:function(o){k=+o;n.dispatchEvent("timeupdate");return k},configurable:true});c.player.defineProperty(n,"volume",{get:function(){return l},set:function(o){l=+o;n.dispatchEvent("volumechange");return l},configurable:true});c.player.defineProperty(n,
"muted",{get:function(){return h},set:function(o){h=+o;n.dispatchEvent("volumechange");return h},configurable:true});n.addEventListener=function(o,t){j[o]||(j[o]=[]);j[o].push(t);return t};n.dispatchEvent=function(o){var t,K=this,x=o.type;if(!x){x=o;if(o=c.events.getInterface(x)){t=r.createEvent(o);t.initEvent(x,true,true,window,1)}}c.forEach(j[x],function(N){N.call(K,t,K)})};n.src=f||"";n.readyState=0;n.duration=0;n.paused=true;n.ended=0;if(b._setup)b._setup.call(n,g);else{n.readyState=4;n.dispatchEvent("load");
n.dispatchEvent("loadeddata")}n.addEventListener("load",function(){n.currentTime=k;n.volume=l;n.muted=h});n.addEventListener("loadeddata",function(){!n.paused&&n.play()});return new c.p.init(n,g)};c[a]=c[a]||d};c.player.defineProperty=Object.defineProperty||function(a,b,d){a.__defineGetter__(b,d.get||c.nop);a.__defineSetter__(b,d.set||c.nop)};var O=/\?/,P={url:"",data:"",dataType:"",success:c.nop,type:"GET",async:true,xhr:function(){return new q.XMLHttpRequest}};c.xhr=function(a){a.dataType=a.dataType&&
a.dataType.toLowerCase()||null;if(a.dataType&&(a.dataType==="jsonp"||a.dataType==="script"))c.xhr.getJSONP(a.url,a.success,a.dataType==="script");else{a=c.extend({},P,a);a.ajax=a.xhr();if(a.ajax){if(a.type==="GET"&&a.data){a.url+=(O.test(a.url)?"&":"?")+a.data;a.data=null}a.ajax.open(a.type,a.url,a.async);a.ajax.send(a.data||null);return c.xhr.httpData(a)}}};c.xhr.httpData=function(a){var b,d=null,e,f=null;a.ajax.onreadystatechange=function(){if(a.ajax.readyState===4){try{d=JSON.parse(a.ajax.responseText)}catch(g){}b=
{xml:a.ajax.responseXML,text:a.ajax.responseText,json:d};if(!b.xml||!b.xml.documentElement){b.xml=null;try{e=new DOMParser;f=e.parseFromString(a.ajax.responseText,"text/xml");if(!f.getElementsByTagName("parsererror").length)b.xml=f}catch(i){}}if(a.dataType)b=b[a.dataType];a.success.call(a.ajax,b)}};return b};c.xhr.getJSONP=function(a,b,d){var e=r.head||r.getElementsByTagName("head")[0]||r.documentElement,f=r.createElement("script"),g=a.split("?")[1],i=false,m=[],k,l;if(g&&!d)m=g.split("&");if(m.length)l=
m[m.length-1].split("=");k=m.length?l[1]?l[1]:l[0]:"jsonp";if(!g&&!d)a+="?callback="+k;if(k&&!d){if(window[k])k=c.guid(k);window[k]=function(h){b&&b(h);i=true};a=a.replace(l.join("="),l[0]+"="+k)}f.onload=function(){d&&b&&b();i&&delete window[k];e.removeChild(f)};f.src=a;e.insertBefore(f,e.firstChild)};c.getJSONP=c.xhr.getJSONP;c.getScript=c.xhr.getScript=function(a,b){return c.xhr.getJSONP(a,b,true)};c.util={toSeconds:function(a,b){var d=/^([0-9]+:){0,2}[0-9]+([.;][0-9]+)?$/,e,f,g;if(typeof a===
"number")return a;typeof a==="string"&&!d.test(a)&&c.error("Invalid time format");d=a.split(":");e=d.length-1;f=d[e];if(f.indexOf(";")>-1){f=f.split(";");g=0;if(b&&typeof b==="number")g=parseFloat(f[1],10)/b;d[e]=parseInt(f[0],10)+g}e=d[0];return{1:parseFloat(e,10),2:parseInt(e,10)*60+parseFloat(d[1],10),3:parseInt(e,10)*3600+parseInt(d[1],10)*60+parseFloat(d[2],10)}[d.length||1]}};var B=C(q.navigator.userLanguage||q.navigator.language);c.locale={get:function(){return B},set:function(a){B=C(a);c.locale.broadcast();
return B},broadcast:function(a){var b=c.instances,d=b.length,e=0,f;for(a=a||"locale:changed";e<d;e++){f=b[e];a in f.data.events&&f.trigger(a)}}};c.p.cue=c.p.exec;c.protect={natives:function(){var a,b=[];if(Object.keys)b=Object.keys(c.p);else for(a in c.p)z.call(c.p,a)&&b.push(a);return b.join(",").toLowerCase().split(",")}()};q.Popcorn=c}else{q.Popcorn={isSupported:false};for(v="forEach extend effects error guid sizeOf isArray nop position disable enable destroy addTrackEvent removeTrackEvent getTrackEvents getTrackEvent getLastTrackEventId timeUpdate plugin removePlugin compose effect parser xhr getJSONP getScript".split(/\s+/);v.length;)q.Popcorn[v.shift()]=
function(){}}})(window,window.document);
