/*

 MediaElement.js
 HTML5 <video> and <audio> shim and player
 http://mediaelementjs.com/

 Creates a JavaScript object that mimics HTML5 MediaElement API
 for browsers that don't understand HTML5 or can't play the provided codec
 Can play MP4 (H.264), Ogg, WebM, FLV, WMV, WMA, ACC, and MP3

 Copyright 2010, John Dyer (http://johndyer.me)
 Dual licensed under the MIT or GPL Version 2 licenses.

*/
var mejs=mejs||{};mejs.version="2.1.6";mejs.meIndex=0;mejs.plugins={silverlight:[{version:[3,0],types:"video/mp4,video/m4v,video/mov,video/wmv,audio/wma,audio/m4a,audio/mp3,audio/wav,audio/mpeg".split(",")}],flash:[{version:[9,0,124],types:"video/mp4,video/m4v,video/mov,video/flv,video/x-flv,audio/flv,audio/x-flv,audio/mp3,audio/m4a,audio/mpeg".split(",")}]};
mejs.Utility={encodeUrl:function(b){return encodeURIComponent(b)},escapeHTML:function(b){return b.toString().split("&").join("&amp;").split("<").join("&lt;").split('"').join("&quot;")},absolutizeUrl:function(b){var a=document.createElement("div");a.innerHTML='<a href="'+this.escapeHTML(b)+'">x</a>';return a.firstChild.href},getScriptPath:function(b){for(var a=0,d,c="",e="",f,g=document.getElementsByTagName("script");a<g.length;a++){f=g[a].src;for(d=0;d<b.length;d++)if(e=b[d],f.indexOf(e)>-1){c=f.substring(0,
f.indexOf(e));break}if(c!=="")break}return c},secondsToTimeCode:function(b,a){var b=Math.round(b),d,c=Math.floor(b/60);c>=60&&(d=Math.floor(c/60),c%=60);d=d===void 0?"00":d>=10?d:"0"+d;b=Math.floor(b%60);return(d>0||a===!0?d+":":"")+(c>=10?c:"0"+c)+":"+(b>=10?b:"0"+b)},timeCodeToSeconds:function(b){b=b.split(":");return b[0]*3600+b[1]*60+parseFloat(b[2].replace(",","."))}};
mejs.PluginDetector={hasPluginVersion:function(b,a){var d=this.plugins[b];a[1]=a[1]||0;a[2]=a[2]||0;return d[0]>a[0]||d[0]==a[0]&&d[1]>a[1]||d[0]==a[0]&&d[1]==a[1]&&d[2]>=a[2]?!0:!1},nav:window.navigator,ua:window.navigator.userAgent.toLowerCase(),plugins:[],addPlugin:function(b,a,d,c,e){this.plugins[b]=this.detectPlugin(a,d,c,e)},detectPlugin:function(b,a,d,c){var e=[0,0,0],f;if(typeof this.nav.plugins!="undefined"&&typeof this.nav.plugins[b]=="object"){if((d=this.nav.plugins[b].description)&&!(typeof this.nav.mimeTypes!=
"undefined"&&this.nav.mimeTypes[a]&&!this.nav.mimeTypes[a].enabledPlugin)){e=d.replace(b,"").replace(/^\s+/,"").replace(/\sr/gi,".").split(".");for(b=0;b<e.length;b++)e[b]=parseInt(e[b].match(/\d+/),10)}}else if(typeof window.ActiveXObject!="undefined")try{(f=new ActiveXObject(d))&&(e=c(f))}catch(g){}return e}};
mejs.PluginDetector.addPlugin("flash","Shockwave Flash","application/x-shockwave-flash","ShockwaveFlash.ShockwaveFlash",function(b){var a=[];if(b=b.GetVariable("$version"))b=b.split(" ")[1].split(","),a=[parseInt(b[0],10),parseInt(b[1],10),parseInt(b[2],10)];return a});
mejs.PluginDetector.addPlugin("silverlight","Silverlight Plug-In","application/x-silverlight-2","AgControl.AgControl",function(b){var a=[0,0,0,0],d=function(a,b,d,g){for(;a.isVersionSupported(b[0]+"."+b[1]+"."+b[2]+"."+b[3]);)b[d]+=g;b[d]-=g};d(b,a,0,1);d(b,a,1,1);d(b,a,2,1E4);d(b,a,2,1E3);d(b,a,2,100);d(b,a,2,10);d(b,a,2,1);d(b,a,3,1);return a});
if(mejs.PluginDetector.ua.match(/android 2\.[12]/)!==null)HTMLMediaElement.canPlayType=function(b){return b.match(/video\/(mp4|m4v)/gi)!==null?"probably":""};
mejs.MediaFeatures={init:function(){var b=mejs.PluginDetector.nav,a=mejs.PluginDetector.ua.toLowerCase(),d,c=["source","track","audio","video"];this.isiPad=a.match(/ipad/i)!==null;this.isiPhone=a.match(/iphone/i)!==null;this.isAndroid=a.match(/android/i)!==null;this.isIE=b.appName.toLowerCase().indexOf("microsoft")!=-1;this.isChrome=a.match(/chrome/gi)!==null;for(b=0;b<c.length;b++)d=document.createElement(c[b]);this.hasNativeFullScreen=typeof d.webkitEnterFullScreen!=="undefined";if(this.isChrome)this.hasNativeFullScreen=
!1;if(this.hasNativeFullScreen&&a.match(/mac os x 10_5/i))this.hasNativeFullScreen=!1}};mejs.MediaFeatures.init();
mejs.HtmlMediaElement={pluginType:"native",isFullScreen:!1,setCurrentTime:function(b){this.currentTime=b},setMuted:function(b){this.muted=b},setVolume:function(b){this.volume=b},stop:function(){this.pause()},setSrc:function(b){if(typeof b=="string")this.src=b;else{var a,d;for(a=0;a<b.length;a++)if(d=b[a],this.canPlayType(d.type))this.src=d.src}},setVideoSize:function(b,a){this.width=b;this.height=a}};mejs.PluginMediaElement=function(b,a,d){this.id=b;this.pluginType=a;this.src=d;this.events={}};
mejs.PluginMediaElement.prototype={pluginElement:null,pluginType:"",isFullScreen:!1,playbackRate:-1,defaultPlaybackRate:-1,seekable:[],played:[],paused:!0,ended:!1,seeking:!1,duration:0,error:null,muted:!1,volume:1,currentTime:0,play:function(){if(this.pluginApi!=null)this.pluginApi.playMedia(),this.paused=!1},load:function(){if(this.pluginApi!=null)this.pluginApi.loadMedia(),this.paused=!1},pause:function(){if(this.pluginApi!=null)this.pluginApi.pauseMedia(),this.paused=!0},stop:function(){if(this.pluginApi!=
null)this.pluginApi.stopMedia(),this.paused=!0},canPlayType:function(b){var a,d,c,e=mejs.plugins[this.pluginType];for(a=0;a<e.length;a++)if(c=e[a],mejs.PluginDetector.hasPluginVersion(this.pluginType,c.version))for(d=0;d<c.types.length;d++)if(b==c.types[d])return!0;return!1},setSrc:function(b){if(typeof b=="string")this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(b)),this.src=mejs.Utility.absolutizeUrl(b);else{var a,d;for(a=0;a<b.length;a++)if(d=b[a],this.canPlayType(d.type))this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(d.src)),
this.src=mejs.Utility.absolutizeUrl(b)}},setCurrentTime:function(b){if(this.pluginApi!=null)this.pluginApi.setCurrentTime(b),this.currentTime=b},setVolume:function(b){if(this.pluginApi!=null)this.pluginApi.setVolume(b),this.volume=b},setMuted:function(b){if(this.pluginApi!=null)this.pluginApi.setMuted(b),this.muted=b},setVideoSize:function(b,a){if(this.pluginElement.style)this.pluginElement.style.width=b+"px",this.pluginElement.style.height=a+"px";this.pluginApi!=null&&this.pluginApi.setVideoSize(b,
a)},setFullscreen:function(b){this.pluginApi!=null&&this.pluginApi.setFullscreen(b)},addEventListener:function(b,a){this.events[b]=this.events[b]||[];this.events[b].push(a)},removeEventListener:function(b,a){if(!b)return this.events={},!0;var d=this.events[b];if(!d)return!0;if(!a)return this.events[b]=[],!0;for(i=0;i<d.length;i++)if(d[i]===a)return this.events[b].splice(i,1),!0;return!1},dispatchEvent:function(b){var a,d,c=this.events[b];if(c){d=Array.prototype.slice.call(arguments,1);for(a=0;a<c.length;a++)c[a].apply(null,
d)}}};
mejs.MediaPluginBridge={pluginMediaElements:{},htmlMediaElements:{},registerPluginElement:function(b,a,d){this.pluginMediaElements[b]=a;this.htmlMediaElements[b]=d},initPlugin:function(b){var a=this.pluginMediaElements[b],d=this.htmlMediaElements[b];switch(a.pluginType){case "flash":a.pluginElement=a.pluginApi=document.getElementById(b);break;case "silverlight":a.pluginElement=document.getElementById(a.id),a.pluginApi=a.pluginElement.Content.MediaElementJS}a.pluginApi!=null&&a.success&&a.success(a,d)},
fireEvent:function(b,a,d){var c,e,b=this.pluginMediaElements[b];b.ended=!1;b.paused=!0;a={type:a,target:b};for(c in d)b[c]=d[c],a[c]=d[c];e=d.bufferedTime||0;a.target.buffered=a.buffered={start:function(){return 0},end:function(){return e},length:1};b.dispatchEvent(a.type,a)}};
mejs.MediaElementDefaults={mode:"auto",plugins:["flash","silverlight"],enablePluginDebug:!1,type:"",pluginPath:mejs.Utility.getScriptPath(["mediaelement.js","mediaelement.min.js","mediaelement-and-player.js","mediaelement-and-player.min.js"]),flashName:"flashmediaelement.swf",enablePluginSmoothing:!1,silverlightName:"silverlightmediaelement.xap",defaultVideoWidth:480,defaultVideoHeight:270,pluginWidth:-1,pluginHeight:-1,timerRate:250,success:function(){},error:function(){}};
mejs.MediaElement=function(b,a){return mejs.HtmlMediaElementShim.create(b,a)};
mejs.HtmlMediaElementShim={create:function(b,a){var d=mejs.MediaElementDefaults,c=typeof b=="string"?document.getElementById(b):b,e=c.tagName.toLowerCase()=="video",f=typeof c.canPlayType!="undefined",g={method:"",url:""},j=c.getAttribute("poster"),h=c.getAttribute("autoplay"),k=c.getAttribute("preload"),l=c.getAttribute("controls"),m;for(m in a)d[m]=a[m];j=typeof j=="undefined"||j===null?"":j;k=typeof k=="undefined"||k===null||k==="false"?"none":k;h=!(typeof h=="undefined"||h===null||h==="false");
l=!(typeof l=="undefined"||l===null||l==="false");g=this.determinePlayback(c,d,e,f);if(g.method=="native")return this.updateNative(c,d,h,k,g);else if(g.method!=="")return this.createPlugin(c,d,e,g.method,g.url!==null?mejs.Utility.absolutizeUrl(g.url):"",j,h,k,l);else this.createErrorMessage(c,d,g.url!==null?mejs.Utility.absolutizeUrl(g.url):"",j)},determinePlayback:function(b,a,d,c){var e=[],f,g,j={method:"",url:""},h=b.getAttribute("src"),k,l;if(typeof a.type!="undefined"&&a.type!=="")e.push({type:a.type,
url:null});else if(h!="undefined"&&h!==null)g=this.checkType(h,b.getAttribute("type"),d),e.push({type:g,url:h});else for(f=0;f<b.childNodes.length;f++)g=b.childNodes[f],g.nodeType==1&&g.tagName.toLowerCase()=="source"&&(h=g.getAttribute("src"),g=this.checkType(h,g.getAttribute("type"),d),e.push({type:g,url:h}));if(c&&(a.mode==="auto"||a.mode==="native"))for(f=0;f<e.length;f++)if(b.canPlayType(e[f].type).replace(/no/,"")!==""||b.canPlayType(e[f].type.replace(/mp3/,"mpeg")).replace(/no/,"")!=="")return j.method=
"native",j.url=e[f].url,j;if(a.mode==="auto"||a.mode==="shim")for(f=0;f<e.length;f++){g=e[f].type;for(b=0;b<a.plugins.length;b++){h=a.plugins[b];k=mejs.plugins[h];for(d=0;d<k.length;d++)if(l=k[d],mejs.PluginDetector.hasPluginVersion(h,l.version))for(c=0;c<l.types.length;c++)if(g==l.types[c])return j.method=h,j.url=e[f].url,j}}if(j.method==="")j.url=e[0].url;return j},checkType:function(b,a,d){return b&&!a?(b=b.substring(b.lastIndexOf(".")+1),(d?"video":"audio")+"/"+b):a&&~a.indexOf(";")?a.substr(0,
a.indexOf(";")):a},createErrorMessage:function(b,a,d,c){var e=document.createElement("div");e.className="me-cannotplay";try{e.style.width=b.width+"px",e.style.height=b.height+"px"}catch(f){}e.innerHTML=c!==""?'<a href="'+d+'"><img src="'+c+'" /></a>':'<a href="'+d+'"><span>Download File</span></a>';b.parentNode.insertBefore(e,b);b.style.display="none";a.error(b)},createPlugin:function(b,a,d,c,e,f,g,j,h){var k=f=1,l="me_"+c+"_"+mejs.meIndex++,m=new mejs.PluginMediaElement(l,c,e),n=document.createElement("div"),
o;for(o=b.parentNode;o!==null&&o.tagName.toLowerCase()!="body";){if(o.parentNode.tagName.toLowerCase()=="p"){o.parentNode.parentNode.insertBefore(o,o.parentNode);break}o=o.parentNode}d?(f=a.videoWidth>0?a.videoWidth:b.getAttribute("width")!==null?b.getAttribute("width"):a.defaultVideoWidth,k=a.videoHeight>0?a.videoHeight:b.getAttribute("height")!==null?b.getAttribute("height"):a.defaultVideoHeight):a.enablePluginDebug&&(f=320,k=240);m.success=a.success;mejs.MediaPluginBridge.registerPluginElement(l,
m,b);n.className="me-plugin";b.parentNode.insertBefore(n,b);d=["id="+l,"isvideo="+(d?"true":"false"),"autoplay="+(g?"true":"false"),"preload="+j,"width="+f,"startvolume="+a.startVolume,"timerrate="+a.timerRate,"height="+k];e!==null&&(c=="flash"?d.push("file="+mejs.Utility.encodeUrl(e)):d.push("file="+e));a.enablePluginDebug&&d.push("debug=true");a.enablePluginSmoothing&&d.push("smoothing=true");h&&d.push("controls=true");switch(c){case "silverlight":n.innerHTML='<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="'+
l+'" name="'+l+'" width="'+f+'" height="'+k+'"><param name="initParams" value="'+d.join(",")+'" /><param name="windowless" value="true" /><param name="background" value="black" /><param name="minRuntimeVersion" value="3.0.0.0" /><param name="autoUpgrade" value="true" /><param name="source" value="'+a.pluginPath+a.silverlightName+'" /></object>';break;case "flash":mejs.MediaFeatures.isIE?(c=document.createElement("div"),n.appendChild(c),c.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="'+
l+'" width="'+f+'" height="'+k+'"><param name="movie" value="'+a.pluginPath+a.flashName+"?x="+new Date+'" /><param name="flashvars" value="'+d.join("&amp;")+'" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /></object>'):n.innerHTML='<embed id="'+l+'" name="'+l+'" play="true" loop="false" quality="high" bgcolor="#000000" wmode="transparent" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+
a.pluginPath+a.flashName+'" flashvars="'+d.join("&")+'" width="'+f+'" height="'+k+'"></embed>'}b.style.display="none";return m},updateNative:function(b,a,d,c,e){for(var f in mejs.HtmlMediaElement)b[f]=mejs.HtmlMediaElement[f];if(mejs.MediaFeatures.isChrome)c==="none"&&!d?(b.src="",b.load(),b.canceledPreload=!0,b.addEventListener("play",function(){if(b.canceledPreload)b.src=e.url,b.load(),b.play(),b.canceledPreload=!1},!1)):d&&(b.load(),b.play());a.success(b,b);return b}};window.mejs=mejs;
window.MediaElement=mejs.MediaElement;
(function(b){mejs.MepDefaults={poster:"",defaultVideoWidth:480,defaultVideoHeight:270,videoWidth:-1,videoHeight:-1,audioWidth:400,audioHeight:30,startVolume:0.8,loop:!1,enableAutosize:!0,alwaysShowHours:!1,features:"playpause,current,progress,duration,tracks,volume,fullscreen".split(",")};mejs.mepIndex=0;mejs.MediaElementPlayer=function(a,d){if(!(this instanceof mejs.MediaElementPlayer))return new mejs.MediaElementPlayer(a,d);this.options=b.extend({},mejs.MepDefaults,d);this.$media=this.$node=b(a);
this.node=this.media=this.$media[0];if(typeof this.node.player!="undefined")return this.node.player;else this.node.player=this;this.isVideo=this.media.tagName.toLowerCase()==="video";this.init();return this};mejs.MediaElementPlayer.prototype={init:function(){var a=this,d=mejs.MediaFeatures,c=b.extend(!0,{},a.options,{success:function(b,d){a.meReady(b,d)},error:function(b){a.handleError(b)}});if(d.isiPad||d.isiPhone)a.$media.attr("controls","controls"),a.$media.removeAttr("poster"),d.isiPad&&a.media.getAttribute("autoplay")!==
null&&(a.media.load(),a.media.play());else if(d.isAndroid){if(a.isVideo){if(a.$media.find("source").length>0)a.media.src=a.$media.find('source[src$="mp4"]').attr("src");a.$media.click(function(){a.media.play()})}}else a.$media.removeAttr("controls"),a.id="mep_"+mejs.mepIndex++,a.container=b('<div id="'+a.id+'" class="mejs-container"><div class="mejs-inner"><div class="mejs-mediaelement"></div><div class="mejs-layers"></div><div class="mejs-controls"></div><div class="mejs-clear"></div></div></div>').addClass(a.$media[0].className).insertBefore(a.$media),
a.container.find(".mejs-mediaelement").append(a.$media),a.controls=a.container.find(".mejs-controls"),a.layers=a.container.find(".mejs-layers"),a.isVideo?(a.width=a.options.videoWidth>0?a.options.videoWidth:a.$media[0].getAttribute("width")!==null?a.$media.attr("width"):a.options.defaultVideoWidth,a.height=a.options.videoHeight>0?a.options.videoHeight:a.$media[0].getAttribute("height")!==null?a.$media.attr("height"):a.options.defaultVideoHeight):(a.width=a.options.audioWidth,a.height=a.options.audioHeight),
a.setPlayerSize(a.width,a.height),c.pluginWidth=a.height,c.pluginHeight=a.width;mejs.MediaElement(a.$media[0],c)},meReady:function(a,d){var c=this,e=mejs.MediaFeatures,f;if(!this.created){this.created=!0;c.media=a;c.domNode=d;if(!e.isiPhone&&!e.isAndroid&&!e.isiPad){c.buildposter(c,c.controls,c.layers,c.media);c.buildoverlays(c,c.controls,c.layers,c.media);c.findTracks();for(f in c.options.features)if(e=c.options.features[f],c["build"+e])try{c["build"+e](c,c.controls,c.layers,c.media)}catch(g){}c.setPlayerSize(c.width,
c.height);c.setControlsSize();c.isVideo&&(c.container.bind("mouseenter",function(){c.controls.css("visibility","visible");c.controls.stop(!0,!0).fadeIn(200)}).bind("mouseleave",function(){c.media.paused||c.controls.stop(!0,!0).fadeOut(200,function(){b(this).css("visibility","hidden");b(this).css("display","block")})}),c.domNode.getAttribute("autoplay")!==null&&c.controls.css("visibility","hidden"),c.options.enableAutosize&&c.media.addEventListener("loadedmetadata",function(a){c.options.videoHeight<=
0&&c.domNode.getAttribute("height")===null&&!isNaN(a.target.videoHeight)&&(c.setPlayerSize(a.target.videoWidth,a.target.videoHeight),c.setControlsSize(),c.media.setVideoSize(a.target.videoWidth,a.target.videoHeight))},!1));c.media.addEventListener("ended",function(){c.media.setCurrentTime(0);c.media.pause();c.setProgressRail&&c.setProgressRail();c.setCurrentRail&&c.setCurrentRail();c.options.loop?c.media.play():c.controls.css("visibility","visible")},!0);c.media.addEventListener("loadedmetadata",
function(){c.updateDuration&&c.updateDuration();c.updateCurrent&&c.updateCurrent();c.setControlsSize()},!0);setTimeout(function(){c.setControlsSize();c.setPlayerSize(c.width,c.height)},50)}c.options.success&&c.options.success(c.media,c.domNode)}},handleError:function(a){this.options.error&&this.options.error(a)},setPlayerSize:function(a,b){this.width=parseInt(a,10);this.height=parseInt(b,10);this.container.width(this.width).height(this.height);this.layers.children(".mejs-layer").width(this.width).height(this.height)},
setControlsSize:function(){var a=0,d=0,c=this.controls.find(".mejs-time-rail"),e=this.controls.find(".mejs-time-total");this.controls.find(".mejs-time-current");this.controls.find(".mejs-time-loaded");others=c.siblings();others.each(function(){b(this).css("position")!="absolute"&&(a+=b(this).outerWidth(!0))});d=this.controls.width()-a-(c.outerWidth(!0)-c.outerWidth(!1));c.width(d);e.width(d-(e.outerWidth(!0)-e.width()));this.setProgressRail&&this.setProgressRail();this.setCurrentRail&&this.setCurrentRail()},
buildposter:function(a,d,c,e){var f=b('<div class="mejs-poster mejs-layer"><img /></div>').appendTo(c),d=a.$media.attr("poster"),c=f.find("img").width(a.width).height(a.height);a.options.poster!=""?c.attr("src",a.options.poster):d!==""&&d!=null?c.attr("src",d):f.remove();e.addEventListener("play",function(){f.hide()},!1)},buildoverlays:function(a,d,c,e){if(a.isVideo){var f=b('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-loading"><span></span></div></div>').hide().appendTo(c),g=b('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-error"></div></div>').hide().appendTo(c),
j=b('<div class="mejs-overlay mejs-layer mejs-overlay-play"><div class="mejs-overlay-button"></div></div>').appendTo(c).click(function(){e.paused?e.play():e.pause()});e.addEventListener("play",function(){j.hide();g.hide()},!1);e.addEventListener("pause",function(){j.show()},!1);e.addEventListener("loadstart",function(){f.show()},!1);e.addEventListener("canplay",function(){f.hide()},!1);e.addEventListener("error",function(){f.hide();g.show();g.find("mejs-overlay-error").html("Error loading this resource")},
!1)}},findTracks:function(){var a=this,d=a.$media.find("track");a.tracks=[];d.each(function(){a.tracks.push({srclang:b(this).attr("srclang").toLowerCase(),src:b(this).attr("src"),kind:b(this).attr("kind"),entries:[],isLoaded:!1})})},changeSkin:function(a){this.container[0].className="mejs-container "+a;this.setPlayerSize();this.setControlsSize()},play:function(){this.media.play()},pause:function(){this.media.pause()},load:function(){this.media.load()},setMuted:function(a){this.media.setMuted(a)},
setCurrentTime:function(a){this.media.setCurrentTime(a)},getCurrentTime:function(){return this.media.currentTime},setVolume:function(a){this.media.setVolume(a)},getVolume:function(){return this.media.volume},setSrc:function(a){this.media.setSrc(a)}};jQuery.fn.mediaelementplayer=function(a){return this.each(function(){new mejs.MediaElementPlayer(b(this),a)})};window.MediaElementPlayer=mejs.MediaElementPlayer})(jQuery);
(function(b){MediaElementPlayer.prototype.buildplaypause=function(a,d,c,e){var f=b('<div class="mejs-button mejs-playpause-button mejs-play" type="button"><button type="button"></button></div>').appendTo(d).click(function(a){a.preventDefault();e.paused?e.play():e.pause();return!1});e.addEventListener("play",function(){f.removeClass("mejs-play").addClass("mejs-pause")},!1);e.addEventListener("playing",function(){f.removeClass("mejs-play").addClass("mejs-pause")},!1);e.addEventListener("pause",function(){f.removeClass("mejs-pause").addClass("mejs-play")},
!1);e.addEventListener("paused",function(){f.removeClass("mejs-pause").addClass("mejs-play")},!1)}})(jQuery);
(function(b){MediaElementPlayer.prototype.buildstop=function(a,d,c,e){b('<div class="mejs-button mejs-stop-button mejs-stop"><button type="button"></button></div>').appendTo(d).click(function(){e.paused||e.pause();e.currentTime>0&&(e.setCurrentTime(0),d.find(".mejs-time-current").width("0px"),d.find(".mejs-time-handle").css("left","0px"),d.find(".mejs-time-float-current").html(mejs.Utility.secondsToTimeCode(0)),d.find(".mejs-currenttime").html(mejs.Utility.secondsToTimeCode(0)),c.find(".mejs-poster").show())})}})(jQuery);
(function(b){MediaElementPlayer.prototype.buildprogress=function(a,d,c,e){b('<div class="mejs-time-rail"><span class="mejs-time-total"><span class="mejs-time-loaded"></span><span class="mejs-time-current"></span><span class="mejs-time-handle"></span><span class="mejs-time-float"><span class="mejs-time-float-current">00:00</span><span class="mejs-time-float-corner"></span></span></span></div>').appendTo(d);var f=d.find(".mejs-time-total"),c=d.find(".mejs-time-loaded"),g=d.find(".mejs-time-current"),
j=d.find(".mejs-time-handle"),h=d.find(".mejs-time-float"),k=d.find(".mejs-time-float-current"),l=function(a){var a=a.pageX,b=f.offset(),d=f.outerWidth(),c=0,c=0;a>b.left&&a<=d+b.left&&e.duration&&(c=(a-b.left)/d,c=c<=0.02?0:c*e.duration,m&&e.setCurrentTime(c),h.css("left",a-b.left),k.html(mejs.Utility.secondsToTimeCode(c)))},m=!1,n=!1;f.bind("mousedown",function(a){m=!0;l(a);return!1});d.find(".mejs-time-rail").bind("mouseenter",function(){n=!0}).bind("mouseleave",function(){n=!1});b(document).bind("mouseup",
function(){m=!1}).bind("mousemove",function(a){(m||n)&&l(a)});e.addEventListener("progress",function(b){a.setProgressRail(b);a.setCurrentRail(b)},!1);e.addEventListener("timeupdate",function(b){a.setProgressRail(b);a.setCurrentRail(b)},!1);this.loaded=c;this.total=f;this.current=g;this.handle=j};MediaElementPlayer.prototype.setProgressRail=function(a){var b=a!=void 0?a.target:this.media,c=null;b&&b.buffered&&b.buffered.length>0&&b.buffered.end&&b.duration?c=b.buffered.end(0)/b.duration:b&&b.bytesTotal!=
void 0&&b.bytesTotal>0&&b.bufferedBytes!=void 0?c=b.bufferedBytes/b.bytesTotal:a&&a.lengthComputable&&a.total!=0&&(c=a.loaded/a.total);c!==null&&(c=Math.min(1,Math.max(0,c)),this.loaded&&this.total&&this.loaded.width(this.total.width()*c))};MediaElementPlayer.prototype.setCurrentRail=function(){if(this.media.currentTime!=void 0&&this.media.duration&&this.total&&this.handle){var a=this.total.width()*this.media.currentTime/this.media.duration,b=a-this.handle.outerWidth(!0)/2;this.current.width(a);this.handle.css("left",
b)}}})(jQuery);
(function(b){MediaElementPlayer.prototype.buildcurrent=function(a,d,c,e){b('<div class="mejs-time"><span class="mejs-currenttime">'+(a.options.alwaysShowHours?"00:":"")+"00:00</span></div>").appendTo(d);this.currenttime=this.controls.find(".mejs-currenttime");e.addEventListener("timeupdate",function(){a.updateCurrent()},!1)};MediaElementPlayer.prototype.buildduration=function(a,d,c,e){d.children().last().find(".mejs-currenttime").length>0?b(' <span> | </span> <span class="mejs-duration">'+(a.options.alwaysShowHours?
"00:":"")+"00:00</span>").appendTo(d.find(".mejs-time")):(d.find(".mejs-currenttime").parent().addClass("mejs-currenttime-container"),b('<div class="mejs-time mejs-duration-container"><span class="mejs-duration">'+(a.options.alwaysShowHours?"00:":"")+"00:00</span></div>").appendTo(d));this.durationD=this.controls.find(".mejs-duration");e.addEventListener("timeupdate",function(){a.updateDuration()},!1)};MediaElementPlayer.prototype.updateCurrent=function(){this.currenttime&&this.currenttime.html(mejs.Utility.secondsToTimeCode(this.media.currentTime|
0,this.options.alwaysShowHours||this.media.duration>3600))};MediaElementPlayer.prototype.updateDuration=function(){this.media.duration&&this.durationD&&this.durationD.html(mejs.Utility.secondsToTimeCode(this.media.duration,this.options.alwaysShowHours))}})(jQuery);
(function(b){MediaElementPlayer.prototype.buildvolume=function(a,d,c,e){var f=b('<div class="mejs-button mejs-volume-button mejs-mute"><button type="button"></button><div class="mejs-volume-slider"><div class="mejs-volume-total"></div><div class="mejs-volume-current"></div><div class="mejs-volume-handle"></div></div></div>').appendTo(d),d=f.find(".mejs-volume-slider"),g=f.find(".mejs-volume-total"),j=f.find(".mejs-volume-current"),h=f.find(".mejs-volume-handle"),k=function(a){a=g.height()-g.height()*
a;h.css("top",a-h.height()/2);j.height(g.height()-a+parseInt(g.css("top").replace(/px/,""),10));j.css("top",a)},l=function(a){var b=g.height(),d=g.offset(),c=parseInt(g.css("top").replace(/px/,""),10),a=a.pageY-d.top,d=(b-a)/b;a<0?a=0:a>b&&(a=b);h.css("top",a-h.height()/2+c);j.height(b-a);j.css("top",a+c);d==0?(e.setMuted(!0),f.removeClass("mejs-mute").addClass("mejs-unmute")):(e.setMuted(!1),f.removeClass("mejs-unmute").addClass("mejs-mute"));d=Math.max(0,d);d=Math.min(d,1);e.setVolume(d)},m=!1;
d.bind("mousedown",function(a){l(a);m=!0;return!1});b(document).bind("mouseup",function(){m=!1}).bind("mousemove",function(a){m&&l(a)});f.find("span").click(function(){e.muted?(e.setMuted(!1),f.removeClass("mejs-unmute").addClass("mejs-mute"),k(1)):(e.setMuted(!0),f.removeClass("mejs-mute").addClass("mejs-unmute"),k(0))});e.addEventListener("volumechange",function(a){m||k(a.target.volume)},!0);k(a.options.startVolume);e.pluginType==="native"&&e.setVolume(a.options.startVolume)}})(jQuery);
(function(b){MediaElementPlayer.prototype.buildfullscreen=function(a,d,c,e){if(a.isVideo){var f=0,g=0,j=a.container,h=b('<div class="mejs-button mejs-fullscreen-button"><button type="button"></button></div>').appendTo(d).click(function(){k(mejs.MediaFeatures.hasNativeFullScreen?!e.webkitDisplayingFullscreen:!e.isFullScreen)}),k=function(b){switch(e.pluginType){case "flash":case "silverlight":e.setFullscreen(b);break;case "native":mejs.MediaFeatures.hasNativeFullScreen?b?(e.webkitEnterFullScreen(),
e.isFullScreen=!0):(e.webkitExitFullScreen(),e.isFullScreen=!1):b?(f=a.$media.height(),g=a.$media.width(),j.addClass("mejs-container-fullscreen").width("100%").height("100%").css("z-index",1E3),a.$media.width("100%").height("100%"),c.children("div").width("100%").height("100%"),h.removeClass("mejs-fullscreen").addClass("mejs-unfullscreen"),a.setControlsSize(),e.isFullScreen=!0):(j.removeClass("mejs-container-fullscreen").width(g).height(f).css("z-index",1),a.$media.width(g).height(f),c.children("div").width(g).height(f),
h.removeClass("mejs-unfullscreen").addClass("mejs-fullscreen"),a.setControlsSize(),e.isFullScreen=!1)}};b(document).bind("keydown",function(a){e.isFullScreen&&a.keyCode==27&&k(!1)})}}})(jQuery);
(function(b){b.extend(mejs.MepDefaults,{startLanguage:"",translations:[],translationSelector:!1,googleApiKey:""});b.extend(MediaElementPlayer.prototype,{buildtracks:function(a,d,c,e){if(a.isVideo&&a.tracks.length!=0){var f,g="";a.chapters=b('<div class="mejs-chapters mejs-layer"></div>').prependTo(c).hide();a.captions=b('<div class="mejs-captions-layer mejs-layer"><div class="mejs-captions-position"><span class="mejs-captions-text"></span></div></div>').prependTo(c).hide();a.captionsText=a.captions.find(".mejs-captions-text");
a.captionsButton=b('<div class="mejs-button mejs-captions-button"><button type="button" ></button><div class="mejs-captions-selector"><ul><li><input type="radio" name="'+a.id+'_captions" id="'+a.id+'_captions_none" value="none" checked="checked" /><label for="'+a.id+'_captions_none">None</label></li></ul></div></button>').appendTo(d).delegate("input[type=radio]","click",function(){lang=this.value;if(lang=="none")a.selectedTrack=null;else for(f=0;f<a.tracks.length;f++)if(a.tracks[f].srclang==lang){a.selectedTrack=
a.tracks[f];a.captions.attr("lang",a.selectedTrack.srclang);a.displayCaptions();break}});a.container.bind("mouseenter",function(){a.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover")}).bind("mouseleave",function(){e.paused||a.container.find(".mejs-captions-position").removeClass("mejs-captions-position-hover")});a.trackToLoad=-1;a.selectedTrack=null;a.isLoadingTrack=!1;if(a.tracks.length>0&&a.options.translations.length>0)for(f=0;f<a.options.translations.length;f++)a.tracks.push({srclang:a.options.translations[f].toLowerCase(),
src:null,kind:"subtitles",entries:[],isLoaded:!1,isTranslation:!0});for(f=0;f<a.tracks.length;f++)a.tracks[f].kind=="subtitles"&&a.addTrackButton(a.tracks[f].srclang,a.tracks[f].isTranslation);a.loadNextTrack();e.addEventListener("timeupdate",function(){a.displayCaptions()},!1);e.addEventListener("loadedmetadata",function(){a.displayChapters()},!1);a.container.hover(function(){a.chapters.css("visibility","visible");a.chapters.fadeIn(200)},function(){e.paused||a.chapters.fadeOut(200,function(){b(this).css("visibility",
"hidden");b(this).css("display","block")})});a.node.getAttribute("autoplay")!==null&&a.chapters.css("visibility","hidden");if(a.options.translationSelector){for(f in mejs.language.codes)g+='<option value="'+f+'">'+mejs.language.codes[f]+"</option>";a.container.find(".mejs-captions-selector ul").before(b('<select class="mejs-captions-translations"><option value="">--Add Translation--</option>'+g+"</select>"));a.container.find(".mejs-captions-translations").change(function(){lang=b(this).val();if(lang!=
""&&(a.tracks.push({srclang:lang,src:null,entries:[],isLoaded:!1,isTranslation:!0}),!a.isLoadingTrack))a.trackToLoad--,a.addTrackButton(lang,!0),a.options.startLanguage=lang,a.loadNextTrack()})}}},loadNextTrack:function(){this.trackToLoad++;this.trackToLoad<this.tracks.length?(this.isLoadingTrack=!0,this.loadTrack(this.trackToLoad)):this.isLoadingTrack=!1},loadTrack:function(a){var d=this,c=d.tracks[a],e=function(){c.isLoaded=!0;d.enableTrackButton(c.srclang);d.loadNextTrack()};c.isTranslation?mejs.TrackFormatParser.translateTrackText(d.tracks[0].entries,
d.tracks[0].srclang,c.srclang,d.options.googleApiKey,function(a){c.entries=a;e()}):b.ajax({url:c.src,success:function(a){c.entries=mejs.TrackFormatParser.parse(a);e();c.kind=="chapters"&&d.media.duration>0&&d.drawChapters(c)},error:function(){d.loadNextTrack()}})},enableTrackButton:function(a){this.captionsButton.find("input[value="+a+"]").prop("disabled",!1).siblings("label").html(mejs.language.codes[a]||a);this.options.startLanguage==a&&b("#"+this.id+"_captions_"+a).click();this.adjustLanguageBox()},
addTrackButton:function(a,d){var c=mejs.language.codes[a]||a;this.captionsButton.find("ul").append(b('<li><input type="radio" name="'+this.id+'_captions" id="'+this.id+"_captions_"+a+'" value="'+a+'" disabled="disabled" /><label for="'+this.id+"_captions_"+a+'">'+c+(d?" (translating)":" (loading)")+"</label></li>"));this.adjustLanguageBox();this.container.find(".mejs-captions-translations option[value="+a+"]").remove()},adjustLanguageBox:function(){this.captionsButton.find(".mejs-captions-selector").height(this.captionsButton.find(".mejs-captions-selector ul").outerHeight(!0)+
this.captionsButton.find(".mejs-captions-translations").outerHeight(!0))},displayCaptions:function(){if(typeof this.tracks!="undefined"){var a,b=this.selectedTrack;if(b!=null&&b.isLoaded)for(a=0;a<b.entries.times.length;a++)if(this.media.currentTime>=b.entries.times[a].start&&this.media.currentTime<=b.entries.times[a].stop){this.captionsText.html(b.entries.text[a]);this.captions.show();return}this.captions.hide()}},displayChapters:function(){var a;for(a=0;a<this.tracks.length;a++)if(this.tracks[a].kind==
"chapters"&&this.tracks[a].isLoaded){this.drawChapters(this.tracks[a]);break}},drawChapters:function(a){var d=this,c,e,f=e=0;d.chapters.empty();for(c=0;c<a.entries.times.length;c++){e=a.entries.times[c].stop-a.entries.times[c].start;e=Math.floor(e/d.media.duration*100);if(e+f>100||c==a.entries.times.length-1&&e+f<100)e=100-f;d.chapters.append(b('<div class="mejs-chapter" rel="'+a.entries.times[c].start+'" style="left: '+f.toString()+"%;width: "+e.toString()+'%;"><div class="mejs-chapter-block'+(c==
a.entries.times.length-1?" mejs-chapter-block-last":"")+'"><span class="ch-title">'+a.entries.text[c]+'</span><span class="ch-time">'+mejs.Utility.secondsToTimeCode(a.entries.times[c].start)+"&ndash;"+mejs.Utility.secondsToTimeCode(a.entries.times[c].stop)+"</span></div></div>"));f+=e}d.chapters.find("div.mejs-chapter").click(function(){d.media.setCurrentTime(parseFloat(b(this).attr("rel")));d.media.paused&&d.media.play()});d.chapters.show()}});mejs.language={codes:{af:"Afrikaans",sq:"Albanian",ar:"Arabic",
be:"Belarusian",bg:"Bulgarian",ca:"Catalan",zh:"Chinese","zh-cn":"Chinese Simplified","zh-tw":"Chinese Traditional",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch",en:"English",et:"Estonian",tl:"Filipino",fi:"Finnish",fr:"French",gl:"Galician",de:"German",el:"Greek",ht:"Haitian Creole",iw:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",ga:"Irish",it:"Italian",ja:"Japanese",ko:"Korean",lv:"Latvian",lt:"Lithuanian",mk:"Macedonian",ms:"Malay",mt:"Maltese",no:"Norwegian",fa:"Persian",
pl:"Polish",pt:"Portuguese",ro:"Romanian",ru:"Russian",sr:"Serbian",sk:"Slovak",sl:"Slovenian",es:"Spanish",sw:"Swahili",sv:"Swedish",tl:"Tagalog",th:"Thai",tr:"Turkish",uk:"Ukrainian",vi:"Vietnamese",cy:"Welsh",yi:"Yiddish"}};mejs.TrackFormatParser={pattern_identifier:/^[0-9]+$/,pattern_timecode:/^([0-9]{2}:[0-9]{2}:[0-9]{2}(,[0-9]{1,3})?) --\> ([0-9]{2}:[0-9]{2}:[0-9]{2}(,[0-9]{3})?)(.*)$/,split2:function(a,b){return a.split(b)},parse:function(a){for(var b=0,a=this.split2(a,/\r?\n/),c={text:[],
times:[]},e,f;b<a.length;b++)if(this.pattern_identifier.exec(a[b])&&(b++,(e=this.pattern_timecode.exec(a[b]))&&b<a.length)){b++;f=a[b];for(b++;a[b]!==""&&b<a.length;)f=f+"\n"+a[b],b++;c.text.push(f);c.times.push({start:mejs.Utility.timeCodeToSeconds(e[1]),stop:mejs.Utility.timeCodeToSeconds(e[3]),settings:e[5]})}return c},translateTrackText:function(a,b,c,e,f){var g={text:[],times:[]},j,h;this.translateText(a.text.join(" <a></a>"),b,c,e,function(b){j=b.split("<a></a>");for(h=0;h<a.text.length;h++)g.text[h]=
j[h],g.times[h]={start:a.times[h].start,stop:a.times[h].stop,settings:a.times[h].settings};f(g)})},translateText:function(a,b,c,e,f){for(var g,j=[],h,k="",l=function(){j.length>0?(h=j.shift(),mejs.TrackFormatParser.translateChunk(h,b,c,e,function(a){a!="undefined"&&(k+=a);l()})):f(k)};a.length>0;)a.length>1E3?(g=a.lastIndexOf(".",1E3),j.push(a.substring(0,g)),a=a.substring(g+1)):(j.push(a),a="");l()},translateChunk:function(a,d,c,e,f){a={q:a,langpair:d+"|"+c,v:"1.0"};if(e!==""&&e!==null)a.key=e;b.ajax({url:"https://ajax.googleapis.com/ajax/services/language/translate",
data:a,type:"GET",dataType:"jsonp",success:function(a){f(a.responseData.translatedText)},error:function(){f(null)}})}};if("x\n\ny".split(/\n/gi).length!=3)mejs.TrackFormatParser.split2=function(a,b){var c=[],e="",f;for(f=0;f<a.length;f++)e+=a.substring(f,f+1),b.test(e)&&(c.push(e.replace(b,"")),e="");c.push(e);return c}})(jQuery);
