(function(c,d){var b=c.document;(function(){var a=false,b=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.JRClass=function(){};JRClass.extend=function(e){var g=this.prototype;a=true;var f=new this;a=false;for(var c in e)f[c]=typeof e[c]=="function"&&typeof g[c]=="function"&&b.test(e[c])?function(a,b){return function(){var d=this._super;this._super=g[a];var c=b.apply(this,arguments);this._super=d;return c}}(c,e[c]):e[c];function d(){!a&&this.init&&this.init.apply(this,arguments)}d.prototype=f;d.constructor=d;d.extend=arguments.callee;return d}})();var a=JRClass.extend({init:function(c,e){if(typeof c=="string")this.video=b.getElementById(c);else this.video=c;this.video.player=this;this.values={};this.elements={};this.options={autoplay:false,preload:true,useBuiltInControls:false,controlsBelow:false,controlsAtStart:false,controlsHiding:true,defaultVolume:.85,playerFallbackOrder:["html5","flash","links"],flashPlayer:"htmlObject",flashPlayerVersion:false};typeof a.options=="object"&&_V_.merge(this.options,a.options);typeof e=="object"&&_V_.merge(this.options,e);if(this.getPreloadAttribute()!==d)this.options.preload=this.getPreloadAttribute();if(this.getAutoplayAttribute()!==d)this.options.autoplay=this.getAutoplayAttribute();this.box=this.video.parentNode;this.linksFallback=this.getLinksFallback();this.hideLinksFallback();this.each(this.options.playerFallbackOrder,function(a){if(this[a+"Supported"]()){this[a+"Init"]();return true}});this.activateElement(this,"player");this.activateElement(this.box,"box")},behaviors:{},newBehavior:function(c,b,a){this.behaviors[c]=b;this.extend(a)},activateElement:function(a,c){if(typeof a=="string")a=b.getElementById(a);this.behaviors[c].call(this,a)},errors:[],warnings:[],warning:function(a){this.warnings.push(a);this.log(a)},history:[],log:function(a){if(!a)return;if(typeof a=="string")a={type:a};a.type&&this.history.push(a.type);this.history.length>=50&&this.history.shift();try{console.log(a.type)}catch(b){try{opera.postError(a.type)}catch(b){}}},setLocalStorage:function(c,b){if(!localStorage)return;try{localStorage[c]=b}catch(d){(d.code==22||d.code==1014)&&this.warning(a.warnings.localStorageFull)}},getPreloadAttribute:function(){if(typeof this.video.hasAttribute=="function"&&this.video.hasAttribute("preload")){var a=this.video.getAttribute("preload");return a===""||a==="true"?"auto":a==="false"?"none":a}},getAutoplayAttribute:function(){if(typeof this.video.hasAttribute=="function"&&this.video.hasAttribute("autoplay")){var a=this.video.getAttribute("autoplay");return a==="false"?false:true}},bufferedPercent:function(){return this.duration()?this.buffered()[1]/this.duration():0},each:function(a,c){if(!a||a.length===0)return;for(var b=0,d=a.length;b<d;b++)if(c.call(this,a[b],b))break},extend:function(b){for(var a in b)if(b.hasOwnProperty(a))this[a]=b[a]}});a.player=a.prototype;a.player.extend({flashSupported:function(){if(!this.flashElement)this.flashElement=this.getFlashElement();return this.flashElement&&this.flashPlayerVersionSupported()?true:false},flashInit:function(){this.replaceWithFlash();this.element=this.flashElement;this.video.src="";var b=a.flashPlayers[this.options.flashPlayer];this.extend(a.flashPlayers[this.options.flashPlayer].api);b.init.context(this)()},getFlashElement:function(){for(var b=this.video.children,a=0,c=b.length;a<c;a++)if(b[a].className=="vjs-flash-fallback")return b[a]},replaceWithFlash:function(){if(this.flashElement){this.box.insertBefore(this.flashElement,this.video);this.video.style.display="none"}},flashPlayerVersionSupported:function(){var b=this.options.flashPlayerVersion?this.options.flashPlayerVersion:a.flashPlayers[this.options.flashPlayer].flashPlayerVersion;return a.getFlashVersion()>=b}});a.flashPlayers={};a.flashPlayers.htmlObject={flashPlayerVersion:9,init:function(){return true},api:{width:function(a){if(a!==d){this.element.width=a;this.box.style.width=a+"px";this.triggerResizeListeners();return this}return this.element.width},height:function(a){if(a!==d){this.element.height=a;this.box.style.height=a+"px";this.triggerResizeListeners();return this}return this.element.height}}};a.player.extend({linksSupported:function(){return true},linksInit:function(){this.showLinksFallback();this.element=this.video},getLinksFallback:function(){return this.box.getElementsByTagName("P")[0]},hideLinksFallback:function(){if(this.linksFallback)this.linksFallback.style.display="none"},showLinksFallback:function(){if(this.linksFallback)this.linksFallback.style.display="block"}});a.merge=function(b,c,d){for(var a in c)if(c.hasOwnProperty(a)&&(!d||!b.hasOwnProperty(a)))b[a]=c[a];return b};a.extend=function(a){this.merge(this,a,true)};a.extend({setupAllWhenReady:function(b){a.options=b;a.DOMReady(a.setup)},DOMReady:function(b){a.addToDOMReady(b)},setup:function(c,h){var g=false,f=[],e;if(!c||c=="All")c=a.getVideoJSTags();else if(typeof c!="object"||c.nodeType==1){c=[c];g=true}for(var d=0;d<c.length;d++){if(typeof c[d]=="string")e=b.getElementById(c[d]);else e=c[d];f.push(new a(e,h))}return g?f[0]:f},getVideoJSTags:function(){for(var e=b.getElementsByTagName("video"),d=[],a,c=0,f=e.length;c<f;c++){a=e[c];a.className.indexOf("video-js")!=-1&&d.push(a)}return d},browserSupportsVideo:function(){if(typeof a.videoSupport!="undefined")return a.videoSupport;a.videoSupport=!!b.createElement("video").canPlayType;return a.videoSupport},getFlashVersion:function(){if(typeof a.flashVersion!="undefined")return a.flashVersion;var b=0,d;if(typeof navigator.plugins!="undefined"&&typeof navigator.plugins["Shockwave Flash"]=="object"){d=navigator.plugins["Shockwave Flash"].description;if(d&&!(typeof navigator.mimeTypes!="undefined"&&navigator.mimeTypes["application/x-shockwave-flash"]&&!navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin))b=parseInt(d.match(/^.*\s+([^\s]+)\.[^\s]+\s+[^\s]+$/)[1],10)}else if(typeof c.ActiveXObject!="undefined")try{var e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(e)b=parseInt(e.GetVariable("$version").match(/^[^\s]+\s(\d+)/)[1],10)}catch(f){}a.flashVersion=b;return a.flashVersion},isIE:function(){return!+"\131"},isIPad:function(){return navigator.userAgent.match(/iPad/i)!==null},isIPhone:function(){return navigator.userAgent.match(/iPhone/i)!==null},isIOS:function(){return a.isIPhone()||a.isIPad()},iOSVersion:function(){var a=navigator.userAgent.match(/OS (\d+)_/i);if(a&&a[1])return a[1]},isAndroid:function(){return navigator.userAgent.match(/Android/i)!==null},androidVersion:function(){var a=navigator.userAgent.match(/Android (\d+)\./i);if(a&&a[1])return a[1]},warnings:{videoNotReady:"Video is not ready yet (try playing the video first).",localStorageFull:"Local Storage is Full"}});a.isIE()&&b.createElement("video");c.VideoJS=c._V_=a;a.player.extend({html5Supported:function(){return a.browserSupportsVideo()&&this.canPlaySource()?true:false},html5Init:function(){this.element=this.video;this.fixPreloading();this.supportProgressEvents();this.volume(localStorage&&localStorage.volume||this.options.defaultVolume);if(a.isIOS()){this.options.useBuiltInControls=true;this.iOSInterface()}else if(a.isAndroid()){this.options.useBuiltInControls=true;this.androidInterface()}if(!this.options.useBuiltInControls){this.video.controls=false;this.options.controlsBelow&&_V_.addClass(this.box,"vjs-controls-below");this.activateElement(this.video,"playToggle");this.buildStylesCheckDiv();this.buildAndActivatePoster();this.buildBigPlayButton();this.buildAndActivateSpinner();this.buildAndActivateControlBar();this.loadInterface();this.getSubtitles()}},canPlaySource:function(){if(this.canPlaySourceResult)return this.canPlaySourceResult;for(var b=this.video.children,a=0,d=b.length;a<d;a++)if(b[a].tagName.toUpperCase()=="SOURCE"){var c=this.video.canPlayType(b[a].type)||this.canPlayExt(b[a].src);if(c=="probably"||c=="maybe"){this.firstPlayableSource=b[a];this.canPlaySourceResult=true;return true}}this.canPlaySourceResult=false;return false},canPlayExt:function(d){if(!d)return"";var b=d.match(/\.([^\.]+)$/);if(b&&b[1]){var c=b[1].toLowerCase();if(a.isAndroid()){if(c=="mp4"||c=="m4v")return"maybe"}else if(a.isIOS())if(c=="m3u8")return"maybe"}return""},forceTheSource:function(){this.video.src=this.firstPlayableSource.src;this.video.load()},fixPreloading:function(){if(typeof this.video.hasAttribute=="function"&&this.video.hasAttribute("preload")&&this.video.preload!="none")this.video.autobuffer=true;else{this.video.autobuffer=false;this.video.preload="none"}},supportProgressEvents:function(){_V_.addListener(this.video,"progress",this.playerOnVideoProgress.context(this))},playerOnVideoProgress:function(a){this.setBufferedFromProgress(a)},setBufferedFromProgress:function(a){if(a.total>0){var b=a.loaded/a.total*this.duration();if(b>this.values.bufferEnd)this.values.bufferEnd=b}},iOSInterface:function(){a.iOSVersion()<4&&this.forceTheSource();a.isIPad()&&this.buildAndActivateSpinner()},androidInterface:function(){this.forceTheSource();_V_.addListener(this.video,"click",function(){this.play()});this.buildBigPlayButton();_V_.addListener(this.bigPlayButton,"click",function(){this.play()}.context(this));this.positionBox();this.showBigPlayButtons()},loadInterface:function(){if(!this.stylesHaveLoaded()){if(!this.positionRetries)this.positionRetries=1;if(this.positionRetries++<100){setTimeout(this.loadInterface.context(this),10);return}}this.hideStylesCheckDiv();this.showPoster();this.video.paused!==false&&this.showBigPlayButtons();this.options.controlsAtStart&&this.showControlBars();this.positionAll()},buildAndActivateControlBar:function(){this.controls=_V_.createElement("div",{className:"vjs-controls"});this.box.appendChild(this.controls);this.activateElement(this.controls,"controlBar");this.activateElement(this.controls,"mouseOverVideoReporter");this.playControl=_V_.createElement("div",{className:"vjs-play-control",innerHTML:"<span></span>"});this.controls.appendChild(this.playControl);this.activateElement(this.playControl,"playToggle");this.progressControl=_V_.createElement("div",{className:"vjs-progress-control"});this.controls.appendChild(this.progressControl);this.progressHolder=_V_.createElement("div",{className:"vjs-progress-holder"});this.progressControl.appendChild(this.progressHolder);this.activateElement(this.progressHolder,"currentTimeScrubber");this.loadProgressBar=_V_.createElement("div",{className:"vjs-load-progress"});this.progressHolder.appendChild(this.loadProgressBar);this.activateElement(this.loadProgressBar,"loadProgressBar");this.playProgressBar=_V_.createElement("div",{className:"vjs-play-progress"});this.progressHolder.appendChild(this.playProgressBar);this.activateElement(this.playProgressBar,"playProgressBar");this.timeControl=_V_.createElement("div",{className:"vjs-time-control"});this.controls.appendChild(this.timeControl);this.currentTimeDisplay=_V_.createElement("span",{className:"vjs-current-time-display",innerHTML:"00:00"});this.timeControl.appendChild(this.currentTimeDisplay);this.activateElement(this.currentTimeDisplay,"currentTimeDisplay");this.timeSeparator=_V_.createElement("span",{innerHTML:" / "});this.timeControl.appendChild(this.timeSeparator);this.durationDisplay=_V_.createElement("span",{className:"vjs-duration-display",innerHTML:"00:00"});this.timeControl.appendChild(this.durationDisplay);this.activateElement(this.durationDisplay,"durationDisplay");this.volumeControl=_V_.createElement("div",{className:"vjs-volume-control",innerHTML:"<div><span></span><span></span><span></span><span></span><span></span><span></span></div>"});this.controls.appendChild(this.volumeControl);this.activateElement(this.volumeControl,"volumeScrubber");this.volumeDisplay=this.volumeControl.children[0];this.activateElement(this.volumeDisplay,"volumeDisplay");this.fullscreenControl=_V_.createElement("div",{className:"vjs-fullscreen-control",innerHTML:"<div><span></span><span></span><span></span><span></span></div>"});this.controls.appendChild(this.fullscreenControl);this.activateElement(this.fullscreenControl,"fullscreenToggle")},buildAndActivatePoster:function(){this.updatePosterSource();if(this.video.poster){this.poster=b.createElement("img");this.box.appendChild(this.poster);this.poster.src=this.video.poster;this.poster.className="vjs-poster";this.activateElement(this.poster,"poster")}else this.poster=false},buildBigPlayButton:function(){this.bigPlayButton=_V_.createElement("div",{className:"vjs-big-play-button",innerHTML:"<span></span>"});this.box.appendChild(this.bigPlayButton);this.activateElement(this.bigPlayButton,"bigPlayButton")},buildAndActivateSpinner:function(){this.spinner=_V_.createElement("div",{className:"vjs-spinner",innerHTML:"<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>"});this.box.appendChild(this.spinner);this.activateElement(this.spinner,"spinner")},buildStylesCheckDiv:function(){this.stylesCheckDiv=_V_.createElement("div",{className:"vjs-styles-check"});this.stylesCheckDiv.style.position="absolute";this.box.appendChild(this.stylesCheckDiv)},hideStylesCheckDiv:function(){this.stylesCheckDiv.style.display="none"},stylesHaveLoaded:function(){return this.stylesCheckDiv.offsetHeight!=5?false:true},positionAll:function(){this.positionBox();this.positionControlBars();this.positionPoster()},positionBox:function(){if(this.videoIsFullScreen){this.box.style.width="";this.element.style.height="";if(this.options.controlsBelow){this.box.style.height="";this.element.style.height=this.box.offsetHeight-this.controls.offsetHeight+"px"}}else{this.box.style.width=this.width()+"px";this.element.style.height=this.height()+"px";if(this.options.controlsBelow)this.element.style.height=""}},getSubtitles:function(){for(var b=this.video.getElementsByTagName("TRACK"),a=0,c=b.length;a<c;a++)if(b[a].getAttribute("kind")=="subtitles"&&b[a].getAttribute("src")){this.subtitlesSource=b[a].getAttribute("src");this.loadSubtitles();this.buildSubtitles()}},loadSubtitles:function(){_V_.get(this.subtitlesSource,this.parseSubtitles.context(this))},parseSubtitles:function(h){var d=h.split("\n"),a="",c,f,e;this.subtitles=[];this.currentSubtitle=false;this.lastSubtitleIndex=0;for(var b=0;b<d.length;b++){a=_V_.trim(d[b]);if(a){c={id:a,index:this.subtitles.length};a=_V_.trim(d[++b]);f=a.split(" --> ");c.start=this.parseSubtitleTime(f[0]);c.end=this.parseSubtitleTime(f[1]);e=[];for(var g=b;g<d.length;g++){a=_V_.trim(d[++b]);if(!a)break;e.push(a)}c.text=e.join("<br/>");this.subtitles.push(c)}}},parseSubtitleTime:function(d){var b=d.split(":"),a=0;a+=parseFloat(b[0])*60*60;a+=parseFloat(b[1])*60;var c=b[2].split(/\.|,/);a+=parseFloat(c[0]);ms=parseFloat(c[1]);if(ms)a+=ms/1e3;return a},buildSubtitles:function(){this.subtitlesDisplay=_V_.createElement("div",{className:"vjs-subtitles"});this.box.appendChild(this.subtitlesDisplay);this.activateElement(this.subtitlesDisplay,"subtitlesDisplay")},addVideoListener:function(a,b){_V_.addListener(this.video,a,b.rEvtContext(this))},play:function(){this.video.play();return this},onPlay:function(a){this.addVideoListener("play",a);return this},pause:function(){this.video.pause();return this},onPause:function(a){this.addVideoListener("pause",a);return this},paused:function(){return this.video.paused},currentTime:function(b){if(b!==d){try{this.video.currentTime=b}catch(c){this.warning(a.warnings.videoNotReady)}this.values.currentTime=b;return this}return this.video.currentTime},onCurrentTimeUpdate:function(a){this.currentTimeListeners.push(a)},duration:function(){return this.video.duration},buffered:function(){if(this.values.bufferStart===d){this.values.bufferStart=0;this.values.bufferEnd=0}if(this.video.buffered&&this.video.buffered.length>0){var a=this.video.buffered.end(0);if(a>this.values.bufferEnd)this.values.bufferEnd=a}return[this.values.bufferStart,this.values.bufferEnd]},volume:function(a){if(a!==d){this.values.volume=Math.max(0,Math.min(1,parseFloat(a)));this.video.volume=this.values.volume;this.setLocalStorage("volume",this.values.volume);return this}return this.values.volume?this.values.volume:this.video.volume},onVolumeChange:function(a){_V_.addListener(this.video,"volumechange",a.rEvtContext(this))},width:function(a){if(a!==d){this.video.width=a;this.box.style.width=a+"px";this.triggerResizeListeners();return this}return this.video.offsetWidth},height:function(a){if(a!==d){this.video.height=a;this.box.style.height=a+"px";this.triggerResizeListeners();return this}return this.video.offsetHeight},supportsFullScreen:function(){if(typeof this.video.webkitEnterFullScreen=="function")if(!navigator.userAgent.match("Chrome")&&!navigator.userAgent.match("Mac OS X 10.5"))return true;return false},html5EnterNativeFullScreen:function(){try{this.video.webkitEnterFullScreen()}catch(b){b.code==11&&this.warning(a.warnings.videoNotReady)}return this},enterFullScreen:function(){if(this.supportsFullScreen())this.html5EnterNativeFullScreen();else this.enterFullWindow()},exitFullScreen:function(){!this.supportsFullScreen()&&this.exitFullWindow()},enterFullWindow:function(){this.videoIsFullScreen=true;this.docOrigOverflow=b.documentElement.style.overflow;_V_.addListener(b,"keydown",this.fullscreenOnEscKey.rEvtContext(this));_V_.addListener(c,"resize",this.fullscreenOnWindowResize.rEvtContext(this));b.documentElement.style.overflow="hidden";_V_.addClass(this.box,"vjs-fullscreen");this.positionAll()},exitFullWindow:function(){this.videoIsFullScreen=false;b.removeEventListener("keydown",this.fullscreenOnEscKey,false);c.removeEventListener("resize",this.fullscreenOnWindowResize,false);b.documentElement.style.overflow=this.docOrigOverflow;_V_.removeClass(this.box,"vjs-fullscreen");this.positionAll()},onError:function(a){this.addVideoListener("error",a);return this},onEnded:function(a){this.addVideoListener("ended",a);return this}});a.player.newBehavior("player",function(){this.onError(this.playerOnVideoError);this.onPlay(this.playerOnVideoPlay);this.onPlay(this.trackCurrentTime);this.onPause(this.playerOnVideoPause);this.onPause(this.stopTrackingCurrentTime);this.onEnded(this.playerOnVideoEnded);this.trackBuffered();this.onBufferedUpdate(this.isBufferFull)},{playerOnVideoError:function(a){this.log(a);this.log(this.video.error)},playerOnVideoPlay:function(){this.hasPlayed=true},playerOnVideoPause:function(){},playerOnVideoEnded:function(){this.currentTime(0);this.pause()},trackBuffered:function(){this.bufferedInterval=setInterval(this.triggerBufferedListeners.context(this),500)},stopTrackingBuffered:function(){clearInterval(this.bufferedInterval)},bufferedListeners:[],onBufferedUpdate:function(a){this.bufferedListeners.push(a)},triggerBufferedListeners:function(){this.isBufferFull();this.each(this.bufferedListeners,function(a){a.context(this)()})},isBufferFull:function(){this.bufferedPercent()==1&&this.stopTrackingBuffered()},trackCurrentTime:function(){this.currentTimeInterval&&clearInterval(this.currentTimeInterval);this.currentTimeInterval=setInterval(this.triggerCurrentTimeListeners.context(this),100);this.trackingCurrentTime=true},stopTrackingCurrentTime:function(){clearInterval(this.currentTimeInterval);this.trackingCurrentTime=false},currentTimeListeners:[],triggerCurrentTimeListeners:function(b,a){this.each(this.currentTimeListeners,function(b){b.context(this)(a||this.currentTime())})},resizeListeners:[],onResize:function(a){this.resizeListeners.push(a)},triggerResizeListeners:function(){this.each(this.resizeListeners,function(a){a.context(this)()})}});a.player.newBehavior("mouseOverVideoReporter",function(a){_V_.addListener(a,"mousemove",this.mouseOverVideoReporterOnMouseMove.context(this));_V_.addListener(a,"mouseout",this.mouseOverVideoReporterOnMouseOut.context(this))},{mouseOverVideoReporterOnMouseMove:function(){this.showControlBars();clearInterval(this.mouseMoveTimeout);this.mouseMoveTimeout=setTimeout(this.hideControlBars.context(this),4e3)},mouseOverVideoReporterOnMouseOut:function(b){var a=b.relatedTarget;while(a&&a!==this.box)a=a.parentNode;a!==this.box&&this.hideControlBars()}});a.player.newBehavior("box",function(a){this.positionBox();_V_.addClass(a,"vjs-paused");this.activateElement(a,"mouseOverVideoReporter");this.onPlay(this.boxOnVideoPlay);this.onPause(this.boxOnVideoPause)},{boxOnVideoPlay:function(){_V_.removeClass(this.box,"vjs-paused");_V_.addClass(this.box,"vjs-playing")},boxOnVideoPause:function(){_V_.removeClass(this.box,"vjs-playing");_V_.addClass(this.box,"vjs-paused")}});a.player.newBehavior("poster",function(a){this.activateElement(a,"mouseOverVideoReporter");this.activateElement(a,"playButton");this.onPlay(this.hidePoster);this.onEnded(this.showPoster);this.onResize(this.positionPoster)},{showPoster:function(){if(!this.poster)return;this.poster.style.display="block";this.positionPoster()},positionPoster:function(){if(!this.poster||this.poster.style.display=="none")return;this.poster.style.height=this.height()+"px";this.poster.style.width=this.width()+"px"},hidePoster:function(){if(!this.poster)return;this.poster.style.display="none"},updatePosterSource:function(){if(!this.video.poster){var a=this.video.getElementsByTagName("img");if(a.length>0)this.video.poster=a[0].src}}});a.player.newBehavior("controlBar",function(a){if(!this.controlBars){this.controlBars=[];this.onResize(this.positionControlBars)}this.controlBars.push(a);_V_.addListener(a,"mousemove",this.onControlBarsMouseMove.context(this));_V_.addListener(a,"mouseout",this.onControlBarsMouseOut.context(this))},{showControlBars:function(){if(!this.options.controlsAtStart&&!this.hasPlayed)return;this.each(this.controlBars,function(a){a.style.display="block"})},positionControlBars:function(){this.updatePlayProgressBars();this.updateLoadProgressBars()},hideControlBars:function(){this.options.controlsHiding&&!this.mouseIsOverControls&&this.each(this.controlBars,function(a){a.style.display="none"})},onControlBarsMouseMove:function(){this.mouseIsOverControls=true},onControlBarsMouseOut:function(){this.mouseIsOverControls=false}});a.player.newBehavior("playToggle",function(a){if(!this.elements.playToggles){this.elements.playToggles=[];this.onPlay(this.playTogglesOnPlay);this.onPause(this.playTogglesOnPause)}this.elements.playToggles.push(a);_V_.addListener(a,"click",this.onPlayToggleClick.context(this))},{onPlayToggleClick:function(){if(this.paused())this.play();else this.pause()},playTogglesOnPlay:function(){this.each(this.elements.playToggles,function(a){_V_.removeClass(a,"vjs-paused");_V_.addClass(a,"vjs-playing")})},playTogglesOnPause:function(){this.each(this.elements.playToggles,function(a){_V_.removeClass(a,"vjs-playing");_V_.addClass(a,"vjs-paused")})}});a.player.newBehavior("playButton",function(a){_V_.addListener(a,"click",this.onPlayButtonClick.context(this))},{onPlayButtonClick:function(){this.play()}});a.player.newBehavior("pauseButton",function(a){_V_.addListener(a,"click",this.onPauseButtonClick.context(this))},{onPauseButtonClick:function(){this.pause()}});a.player.newBehavior("playProgressBar",function(a){if(!this.playProgressBars){this.playProgressBars=[];this.onCurrentTimeUpdate(this.updatePlayProgressBars)}this.playProgressBars.push(a)},{updatePlayProgressBars:function(b){var a=b!==d?b/this.duration():this.currentTime()/this.duration();if(isNaN(a))a=0;this.each(this.playProgressBars,function(b){if(b.style)b.style.width=_V_.round(a*100,2)+"%"})}});a.player.newBehavior("loadProgressBar",function(a){if(!this.loadProgressBars)this.loadProgressBars=[];this.loadProgressBars.push(a);this.onBufferedUpdate(this.updateLoadProgressBars)},{updateLoadProgressBars:function(){this.each(this.loadProgressBars,function(a){if(a.style)a.style.width=_V_.round(this.bufferedPercent()*100,2)+"%"})}});a.player.newBehavior("currentTimeDisplay",function(a){if(!this.currentTimeDisplays){this.currentTimeDisplays=[];this.onCurrentTimeUpdate(this.updateCurrentTimeDisplays)}this.currentTimeDisplays.push(a)},{updateCurrentTimeDisplays:function(a){if(!this.currentTimeDisplays)return;var b=a?a:this.currentTime();this.each(this.currentTimeDisplays,function(a){a.innerHTML=_V_.formatTime(b)})}});a.player.newBehavior("durationDisplay",function(a){if(!this.durationDisplays){this.durationDisplays=[];this.onCurrentTimeUpdate(this.updateDurationDisplays)}this.durationDisplays.push(a)},{updateDurationDisplays:function(){if(!this.durationDisplays)return;this.each(this.durationDisplays,function(a){if(this.duration())a.innerHTML=_V_.formatTime(this.duration())})}});a.player.newBehavior("currentTimeScrubber",function(a){_V_.addListener(a,"mousedown",this.onCurrentTimeScrubberMouseDown.rEvtContext(this))},{onCurrentTimeScrubberMouseDown:function(a,c){a.preventDefault();this.currentScrubber=c;this.stopTrackingCurrentTime();this.videoWasPlaying=!this.paused();this.pause();_V_.blockTextSelection();this.setCurrentTimeWithScrubber(a);_V_.addListener(b,"mousemove",this.onCurrentTimeScrubberMouseMove.rEvtContext(this));_V_.addListener(b,"mouseup",this.onCurrentTimeScrubberMouseUp.rEvtContext(this))},onCurrentTimeScrubberMouseMove:function(a){this.setCurrentTimeWithScrubber(a)},onCurrentTimeScrubberMouseUp:function(){_V_.unblockTextSelection();b.removeEventListener("mousemove",this.onCurrentTimeScrubberMouseMove,false);b.removeEventListener("mouseup",this.onCurrentTimeScrubberMouseUp,false);if(this.videoWasPlaying){this.play();this.trackCurrentTime()}},setCurrentTimeWithScrubber:function(c){var b=_V_.getRelativePosition(c.pageX,this.currentScrubber),a=b*this.duration();this.triggerCurrentTimeListeners(0,a);if(a==this.duration())a=a-.1;this.currentTime(a)}});a.player.newBehavior("volumeDisplay",function(a){if(!this.volumeDisplays){this.volumeDisplays=[];this.onVolumeChange(this.updateVolumeDisplays)}this.volumeDisplays.push(a);this.updateVolumeDisplay(a)},{updateVolumeDisplays:function(){if(!this.volumeDisplays)return;this.each(this.volumeDisplays,function(a){this.updateVolumeDisplay(a)})},updateVolumeDisplay:function(a){var b=Math.ceil(this.volume()*6);this.each(a.children,function(a,c){if(c<b)_V_.addClass(a,"vjs-volume-level-on");else _V_.removeClass(a,"vjs-volume-level-on")})}});a.player.newBehavior("volumeScrubber",function(a){_V_.addListener(a,"mousedown",this.onVolumeScrubberMouseDown.rEvtContext(this))},{onVolumeScrubberMouseDown:function(c,a){_V_.blockTextSelection();this.currentScrubber=a;this.setVolumeWithScrubber(c);_V_.addListener(b,"mousemove",this.onVolumeScrubberMouseMove.rEvtContext(this));_V_.addListener(b,"mouseup",this.onVolumeScrubberMouseUp.rEvtContext(this))},onVolumeScrubberMouseMove:function(a){this.setVolumeWithScrubber(a)},onVolumeScrubberMouseUp:function(a){this.setVolumeWithScrubber(a);_V_.unblockTextSelection();b.removeEventListener("mousemove",this.onVolumeScrubberMouseMove,false);b.removeEventListener("mouseup",this.onVolumeScrubberMouseUp,false)},setVolumeWithScrubber:function(b){var a=_V_.getRelativePosition(b.pageX,this.currentScrubber);this.volume(a)}});a.player.newBehavior("fullscreenToggle",function(a){_V_.addListener(a,"click",this.onFullscreenToggleClick.context(this))},{onFullscreenToggleClick:function(){if(!this.videoIsFullScreen)this.enterFullScreen();else this.exitFullScreen()},fullscreenOnWindowResize:function(){this.positionControlBars()},fullscreenOnEscKey:function(a){a.keyCode==27&&this.exitFullScreen()}});a.player.newBehavior("bigPlayButton",function(a){if(!this.elements.bigPlayButtons){this.elements.bigPlayButtons=[];this.onPlay(this.bigPlayButtonsOnPlay);this.onEnded(this.bigPlayButtonsOnEnded)}this.elements.bigPlayButtons.push(a);this.activateElement(a,"playButton")},{bigPlayButtonsOnPlay:function(){this.hideBigPlayButtons()},bigPlayButtonsOnEnded:function(){this.showBigPlayButtons()},showBigPlayButtons:function(){this.each(this.elements.bigPlayButtons,function(a){a.style.display="block"})},hideBigPlayButtons:function(){this.each(this.elements.bigPlayButtons,function(a){a.style.display="none"})}});a.player.newBehavior("spinner",function(a){if(!this.spinners){this.spinners=[];_V_.addListener(this.video,"loadeddata",this.spinnersOnVideoLoadedData.context(this));_V_.addListener(this.video,"loadstart",this.spinnersOnVideoLoadStart.context(this));_V_.addListener(this.video,"seeking",this.spinnersOnVideoSeeking.context(this));_V_.addListener(this.video,"seeked",this.spinnersOnVideoSeeked.context(this));_V_.addListener(this.video,"canplay",this.spinnersOnVideoCanPlay.context(this));_V_.addListener(this.video,"canplaythrough",this.spinnersOnVideoCanPlayThrough.context(this));_V_.addListener(this.video,"waiting",this.spinnersOnVideoWaiting.context(this));_V_.addListener(this.video,"stalled",this.spinnersOnVideoStalled.context(this));_V_.addListener(this.video,"suspend",this.spinnersOnVideoSuspend.context(this));_V_.addListener(this.video,"playing",this.spinnersOnVideoPlaying.context(this));_V_.addListener(this.video,"timeupdate",this.spinnersOnVideoTimeUpdate.context(this))}this.spinners.push(a)},{showSpinners:function(){this.each(this.spinners,function(a){a.style.display="block"});clearInterval(this.spinnerInterval);this.spinnerInterval=setInterval(this.rotateSpinners.context(this),100)},hideSpinners:function(){this.each(this.spinners,function(a){a.style.display="none"});clearInterval(this.spinnerInterval)},spinnersRotated:0,rotateSpinners:function(){this.each(this.spinners,function(a){a.style.WebkitTransform="scale(0.5) rotate("+this.spinnersRotated+"deg)";a.style.MozTransform="scale(0.5) rotate("+this.spinnersRotated+"deg)"});if(this.spinnersRotated==360)this.spinnersRotated=0;this.spinnersRotated+=45},spinnersOnVideoLoadedData:function(){this.hideSpinners()},spinnersOnVideoLoadStart:function(){this.showSpinners()},spinnersOnVideoSeeking:function(){},spinnersOnVideoSeeked:function(){},spinnersOnVideoCanPlay:function(){},spinnersOnVideoCanPlayThrough:function(){this.hideSpinners()},spinnersOnVideoWaiting:function(){this.showSpinners()},spinnersOnVideoStalled:function(){},spinnersOnVideoSuspend:function(){},spinnersOnVideoPlaying:function(){this.hideSpinners()},spinnersOnVideoTimeUpdate:function(){this.spinner.style.display=="block"&&this.hideSpinners()}});a.player.newBehavior("subtitlesDisplay",function(a){if(!this.subtitleDisplays){this.subtitleDisplays=[];this.onCurrentTimeUpdate(this.subtitleDisplaysOnVideoTimeUpdate);this.onEnded(function(){this.lastSubtitleIndex=0}.context(this))}this.subtitleDisplays.push(a)},{subtitleDisplaysOnVideoTimeUpdate:function(b){if(this.subtitles)if(!this.currentSubtitle||this.currentSubtitle.start>=b||this.currentSubtitle.end<b){var c=false,d=this.subtitles[this.lastSubtitleIndex].start>b,a=this.lastSubtitleIndex-d?1:0;while(true)if(d){if(a<0||this.subtitles[a].end<b)break;if(this.subtitles[a].start<b){c=a;break}a--}else{if(a>=this.subtitles.length||this.subtitles[a].start>b)break;if(this.subtitles[a].end>b){c=a;break}a++}if(c!==false){this.currentSubtitle=this.subtitles[c];this.lastSubtitleIndex=c;this.updateSubtitleDisplays(this.currentSubtitle.text)}else if(this.currentSubtitle){this.currentSubtitle=false;this.updateSubtitleDisplays("")}}},updateSubtitleDisplays:function(a){this.each(this.subtitleDisplays,function(b){b.innerHTML=a})}});a.extend({addClass:function(a,b){if((" "+a.className+" ").indexOf(" "+b+" ")==-1)a.className=a.className===""?b:a.className+" "+b},removeClass:function(b,c){if(b.className.indexOf(c)==-1)return;var a=b.className.split(/\s+/);a.splice(a.lastIndexOf(c),1);b.className=a.join(" ")},createElement:function(c,a){return this.merge(b.createElement(c),a)},blockTextSelection:function(){b.body.focus();b.onselectstart=function(){return false}},unblockTextSelection:function(){b.onselectstart=function(){return true}},formatTime:function(c){var a=Math.round(c),b=Math.floor(a/60);b=b>=10?b:"0"+b;a=Math.floor(a%60);a=a>=10?a:"0"+a;return b+":"+a},getRelativePosition:function(b,a){return Math.max(0,Math.min(1,(b-this.findPosX(a))/a.offsetWidth))},findPosX:function(a){var b=a.offsetLeft;while(a=a.offsetParent)b+=a.offsetLeft;return b},getComputedStyleValue:function(a,b){return c.getComputedStyle(a,null).getPropertyValue(b)},round:function(b,a){if(!a)a=0;return Math.round(b*Math.pow(10,a))/Math.pow(10,a)},addListener:function(a,c,b){if(a.addEventListener)a.addEventListener(c,b,false);else a.attachEvent&&a.attachEvent("on"+c,b)},removeListener:function(a,c,b){if(a.removeEventListener)a.removeEventListener(c,b,false);else a.attachEvent&&a.detachEvent("on"+c,b)},"get":function(c,b){if(typeof XMLHttpRequest=="undefined")XMLHttpRequest=function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(b){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(c){}throw new Error("This browser does not support XMLHttpRequest.");};var a=new XMLHttpRequest;a.open("GET",c);a.onreadystatechange=function(){a.readyState==4&&a.status==200&&b(a.responseText)}.context(this);a.send()},trim:function(a){return a.toString().replace(/^\s+/,"").replace(/\s+$/,"")},bindDOMReady:function(){if(b.readyState==="complete")return a.onDOMReady();if(b.addEventListener){b.addEventListener("DOMContentLoaded",a.DOMContentLoaded,false);c.addEventListener("load",a.onDOMReady,false)}else if(b.attachEvent){b.attachEvent("onreadystatechange",a.DOMContentLoaded);c.attachEvent("onload",a.onDOMReady)}},DOMContentLoaded:function(){if(b.addEventListener){b.removeEventListener("DOMContentLoaded",a.DOMContentLoaded,false);a.onDOMReady()}else if(b.attachEvent)if(b.readyState==="complete"){b.detachEvent("onreadystatechange",a.DOMContentLoaded);a.onDOMReady()}},DOMReadyList:[],addToDOMReady:function(c){if(a.DOMIsReady)c.call(b);else a.DOMReadyList.push(c)},DOMIsReady:false,onDOMReady:function(){if(a.DOMIsReady)return;if(!b.body)return setTimeout(a.onDOMReady,13);a.DOMIsReady=true;if(a.DOMReadyList){for(var c=0;c<a.DOMReadyList.length;c++)a.DOMReadyList[c].call(b);a.DOMReadyList=null}}});a.bindDOMReady();Function.prototype.context=function(c){var a=this,b=function(){return a.apply(c,arguments)};return b};Function.prototype.evtContext=function(c){var a=this,b=function(){var b=this;return a.call(c,arguments[0],b)};return b};Function.prototype.rEvtContext=function(c,a){if(this.hasContext===true)return this;if(!a)a=c;for(var b in a)if(a[b]==this){a[b]=this.evtContext(c);a[b].hasContext=true;return a[b]}return this.evtContext(c)};c.jQuery&&(function(b){b.fn.VideoJS=function(b){this.each(function(){a.setup(this,b)});return this};b.fn.player=function(){return this[0].player}})(jQuery);c.VideoJS=c._V_=a})(window)
