/**
 * @author alexander.farkas
 * 
 * Extends: jQuery UI's Slider with WAI-Aria for a11y
 */
(function($){
	var sup = $.ui.slider.prototype,
		uID = 0,
		min = function(i, style){
			return (style === '0px') ? '1px' : style;
		},
		inline = function(i, style){
			return (style === 'inline') ? 'inline-block' : style;
		}
	;
	
	$.support.valueText = (!$.browser.msie || parseInt($.browser.version, 10) > 8);
	$.widget('ui.a11ySlider', $.ui.slider, {
		options: {
			textValue: '{value} %',
			roundValue: true
		},
		widgetEventPrefix: "slide",
		_create: function(){
			var o 		= this.options,
				that 	= this
			;
			
			this.element
				.attr('role', 'application')
				.bind('slidechange', $.proxy(this, '_updateA11yValues') )
			;
			
			sup._create.apply(this, arguments);
								
			this.handles
				.removeAttr('href')
				.attr({
					tabindex: '0',
					role: 'slider',
					'aria-valuemin': this._valueMax(),
					'aria-valuemax': this._valueMin()
				})
				.css({
					display: inline,
					minHeight: min,
					minWidth: min
				})
				.each(function(i){
					that._updateA11yValues(i, {value: that.values(i), handle: this});
				})
			;
			$('.handle-label', this.element)
				.hide()
				.each(function(i){
					var id = this.id;
					if(!id){
						uID++;
						id = 'slider-label-'+uID;
						this.id = id;
					}
					that.handles
						.filter(':eq('+ i +')')
						.attr('aria-labelledby', id)
					;
				})
			;
			//this._updateA11yValues();
		},
		_setOption: function( key, value ) {
			sup._setOption.apply(this, arguments);
			if ( key === "disabled" ) {
				this.handles
					.attr({
						'aria-disabled': String( value ),
						tabindex: (value) ? '-1' : '0'
					})
				;
			}
			return this;
		},
		_updateA11yValues: function(i, ui){
			var that 	= this,
				o 		= this.options
			;
			
			if(!ui){
				ui = {
					handle: this.handles.get(i),
					value: this.values(i)
				};
			}

			var handle 		= $(ui.handle),
				now 		= ui.value,
				textValue
			;
			if(o.roundValue && isFinite(now)){
				now = Math.round(now * 100) / 100;
			}
			if($.isFunction(o.textValue)){
				textValue = o.textValue(now, i, handle);
			} else {
				textValue = $.isArray(o.textValue) ? o.textValue[i] : o.textValue;
				textValue = textValue.replace('{value}', now);
			}
			
			handle
				.attr({
					'aria-valuenow': ($.support.valueText) ? now : textValue,
					'aria-valuetext': textValue
				})
			;
			
			
			
		}
	});
})(jQuery);

/**!
 * Part of the jMediaelement-Project v1.3.3 | http://github.com/aFarkas/jMediaelement
 * @author Alexander Farkas
 * Copyright 2010, Alexander Farkas
 * Dual licensed under the MIT or GPL Version 2 licenses.
 */
