
(function($,undefined){$.fn.jPlayer=function(options){var name="jPlayer";var isMethodCall=typeof options==="string",args=Array.prototype.slice.call(arguments,1),returnValue=this;options=!isMethodCall&&args.length?$.extend.apply(null,[true,options].concat(args)):options;if(isMethodCall&&options.charAt(0)==="_"){return returnValue;}
if(isMethodCall){this.each(function(){var instance=$.data(this,name),methodValue=instance&&$.isFunction(instance[options])?instance[options].apply(instance,args):instance;if(methodValue!==instance&&methodValue!==undefined){returnValue=methodValue;return false;}});}else{this.each(function(){var instance=$.data(this,name);if(instance){instance.option(options||{})._init();instance.option(options||{});}else{$.data(this,name,new $.jPlayer(options,this));}});}
return returnValue;};$.jPlayer=function(options,element){if(arguments.length){this.element=$(element);this.options=$.extend(true,{},this.options,options);var self=this;this.element.bind("remove.jPlayer",function(){self.destroy();});this._init();}};$.jPlayer.event={ready:"jPlayer_ready",resize:"jPlayer_resize",error:"jPlayer_error",warning:"jPlayer_warning",loadstart:"jPlayer_loadstart",progress:"jPlayer_progress",suspend:"jPlayer_suspend",abort:"jPlayer_abort",emptied:"jPlayer_emptied",stalled:"jPlayer_stalled",play:"jPlayer_play",pause:"jPlayer_pause",loadedmetadata:"jPlayer_loadedmetadata",loadeddata:"jPlayer_loadeddata",waiting:"jPlayer_waiting",playing:"jPlayer_playing",canplay:"jPlayer_canplay",canplaythrough:"jPlayer_canplaythrough",seeking:"jPlayer_seeking",seeked:"jPlayer_seeked",timeupdate:"jPlayer_timeupdate",ended:"jPlayer_ended",ratechange:"jPlayer_ratechange",durationchange:"jPlayer_durationchange",volumechange:"jPlayer_volumechange"};$.jPlayer.htmlEvent=["loadstart","abort","emptied","stalled","loadedmetadata","loadeddata","canplaythrough","ratechange"];$.jPlayer.pause=function(){$.each($.jPlayer.prototype.instances,function(i,element){if(element.data("jPlayer").status.srcSet){element.jPlayer("pause");}});};$.jPlayer.timeFormat={showHour:false,showMin:true,showSec:true,padHour:false,padMin:true,padSec:true,sepHour:":",sepMin:":",sepSec:""};$.jPlayer.convertTime=function(sec){var myTime=new Date(sec*1000);var hour=myTime.getUTCHours();var min=myTime.getUTCMinutes();var sec=myTime.getUTCSeconds();var strHour=($.jPlayer.timeFormat.padHour&&hour<10)?"0"+hour:hour;var strMin=($.jPlayer.timeFormat.padMin&&min<10)?"0"+min:min;var strSec=($.jPlayer.timeFormat.padSec&&sec<10)?"0"+sec:sec;return(($.jPlayer.timeFormat.showHour)?strHour+$.jPlayer.timeFormat.sepHour:"")+(($.jPlayer.timeFormat.showMin)?strMin+$.jPlayer.timeFormat.sepMin:"")+(($.jPlayer.timeFormat.showSec)?strSec+$.jPlayer.timeFormat.sepSec:"");};$.jPlayer.uaMatch=function(ua){var ua=ua.toLowerCase();var rwebkit=/(webkit)[ \/]([\w.]+)/;var ropera=/(opera)(?:.*version)?[ \/]([\w.]+)/;var rmsie=/(msie) ([\w.]+)/;var rmozilla=/(mozilla)(?:.*? rv:([\w.]+))?/;var match=rwebkit.exec(ua)||ropera.exec(ua)||rmsie.exec(ua)||ua.indexOf("compatible")<0&&rmozilla.exec(ua)||[];return{browser:match[1]||"",version:match[2]||"0"};};$.jPlayer.browser={};var browserMatch=$.jPlayer.uaMatch(navigator.userAgent);if(browserMatch.browser){$.jPlayer.browser[browserMatch.browser]=true;$.jPlayer.browser.version=browserMatch.version;}
$.jPlayer.prototype={count:0,version:{script:"2.0.2",needFlash:"2.0.0",flash:"unknown"},options:{swfPath:"js",solution:"html, flash",supplied:"mp3",preload:'metadata',volume:0.8,muted:false,backgroundColor:"",cssSelectorAncestor:"#jp_interface_1",cssSelector:{videoPlay:".jp-video-play",play:".jp-play",pause:".jp-pause",stop:".jp-stop",seekBar:".jp-seek-bar",playBar:".jp-play-bar",mute:".jp-mute",unmute:".jp-unmute",volumeBar:".jp-volume-bar",volumeBarValue:".jp-volume-bar-value",currentTime:".jp-current-time",duration:".jp-duration"},idPrefix:"jp",errorAlerts:false,warningAlerts:false},instances:{},status:{src:"",media:{},paused:true,format:{},formatType:"",waitForPlay:true,waitForLoad:true,srcSet:false,video:false,seekPercent:0,currentPercentRelative:0,currentPercentAbsolute:0,currentTime:0,duration:0},_status:{volume:undefined,muted:false,width:0,height:0},internal:{ready:false,instance:undefined,htmlDlyCmdId:undefined},solution:{html:true,flash:true},format:{mp3:{codec:'audio/mpeg; codecs="mp3"',flashCanPlay:true,media:'audio'},m4a:{codec:'audio/mp4; codecs="mp4a.40.2"',flashCanPlay:true,media:'audio'},oga:{codec:'audio/ogg; codecs="vorbis"',flashCanPlay:false,media:'audio'},wav:{codec:'audio/wav; codecs="1"',flashCanPlay:false,media:'audio'},webma:{codec:'audio/webm; codecs="vorbis"',flashCanPlay:false,media:'audio'},m4v:{codec:'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',flashCanPlay:true,media:'video'},ogv:{codec:'video/ogg; codecs="theora, vorbis"',flashCanPlay:false,media:'video'},webmv:{codec:'video/webm; codecs="vorbis, vp8"',flashCanPlay:false,media:'video'}},_init:function(){var self=this;this.element.empty();this.status=$.extend({},this.status,this._status);this.internal=$.extend({},this.internal);this.formats=[];this.solutions=[];this.require={};this.htmlElement={};this.html={};this.html.audio={};this.html.video={};this.flash={};this.css={};this.css.cs={};this.css.jq={};this.status.volume=this._limitValue(this.options.volume,0,1);this.status.muted=this.options.muted;this.status.width=this.element.css('width');this.status.height=this.element.css('height');this.element.css({'background-color':this.options.backgroundColor});$.each(this.options.supplied.toLowerCase().split(","),function(index1,value1){var format=value1.replace(/^\s+|\s+$/g,"");if(self.format[format]){var dupFound=false;$.each(self.formats,function(index2,value2){if(format===value2){dupFound=true;return false;}});if(!dupFound){self.formats.push(format);}}});$.each(this.options.solution.toLowerCase().split(","),function(index1,value1){var solution=value1.replace(/^\s+|\s+$/g,"");if(self.solution[solution]){var dupFound=false;$.each(self.solutions,function(index2,value2){if(solution===value2){dupFound=true;return false;}});if(!dupFound){self.solutions.push(solution);}}});this.internal.instance="jp_"+this.count;this.instances[this.internal.instance]=this.element;if(this.element.attr("id")===""){this.element.attr("id",this.options.idPrefix+"_jplayer_"+this.count);}
this.internal.self=$.extend({},{id:this.element.attr("id"),jq:this.element});this.internal.audio=$.extend({},{id:this.options.idPrefix+"_audio_"+this.count,jq:undefined});this.internal.video=$.extend({},{id:this.options.idPrefix+"_video_"+this.count,jq:undefined});this.internal.flash=$.extend({},{id:this.options.idPrefix+"_flash_"+this.count,jq:undefined,swf:this.options.swfPath+((this.options.swfPath!==""&&this.options.swfPath.slice(-1)!=="/")?"/":"")+"Jplayer.swf"});this.internal.poster=$.extend({},{id:this.options.idPrefix+"_poster_"+this.count,jq:undefined});$.each($.jPlayer.event,function(eventName,eventType){if(self.options[eventName]!==undefined){self.element.bind(eventType+".jPlayer",self.options[eventName]);self.options[eventName]=undefined;}});this.htmlElement.poster=document.createElement('img');this.htmlElement.poster.id=this.internal.poster.id;this.htmlElement.poster.onload=function(){if(!self.status.video||self.status.waitForPlay){self.internal.poster.jq.show();}};this.element.append(this.htmlElement.poster);this.internal.poster.jq=$("#"+this.internal.poster.id);this.internal.poster.jq.css({'width':this.status.width,'height':this.status.height});this.internal.poster.jq.hide();this.require.audio=false;this.require.video=false;$.each(this.formats,function(priority,format){self.require[self.format[format].media]=true;});this.html.audio.available=false;if(this.require.audio){this.htmlElement.audio=document.createElement('audio');this.htmlElement.audio.id=this.internal.audio.id;this.html.audio.available=!!this.htmlElement.audio.canPlayType;}
this.html.video.available=false;if(this.require.video){this.htmlElement.video=document.createElement('video');this.htmlElement.video.id=this.internal.video.id;this.html.video.available=!!this.htmlElement.video.canPlayType;}
this.flash.available=this._checkForFlash(10);this.html.canPlay={};this.flash.canPlay={};$.each(this.formats,function(priority,format){self.html.canPlay[format]=self.html[self.format[format].media].available&&""!==self.htmlElement[self.format[format].media].canPlayType(self.format[format].codec);self.flash.canPlay[format]=self.format[format].flashCanPlay&&self.flash.available;});this.html.desired=false;this.flash.desired=false;$.each(this.solutions,function(solutionPriority,solution){if(solutionPriority===0){self[solution].desired=true;}else{var audioCanPlay=false;var videoCanPlay=false;$.each(self.formats,function(formatPriority,format){if(self[self.solutions[0]].canPlay[format]){if(self.format[format].media==='video'){videoCanPlay=true;}else{audioCanPlay=true;}}});self[solution].desired=(self.require.audio&&!audioCanPlay)||(self.require.video&&!videoCanPlay);}});this.html.support={};this.flash.support={};$.each(this.formats,function(priority,format){self.html.support[format]=self.html.canPlay[format]&&self.html.desired;self.flash.support[format]=self.flash.canPlay[format]&&self.flash.desired;});this.html.used=false;this.flash.used=false;$.each(this.solutions,function(solutionPriority,solution){$.each(self.formats,function(formatPriority,format){if(self[solution].support[format]){self[solution].used=true;return false;}});});this.html.active=false;this.html.audio.gate=false;this.html.video.gate=false;this.flash.active=false;this.flash.gate=false;$.each(this.options.cssSelector,function(fn,cssSel){self._cssSelector(fn,cssSel);});if(!(this.html.used||this.flash.used)){this._error({type:$.jPlayer.error.NO_SOLUTION,context:"{solution:'"+this.options.solution+"', supplied:'"+this.options.supplied+"'}",message:$.jPlayer.errorMsg.NO_SOLUTION,hint:$.jPlayer.errorHint.NO_SOLUTION});}
if(this.flash.used){var flashVars='id='+escape(this.internal.self.id)+'&vol='+this.status.volume+'&muted='+this.status.muted;if($.browser.msie&&Number($.browser.version)<=8){var html_obj='<object id="'+this.internal.flash.id+'"';html_obj+=' classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"';html_obj+=' codebase="'+document.URL.substring(0,document.URL.indexOf(':'))+'://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"';html_obj+=' type="application/x-shockwave-flash"';html_obj+=' width="0" height="0">';html_obj+='</object>';var obj_param=[];obj_param[0]='<param name="movie" value="'+this.internal.flash.swf+'" />';obj_param[1]='<param name="quality" value="high" />';obj_param[2]='<param name="FlashVars" value="'+flashVars+'" />';obj_param[3]='<param name="allowScriptAccess" value="always" />';obj_param[4]='<param name="bgcolor" value="'+this.options.backgroundColor+'" />';var ie_dom=document.createElement(html_obj);for(var i=0;i<obj_param.length;i++){ie_dom.appendChild(document.createElement(obj_param[i]));}
this.element.append(ie_dom);}else{var html_embed='<embed name="'+this.internal.flash.id+'" id="'+this.internal.flash.id+'" src="'+this.internal.flash.swf+'"';html_embed+=' width="0" height="0" bgcolor="'+this.options.backgroundColor+'"';html_embed+=' quality="high" FlashVars="'+flashVars+'"';html_embed+=' allowScriptAccess="always"';html_embed+=' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';this.element.append(html_embed);}
this.internal.flash.jq=$("#"+this.internal.flash.id);this.internal.flash.jq.css({'width':'0px','height':'0px'});}
if(this.html.used){if(this.html.audio.available){this._addHtmlEventListeners(this.htmlElement.audio,this.html.audio);this.element.append(this.htmlElement.audio);this.internal.audio.jq=$("#"+this.internal.audio.id);}
if(this.html.video.available){this._addHtmlEventListeners(this.htmlElement.video,this.html.video);this.element.append(this.htmlElement.video);this.internal.video.jq=$("#"+this.internal.video.id);this.internal.video.jq.css({'width':'0px','height':'0px'});}}
if(this.html.used&&!this.flash.used){window.setTimeout(function(){self.internal.ready=true;self.version.flash="n/a";self._trigger($.jPlayer.event.ready);},100);}
this._updateInterface();this._updateButtons(false);this._updateVolume(this.status.volume);this._updateMute(this.status.muted);if(this.css.jq.videoPlay.length){this.css.jq.videoPlay.hide();}
$.jPlayer.prototype.count++;},destroy:function(){this._resetStatus();this._updateInterface();this._seeked();if(this.css.jq.currentTime.length){this.css.jq.currentTime.text("");}
if(this.css.jq.duration.length){this.css.jq.duration.text("");}
if(this.status.srcSet){this.pause();}
$.each(this.css.jq,function(fn,jq){jq.unbind(".jPlayer");});this.element.removeData("jPlayer");this.element.unbind(".jPlayer");this.element.empty();this.instances[this.internal.instance]=undefined;},enable:function(){},disable:function(){},_addHtmlEventListeners:function(mediaElement,entity){var self=this;mediaElement.preload=this.options.preload;mediaElement.muted=this.options.muted;mediaElement.addEventListener("progress",function(){if(entity.gate&&!self.status.waitForLoad){self._getHtmlStatus(mediaElement);self._updateInterface();self._trigger($.jPlayer.event.progress);}},false);mediaElement.addEventListener("timeupdate",function(){if(entity.gate&&!self.status.waitForLoad){self._getHtmlStatus(mediaElement);self._updateInterface();self._trigger($.jPlayer.event.timeupdate);}},false);mediaElement.addEventListener("durationchange",function(){if(entity.gate&&!self.status.waitForLoad){self.status.duration=this.duration;self._getHtmlStatus(mediaElement);self._updateInterface();self._trigger($.jPlayer.event.durationchange);}},false);mediaElement.addEventListener("play",function(){if(entity.gate&&!self.status.waitForLoad){self._updateButtons(true);self._trigger($.jPlayer.event.play);}},false);mediaElement.addEventListener("playing",function(){if(entity.gate&&!self.status.waitForLoad){self._updateButtons(true);self._seeked();self._trigger($.jPlayer.event.playing);}},false);mediaElement.addEventListener("pause",function(){if(entity.gate&&!self.status.waitForLoad){self._updateButtons(false);self._trigger($.jPlayer.event.pause);}},false);mediaElement.addEventListener("waiting",function(){if(entity.gate&&!self.status.waitForLoad){self._seeking();self._trigger($.jPlayer.event.waiting);}},false);mediaElement.addEventListener("canplay",function(){if(entity.gate&&!self.status.waitForLoad){mediaElement.volume=self._volumeFix(self.status.volume);self._trigger($.jPlayer.event.canplay);}},false);mediaElement.addEventListener("seeking",function(){if(entity.gate&&!self.status.waitForLoad){self._seeking();self._trigger($.jPlayer.event.seeking);}},false);mediaElement.addEventListener("seeked",function(){if(entity.gate&&!self.status.waitForLoad){self._seeked();self._trigger($.jPlayer.event.seeked);}},false);mediaElement.addEventListener("suspend",function(){if(entity.gate&&!self.status.waitForLoad){self._seeked();self._trigger($.jPlayer.event.suspend);}},false);mediaElement.addEventListener("ended",function(){if(entity.gate&&!self.status.waitForLoad){if(!$.jPlayer.browser.webkit){self.htmlElement.media.currentTime=0;}
self.htmlElement.media.pause();self._updateButtons(false);self._getHtmlStatus(mediaElement,true);self._updateInterface();self._trigger($.jPlayer.event.ended);}},false);mediaElement.addEventListener("error",function(){if(entity.gate&&!self.status.waitForLoad){self._updateButtons(false);self._seeked();if(self.status.srcSet){self.status.waitForLoad=true;self.status.waitForPlay=true;if(self.status.video){self.internal.video.jq.css({'width':'0px','height':'0px'});}
if(self._validString(self.status.media.poster)){self.internal.poster.jq.show();}
if(self.css.jq.videoPlay.length){self.css.jq.videoPlay.show();}
self._error({type:$.jPlayer.error.URL,context:self.status.src,message:$.jPlayer.errorMsg.URL,hint:$.jPlayer.errorHint.URL});}}},false);$.each($.jPlayer.htmlEvent,function(i,eventType){mediaElement.addEventListener(this,function(){if(entity.gate&&!self.status.waitForLoad){self._trigger($.jPlayer.event[eventType]);}},false);});},_getHtmlStatus:function(media,override){var ct=0,d=0,cpa=0,sp=0,cpr=0;ct=media.currentTime;cpa=(this.status.duration>0)?100*ct/this.status.duration:0;if((typeof media.seekable==="object")&&(media.seekable.length>0)){sp=(this.status.duration>0)?100*media.seekable.end(media.seekable.length-1)/this.status.duration:100;cpr=100*media.currentTime/media.seekable.end(media.seekable.length-1);}else{sp=100;cpr=cpa;}
if(override){ct=0;cpr=0;cpa=0;}
this.status.seekPercent=sp;this.status.currentPercentRelative=cpr;this.status.currentPercentAbsolute=cpa;this.status.currentTime=ct;},_resetStatus:function(){var self=this;this.status=$.extend({},this.status,$.jPlayer.prototype.status);},_trigger:function(eventType,error,warning){var event=$.Event(eventType);event.jPlayer={};event.jPlayer.version=$.extend({},this.version);event.jPlayer.status=$.extend(true,{},this.status);event.jPlayer.html=$.extend(true,{},this.html);event.jPlayer.flash=$.extend(true,{},this.flash);if(error)event.jPlayer.error=$.extend({},error);if(warning)event.jPlayer.warning=$.extend({},warning);this.element.trigger(event);},jPlayerFlashEvent:function(eventType,status){if(eventType===$.jPlayer.event.ready&&!this.internal.ready){this.internal.ready=true;this.version.flash=status.version;if(this.version.needFlash!==this.version.flash){this._error({type:$.jPlayer.error.VERSION,context:this.version.flash,message:$.jPlayer.errorMsg.VERSION+this.version.flash,hint:$.jPlayer.errorHint.VERSION});}
this._trigger(eventType);}
if(this.flash.gate){switch(eventType){case $.jPlayer.event.progress:this._getFlashStatus(status);this._updateInterface();this._trigger(eventType);break;case $.jPlayer.event.timeupdate:this._getFlashStatus(status);this._updateInterface();this._trigger(eventType);break;case $.jPlayer.event.play:this._seeked();this._updateButtons(true);this._trigger(eventType);break;case $.jPlayer.event.pause:this._updateButtons(false);this._trigger(eventType);break;case $.jPlayer.event.ended:this._updateButtons(false);this._trigger(eventType);break;case $.jPlayer.event.error:this.status.waitForLoad=true;this.status.waitForPlay=true;if(this.status.video){this.internal.flash.jq.css({'width':'0px','height':'0px'});}
if(this._validString(this.status.media.poster)){this.internal.poster.jq.show();}
if(this.css.jq.videoPlay.length){this.css.jq.videoPlay.show();}
if(this.status.video){this._flash_setVideo(this.status.media);}else{this._flash_setAudio(this.status.media);}
this._error({type:$.jPlayer.error.URL,context:status.src,message:$.jPlayer.errorMsg.URL,hint:$.jPlayer.errorHint.URL});break;case $.jPlayer.event.seeking:this._seeking();this._trigger(eventType);break;case $.jPlayer.event.seeked:this._seeked();this._trigger(eventType);break;case $.jPlayer.event.ready:break;default:this._trigger(eventType);}}
return false;},_getFlashStatus:function(status){this.status.seekPercent=status.seekPercent;this.status.currentPercentRelative=status.currentPercentRelative;this.status.currentPercentAbsolute=status.currentPercentAbsolute;this.status.currentTime=status.currentTime;this.status.duration=status.duration;},_updateButtons:function(playing){this.status.paused=!playing;if(this.css.jq.play.length&&this.css.jq.pause.length){if(playing){this.css.jq.play.hide();this.css.jq.pause.show();}else{this.css.jq.play.show();this.css.jq.pause.hide();}}},_updateInterface:function(){if(this.css.jq.seekBar.length){this.css.jq.seekBar.width(this.status.seekPercent+"%");}
if(this.css.jq.playBar.length){this.css.jq.playBar.width(this.status.currentPercentRelative+"%");}
if(this.css.jq.currentTime.length){this.css.jq.currentTime.text($.jPlayer.convertTime(this.status.currentTime));}
if(this.css.jq.duration.length){this.css.jq.duration.text($.jPlayer.convertTime(this.status.duration));}},_seeking:function(){if(this.css.jq.seekBar.length){this.css.jq.seekBar.addClass("jp-seeking-bg");}},_seeked:function(){if(this.css.jq.seekBar.length){this.css.jq.seekBar.removeClass("jp-seeking-bg");}},setMedia:function(media){var self=this;this._seeked();clearTimeout(this.internal.htmlDlyCmdId);var audioGate=this.html.audio.gate;var videoGate=this.html.video.gate;var supported=false;$.each(this.formats,function(formatPriority,format){var isVideo=self.format[format].media==='video';$.each(self.solutions,function(solutionPriority,solution){if(self[solution].support[format]&&self._validString(media[format])){var isHtml=solution==='html';if(isVideo){if(isHtml){self.html.audio.gate=false;self.html.video.gate=true;self.flash.gate=false;}else{self.html.audio.gate=false;self.html.video.gate=false;self.flash.gate=true;}}else{if(isHtml){self.html.audio.gate=true;self.html.video.gate=false;self.flash.gate=false;}else{self.html.audio.gate=false;self.html.video.gate=false;self.flash.gate=true;}}
if(self.flash.active||(self.html.active&&self.flash.gate)||(audioGate===self.html.audio.gate&&videoGate===self.html.video.gate)){self.clearMedia();}else if(audioGate!==self.html.audio.gate&&videoGate!==self.html.video.gate){self._html_pause();if(self.status.video){self.internal.video.jq.css({'width':'0px','height':'0px'});}
self._resetStatus();}
if(isVideo){if(isHtml){self._html_setVideo(media);self.html.active=true;self.flash.active=false;}else{self._flash_setVideo(media);self.html.active=false;self.flash.active=true;}
if(self.css.jq.videoPlay.length){self.css.jq.videoPlay.show();}
self.status.video=true;}else{if(isHtml){self._html_setAudio(media);self.html.active=true;self.flash.active=false;}else{self._flash_setAudio(media);self.html.active=false;self.flash.active=true;}
if(self.css.jq.videoPlay.length){self.css.jq.videoPlay.hide();}
self.status.video=false;}
supported=true;return false;}});if(supported){return false;}});if(supported){if(this._validString(media.poster)){if(this.htmlElement.poster.src!==media.poster){this.htmlElement.poster.src=media.poster;}else{this.internal.poster.jq.show();}}else{this.internal.poster.jq.hide();}
this.status.srcSet=true;this.status.media=$.extend({},media);this._updateButtons(false);this._updateInterface();}else{if(this.status.srcSet&&!this.status.waitForPlay){this.pause();}
this.html.audio.gate=false;this.html.video.gate=false;this.flash.gate=false;this.html.active=false;this.flash.active=false;this._resetStatus();this._updateInterface();this._updateButtons(false);this.internal.poster.jq.hide();if(this.html.used&&this.require.video){this.internal.video.jq.css({'width':'0px','height':'0px'});}
if(this.flash.used){this.internal.flash.jq.css({'width':'0px','height':'0px'});}
this._error({type:$.jPlayer.error.NO_SUPPORT,context:"{supplied:'"+this.options.supplied+"'}",message:$.jPlayer.errorMsg.NO_SUPPORT,hint:$.jPlayer.errorHint.NO_SUPPORT});}},clearMedia:function(){this._resetStatus();this._updateButtons(false);this.internal.poster.jq.hide();clearTimeout(this.internal.htmlDlyCmdId);if(this.html.active){this._html_clearMedia();}else if(this.flash.active){this._flash_clearMedia();}},load:function(){if(this.status.srcSet){if(this.html.active){this._html_load();}else if(this.flash.active){this._flash_load();}}else{this._urlNotSetError("load");}},play:function(time){time=(typeof time==="number")?time:NaN;if(this.status.srcSet){if(this.html.active){this._html_play(time);}else if(this.flash.active){this._flash_play(time);}}else{this._urlNotSetError("play");}},videoPlay:function(e){this.play();},pause:function(time){time=(typeof time==="number")?time:NaN;if(this.status.srcSet){if(this.html.active){this._html_pause(time);}else if(this.flash.active){this._flash_pause(time);}}else{this._urlNotSetError("pause");}},pauseOthers:function(){var self=this;$.each(this.instances,function(i,element){if(self.element!==element){if(element.data("jPlayer").status.srcSet){element.jPlayer("pause");}}});},stop:function(){if(this.status.srcSet){if(this.html.active){this._html_pause(0);}else if(this.flash.active){this._flash_pause(0);}}else{this._urlNotSetError("stop");}},playHead:function(p){p=this._limitValue(p,0,100);if(this.status.srcSet){if(this.html.active){this._html_playHead(p);}else if(this.flash.active){this._flash_playHead(p);}}else{this._urlNotSetError("playHead");}},mute:function(){this.status.muted=true;if(this.html.used){this._html_mute(true);}
if(this.flash.used){this._flash_mute(true);}
this._updateMute(true);this._updateVolume(0);this._trigger($.jPlayer.event.volumechange);},unmute:function(){this.status.muted=false;if(this.html.used){this._html_mute(false);}
if(this.flash.used){this._flash_mute(false);}
this._updateMute(false);this._updateVolume(this.status.volume);this._trigger($.jPlayer.event.volumechange);},_updateMute:function(mute){if(this.css.jq.mute.length&&this.css.jq.unmute.length){if(mute){this.css.jq.mute.hide();this.css.jq.unmute.show();}else{this.css.jq.mute.show();this.css.jq.unmute.hide();}}},volume:function(v){v=this._limitValue(v,0,1);this.status.volume=v;if(this.html.used){this._html_volume(v);}
if(this.flash.used){this._flash_volume(v);}
if(!this.status.muted){this._updateVolume(v);}
this._trigger($.jPlayer.event.volumechange);},volumeBar:function(e){if(!this.status.muted&&this.css.jq.volumeBar){var offset=this.css.jq.volumeBar.offset();var x=e.pageX-offset.left;var w=this.css.jq.volumeBar.width();var v=x/w;this.volume(v);}},volumeBarValue:function(e){this.volumeBar(e);},_updateVolume:function(v){if(this.css.jq.volumeBarValue.length){this.css.jq.volumeBarValue.width((v*100)+"%");}},_volumeFix:function(v){var rnd=0.001*Math.random();var fix=(v<0.5)?rnd:-rnd;return(v+fix);},_cssSelectorAncestor:function(ancestor,refresh){this.options.cssSelectorAncestor=ancestor;if(refresh){$.each(this.options.cssSelector,function(fn,cssSel){self._cssSelector(fn,cssSel);});}},_cssSelector:function(fn,cssSel){var self=this;if(typeof cssSel==='string'){if($.jPlayer.prototype.options.cssSelector[fn]){if(this.css.jq[fn]&&this.css.jq[fn].length){this.css.jq[fn].unbind(".jPlayer");}
this.options.cssSelector[fn]=cssSel;this.css.cs[fn]=this.options.cssSelectorAncestor+" "+cssSel;if(cssSel){this.css.jq[fn]=$(this.css.cs[fn]);}else{this.css.jq[fn]=[];}
if(this.css.jq[fn].length){var handler=function(e){self[fn](e);$(this).blur();return false;}
this.css.jq[fn].bind("click.jPlayer",handler);}
if(cssSel&&this.css.jq[fn].length!==1){this._warning({type:$.jPlayer.warning.CSS_SELECTOR_COUNT,context:this.css.cs[fn],message:$.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.css.jq[fn].length+" found for "+fn+" method.",hint:$.jPlayer.warningHint.CSS_SELECTOR_COUNT});}}else{this._warning({type:$.jPlayer.warning.CSS_SELECTOR_METHOD,context:fn,message:$.jPlayer.warningMsg.CSS_SELECTOR_METHOD,hint:$.jPlayer.warningHint.CSS_SELECTOR_METHOD});}}else{this._warning({type:$.jPlayer.warning.CSS_SELECTOR_STRING,context:cssSel,message:$.jPlayer.warningMsg.CSS_SELECTOR_STRING,hint:$.jPlayer.warningHint.CSS_SELECTOR_STRING});}},seekBar:function(e){if(this.css.jq.seekBar){var offset=this.css.jq.seekBar.offset();var x=e.pageX-offset.left;var w=this.css.jq.seekBar.width();var p=100*x/w;this.playHead(p);}},playBar:function(e){this.seekBar(e);},currentTime:function(e){},duration:function(e){},option:function(key,value){var options=key;if(arguments.length===0){return $.extend(true,{},this.options);}
if(typeof key==="string"){var keys=key.split(".");if(value===undefined){var opt=$.extend(true,{},this.options);for(var i=0;i<keys.length;i++){if(opt[keys[i]]!==undefined){opt=opt[keys[i]];}else{this._warning({type:$.jPlayer.warning.OPTION_KEY,context:key,message:$.jPlayer.warningMsg.OPTION_KEY,hint:$.jPlayer.warningHint.OPTION_KEY});return undefined;}}
return opt;}
options={};var opt=options;for(var i=0;i<keys.length;i++){if(i<keys.length-1){opt[keys[i]]={};opt=opt[keys[i]];}else{opt[keys[i]]=value;}}}
this._setOptions(options);return this;},_setOptions:function(options){var self=this;$.each(options,function(key,value){self._setOption(key,value);});return this;},_setOption:function(key,value){var self=this;switch(key){case"cssSelectorAncestor":this.options[key]=value;$.each(self.options.cssSelector,function(fn,cssSel){self._cssSelector(fn,cssSel);});break;case"cssSelector":$.each(value,function(fn,cssSel){self._cssSelector(fn,cssSel);});break;}
return this;},resize:function(css){if(this.html.active){this._resizeHtml(css);}
if(this.flash.active){this._resizeFlash(css);}
this._trigger($.jPlayer.event.resize);},_resizePoster:function(css){},_resizeHtml:function(css){},_resizeFlash:function(css){this.internal.flash.jq.css({'width':css.width,'height':css.height});},_html_initMedia:function(){if(this.status.srcSet&&!this.status.waitForPlay){this.htmlElement.media.pause();}
if(this.options.preload!=='none'){this._html_load();}
this._trigger($.jPlayer.event.timeupdate);},_html_setAudio:function(media){var self=this;$.each(this.formats,function(priority,format){if(self.html.support[format]&&media[format]){self.status.src=media[format];self.status.format[format]=true;self.status.formatType=format;return false;}});this.htmlElement.media=this.htmlElement.audio;this._html_initMedia();},_html_setVideo:function(media){var self=this;$.each(this.formats,function(priority,format){if(self.html.support[format]&&media[format]){self.status.src=media[format];self.status.format[format]=true;self.status.formatType=format;return false;}});this.htmlElement.media=this.htmlElement.video;this._html_initMedia();},_html_clearMedia:function(){if(this.htmlElement.media){if(this.htmlElement.media.id===this.internal.video.id){this.internal.video.jq.css({'width':'0px','height':'0px'});}
this.htmlElement.media.pause();this.htmlElement.media.src="";if(!($.browser.msie&&Number($.browser.version)>=9)){this.htmlElement.media.load();}}},_html_load:function(){if(this.status.waitForLoad){this.status.waitForLoad=false;this.htmlElement.media.src=this.status.src;try{this.htmlElement.media.load();}catch(err){}}
clearTimeout(this.internal.htmlDlyCmdId);},_html_play:function(time){var self=this;this._html_load();this.htmlElement.media.play();if(!isNaN(time)){try{this.htmlElement.media.currentTime=time;}catch(err){this.internal.htmlDlyCmdId=setTimeout(function(){self.play(time);},100);return;}}
this._html_checkWaitForPlay();},_html_pause:function(time){var self=this;if(time>0){this._html_load();}else{clearTimeout(this.internal.htmlDlyCmdId);}
this.htmlElement.media.pause();if(!isNaN(time)){try{this.htmlElement.media.currentTime=time;}catch(err){this.internal.htmlDlyCmdId=setTimeout(function(){self.pause(time);},100);return;}}
if(time>0){this._html_checkWaitForPlay();}},_html_playHead:function(percent){var self=this;this._html_load();try{if((typeof this.htmlElement.media.seekable==="object")&&(this.htmlElement.media.seekable.length>0)){this.htmlElement.media.currentTime=percent*this.htmlElement.media.seekable.end(this.htmlElement.media.seekable.length-1)/100;}else if(this.htmlElement.media.duration>0&&!isNaN(this.htmlElement.media.duration)){this.htmlElement.media.currentTime=percent*this.htmlElement.media.duration/100;}else{throw"e";}}catch(err){this.internal.htmlDlyCmdId=setTimeout(function(){self.playHead(percent);},100);return;}
if(!this.status.waitForLoad){this._html_checkWaitForPlay();}},_html_checkWaitForPlay:function(){if(this.status.waitForPlay){this.status.waitForPlay=false;if(this.css.jq.videoPlay.length){this.css.jq.videoPlay.hide();}
if(this.status.video){this.internal.poster.jq.hide();this.internal.video.jq.css({'width':this.status.width,'height':this.status.height});}}},_html_volume:function(v){if(this.html.audio.available){this.htmlElement.audio.volume=v;}
if(this.html.video.available){this.htmlElement.video.volume=v;}},_html_mute:function(m){if(this.html.audio.available){this.htmlElement.audio.muted=m;}
if(this.html.video.available){this.htmlElement.video.muted=m;}},_flash_setAudio:function(media){var self=this;try{$.each(this.formats,function(priority,format){if(self.flash.support[format]&&media[format]){switch(format){case"m4a":self._getMovie().fl_setAudio_m4a(media[format]);break;case"mp3":self._getMovie().fl_setAudio_mp3(media[format]);break;}
self.status.src=media[format];self.status.format[format]=true;self.status.formatType=format;return false;}});if(this.options.preload==='auto'){this._flash_load();this.status.waitForLoad=false;}}catch(err){this._flashError(err);}},_flash_setVideo:function(media){var self=this;try{$.each(this.formats,function(priority,format){if(self.flash.support[format]&&media[format]){switch(format){case"m4v":self._getMovie().fl_setVideo_m4v(media[format]);break;}
self.status.src=media[format];self.status.format[format]=true;self.status.formatType=format;return false;}});if(this.options.preload==='auto'){this._flash_load();this.status.waitForLoad=false;}}catch(err){this._flashError(err);}},_flash_clearMedia:function(){this.internal.flash.jq.css({'width':'0px','height':'0px'});try{this._getMovie().fl_clearMedia();}catch(err){this._flashError(err);}},_flash_load:function(){try{this._getMovie().fl_load();}catch(err){this._flashError(err);}
this.status.waitForLoad=false;},_flash_play:function(time){try{this._getMovie().fl_play(time);}catch(err){this._flashError(err);}
this.status.waitForLoad=false;this._flash_checkWaitForPlay();},_flash_pause:function(time){try{this._getMovie().fl_pause(time);}catch(err){this._flashError(err);}
if(time>0){this.status.waitForLoad=false;this._flash_checkWaitForPlay();}},_flash_playHead:function(p){try{this._getMovie().fl_play_head(p)}catch(err){this._flashError(err);}
if(!this.status.waitForLoad){this._flash_checkWaitForPlay();}},_flash_checkWaitForPlay:function(){if(this.status.waitForPlay){this.status.waitForPlay=false;if(this.css.jq.videoPlay.length){this.css.jq.videoPlay.hide();}
if(this.status.video){this.internal.poster.jq.hide();this.internal.flash.jq.css({'width':this.status.width,'height':this.status.height});}}},_flash_volume:function(v){try{this._getMovie().fl_volume(v);}catch(err){this._flashError(err);}},_flash_mute:function(m){try{this._getMovie().fl_mute(m);}catch(err){this._flashError(err);}},_getMovie:function(){return document[this.internal.flash.id];},_checkForFlash:function(version){var flashIsInstalled=false;var flash;if(window.ActiveXObject){try{flash=new ActiveXObject(("ShockwaveFlash.ShockwaveFlash."+version));flashIsInstalled=true;}
catch(e){}}
else if(navigator.plugins&&navigator.mimeTypes.length>0){flash=navigator.plugins["Shockwave Flash"];if(flash){var flashVersion=navigator.plugins["Shockwave Flash"].description.replace(/.*\s(\d+\.\d+).*/,"$1");if(flashVersion>=version){flashIsInstalled=true;}}}
if($.browser.msie&&Number($.browser.version)>=9){return false;}else{return flashIsInstalled;}},_validString:function(url){return(url&&typeof url==="string");},_limitValue:function(value,min,max){return(value<min)?min:((value>max)?max:value);},_urlNotSetError:function(context){this._error({type:$.jPlayer.error.URL_NOT_SET,context:context,message:$.jPlayer.errorMsg.URL_NOT_SET,hint:$.jPlayer.errorHint.URL_NOT_SET});},_flashError:function(error){this._error({type:$.jPlayer.error.FLASH,context:this.internal.flash.swf,message:$.jPlayer.errorMsg.FLASH+error.message,hint:$.jPlayer.errorHint.FLASH});},_error:function(error){this._trigger($.jPlayer.event.error,error);if(this.options.errorAlerts){this._alert("Error!"+(error.message?"\n\n"+error.message:"")+(error.hint?"\n\n"+error.hint:"")+"\n\nContext: "+error.context);}},_warning:function(warning){this._trigger($.jPlayer.event.warning,undefined,warning);if(this.options.warningAlerts){this._alert("Warning!"+(warning.message?"\n\n"+warning.message:"")+(warning.hint?"\n\n"+warning.hint:"")+"\n\nContext: "+warning.context);}},_alert:function(message){alert("jPlayer "+this.version.script+" : id='"+this.internal.self.id+"' : "+message);}};$.jPlayer.error={FLASH:"e_flash",NO_SOLUTION:"e_no_solution",NO_SUPPORT:"e_no_support",URL:"e_url",URL_NOT_SET:"e_url_not_set",VERSION:"e_version"};$.jPlayer.errorMsg={FLASH:"jPlayer's Flash fallback is not configured correctly, or a command was issued before the jPlayer Ready event. Details: ",NO_SOLUTION:"No solution can be found by jPlayer in this browser. Neither HTML nor Flash can be used.",NO_SUPPORT:"It is not possible to play any media format provided in setMedia() on this browser using your current options.",URL:"Media URL could not be loaded.",URL_NOT_SET:"Attempt to issue media playback commands, while no media url is set.",VERSION:"jPlayer "+$.jPlayer.prototype.version.script+" needs Jplayer.swf version "+$.jPlayer.prototype.version.needFlash+" but found "};$.jPlayer.errorHint={FLASH:"Check your swfPath option and that Jplayer.swf is there.",NO_SOLUTION:"Review the jPlayer options: support and supplied.",NO_SUPPORT:"Video or audio formats defined in the supplied option are missing.",URL:"Check media URL is valid.",URL_NOT_SET:"Use setMedia() to set the media URL.",VERSION:"Update jPlayer files."};$.jPlayer.warning={CSS_SELECTOR_COUNT:"e_css_selector_count",CSS_SELECTOR_METHOD:"e_css_selector_method",CSS_SELECTOR_STRING:"e_css_selector_string",OPTION_KEY:"e_option_key"};$.jPlayer.warningMsg={CSS_SELECTOR_COUNT:"The number of methodCssSelectors found did not equal one: ",CSS_SELECTOR_METHOD:"The methodName given in jPlayer('cssSelector') is not a valid jPlayer method.",CSS_SELECTOR_STRING:"The methodCssSelector given in jPlayer('cssSelector') is not a String or is empty.",OPTION_KEY:"The option requested in jPlayer('option') is undefined."};$.jPlayer.warningHint={CSS_SELECTOR_COUNT:"Check your css selector and the ancestor.",CSS_SELECTOR_METHOD:"Check your method name.",CSS_SELECTOR_STRING:"Check your css selector is a string.",OPTION_KEY:"Check your option name."};})(jQuery);
