jQuery.webshims.register("mediaelement-swf",function(e,t,n,r,i,s){"use strict";var o="sendEvent",u=t.mediaelement,a=n.swfobject,f=Modernizr.audio&&Modernizr.video,l=a.hasFlashPlayerVersion("9.0.115"),c=0,h={paused:!0,ended:!1,currentSrc:"",duration:n.NaN,readyState:0,networkState:0,videoHeight:0,videoWidth:0,error:null,buffered:{start:function(e){if(e){t.error("buffered index size error");return}return 0},end:function(e){if(e){t.error("buffered index size error");return}return 0},length:0}},p=Object.keys(h),d={currentTime:0,volume:1,muted:!1},v=Object.keys(d),m=e.extend({isActive:"html5",activating:"html5",wasSwfReady:!1,_bufferedEnd:0,_bufferedStart:0,_metadata:!1,_durationCalcs:-1,_callMeta:!1,currentTime:0,_ppFlag:i},h,d),g=/^jwplayer-/,y=function(e){var n=r.getElementById(e.replace(g,""));if(!n)return;var i=t.data(n,"mediaelement");return i.isActive=="third"?i:null},b=function(e){try{e.nodeName}catch(n){return null}var r=t.data(e,"mediaelement");return r&&r.isActive=="third"?r:null},w=function(t,n){n=e.Event(n),n.preventDefault(),e.event.trigger(n,i,t)},E=s.playerPath||t.cfg.basePath+"jwplayer/"+(s.playerName||"player.swf"),S=s.pluginPath||t.cfg.basePath+"swf/jwwebshims.swf";t.extendUNDEFProp(s.params,{allowscriptaccess:"always",allowfullscreen:"true",wmode:"transparent"}),t.extendUNDEFProp(s.vars,{screencolor:"ffffffff"}),t.extendUNDEFProp(s.attrs,{bgcolor:"#000000"});var x=function(t,n){var r=t.duration;if(r&&t._durationCalcs>0)return;try{t.duration=t.jwapi.getPlaylist()[0].duration;if(!t.duration||t.duration<=0||t.duration===t._lastDuration)t.duration=r}catch(i){}t.duration&&t.duration!=t._lastDuration?(w(t._elem,"durationchange"),(t._elemNodeName=="audio"||t._callMeta)&&u.jwEvents.Model.META(e.extend({duration:t.duration},n),t),t._durationCalcs--):t._durationCalcs++},T=function(e,t){e<3&&clearTimeout(t._canplaythroughTimer),e>=3&&t.readyState<3&&(t.readyState=e,w(t._elem,"canplay"),clearTimeout(t._canplaythroughTimer),t._canplaythroughTimer=setTimeout(function(){T(4,t)},4e3)),e>=4&&t.readyState<4&&(t.readyState=e,w(t._elem,"canplaythrough")),t.readyState=e};e.extend(e.event.customEvent,{updatemediaelementdimensions:!0,flashblocker:!0,swfstageresize:!0,mediaelementapichange:!0}),u.jwEvents={View:{PLAY:function(e){var t=y(e.id);if(!t||t.stopPlayPause)return;t._ppFlag=!0,t.paused==e.state&&(t.paused=!e.state,t.ended&&(t.ended=!1),w(t._elem,e.state?"play":"pause"))}},Model:{BUFFER:function(t){var n=y(t.id);if(!n||!("percentage"in t)||n._bufferedEnd==t.percentage)return;n.networkState=t.percentage==100?1:2,(isNaN(n.duration)||t.percentage>5&&t.percentage<25||t.percentage===100)&&x(n,t),n.ended&&(n.ended=!1);if(!n.duration)return;t.percentage>2&&t.percentage<20?T(3,n):t.percentage>20&&T(4,n),n._bufferedEnd&&n._bufferedEnd>t.percentage&&(n._bufferedStart=n.currentTime||0),n._bufferedEnd=t.percentage,n.buffered.length=1,t.percentage==100&&(n.networkState=1,T(4,n)),e.event.trigger("progress",i,n._elem,!0)},META:function(e,t){t=t&&t.networkState?t:y(e.id);if(!t)return;if(!("duration"in e)){t._callMeta=!0;return}if(t._metadata&&(!e.height||t.videoHeight==e.height)&&e.duration===t.duration)return;t._metadata=!0;var n=t.duration;e.duration&&(t.duration=e.duration),t._lastDuration=t.duration;if(e.height||e.width)t.videoHeight=e.height||0,t.videoWidth=e.width||0;t.networkState||(t.networkState=2),t.readyState<1&&T(1,t),t.duration&&n!==t.duration&&w(t._elem,"durationchange"),w(t._elem,"loadedmetadata")},TIME:function(e){var t=y(e.id);if(!t||t.currentTime===e.position)return;t.currentTime=e.position,t.duration&&t.durationn)n++,r=e.actionQueue.shift(),e.jwapi[r.fn].apply(e.jwapi,r.args);e.actionQueue.length&&(e.actionQueue=[])},k=function(t){if(!t)return;(t._ppFlag===i&&e.prop(t._elem,"autoplay")||!t.paused)&&setTimeout(function(){if(t.isActive=="third"&&(t._ppFlag===i||!t.paused))try{e(t._elem).play()}catch(n){}},1)};u.playerResize=function(t){if(!t)return;var n=r.getElementById(t.replace(g,""));n&&e(n).triggerHandler("swfstageresize"),n=null},e(r).on("emptied",function(e){var t=b(e.target);k(t)});var L;u.jwPlayerReady=function(n){var r=y(n.id),i=!0,s=0,o=function(){if(s>9)return;s++;if(N(r)){if(!r.wasSwfReady){var i=parseFloat(n.version,10);(i<5.1||i>=6)&&t.warn("mediaelement-swf is only testet with jwplayer 5.6+")}else e(r._elem).mediaLoad();r.wasSwfReady=!0,r.tryedReframeing=0,C(r),k(r)}else clearTimeout(r.reframeTimer),r.reframeTimer=setTimeout(o,9*s),s>2&&r.tryedReframeing<9&&(r.tryedReframeing++,r.shadowElem.css({overflow:"visible"}),setTimeout(function(){r.shadowElem.css({overflow:"hidden"})},16))};if(!r||!r.jwapi)return;r.tryedReframeing||(r.tryedReframeing=0),clearTimeout(L),r.jwData=n,r.shadowElem.removeClass("flashblocker-assumed"),e.prop(r._elem,"volume",r.volume),e.prop(r._elem,"muted",r.muted),o()};var A=e.noop;if(f){var O={play:1,playing:1},M=["play","pause","playing","canplay","progress","waiting","ended","loadedmetadata","durationchange","emptied"],_=M.map(function(e){return e+".webshimspolyfill"}).join(" "),D=function(n){var r=t.data(n.target,"mediaelement");if(!r)return;var i=n.originalEvent&&n.originalEvent.type===n.type;i==(r.activating=="third")&&(n.stopImmediatePropagation(),O[n.type]&&r.isActive!=r.activating&&e(n.target).pause())};A=function(n){e(n).off(_).on(_,D),M.forEach(function(e){t.moveToFirstEvent(n,e)})},A(r)}u.setActive=function(n,r,i){i||(i=t.data(n,"mediaelement"));if(!i||i.isActive==r)return;r!="html5"&&r!="third"&&t.warn("wrong type for mediaelement activating: "+r);var s=t.data(n,"shadowData");i.activating=r,e(n).pause(),i.isActive=r,r=="third"?(s.shadowElement=s.shadowFocusElement=i.shadowElem[0],e(n).addClass("swf-api-active nonnative-api-active").hide().getShadowElement().show()):(e(n).removeClass("swf-api-active nonnative-api-active").show().getShadowElement().hide(),s.shadowElement=s.shadowFocusElement=!1),e(n).trigger("mediaelementapichange")};var P=function(){var e=["_bufferedEnd","_bufferedStart","_metadata","_ppFlag","currentSrc","currentTime","duration","ended","networkState","paused","videoHeight","videoWidth","_callMeta","_durationCalcs"],t=e.length;return function(n){if(!n)return;var r=t,i=n.networkState;T(0,n);while(--r)delete n[e[r]];n.actionQueue=[],n.buffered.length=0,i&&w(n._elem,"emptied")}}(),H=function(t,n){var r=t._elem,i=t.shadowElem;e(r)[n?"addClass":"removeClass"]("webshims-controls"),t._elemNodeName=="audio"&&!n?i.css({width:0,height:0}):i.css({width:r.style.width||e(r).width(),height:r.style.height||e(r).height()})};u.createSWF=function(n,r,i){if(!l){setTimeout(function(){e(n).mediaLoad()},1);return}c<1?c=1:c++;var h=e.extend({},s.vars,{image:e.attr(n,"poster")&&e.prop(n,"poster")||"",file:r.streamId||r.srcProp}),p=e(n).data("vars")||{};r.server&&(h.streamer=r.server),i||(i=t.data(n,"mediaelement"));if(i&&i.swfCreated){u.setActive(n,"third",i),P(i),i.currentSrc=r.srcProp,e.extend(h,p),s.changeSWF(h,n,r,i,"load"),B(n,o,["LOAD",h]);return}var d=e.prop(n,"controls"),v="jwplayer-"+t.getID(n),g=e.extend({},s.params,e(n).data("params")),y=n.nodeName.toLowerCase(),b=e.extend({},s.attrs,{name:v,id:v},e(n).data("attrs")),w=e('
').css({position:"relative",overflow:"hidden"});i=t.data(n,"mediaelement",t.objectCreate(m,{actionQueue:{value:[]},shadowElem:{value:w},_elemNodeName:{value:y},_elem:{value:n},currentSrc:{value:r.srcProp},swfCreated:{value:!0},buffered:{value:{start:function(e){if(e>=i.buffered.length){t.error("buffered index size error");return}return 0},end:function(e){if(e>=i.buffered.length){t.error("buffered index size error");return}return(i.duration-i._bufferedStart)*i._bufferedEnd/100+i._bufferedStart},length:0}}})),H(i,d),w.insertBefore(n),f&&e.extend(i,{volume:e.prop(n,"volume"),muted:e.prop(n,"muted")}),e.extend(h,{id:v,controlbar:d?s.vars.controlbar||(y=="video"?"over":"bottom"):y=="video"?"none":"bottom",icons:""+(d&&y=="video")},p,{playerready:"jQuery.webshims.mediaelement.jwPlayerReady"}),h.plugins?h.plugins+=","+S:h.plugins=S,t.addShadowDom(n,w),A(n),u.setActive(n,"third",i),s.changeSWF(h,n,r,i,"embed"),e(n).on("updatemediaelementdimensions updateshadowdom",function(){H(i,e.prop(n,"controls"))}),a.embedSWF(E,v,"100%","100%","9.0.0",!1,h,g,b,function(r){r.success&&(i.jwapi=r.ref,d||e(r.ref).attr("tabindex","-1").css("outline","none"),setTimeout(function(){if(!r.ref.parentNode&&w[0].parentNode||r.ref.style.display=="none")w.addClass("flashblocker-assumed"),e(n).trigger("flashblocker"),t.warn("flashblocker assumed");e(r.ref).css({minHeight:"2px",minWidth:"2px",display:"block"})},9),L||(clearTimeout(L),L=setTimeout(function(){var n=e(r.ref);n[0].offsetWidth>1&&n[0].offsetHeight>1&&location.protocol.indexOf("file:")===0?t.error("Add your local development-directory to the local-trusted security sandbox: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html"):(n[0].offsetWidth<2||n[0].offsetHeight<2)&&t.warn("JS-SWF connection can't be established on hidden or unconnected flash objects"),n=null},8e3)))})};var B=function(e,t,n,r){return r=r||b(e),r?(r.jwapi&&r.jwapi[t]?r.jwapi[t].apply(r.jwapi,n||[]):(r.actionQueue.push({fn:t,args:n}),r.actionQueue.length>10&&setTimeout(function(){r.actionQueue.length>5&&r.actionQueue.shift()},99)),r):!1};["audio","video"].forEach(function(n){var r={},i,s=function(e){if(n=="audio"&&(e=="videoHeight"||e=="videoWidth"))return;r[e]={get:function(){var t=b(this);return t?t[e]:f&&i[e].prop._supget?i[e].prop._supget.apply(this):m[e]},writeable:!1}},u=function(e,t){s(e),delete r[e].writeable,r[e].set=t};u("volume",function(e){var n=b(this);if(n){e*=100;if(!isNaN(e)){var r=n.muted;(e<0||e>100)&&t.error("volume greater or less than allowed "+e/100),B(this,o,["VOLUME",e],n);if(r)try{n.jwapi.sendEvent("mute","true")}catch(s){}e/=100;if(n.volume==e||n.isActive!="third")return;n.volume=e,w(n._elem,"volumechange"),n=null}}else if(i.volume.prop._supset)return i.volume.prop._supset.apply(this,arguments)}),u("muted",function(e){var t=b(this);if(t){e=!!e,B(this,o,["mute",""+e],t);if(t.muted==e||t.isActive!="third")return;t.muted=e,w(t._elem,"volumechange"),t=null}else if(i.muted.prop._supset)return i.muted.prop._supset.apply(this,arguments)}),u("currentTime",function(e){var t=b(this);if(t){e*=1;if(!isNaN(e)){t.paused&&(clearTimeout(t.stopPlayPause),t.stopPlayPause=setTimeout(function(){t.paused=!0,t.stopPlayPause=!1},50)),B(this,o,["SEEK",""+e],t);if(t.paused){t.readyState>0&&(t.currentTime=e,w(t._elem,"timeupdate"));try{t.jwapi[o]("play","false")}catch(n){}}}}else if(i.currentTime.prop._supset)return i.currentTime.prop._supset.apply(this,arguments)}),["play","pause"].forEach(function(e){r[e]={value:function(){var t=b(this);if(t)t.stopPlayPause&&clearTimeout(t.stopPlayPause),B(this,o,["play",e=="play"],t),setTimeout(function(){t.isActive=="third"&&(t._ppFlag=!0,t.paused!=(e!="play")&&(t.paused=e!="play",w(t._elem,e)))},1);else if(i[e].prop._supvalue)return i[e].prop._supvalue.apply(this,arguments)}}}),p.forEach(s),t.onNodeNamesPropertyModify(n,"controls",function(r,i){var s=b(this);e(this)[i?"addClass":"removeClass"]("webshims-controls");if(s){try{B(this,i?"showControls":"hideControls",[n],s)}catch(o){t.warn("you need to generate a crossdomain.xml")}n=="audio"&&H(s,i),e(s.jwapi).attr("tabindex",i?"0":"-1")}}),i=t.defineNodeNameProperties(n,r,"prop")});if(l){var j=e.cleanData,F=e.browser.msie&&t.browserVersion<9,I={object:1,OBJECT:1};e.cleanData=function(e){var t,n,r;if(e&&(n=e.length)&&c)for(t=0;t