(function(a){function u(){a.event.special.mediaerror.handler.apply(a(this).closest("video, audio")[0],arguments)}function v(b){if(a.support.mediaElements){var e=a.data(this,"mediaElemSupport");if(e&&e.apis){b&&b.type&&a.data(this,"calledMediaError",false);e=e.apis;b=this;var g=a.attr(this,"srces");if(b.error||g.length&&!e.nativ.canPlaySrces(g)){a.event.special.mediaerror.handler.call(this,a.Event("mediaerror"));try{b.pause()}catch(l){}}a("source",this).unbind("error",u).filter(":last").bind("error",
u)}}}function x(b){var e=b.indexOf("?"),g="";b=e>0?b.substring(0,e):b;e=b.lastIndexOf(".")+1;return g=b.substr(e)}function y(b,e){var g=b.nodeName.toLowerCase();e=h.getSuitedPlayers(b,e.apiOrder);var l=a.data(b,"mediaElemSupport");if(e)if(e==="noSource")l.noSource=true;else if(h._setAPIActive(b,e.name))l.apis[e.name]._mmload&&l.apis[e.name]._mmload(e.src,a.attr(b,"poster"));else h._embedApi(b,e,l,g);else{l.apis.nativ._trigger({type:"totalerror"});try{b.pause()}catch(n){}}}a.multimediaSupport={};var h=
a.multimediaSupport,f=(new Date).getTime(),c=document,i=a("<video />")[0],k=!("webkitPreservesPitch"in i&&parseFloat(a.browser.version,10)<534.7&&(navigator.userAgent.indexOf("Chrome")!==-1||navigator.userAgent.indexOf("Mac")===-1));a.support.video=!!i.canPlayType;a.support.autoBuffer=!!("autobuffer"in i);a.support.audio=!!a("<audio />")[0].canPlayType;i=null;a("<source />");a("<track />");a.support.mediaElements=a.support.video&&a.support.audio;a.support.dynamicHTML5=!!a("<video><div></div></video>")[0].innerHTML;
a.support.mediaLoop="loop"in a("<video />")[0];a.browser.deprecatedPoster=!k;a.fixHTML5=function(){var b,e;return a.support.dynamicHTML5?function(g){return g}:function(g){if(!b){e=document.body;b=document.createElement("div");b.style.display="none"}var l=b.cloneNode(false);e.appendChild(l);l.innerHTML=g;e.removeChild(l);return l.childNodes}}();var d={left:"0px",position:"absolute",visibility:"hidden",display:"block"},j=function(b,e){var g=e.parentNode;e=document.body;for(var l={width:0,height:0};g&&
g!==e;){if(a.curCSS(g,"display")==="none"){a.swap(g,d,function(){var n=false;if(a.curCSS(g,"display",true)==="none"){g.style.display="";n=a.attr(g,"style");a.attr(g,"style",n+"; display: block !important;")}l.height=b.innerHeight();l.width=b.innerWidth();if(!l.width&&!l.height)l=j(b,g);n!==false&&a.attr(g,"style",n)});if(l.width||l.height)break}g=g.parentNode}return l},m=["float"];a.each(["Top","Left","Right","Bottom"],function(b,e){m.push("margin"+e);m.push("padding"+e);m.push("border"+e+"Width");
setTimeout(function(){h._transferStyles.push("border"+e+"Color");h._transferStyles.push("border"+e+"Style")},1)});a.fn.getDimensions=function(){var b={width:0,height:0};if(this[0]){var e=this,g=this[0].style;b.height=g.height;b.width=g.width;a.each(m,function(l,n){b[n]=g[n]||e.css(n)});if(!b.width||!b.height||b.height=="auto"||b.width=="auto"){b.height=this.innerHeight();b.width=this.innerWidth();if(!b.width&&!b.height)b=j(this,this[0])}}return b};var q=a.attr,o=/video|audio|source/i,r={src:1,poster:1},
w={loop:1,autoplay:1,controls:1},B={srces:1,getConfig:1,preload:1},A={auto:1,metadata:1,none:1},z={change:function(b,e,g){if(a.support.mediaElements){var l=b.getAttribute("preload")||"metadata3";if(g||e!==l)if(k){if(a.support.autoBuffer)b.autobuffer=e==="auto"}else if(e==="none"||l==="none"&&(e==="auto"||!b.getAttribute("poster"))){a(b).unbind("play",z.changePlayMode);e==="none"&&a(b).bind("play",z.changePlayMode);a.attr(b,"srces",a.attr(b,"srces"),e)}}},changeAutoplay:function(b,e){if(a.support.mediaElements&&
!k&&a.attr(b,"preload")==="none"&&e!==a.attr(b,"autoplay")){var g=a.attr(b,"srces");a.attr(b,"srces",g,"auto");g.length&&e&&setTimeout(function(){b.play&&a(b).getMediaAPI()==="nativ"&&b.play()},9)}},changePlayMode:function(){z.changeAutoplay(this,true)},addSrces:function(b,e,g){if(k||!a.support.mediaElements)return false;g=g||a.attr(b,"preload");a(b).unbind("play",z.changePlayMode);if(g==="auto"||a.attr(b,"autoplay"))return a.data(b,"jme-srces",false);a(b).bind("play",z.changePlayMode);a.data(b,"jme-srces",
e);return true}};a.attr=function(b,e,g,l){if(!(b.nodeName&&o.test(b.nodeName)&&(B[e]||w[e]||r[e])))return q(b,e,g,l);var n;if(g===undefined){if(w[e])return typeof b[e]==="boolean"?b[e]:!!(b.attributes[e]||{}).specified;if(r[e])return a.support.video&&b[e]||h.makeAbsURI(b.getAttribute(e));switch(e){case "srces":if(n=a.data(b,"jme-srces"))break;if(n=a.attr(b,"src"))n=[{src:n,type:b.getAttribute("type"),media:b.getAttribute("media")}];else{n=[];a("source",b).each(function(){n.push({src:a.attr(this,"src"),
type:this.getAttribute("type"),media:this.getAttribute("media")})});n.length||a("a.source",b).each(function(){n.push({src:this.href,type:this.getAttribute("type"),media:this.getAttribute("data-media")})})}break;case "getConfig":n={};a.each(["autoplay","loop","controls","poster","preload"],function(p,s){n[s]=a.attr(b,s)});break;case "preload":n=b.preload||b.getAttribute("preload");if(n==="")n="auto";A[n]||(n="metadata");break}return n}else if(w[e]){g=!!g;b[e]=g;e==="autoplay"&&z.changeAutoplay(b,g);
if(g){b[e]=g;b.setAttribute(e,e)}else{b[e]=g;b.removeAttribute(e)}}else if(r[e])b.setAttribute(e,g);else if(e==="srces"){a("source, a.source",b).remove();b.removeAttribute("src");g=a.isArray(g)?g:[g];z.addSrces(b,g,l)||a.each(g,function(p,s){n=c.createElement("source");if(typeof s==="string")s={src:s};n.setAttribute("src",s.src);s.type&&n.setAttribute("type",s.type);s.media&&n.setAttribute("media",s.media);b.appendChild(n)})}else if(e==="getConfig")a.each(g,function(p,s){a.attr(b,p,s)});else if(e===
"preload"){if(g==="")g="auto";else A[g]||(g="metadata");z.change(b,g,l);b.setAttribute(e,g)}};a.event.special.mediaerror={setup:function(){var b=a(this).bind("error",a.event.special.mediaerror.handler).bind("native_mediareset",v);setTimeout(function(){b.each(v)},0)},teardown:function(){a(this).unbind("error",a.event.special.mediaerror.handler).find("source").unbind("error",u)},handler:function(b){if(!a.data(this,"calledMediaError")){b=a.extend({},b||{},{type:"mediaerror"});a.data(this,"calledMediaError",
true);return a.event.handle.apply(this,arguments)}}};var D={audio:{"audio/ogg":["ogg","oga","ogm"],"audio/mpeg":["mp2","mp3","mpga","mpega"],"audio/mp4":["mp4","mpg4"],"audio/wav":["wav"],"audio/x-m4a":["m4a"],"audio/x-m4p":["m4p"],"audio/3gpp":["3gp","3gpp"],"audio/webm":["webm"]},video:{"video/ogg":["ogg","ogv","ogm"],"video/mpeg":["mpg","mpeg","mpe"],"video/mp4":["mp4","mpg4","m4v"],"video/quicktime":["mov","qt"],"video/x-msvideo":["avi"],"video/x-ms-asf":["asf","asx"],"video/flv":["flv","f4v"],
"video/3gpp":["3gp","3gpp"],"video/webm":["webm"]}};a.extend(h,{jsPath:function(){var b=a("script");b=b[b.length-1].src.split("?")[0];return b.slice(0,b.lastIndexOf("/")+1)}(),extendWithData:function(){var b={string:1,number:1,"boolean":1};return function(e,g,l){l||(l=g);a.each(l,a.isArray(l)?function(n,p){h.getData(e,p,g)}:function(n,p){b[typeof p]&&h.getData(e,n,g)});return g}}(),getData:function(){var b=function(e,g){e=e.getAttribute("data-"+g);if(!(!e&&e!==""))return e*1==e?parseFloat(e,10):e===
"false"?false:e==="true"?true:e};return function(e,g,l){var n=g;l=l||{};if(typeof g==="string")g=[n];a.each(g,a.isArray(g)?function(p,s){p=b(e,s);if(p!==undefined)l[s]=p}:function(p){var s=b(e,p);if(s!==undefined)l[p]=s});return l}}(),registerMimetype:function(b,e){arguments.length===1?a.each(D,function(g){h.registerMimetype(g,b)}):a.each(e,function(g,l){if(D[b][g])D[b][g]=[];D[b][g]=D[b][g].concat(l)})},_showMimeTypes:function(){window.console&&console.log(D)},add:function(b,e,g){if(!this.apis[e][b]){this.apis[e][b]=
h.beget(this.fn);b!=="nativ"&&a.inArray(b,a.fn.jmeEmbed.defaults.apiOrder)===-1&&a.fn.jmeEmbed.defaults.apiOrder.push(b)}a.extend(true,this.apis[e][b],g)},fn:{_init:a.noop,canPlayType:function(b){var e=this.apiElem,g;if(e&&e.canPlayType){g=e.canPlayType(b);return g==="no"?"":g}b=h.extractContainerCodecsFormType(b);var l=this;g="probably";if(!b[1])return this.canPlayContainer&&a.inArray(b[0],this.canPlayContainer)!==-1?"maybe":"";a.each(b[1],function(n,p){if(!l.canPlayCodecs||a.inArray(p,l.canPlayCodecs)===
-1){g="";return false}});return g},canPlaySrc:function(b){var e=this;if(typeof b!=="string"){if(b.type)return this.canPlayType(b.type);b=b.src}var g=x(b),l="";a.each(D[this.nodeName],function(n,p){if(a.inArray(g,p)!==-1){l=e.canPlayType(n);return false}});return l},canPlaySrces:function(b){b=b||a.attr(this.element,"srces");a.isArray(b)||(b=[b]);var e=this,g=false,l="";a.each(b,function(n,p){if(g=e.canPlaySrc(p)){l=p;return false}});return l},_setActive:a.noop,_setInactive:a.noop,_trigger:function(b){a(this.element).triggerHandler(b,
b)}},apis:{audio:{},video:{}},extractContainerCodecsFormType:function(b){b=b.split(/\s*;\s*/g);if(b[1]&&b[1].indexOf("codecs")!==-1)b[1]=b[1].replace(/["|']$/,"").replace(/^\s*codecs=('|")/,"").split(/\s*,\s*/g);return b},makeAbsURI:function(){return function(b){if(b&&typeof b==="string")b=a('<a href="'+b+'"></a>')[0].href;return b}}(),beget:function(b){var e=function(){};e.prototype=b;return new e},_create:function(b,e,g,l){var n=a.data(g,"mediaElemSupport")||a.data(g,"mediaElemSupport",{apis:{},
nodeName:b});if(!n.apis[e]){n.apis[e]=h.beget(h.apis[b][e]);n.apis[e].element=g;n.apis[e].nodeName=b;n.apis[e].name=e;n.apis[e].data={};n.apis[e].embedOpts=l}return n},_transferStyles:["backgroundColor","backgroundPosition","backgroundImage","backgroundRepeat","background-attachment"],_setAPIActive:function(b,e){var g=a.data(b,"mediaElemSupport"),l=g.name;if(l===e)return true;var n=g.apis[l].apiElem,p=g.apis[e]&&g.apis[e].apiElem,s=false;if(p&&p.nodeName){if(g.nodeName!=="audio"||a.attr(b,"controls"))e===
"nativ"?g.apis[e].visualElem.css({display:""}):g.apis[e].visualElem.css(a.extend({visibility:""},g.apis[l].visualElem.getDimensions()));g.apis[e]._setActive(l);s=true;g.apis[e]._trigger({type:"apiActivated",api:e});if(g.apis[l]){g.apis[l]._volumelevelState!==undefined&&a(b).volumelevel(g.apis[l]._volumelevelState);g.apis[l]._muteState!==undefined&&a(b).muted(g.apis[l]._muteState);g.apis[l].visualElem&&a.each(h._transferStyles,function(t,C){g.apis[e].visualElem.css(C,g.apis[l].visualElem.css(C))})}}g.apis[e].isAPIActive=
true;if(n&&n.nodeName){if(l==="nativ")n.style.display="none";else g.apis[l].visualElem.css({height:0,width:0,visibility:"hidden"});g.apis[l]._setInactive(e);g.apis[l].isAPIActive=false;g.apis[e]._trigger({type:"apiDeActivated",api:l})}g.name=e;return s},getSuitedPlayers:function(b,e){var g=a.data(b,"mediaElemSupport");if(g&&g.apis){g=g.apis;var l=a.attr(b,"srces"),n=false,p=function(s,t){if(!(typeof t.isTechAvailable==="boolean"&&!t.isTechAvailable||a.isFunction(t.isTechAvailable)&&!t.isTechAvailable())){if(t=
t.canPlaySrces(l))n={src:t.src||t,name:s};return n}};if(!l.length)return"noSource";e?a.each(e,function(s,t){return!p(t,g[t])}):a.each(g,function(s,t){return!p(s,t)});return n}},_embedApi:function(b,e,g){var l=a.attr(b,"getConfig"),n=a(b),p=b.id,s=n.attr("aria-labelledby");if(!p){f++;p=g.nodeName+"-"+f;b.id=p}g.apis[e.name].visualElem=a('<div class="media-element-box mm-'+g.nodeName+'-box" style="position: relative;" />').insertBefore(b);s&&g.apis[e.name].visualElem.attr({role:"group","aria-labelledby":s});
if(g.nodeName==="audio"&&!l.controls)g.apis[e.name].visualElem.css({height:0,width:0});else{g.apis[e.name].visualElem.css(n.getDimensions());a.each(h._transferStyles,function(t,C){g.apis[e.name].visualElem.css(C,n.css(C))})}g.apis[e.name]._embed(e.src,g.name+"-"+p,l,function(t){g.apis[e.name].apiElem=t;a(t).addClass(g.nodeName);l.controls||a(t).attr({tabindex:"-1",role:"presentation"});g.apis[e.name]._init();g.apis[e.name]._trigger({type:"apiActivated",api:e.name})})},getPluginVersion:function(b,
e){e=e||navigator.plugins&&navigator.plugins[b];b=[-1,0];if(e)if((e=(e.description||"").replace(/,/g,".").match(/(\d+)/g)||["0"])&&e[0]){b[0]=e[0];if(e[1])b[0]+="."+e[1];b[0]=parseFloat(b[0],10);if(e[2])b[1]=parseInt(e[2],10)}return b},embedObject:function(b,e,g,l,n){b.style.overflow="hidden";b=a("<div />").prependTo(b)[0];var p;if(navigator.plugins&&navigator.plugins.length){p=c.createElement("object");a.each(g,function(s,t){p.setAttribute(s,t)});a.each(l,function(s,t){var C=c.createElement("param");
C.setAttribute("name",s);C.setAttribute("value",t);p.appendChild(C)});p.setAttribute("id",e);p.setAttribute("name",e);if(l.wmode==="transparent"){p.style.minHeight="1px";p.style.minHeight="1px"}b.parentNode.replaceChild(p,b)}else if(window.ActiveXObject){p='<object style="width: 100%; height: 100%; width="100%" height="100%"';a.each(a.extend({},g,n),function(s,t){p+=" "+s+'="'+t+'"'});p+=' name="'+e+'"';p+=' id="'+e+'"';p+=">";a.each(l,function(s,t){p+=' <param name="'+s+'" value="'+t+'" />'});p+=
"</object>";b.outerHTML=p;p=c.getElementById(e)}if(p){p.setAttribute("width","100%");p.setAttribute("height","100%")}a(window).unload(function(){jQuery.cleanData([p]);p=null});setTimeout(function(){if(p&&p.style){p.style.width="100%";p.style.height="100%"}},0);return p}});h.add("nativ","video",{});h.add("nativ","audio",{});var E=function(){var b=a(this).hide().children(":not(source, track)").clone().insertAfter(this);a(this).one("mediareset",function(){a(this).show();b.remove()})};a.fn.jmeEmbed=function(b){b=
a.extend(true,{},a.fn.jmeEmbed.defaults,b);b.showFallback&&a.support.mediaElements&&this.bind("totalerror",E);return this.each(function(){var e=this.nodeName.toLowerCase(),g=false,l=this;if(!(e!=="video"&&e!=="audio"||a.support.flash9&&a.nodeName(l.parentNode,"object"))){a("object, embed",this).each(function(){a("> *:not(param, embed, object)",this).appendTo(l)}).remove();a(this).trigger("jmeBeforeEmbed",{options:b,nodeName:e});b.removeControls&&a.attr(this,"controls",false);var n=h._create(e,"nativ",
this,b);n.name="nativ";n.apis.nativ.apiElem=this;n.apis.nativ.visualElem=a(this);n.apis.nativ.isAPIActive=true;a.each(h.apis[e],function(p){p!=="nativ"&&h._create(e,p,l,b)});a(this).bind("mediaerror",function(){n.name==="nativ"&&y(this,b)});if(a.support.flash9&&b.activateFlash){g=h.getSuitedPlayers(l,["jwPlayer"]);if(g=="noSource")g={name:"jwPlayer"};n.apis.nativ.isAPIReady=true;if(g.name=="jwPlayer"&&!h._setAPIActive(this,"jwPlayer"))h._embedApi(this,g,n,e);else g=false}if(!g)if(b.debug||!a.support.mediaElements){y(this,
b);n.apis.nativ.isAPIReady=true}else n.apis.nativ._init();a.attr(this,"preload",a.attr(this,"preload"),true);a(this).trigger("jmeEmbed",{options:b,nodeName:e,data:n})}})};a.fn.jmeEmbed.defaults={debug:false,removeControls:false,showFallback:false,apiOrder:[],activateFlash:false};a.fn.mediaElementEmbed=a.fn.jmeEmbed;if(a.cleanData&&window.ActiveXObject){var F=a.cleanData;a.cleanData=function(b){F(b);for(var e=0,g=b.length;e<g;e++)if(b[e].nodeName==="OBJECT")try{for(var l in b[e])if(typeof b[e][l]===
"function")b[e][l]=null}catch(n){}}}})(jQuery);
(function(a){var u=document.createElement("video"),v=a.multimediaSupport,x={apiActivated:1,apiDeActivated:1,mediareset:1,native_mediareset:1,totalerror:1,jmeflashRefresh:1,flashblocker:1},y={native_mediareset:1,apiDeActivated:1,native_mediareset:1,apiActivated:1,timechange:1,progresschange:1,mmAPIReady:1,jmeflashRefresh:1},h={};if("enterFullScreen"in u&&u.supportsFullscreen){a.support.videoFullscreen=true;h.enter="enterFullScreen";h.exit="exitFullScreen"}else a.each(["webkit","moz","o","ms"],function(d,
j){if(j+"EnterFullScreen"in u&&j+"SupportsFullscreen"in u){a.support.videoFullscreen=true;h.enter=j+"EnterFullScreen";h.exit=j+"ExitFullScreen";return false}});u=null;a.extend(v,{capturingEvents:function(d){if(document.addEventListener){if(typeof d=="string")d=[d];a.each(d,function(j,m){var q=function(o){o=a.event.fix(o);return a.event.handle.call(this,o)};a.event.special[m]=a.event.special[m]||{};a.extend(a.event.special[m],{setup:function(){this.addEventListener(m,q,true)},teardown:function(){this.removeEventListener(m,
q,true)}})})}},formatTime:function(d){return a.map([parseInt(d/60,10),parseInt(d%60,10)],function(j){return isNaN(j)?"--":j<10?"0"+j:j}).join(":")}});v.capturingEvents("play pause playing waiting ended".split(" "));a.event.special.loadedmeta={add:function(d){var j=a(this).getJMEAPI();if(j&&j.loadedmeta){j=a.extend({},j.loadedmeta);d.handler.call(this,j,j)}}};a.extend(v.fn,{_trigger:function(d){var j=d.type?d:{type:d},m=j.type;switch(m){case "mmAPIReady":if(this.isAPIReady)return;this.isAPIReady=true;
break;case "loadedmeta":this.loadedmeta=j;break;case "totalerror":this.totalerror=true;break;case "mute":this._muteState=d.isMuted;break;case "volumelevelchange":this._volumelevelState=d.volumelevel;break;case "mediareset":this._bufferLoaded=this.totalerror=this.loadedmeta=false;break}if(!(!this.isAPIActive||this.totalerror&&!x[m]||this._stoppedEvents[m])){!this.isAPIReady&&!x[m]&&this._trigger("mmAPIReady");if(d.type==="progresschange")this._bufferLoaded=d.relLoaded;d.target=this.element;d=a.Event(d);
d.preventDefault();j.mediaAPI=this.name;y[m]&&d.stopPropagation();a.event.trigger(d,j,this.element)}},_stoppedEvents:{},_stopEvent:function(d,j){this._stoppedEvents[d]=true;if(j){var m=this;setTimeout(function(){m._allowEvent(d)},9)}},_allowEvent:function(d){this._stoppedEvents[d]=false},supportsFullScreen:function(){return this._videoFullscreen||false},enterFullscreen:a.noop,exitFullscreen:a.noop,isAPIReady:false,isJMEReady:function(){return this.isAPIReady},relCurrentTime:function(d){var j=this.getDuration()||
Number.MIN_VALUE;d&&isFinite(d)&&this.currentTime(j*d/100);return this.currentTime()/j*100},getMediaAPI:function(){return this.name},togglePlay:function(){this[this.isPlaying()?"pause":"play"]()},toggleMuted:function(){this.muted(!this.muted())},getJMEVisual:function(){return this.visualElem},jmeReady:function(d,j){var m={type:"mmAPIReady"};if(this.isJMEReady()&&(this.name!=="nativ"||a.support.mediaElements))d.call(this.element,m,m);else{j=j||"jmediaelement";var q=this,o=function(){a(q.element).unbind("mmAPIReady."+
j,o).unbind("jmeflashRefresh."+j,o);d.call(q.element,m,m)};a(this.element).bind("mmAPIReady."+j,o).bind("jmeflashRefresh."+j,o)}},unAPIReady:function(d){a(this.element).unbind("mmAPIReady."+d)},_adjustPluginLoop:function(d){var j=a.attr(this.element,"loop"),m=this;j!==d&&setTimeout(function(){m[j?"play":"pause"]()},0)},_format:v.formatTime,getFormattedDuration:function(){return this._format(this.getDuration())},getFormattedTime:function(){return this._format(this.currentTime())},loadSrc:function(d,
j,m,q){if(d){a.attr(this.element,"srces",d);d=a.isArray(d)?d:[d]}else d=a.attr(this.element,"srces");if(j!==undefined)j?a.attr(this.element,"poster",j):a(this.element).removeAttr("poster");else j=a.attr(this.element,"poster");var o=a.data(this.element,"mediaElemSupport");typeof m=="string"&&o.mediaName&&o.mediaName.text(m);o.noSource=!!d.length;this._isResetting=true;d=this.canPlaySrces(d);this._trigger("mediareset");if(d){d=d.src||d;this._mmload(d,j,q)}else{v._setAPIActive(this.element,"nativ");
this._trigger("native_mediareset");a(this.element).data("mediaElemSupport").apis.nativ._mmload()}this._isResetting=false},isPlaying:function(){return this._isResetting?false:this._isPlaying()},_makenum:function(d){var j=false;if(d==d*1)j=parseFloat(d,10);return j}});var f=function(d){var j=function(){for(var r=d.element.currentTime||0,w=d.element.buffered,B=w.length,A={},z=0;z<B;z++){A.start=w.start(z);A.end=w.end(z);if(A.start<=r&&A.end>=r)break}return A},m=function(r){var w={type:"progresschange"},
B;if(this.buffered&&this.buffered.length){if(r=this.duration){B=j();w.relStart=B.start/r*100;w.relLoaded=B.end/r*100}d._trigger(w)}else if(r.originalEvent&&"lengthComputable"in r.originalEvent&&r.originalEvent.loaded){if(r.originalEvent.lengthComputable&&r.originalEvent.total){w.relStart=0;w.relLoaded=r.originalEvent.loaded/r.originalEvent.total*100}d._trigger(w)}if(!w.relLoaded&&this.readyState===4){w.relStart=0;w.relLoaded=100;d._trigger(w)}return w.relLoaded},q=function(){if(m.call(d.element,{type:"ipadprogress"})>=
100||d.element.readyState===1)clearInterval(o)},o;a(d.element).bind("progress load",m);"buffered"in d.element&&a(d.element).bind("play waiting loadstart",function(){clearInterval(o);if(d.isAPIActive){o=setInterval(q,333);q()}})},c={isTechAvailable:a.support.mediaElements,_init:function(){var d=this,j=this.apiElem.muted,m=false,q=function(o){clearInterval(m);if(!d.element.error&&d.element.mozLoadFrom&&d.isAPIActive&&!d.element.readyState&&d.element.networkState===2&&a.support.flash9)if(o===true)d.element.load();
else m=setTimeout(function(){q(true)},o==="initial"?2E4:9E3)};f(this);a(this.element).bind({volumechange:function(){if(j!==d.apiElem.muted){j=d.apiElem.muted;d._trigger.call(d,{type:"mute",isMuted:j})}else d._trigger.call(d,{type:"volumelevelchange",volumelevel:d.apiElem.volume*100})},ended:function(){if(d.isAPIActive&&this.ended&&!this.paused&&!a.attr(this,"loop")){d._stopEvent("pause",true);this.pause()}},timeupdate:function(){var o={type:"timechange",time:this.currentTime};if(this.duration){o.duration=
this.duration;o.timeProgress=o.time/o.duration*100}d._trigger(o)},progress:function(){!d.loadedmeta&&this.duration&&d._trigger({type:"loadedmeta",duration:this.duration})},loadedmetadata:function(){d._trigger({type:"loadedmeta",duration:this.duration})}}).bind("play playing",function(o){if(!d.isAPIActive&&o.originalEvent&&!d.element.paused&&!d.element.ended)try{d.element.pause()}catch(r){}}).bind("mediareset",q).bind("ended play pause waiting playing",function(o){if(!d.isAPIActive&&o.originalEvent&&
(o.originalEvent.mediaAPI==="nativ"||!o.originalEvent.mediaAPI)||d._stoppedEvents[o.type])o.stopImmediatePropagation()});q("initial");a.support.mediaLoop||a(this.element).bind("ended",function(){if(d.isAPIActive&&a.attr(this,"loop")){var o=this;setTimeout(function(){a.attr(o,"loop")&&o.play()},0)}});if(!this.element.error)if(this.element.readyState>0)this._trigger({type:"loadedmeta",duration:this.element.duration});else if(this.element.networkState!==2||"webkitPreservesPitch"in this.element)this._trigger("mmAPIReady")},
play:function(){this.element.play()},pause:function(){this._allowEvent("pause");this.element.pause()},muted:function(d){if(typeof d!=="boolean")return this.element.muted;this.element.muted=d},volume:function(d){if(!isFinite(d))return this.element.volume*100;this.element.volume=d/100},currentTime:function(d){if(!isFinite(d))return this.element.currentTime;try{this.element.currentTime=d}catch(j){}},_mmload:function(){this.element.load?this.element.load():a(this.element).triggerHandler("error")},_isPlaying:function(){return!this.element.paused&&
this.element.readyState>1&&!this.element.error&&!this.element.ended},getDuration:function(){return this.element.duration},getCurrentSrc:function(){return this.element.currentSrc}};v.add("nativ","video",a.extend({_videoFullscreen:a.support.videoFullscreen,enterFullScreen:function(){if(!this._videoFullscreen)return false;try{this.element[h.enter]()}catch(d){return false}return true},exitFullScreen:function(){if(!this._videoFullscreen)return false;try{this.element[h.exit]()}catch(d){return false}return true}},
c));v.add("nativ","audio",c);a.fn.getJMEAPI=function(d){if(this[0]){var j=a.data(this[0],"mediaElemSupport");return d||!j||!j.name||!j.apis?j:j.apis[j.name]}};var i={jmeReady:1,getJMEVisual:1,jmeReady:1,isJMEReady:1,getMediaAPI:1,supportsFullScreen:1};v.registerAPI=function(d){if(typeof d==="string")d=[d];a.each(d,function(j,m){if((j=v.apis.video.nativ[m])&&!a.fn[m]&&a.isFunction(j)&&m.indexOf("_")!==0)a.fn[m]=function(){var q=arguments,o;this.each(function(){var r=a(this).getJMEAPI();if(r)if(i[m]||
m=="loadSrc"&&a.data(this,"mediaElemSupport").noSource||r.isJMEReady()&&!r.totalerror&&(r.name!=="nativ"||a.support.mediaElements)){o=r[m].apply(r,q);return o===undefined}else{r.unAPIReady(m+"queue");r.jmeReady.call(r,function(){r[m].apply(r,q)},m+"queue")}});return o===undefined?this:o}})};var k=[];a.each(v.apis.video.nativ,function(d){k.push(d)});v.registerAPI(k);a.fn.onAPIReady=a.fn.jmeReady;a.fn.getMMAPI=a.fn.getJMEAPI;v.fn._extend=function(d,j){var m=[];a.each(d,function(q,o){v.fn[q]=o;m.push(q);
if(j)i[q]=true});v.registerAPI(m)}})(jQuery);
(function(a){function u(h,f){h=a(h);var c={},i=h.attr("data-controls");c.mm=i?a("#"+i):a("video, audio",h).filter(":first");c.api=c.mm.getJMEAPI(true)||c.mm.jmeEmbed(f.embed).getJMEAPI(true);if(!c.api)return c;if(h.is(f.controlSel))c.controls=h;if(!c.controls||c.controls.hasClass(f.classPrefix+"media-controls")){if(h[0]&&!c.api.controlWrapper&&a.contains(h[0],c.mm[0]))c.api.controlWrapper=h;c.controls=c.controls?a(f.controlSel,h).add(c.controls):a(f.controlSel,h)}return c}function v(h,f,c,i){if(!h.data("jmePlayer")){y.addStateClasses(h,
f,i.classPrefix);h.data("jmePlayer",{mediaelement:f,api:c});a.fn.videoOverlay&&h.videoOverlay({video:f,startCSS:{width:"auto",height:"auto",zIndex:99998,padding:0,margin:0,borderWidth:0},position:{bottom:0,left:0,right:0,top:0,width:0,height:0}});a.ui&&a.ui.keyCode&&h.bind("keydown",function(k){if(!k.jmeHandledEvent){k.jmeHandledEvent=true;if({40:1,37:1,39:1,38:1}[k.keyCode]){if(!a(k.target).is(".ui-slider-handle")){var d=5;switch(k.keyCode){case a.ui.keyCode.UP:if(k.ctrlKey)d+=5;f.volume(Math.min(100,
f.volume()+d));break;case a.ui.keyCode.DOWN:if(k.ctrlKey)d+=5;f.volume(Math.max(0,f.volume()-d));break;case a.ui.keyCode.LEFT:if(k.ctrlKey)d+=55;f.currentTime(Math.max(0,f.currentTime()-d));break;case a.ui.keyCode.RIGHT:if(k.ctrlKey)d+=55;f.currentTime(Math.min(f.getDuration(),f.currentTime()+d));break}k.preventDefault()}}else if(k.keyCode===a.ui.keyCode.SPACE&&(!a.nodeName(k.target,"button")&&a.attr(k.target,"role")!=="button"||h.hasClass("wraps-fullscreen"))){f.togglePlay();k.preventDefault()}}})}}
a.event.special.ariaclick||function(){var h=false,f=function(c){if(!h&&(!c.keyCode||c.keyCode===13||c.keyCode===32&&a.attr(c.target,"role")==="button")){h=true;setTimeout(function(){h=false},1);return a.event.special.ariaclick.handler.apply(this,arguments)}else if(h&&c.type=="click"){c.preventDefault();return false}};a.event.special.ariaclick={setup:function(){a(this).bind("click keydown",f);return true},teardown:function(){a(this).unbind("click keydown",f);return true},handler:function(c){c.type=
"ariaclick";return a.event.handle.apply(this,arguments)}}}();var x={},y=a.multimediaSupport;a.fn.jmeControl=function(h){function f(){var c=u(this,h);if(c.api){c.api.controls=c.api.controls||[];if(c.api){c.controls.each(function(){var i=a(this);if(a.inArray(this,c.api.controls)===-1){c.api.controls.push(this);a.each(x,function(k,d){if(i.hasClass(h.classPrefix+k)){k=a.extend(true,{},h);k[d.optionsName]=y.extendWithData(i[0],k[d.optionsName],h[d.optionsName]);d(i,c.mm,c.api,k);return false}})}});c.api.controlWrapper&&
c.api.controlWrapper[0]&&v(c.api.controlWrapper,c.mm,c.api,h)}}}h=a.extend(true,{},a.fn.jmeControl.defaults,h);h.controlSel=[];a.each(x,function(c){c!=="media-controls"&&h.controlSel.push("."+h.classPrefix+c)});h.controlSel.push("."+h.classPrefix+"media-controls");h.controlSel=h.controlSel.join(", ");return this.each(f)};a.fn.jmeControl.defaults={embed:{removeControls:true},classPrefix:"",addThemeRoller:true};a.support.waiaria=!a.browser.msie||a.browser.version>7;a.fn.jmeControl.getBtn=function(){var h=
/\s*\/\s*|\s*\|\s*|\s*\,\s*/g;return function(f){var c={icon:a(".ui-icon",f),text:a(".button-text",f),title:f};if(!f.is(":button")&&!f.attr("role")){a.support.waiaria&&f.removeAttr("href");f.attr({role:"button",tabindex:0})}if(!c.icon[0]&&!c.text[0]&&!a("*",f)[0]){c.icon=f;c.text=f}c.names=c.text.text().split(h);c.titleText=(f.attr("title")||"").split(h);if(c.names.length!==2)c.text=a([]);if(c.titleText.length!==2)c.title=a([]);return c}}();y.camelCase=function(){var h=/-([a-z])/ig,f=function(c,i){return i.toUpperCase()};
return function(c){return c.replace(h,f)}}();a.fn.jmeControl.addControl=function(h,f,c,i){c=c||{};i=i||y.camelCase(h);a.fn.jmeControl.defaults[i]=c;f.optionsName=i;x[h]=f};a.fn.jmeControl.addControls=function(h){a.each(h,function(f,c){a.fn.jmeControl.addControl(c.name,c.fn,c.options,c.optionName)})};a.fn.registerMMControl=a.fn.jmeControl;a.each({"play-pause":{stateMethod:"isPlaying",actionMethod:"togglePlay",evts:"play playing pause ended loadedmeta mediareset",trueClass:"ui-icon-pause",falseClass:"ui-icon-play"},
"mute-unmute":{stateMethod:"muted",actionMethod:"toggleMuted",evts:"mute loadedmeta",trueClass:"ui-icon-volume-off",falseClass:"ui-icon-volume-on"}},function(h,f){a.fn.jmeControl.addControl(h,function(c,i,k,d){function j(q){if(h=="play-pause"&&q&&q.type=="playing"?true:i[f.stateMethod]()){m.text.text(m.names[1]);m.title.attr("title",m.titleText[1]);m.icon.addClass(f.trueClass).removeClass(f.falseClass)}else{m.text.text(m.names[0]);m.title.attr("title",m.titleText[0]);m.icon.addClass(f.falseClass).removeClass(f.trueClass)}}
var m=a.fn.jmeControl.getBtn(c);d.addThemeRoller&&c.addClass("ui-state-default ui-corner-all");j();i.bind(f.evts,j).jmeReady(j);c.bind("ariaclick",function(q){i[f.actionMethod]();q.preventDefault()})})});a.each(["current-time","remaining-time"],function(h,f){a.fn.jmeControl.addControl(f,function(c,i,k,d){var j=f=="remaining-time"?function(q,o){c.html(k.apis[k.name]._format(m-o.time))}:function(q,o){c.html(k.apis[k.name]._format(o.time))},m=Number.MIN_VALUE;d.addThemeRoller&&c.addClass("ui-widget-content ui-corner-all");
c.html("00:00").attr("role","timer");f=="remaining-time"&&i.bind("loadedmeta",function(q,o){m=o.duration||Number.MIN_VALUE;j(false,{time:0})});i.bind("timechange",j).bind("mediareset",function(){c.html("00:00")})})});a.fn.jmeControl.addControls([{name:"duration",fn:function(h,f,c,i){i.addThemeRoller&&h.addClass("ui-widget-content ui-corner-all");h.html("00:00");f.bind("loadedmeta",function(k,d){h.html(c.apis[c.name]._format(d.duration))}).bind("mediareset",function(){h.html("00:00")})}},{name:"media-controls",
options:{dynamicTimeslider:false,timeSliderAdjust:0,excludeSel:false,fullWindowOverlay:false},fn:function(h,f,c,i){function k(){var m=h.width()+i.mediaControls.timeSliderAdjust,q=d.outerWidth(true)-d.innerWidth();a("> *",h).each(function(){if(d[0]!==this&&this.offsetWidth&&a.curCSS(this,"position")!=="absolute"&&(!i.excludeSel||!a(this).is(i.excludeSel)))q+=a(this).outerWidth(true)});d.css("width",m-q)}i.addThemeRoller&&h.addClass("ui-widget ui-widget-header ui-corner-all");h.attr("role","toolbar");
if(i.mediaControls.dynamicTimeslider){var d=a("."+i.classPrefix+"timeline-slider",h),j=setTimeout(k,0);f.jmeReady(function(){clearInterval(j);setTimeout(k,0)});a(window).bind("resize",k);f.bind("resize emchange",k)}i.mediaControls.fullWindowOverlay&&a.fn.videoOverlay&&h.videoOverlay({fullscreenClass:i.classPrefix+"controls-fullscreenvideo",video:f,startCSS:{width:"auto"},position:{bottom:0,left:0,right:0}})}},{name:"media-label",fn:function(){var h=0;return function(f,c,i,k){if(!(!i.controlWrapper||
i.controlWrapper.attr("role"))){c=f.attr("id");var d=a("."+k.classPrefix+"media-name",f);if(!c){h++;c=k.classPrefix+"media-label-"+h;f.attr("id",c)}i.mediaName=d[0]?d:f;i.controlWrapper.attr({role:"group","aria-labelledby":c})}}}()},{name:"fallback",fn:function(h,f,c,i){if(!(i.embed.showFallback||!a.support.mediaElements)){var k=h.clone(true);f.bind("totalerror",function(){f.after(k).hide();a(this).one("mediareset",function(){f.show();k.detach()})})}}},{name:"media-state",options:{click:"togglePlay"},
fn:function(h,f,c,i){y.addStateClasses(h,f,i.classPrefix);i.mediaState.click&&f[i.mediaState.click]&&h.click(function(){f[i.mediaState.click]()})}}]);y.addStateClasses=function(h,f,c){c=c||"";var i=c+"playing "+c+"totalerror "+c+"waiting "+c+"idle "+c+"flashblocker",k=function(){h.removeClass(i)};f.jmeReady(function(){var d=f.isPlaying();if(typeof d==="boolean")h.addClass(c+d?"idle":"playing")});h.addClass(c+f.getMediaAPI());f.bind({apiActivated:function(d,j){h.addClass(c+j.api)},apiDeActivated:function(d,
j){h.removeClass(c+j.api)}}).bind("playing totalerror waiting flashblocker",function(d){k();h.addClass(c+d.type)}).bind("play",function(){h.removeClass(c+"idle")}).bind("pause ended mediareset",function(){k();h.addClass(c+"idle")}).bind("canplay",function(){h.removeClass(c+"waiting")})};(function(){var h=a.fn.a11ySlider?"a11ySlider":"slider",f={range:false,animate:false};a(function(){h=a.fn.a11ySlider?"a11ySlider":"slider"});a.fn.jmeControl.addControls([{name:"timeline-slider",optionName:"timeSlider",
options:f,fn:function(c,i,k,d){var j=false,m=function(){if(k.apis[k.name].loadedmeta&&k.apis[k.name].loadedmeta.duration){c[h]("option","step",100/Math.max(100,c[0].offsetWidth));c[h]("option","disabled",false)}else c[h]("option","disabled",true)};c[h](d.timeSlider)[h]("option","disabled",true);a(window).bind("resize",m);a(document).bind("emchange",m);i.bind("loadedmeta resize",m).bind("timechange",function(q,o){parseInt(o.timeProgress,10);o.timeProgress!==undefined&&!j&&c[h]("value",o.timeProgress)}).bind("mediareset",
function(){c[h]("value",0);m()}).bind("ended",function(){c[h]("value",100)});c.bind("slidestart",function(q){if(q.originalEvent)j=true}).bind("slidestop",function(){j=false}).bind("slide",function(q,o){q.originalEvent&&k.apis[k.name].isAPIReady&&k.apis[k.name].relCurrentTime(o.value)})}},{name:"volume-slider",options:a.extend({mutestate:false},{range: false, animate: false, orientation: 'vertical'}),fn:function(c,i,k,d){function j(q,o){m||(q.type=="volumelevelchange"?c[h]("value",o.volumelevel):c[h]("value",i.muted()?0:i.volume()))}var m=false;c[h](d.volumeSlider)[h]("option",
"disabled",true);c.bind("slidestart",function(q){if(q.originalEvent)m=true}).bind("slidestop",function(){m=false}).bind("slide",function(q,o){if(q.originalEvent&&k.apis[k.name].isAPIReady){k.apis[k.name].volume(o.value);d.volumeSlider.mutestate&&k.apis[k.name].muted()&&k.apis[k.name].muted(false)}});i.bind("volumelevelchange loadedmeta",j).jmeReady(function(){c[h]("option","disabled",false);j({type:"ready"})});d.volumeSlider.mutestate&&i.bind("mute",j)}},{name:"progressbar",fn:function(c,i,k,d){function j(q,
o){"relLoaded"in o?c.progressbar("option","disabled",false).progressbar("value",o.relLoaded):c.progressbar("option","disabled",true)}function m(){c.progressbar("option","disabled",true).progressbar("value",0)}c.progressbar(d.progressbar).progressbar("option","disabled",true);i.bind("progresschange",j).bind("mediareset",m)}}])})()})(jQuery);
(function(a){var u={type:"application/x-shockwave-flash"},v={classid:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},x=a.multimediaSupport;a.extend(a.fn.jmeEmbed.defaults,{jwPlayer:{path:x.jsPath+"player.swf",hideIcons:"auto",vars:{},attrs:{},plugins:{},params:{allowscriptaccess:"always",allowfullscreen:"true"}}});a(function(){var i=(a("script.jwPlayer")[0]||{}).src;if(i)a.fn.jmeEmbed.defaults.jwPlayer.path=i});var y={A:/&amp;/g,a:/&/g,e:/\=/g,q:/\?/g},h={audio:"sound",video:"video"},f=function(i){return i.replace?
i.replace(y.A,"%26").replace(y.a,"%26").replace(y.e,"%3D").replace(y.q,"%3F"):i};(function(){a.support.flash9=false;a.support.flashVersion=0;var i=x.getPluginVersion("Shockwave Flash"),k=function(j){a.support.flash9=false;try{if(j&&typeof j.GetVariable!=="undefined"){var m=j.GetVariable("$version");j=x.getPluginVersion("",{description:m});a.support.flashVersion=j[0];a.support.flash9=!!(j[0]>9||j[0]===9&&j[1]>=115)}}catch(q){}};if(i&&i[0])a.support.flashVersion=i[0];if(i[0]>9||i[0]===9&&i[1]>=115){a.support.flash9=
true;a(function(){i=a("<object />",u).appendTo("body");k(i[0]);i.remove()})}else if(window.ActiveXObject)try{i=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");k(i);i=null}catch(d){}})();var c={isTechAvailable:function(){return a.support.flash9},_extendJWLoad:function(i,k,d){if(i){d=d||this.element;x.extendWithData(d,k,["type","provider","stretching","bufferlength"]);if(!this.canPlaySrc(i)){if(!k.provider)k.provider=h[this.nodeName];if(!k.type)k.type=h[this.nodeName]}return k}},_embed:function(i,
k,d,j){var m=this.embedOpts.jwPlayer,q=a.extend({},m.vars,{file:i,id:k}),o=a.extend({name:k},m.attrs,u,!window.ActiveXObject?{data:m.path}:{}),r=a.extend({movie:m.path},m.params),w=[],B=this;this._extendJWLoad(i,q);if(d.poster)q.image=d.poster;q.autostart=""+d.autoplay;q.repeat=d.loop?"single":"false";q.controlbar=d.controls?"bottom":"none";if(!d.controls&&this.nodeName!=="audio"&&r.wmode===undefined)r.wmode="transparent";if(!d.controls&&m.hideIcons&&r.wmode==="transparent"||m.hideIcons===true){q.icons=
"false";q.showicons="false"}if(r.wmode==="transparent"&&!q.screencolor&&!o.bgcolor){q.screencolor="ffffffff";o.bgcolor="#000000"}r.flashvars=[];a.each(q,function(A,z){r.flashvars.push(f(A)+"="+f(z))});a.each(m.plugins,function(A,z){w.push(z)});w.length&&r.flashvars.push("plugins="+w.join(","));r.flashvars=r.flashvars.join("&");j(x.embedObject(this.visualElem[0],k,o,r,v,"Shockwave Flash"));setTimeout(function(){var A=a("object",B.visualElem)[0];if(!A||A.style.display==="none"&&a("> *",B.visualElem).length>
1){a("div[bgactive]",B.visualElem).css({width:"100%",height:"100%"});B._trigger("flashblocker")}},9)},canPlaySrc:function(i){var k=x.fn.canPlaySrc.apply(this,arguments),d=-1;d=i.src||i;if(!k&&typeof d==="string"){d=d.indexOf("youtube.com/");if(d<15&&d>6)k="maybe"}return k},canPlayCodecs:["avc1.42E01E","mp4a.40.2","avc1.58A01E","avc1.4D401E","avc1.64001E","VP6","mp3","AAC"],canPlayContainer:["video/3gpp","video/x-msvideo","video/quicktime","video/x-m4v","video/mp4","video/m4p","video/x-flv","video/flv",
"audio/mpeg","audio/mp3","audio/x-fla","audio/fla","youtube/flv","jwplayer/jwplayer"]};x.add("jwPlayer","video",c);x.add("jwPlayer","audio",c)})(jQuery);
(function(a){function u(f){if(f){f=f.replace(y,"");return a.data(v.getElementById(f),"mediaElemSupport").apis.jwPlayer}}var v=document,x=a.multimediaSupport,y=/^jwPlayer-/;window.jwEvents={View:{PLAY:function(f){if(f=f.state&&u(f.id)){f._trigger("play");f._$isPlaystate=true}}},Model:{BUFFER:function(f){var c=u(f.id);if(c){if(c._$timeProgress&&f.percentage+c._$startBuffer+1<c._$timeProgress)c._$startBuffer=c._$timeProgress;f={type:"progresschange",relLoaded:f.percentage+c._$startBuffer,relStart:0};
c._$buffered=f.relLoaded;c._trigger(f)}},STATE:function(f){if(privJwEvents.Model.STATE(f)==="playing")if(f=u(f.id)){f._trigger("playing");f._$isPlaystate=true}},META:function(f){if(f.type==="metadata"){var c=u(f.id);c&&c._trigger({type:"loadedmeta",duration:f.duration})}},TIME:function(f){var c=u(f.id),i={type:"timechange",time:f.position};if(c){c.loadedmeta||c._trigger({type:"loadedmeta",duration:f.duration});c._$currentPos=f.position;if(f.duration){i.duration=f.duration;i.timeProgress=f.position/
f.duration*100;c._$timeProgress=i.timeProgress}c._trigger(i)}},STATE:function(f){if(f.newstate==="IDLE")return false;var c=u(f.id),i;if(!c)return false;switch(f.newstate){case "PLAYING":i="playing";break;case "PAUSED":c._$isPlaystate=false;i="pause";break;case "COMPLETED":c._$isPlaystate=false;i="ended";c._adjustPluginLoop(c.apiElem.getConfig().repeat=="single");break;case "BUFFERING":i="waiting";break}i&&c._trigger(i);return i}},Controller:{VOLUME:function(f){var c=u(f.id);!c||c._$lastMuteState!==
c.muted()||c._trigger({type:"volumelevelchange",volumelevel:f.percentage})},MUTE:function(f){var c=u(f.id);if(c){c._$lastMuteState=f.state;c._trigger({type:"mute",isMuted:f.state})}}}};window.playerReady=function(f){var c=u(f.id);if(c){if(c.isAPIReady){if(c.apiElem.sendEvent)setTimeout(function(){c._lastLoad&&c._mmload(c._lastLoad.file,c._lastLoad.image);if(c._$isPlaystate&&!(c.apiElem.getConfig()||{}).autostart)c.play()},8);else{c._$reInit();return}setTimeout(function(){c._trigger("jmeflashRefresh")},
8)}else if(!c.apiElem.sendEvent){c._$reInit();return}a.each(jwEvents,function(i,k){a.each(k,function(d){c.apiElem["add"+i+"Listener"](d,"jwEvents."+i+"."+d)})});setTimeout(function(){c._$lastMuteState=c.muted();var i=a.attr(c.element,"getConfig");c._trigger("mmAPIReady");if(!i.autoplay&&!c._$isPlaystate&&(c.apiElem.getConfig()||{}).state==="IDLE")if(c.nodeName==="audio"&&i.preload==="auto"){c.apiElem.sendEvent("PLAY","true");c.apiElem.sendEvent("PLAY","false")}else if(c.nodeName==="video"&&i.preload!==
"none"&&!i.poster){c.apiElem.sendEvent("PLAY","true");c.apiElem.sendEvent("PLAY","false");c.currentTime(0)}},9)}};var h={_init:function(){this._$resetStates()},_$resetStates:function(){this._$currentPos=this._$timeProgress=this._$startBuffer=this._$buffered=0},_$reInitCount:0,_$reInitTimer:false,_$reInit:function(){var f=this;if(this._$reInitCount<5){this.visualElem[0].style.overflow="visible";setTimeout(function(){f.visualElem[0].style.overflow="hidden"},0)}this._$reInitCount++;this._$resetStates();
if(!this._$reInitTimer){this._$reInitTimer=true;setTimeout(function(){f._$reInitCount=0;f._$reInitTimer=false},2E4)}},play:function(){this.apiElem.sendEvent("PLAY","true");this._$isPlaystate=true;this._trigger("play")},pause:function(){this.apiElem.sendEvent("PLAY","false")},_isPlaying:function(){var f=this.apiElem.getConfig();return f?f.state==="PLAYING":undefined},_mmload:function(f,c,i){var k=this._isPlaying();this._lastLoad={file:f};if(c)this._lastLoad.image=c;this._$resetStates();this._extendJWLoad(f,
this._lastLoad);typeof i=="object"&&a.extend(this._lastLoad,i);if(this.apiElem.sendEvent){this.apiElem.sendEvent("LOAD",this._lastLoad);this.isAPIActive&&(a.attr(this.element,"autoplay")||k)?this.apiElem.sendEvent("PLAY","true"):this.apiElem.sendEvent("PLAY","false")}},muted:function(f){if(typeof f!=="boolean")return(this.apiElem.getConfig()||{}).mute;this.apiElem.sendEvent("mute",f?"true":false)},currentTime:function(f){if(!isFinite(f))return this._$currentPos||0;this._$currentPos=f;var c=this._isPlaying();
this.apiElem.sendEvent("SEEK",f);c||this.pause();this._trigger({type:"timechange",time:f})},getDuration:function(){var f=this.apiElem.getPlaylist()[0].duration||0;return f<0?0:f},volume:function(f){if(!isFinite(f))return parseInt(this.apiElem.getConfig().volume,10);var c=this.muted();this.apiElem.sendEvent("VOLUME",""+f);c&&this.apiElem.sendEvent("mute","true")},getCurrentSrc:function(){return(this.apiElem.getConfig()||{}).file||""}};a.extend(h,{isJMEReady:function(){var f=false;if(this.isAPIReady&&
this.apiElem.sendEvent&&this.apiElem.getConfig){a.browser.mozilla&&this.apiElem.getConfig();f=true}return f}});x.add("jwPlayer","video",a.extend({},h,{exitFullScreen:function(){if(this.apiElem.jmeExitFullScreen)try{this.apiElem.jmeExitFullScreen();return true}catch(f){}return false}}));x.add("jwPlayer","audio",h)})(jQuery);

/**
 * fullwindow plugin for the jMediaelement project | http://github.com/aFarkas/jMediaelement
 * @author Alexander Farkas
 * Copyright 2010, Alexander Farkas
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * 
 * API:
 * $('video').enterFullWindow() - enters fullWindow
 * $('video').exitFullWindow() - exits fullWindow
 * $('video').supportsFullWindow() - is fullwindow / position fixed supported (feature detection, not browser sniffing!)
 * 
 * Controls:
 * an element with the class 'fullscreen' generates a fullwindow-togglebutton
 * 
 * <a class="fullscreen" role="button" tabindex="0">toggle fullscreen</a>
 * 
 * Documentation:
 * http://protofunc.com/jme/plugins/fullwindow.html
 */

(function($){
	$.support.cssPointerEvents = ('pointerEvents' in $('<div />')[0].style);
	$.support.getBoundingClientRect = ('getBoundingClientRect' in $('<div />')[0]);
	
	/* helper methods */
	var pos = {
			relative: 1,
			absolute: 1
		},
		getPosedAncestors = function(elem){
		var ret 	= [],
			bodyReg = /^body|html$/i
		;
		if(elem.jquery){
			elem = elem[0];
		}
		elem = elem.parentNode;
		while( elem && !bodyReg.test(elem.nodeName) ){
			if( pos[ $.curCSS(elem, 'position') ] ){
				ret.push(elem);
			}
			elem = elem.parentNode;
		}
		
		return $(ret);
	};
	
	var zIndexReg = /zIndex/;
	$.fn.storeInlineStyle = function(styles, name){
		if(!styles && !name){
			name = 'storedInlineStyle';
		} else if(typeof styles === 'string'){
			name =  styles;
			styles = false;
		} else {
			name = name || 'storedInlineStyle';
		}
		
		return this.each(function(){
			var data 	= $.data(this, name) || $.data(this, name, {}),
				elemS 	= this.style,
				elem 	= this
			;
			
			if(!styles){
				if(!data){return;}
				$(this).css(data);
				$.data(this, name, {});
			} else {
				$.each(styles, function(prop, val){
					data[prop] = elemS[prop];
					//ie7 reports zIndex always as inline-style
					if( prop === 'zIndex' && data[prop] !== '' && !$.support.style && !zIndexReg.test( elem.style.cssText ) ){
						data[prop] = '';
					}
				});
				$(this).css(styles);
			}
		});
	};
	
	var videoBaseCSS = {
			position: 'fixed',
			zIndex: 99999,
			width: 'auto',
			height: 'auto'
		},
		parentsCss 	= {
			position: 'static'
		},
		bodyCSS = {
			overflow: 'hidden'
		},
		win 	= $(window),
		doc 	= $(document),
		doSize 	= function(winDim, max, model){
			var ret = {};
			ret[model[0]] = max[model[0]];
			ret[model[1]] = max[model[0]] * model[2];
			
			ret.bottom = (winDim.height / 2) - (ret.height / 2);
			ret.top = ret.bottom;
			ret.left = (winDim.width / 2) - (ret.width / 2);
			ret.right = ret.left;
			return ret;
		},
		getSize	= function(rel, maxWidth, maxHeight){
			var width 	= win.width(),
				height	= win.height()
			;
			
			var winDim = {
					width: win.width(),
					height: win.height()
				},
				max 	= {
					width: maxWidth ? Math.min(winDim.width, maxWidth) : winDim.width,
					height: maxHeight ? Math.min(winDim.height, maxHeight) : winDim.height
				}
			;
			
			return doSize(winDim, max, (max.width / max.height > rel) ?  ['height', 'width', rel] : ['width', 'height', 1 / rel] );
		},
		supportsFullWindow
	;
	
	$.each(['Top', 'Left', 'Right', 'Bottom'], function(i, name){
		videoBaseCSS['padding'+ name] = 0;
		videoBaseCSS['margin'+ name] = 0;
		videoBaseCSS['border'+ name +'Width'] = 0;
	});
	
	var windowOverlay = (function(){
		var trans 	= /transparent|rgba\(0, 0, 0, 0\)/,
			overlay = $('<div class="fullwindow-overlay" />')
						.css({
							position: 'fixed',
							display: 'none',
							right: 0,
							bottom: 0,
							top: 0,
							left: 0,
							zIndex: 99990
						}), 
			isVisible, timer
		;
		
		// IE7/IE8 retrigger
		win.bind('resize', function(){
			if(isVisible){
				clearTimeout(timer);
				timer = setTimeout(function(){
					overlay.css({top: -1, left: -1, right: -1, bottom: -1});
					setTimeout(function(){
						overlay.css({top: 0, left: 0, right: 0, bottom: 0});
					}, 1);
				}, 100);
			}
		});
		
		var pub = {
			show: function(video){
				if(!overlay || isVisible){return;}
				var bgCol = overlay.css('backgroundColor'),
					bgImg = overlay.css('backgroundImage')
				;
				if( (!bgCol || trans.test( bgCol ) ) && ( !bgImg || bgImg == 'none' ) ){
					overlay.css('backgroundColor', '#000');
				}
				overlay.insertAfter(video).show();
				isVisible = true;
			},
			hide: function(){
				if(!overlay || !isVisible){return;}
				overlay.hide().css('backgroundColor', '').detach();
				isVisible = false;
			}
		};
		
		return pub;
	})();
	
	$(function(){
		var div = $('<div style="visibility: hidden; postion: absolute; top: 0; left: 10px; padding: 10px;"><div style="position: fixed; top: 0;left: 0;" /></div>').appendTo('body');
		supportsFullWindow = !($('div', div).offset().left);
		div.remove();
	});
	
	
	var defaultOverlayCSS = {
		position: 'fixed',
		zIndex: 999996
	};
	
	$.fn.videoOverlay = function(o){
		o = $.extend(true, {}, $.fn.videoOverlay.defaults, o);
		if( !o.video ){return this;}
		o.video = $(o.video);
		var overlayCSS 	= $.extend({}, defaultOverlayCSS, o.startCSS),
			dynPos		= o.position
		;
		if( !$.isFunction( o.position ) ){
			$.each(o.position, function(styleName, posval){
				overlayCSS[styleName] = posval;
			});
			o.position = function(css){
				var ret = {};
				for(var name in dynPos){
					ret[name] = css[name];
				}
				return ret;
			};
		}
		
		return this.each(function(){
			var overlay = $(this);
			o.video
				.bind({
					fullwindow: function(e, evt){
						if( !evt.isFullwindow ){
							//restore old css
							overlay
								.storeInlineStyle('fsstoredOverlay')
								.removeClass(o.fullscreenClass)
							;
						} else {
							//store pre css
							overlay
								.storeInlineStyle(overlayCSS, 'fsstoredOverlay')
								.addClass(o.fullscreenClass)
							;
							
						}
					},
					fullwindowresize: function(e, evt){
						overlay.css( o.position(evt) );
					}
				})
			;
		});
	};
	
	$.fn.videoOverlay.defaults = {
		video: false,
		fullscreenClass: 'videooverlay-infullscreen',
		startCSS: {},
		position: {}
	};
	
	/* 
	 * extend jme api
	 */
	$.multimediaSupport.fn._extend({
		supportsFullWindow: function(){
			return supportsFullWindow;
		},
		enterFullWindow: function(maxWidth, maxHeight){
			if(this.visualElem.hasClass('displays-fullscreen') || !supportsFullWindow){return;}
			var data 	= $.data(this.element, 'mediaElemSupport'),
				that 	= this,
				curDim 	= {
					width: this.visualElem.width(),
					height: this.visualElem.height()
				},
				rel 	= curDim.width / curDim.height,
				wrapper = ( data.controlWrapper && data.controlWrapper[0]) ? data.controlWrapper : this.visualElem,
				vidCss,
				videoCSS
			;
			
			data._$fullwindowScrollPosition = {
				top: win.scrollTop(),
				left: win.scrollLeft()
			};
			
			this._posedAncestors = getPosedAncestors(wrapper[0]).storeInlineStyle(parentsCss, 'fsstoredZindexInlineStyle');
				
			$('html, body')
				.addClass('contains-fullscreenvideo')
				.storeInlineStyle(bodyCSS, 'fsstoredInlineStyle')
			;
			
			if(data.controlWrapper && data.controlWrapper[0]){
				data.controlWrapper.addClass('wraps-fullscreen');
			}
			
			windowOverlay.show(wrapper);
			
			vidCss 	= getSize(rel, maxWidth, maxHeight);
			videoCSS= $.extend({}, videoBaseCSS, vidCss);
			
			this.visualElem
				.addClass('displays-fullscreen')
				.storeInlineStyle(videoCSS, 'fsstoredInlineStyle')
			;
			
			doc.bind('keydown.jmefullscreen', function(e){
				if(e.keyCode === 27){
					that.exitFullWindow();
				}
			});
			//IE 7 triggers resize event on enterFullWindow
			setTimeout(function(){
				win.bind('resize.jmefullscreen', function(){
					vidCss = getSize(rel, maxWidth, maxHeight);
					that.visualElem.css(vidCss);
					$(that.element).triggerHandler('fullwindowresize', vidCss);
					$(that.element).triggerHandler('resize');
				});
				$(that.element).triggerHandler('fullwindowresize', vidCss);
			}, 0);
			
			$(this.element).addClass('displays-fullscreen');
			
			this._trigger({type: 'fullwindow', isFullwindow: true, bbox: vidCss});
			$(this.element).triggerHandler('fullwindowresize', vidCss);
			$(this.element).triggerHandler('resize');
		},
		exitFullWindow: function(){
			if(!this.visualElem.hasClass('displays-fullscreen') || !supportsFullWindow){return;}
			var data 	= $.data(this.element, 'mediaElemSupport'),
				that 	= this,
				ancestors
			;
			if(this._posedAncestors){
				this._posedAncestors.storeInlineStyle('fsstoredZindexInlineStyle');
			}
			
			$('html, body')
				.css({overflow: 'auto'})
				.storeInlineStyle('fsstoredInlineStyle')
				.removeClass('contains-fullscreenvideo')
			;
			
			this.visualElem
				.storeInlineStyle('fsstoredInlineStyle')
				.removeClass('displays-fullscreen')
			;
			if(data.controlWrapper){
				data.controlWrapper.removeClass('wraps-fullscreen');
			}
						
			windowOverlay.hide();
			
			win.unbind('.jmefullscreen');
			doc.unbind('.jmefullscreen');
			$(this.element).removeClass('displays-fullscreen').unbind('.jmefullscreen');
			
			this._trigger({type: 'fullwindow', isFullwindow: false});
			$(this.element).triggerHandler('resize');
			if( data._$fullwindowScrollPosition ){
				win.scrollTop( data._$fullwindowScrollPosition.top );
				win.scrollLeft( data._$fullwindowScrollPosition.left );
				data._$fullwindowScrollPosition = false;
			}
		}
	}, true);
	
	
	/* 
	 * extend jme controls
	 */
	
	if ( $.fn.jmeControl ) {
		var supportJmefsButton = $.fn.jmeEmbed.defaults.jwPlayer && $.support.getBoundingClientRect && $.support.cssPointerEvents;
		if( $.fn.jmeEmbed.defaults.jwPlayer ){
			$.fn.jmeEmbed.defaults.jwPlayer.plugins.jmefs = $.multimediaSupport.jsPath + 'jmefs.swf';
			$(function(){
				var path = ($('script.jme-jwPlayer')[0] || {}).src;
				if(path){
					$.fn.jmeEmbed.defaults.jwPlayer.plugins.jmefs = path;
				}
			});
		}
		
		var fsID 		= 0,
			jmefsButton = {
			create: function(control, video, data, o){
				if(!supportJmefsButton || !data.controlWrapper || !$.contains(data.controlWrapper[0], control[0])){return;}
				var that 		= this,
					initActive 	= function(){
						that.jwPlayer = data.apis.jwPlayer;
						that.activate();
					},
					activate 	= function(){
						video
							.jmeReady(initActive)
							.one('jmeflashRefresh', initActive)
						;
					}
				;
				
				this.control = control;
				if(!this.control.attr('id')){
					fsID++;
					this.control.attr('id', 'fs-btn-'+ fsID);
				}
				this.wrapper = data.controlWrapper;
				this.video = video;
				this.data = data;
				video
					.bind('apiActivated', function(e, evt){
						if(evt.api === 'jwPlayer'){
							activate();
						}
					})
					.bind('apiDeActivated', function(e, evt){
						if(evt.api === 'jwPlayer'){
							that.deactivate();
						}
					})
				;
				if(data.name === 'jwPlayer'){
					activate();
				}
			},
			activate: function(){
				if(!this.jwPlayer.apiElem.jmefsSetButtonCursor || this.activated || this.data.name != 'jwPlayer'){return;}
				this.activated = true;
				var that = this,
					rePos = function(){
						if(that.timer){
							clearTimeout(that.timer);
						}
						that.timer = setTimeout(function(){
							that.setPos();
						}, 30);
					}
				;
				this.jwPlayer.apiElem.jmefsSetButtonCursor(true);
				this.control.addClass('jme-flashbutton');
				this.wrapper.addClass('jme-flashbutton-wrapper');
				if(!this.setBtnCallback){
					this.jwPlayer.apiElem.jmefsSetButtonCallback('$.fn.jmeControl.defaults.fullscreen.jmeBtn', this.video.attr('id'), this.control.attr('id'));
					this.setBtnCallback = true;
				}
				this.video.bind('resize.jmeFSBtn', rePos);
				this.wrapper.bind('DOMSubtreeModified.jmeFSBtn', rePos);
				this.setPos();
			},
			deactivate: function(){
				this.activated = false;
				this.control.removeClass('jme-flashbutton');
				this.wrapper.removeClass('jme-flashbutton-wrapper').unbind('DOMSubtreeModified.jmeFSBtn');
				this.video.unbind('resize.jmeFSBtn');
				if(this.timer){
					clearTimeout(this.timer);
				}
				if(this.jwPlayer && this.jwPlayer.apiElem && this.jwPlayer.apiElem.jmefsSetButtonSize){
					this.jwPlayer.apiElem.jmefsSetButtonSize(0, 0);
					this.jwPlayer.apiElem.jmefsSetButtonPosition(-1, -1);
				}
			},
			setPos: function(){
				if(!this.jwPlayer.isAPIReady || !this.jwPlayer.apiElem.jmefsSetButtonPosition){return;}
				var displayBBox = this.jwPlayer.apiElem.getBoundingClientRect(),
					btnBBox 	= this.control[0].getBoundingClientRect()
				;
				this.jwPlayer.apiElem.jmefsSetButtonPosition(btnBBox.left - displayBBox.left, btnBBox.top - displayBBox.top);
				this.jwPlayer.apiElem.jmefsSetButtonSize(btnBBox.width, btnBBox.height);
			}
		};
		
		
		$.fn.jmeControl.addControl('video-box', function(control, video, data, o){
			control.videoOverlay({
				video: video,
				startCSS: {
					width: 'auto',
					height: 'auto',
					zIndex: 99998
				},
				position: {
					bottom: 0,
					left: 0,
					right: 0,
					top: 0,
					wdith: 0,
					height: 0
				}
			});
		});
		
		$.fn.jmeControl.addControl('fullscreen', function(control, video, data, o){
			
			if ( !supportsFullWindow && !video.supportsFullScreen() ) {
				control.addClass('fullscreen-unsupported ui-disabled');
				if(data.controlWrapper){
					data.controlWrapper.addClass('fullscreen-unsupported');
				}
				return;
			}
			var elems = $.fn.jmeControl.getBtn(control), changeState = function(){
				if (video.hasClass('displays-fullscreen')) {
					elems.text.text(elems.names[1]);
					elems.title.attr('title', elems.titleText[1]);
					elems.icon.addClass('ui-icon-circle-zoomout').removeClass('ui-icon-circle-zoomin');
				}
				else {
					elems.text.text(elems.names[0]);
					elems.title.attr('title', elems.titleText[0]);
					elems.icon.addClass('ui-icon-circle-zoomin').removeClass('ui-icon-circle-zoomout');
				}
			};
			if (o.addThemeRoller) {
				control.addClass('ui-state-default ui-corner-all');
			}
			if(o.fullscreen.tryFullScreen){
				$.multimediaSupport.beget(jmefsButton).create(control, video, data, o);
			}
			
			control.bind('ariaclick', function(){
				var isFullscreen = video.hasClass('displays-fullscreen');
				if( !isFullscreen ){
					video.play();
				}
				if ( o.fullscreen.tryFullScreen && !isFullscreen && video.supportsFullScreen() && video.enterFullScreen() ){
					return;
				}
				if ( isFullscreen ) {
					video.exitFullWindow();
				} else {
					video.enterFullWindow(o.fullscreen['max-width'], o.fullscreen['max-height']);
				}
				
				return false;
			});
			changeState();
			video.bind('fullwindow', changeState);
		},
		{
			tryFullScreen: true,
			'max-width': false,
			'max-height': false,
			jmeBtn: function(type, vid, cid){
				if(type === 'resize'){
					$(document.getElementById(vid)).triggerHandler('resize');				
				} else {
					$(document.getElementById(cid))[(type === 'jmefsButtonOver') ? 'addClass' : 'removeClass']('jme-over ui-state-over');
				}
			}
		});
		
	}
})(jQuery);

