(function(){function n(a){console.log("$f.fireEvent",[].slice.call(a))}function e(a){if(!a||typeof a!="object")return a;var c=new a.constructor;for(var b in a)if(a.hasOwnProperty(b))c[b]=e(a[b]);return c}function a(a,f){if(!a)return;var b,d=0,e=a.length;if(e===undefined){for(b in a)if(f.call(a[b],b,a[b])===false)break}else for(var c=a[0];d<e&&f.call(c,d,c)!==false;c=a[++d]);return a}function k(a){return document.getElementById(a)}function b(c,b,d){c&&b&&a(b,function(b,a){if(!d||typeof a!="function")c[b]=a})}function m(b){var c=b.indexOf(".");if(c!=-1){var f=b.substring(0,c)||"*",e=b.substring(c+1,b.length),d=[];a(document.getElementsByTagName(f),function(){this.className&&this.className.indexOf(e)!=-1&&d.push(this)});return d}}function l(a){a=a||window.event;if(a.preventDefault){a.stopPropagation();a.preventDefault()}else{a.returnValue=false;a.cancelBubble=true}return false}function d(b,a,c){b[a]=b[a]||[];b[a].push(c)}function f(){return"_"+(""+Math.random()).substring(2,10)}var j=function(g,h,e){var c=this,i={},j={};c.index=h;if(typeof g=="string")g={url:g};b(this,g,true);a("Begin*,Start,Pause*,Resume*,Seek*,Stop*,Finish*,LastSecond,Update,BufferFull,BufferEmpty,BufferStop".split(","),function(){var a="on"+this;if(a.indexOf("*")!=-1){a=a.substring(0,a.length-1);var b="onBefore"+a.substring(2);c[b]=function(a){d(j,b,a);return c}}c[a]=function(b){d(j,a,b);return c};if(h==-1){if(c[b])e[b]=c[b];if(c[a])e[a]=c[a]}});b(this,{onCuepoint:function(a,d){if(arguments.length==1){i.embedded=[null,a];return c}if(typeof a=="number")a=[a];var b=f();i[b]=[a,d];e.isLoaded()&&e._api().fp_addCuepoints(a,h,b);return c},update:function(a){b(c,a);e.isLoaded()&&e._api().fp_updateClip(a,h);var d=e.getConfig(),f=h==-1?d.clip:d.playlist[h];b(f,a,true)},_fireEvent:function(g,f,k,d){if(g=="onLoad"){a(i,function(b,a){a[0]&&e._api().fp_addCuepoints(a[0],h,b)});return false}d=d||c;if(g=="onCuepoint"){var m=i[f];if(m)return m[1].call(e,d,k)}if(g=="onStart"||g=="onUpdate"){b(d,f);if(!d.duration)d.duration=f.metaData.duration;else d.fullDuration=f.metaData.duration}var l=true;a(j[g],function(){l=this.call(e,d,f,k)});return l}});if(g.onCuepoint){var k=g.onCuepoint;c.onCuepoint.apply(c,typeof k=="function"?[k]:k);delete g.onCuepoint}a(g,function(a,b){if(typeof b=="function"){d(j,a,b);delete g[a]}});if(h==-1)e.onCuepoint=this.onCuepoint},h=function(e,h,d,j){var g={},c=this,i=false;j&&b(g,j);a(h,function(a,b){if(typeof b=="function"){g[a]=b;delete h[a]}});b(this,{animate:function(b,a,i){if(!b)return c;if(typeof a=="function"){i=a;a=500}if(typeof b=="string"){var k=b;b={};b[k]=a;a=500}if(i){var j=f();g[j]=i}if(a===undefined)a=500;h=d._api().fp_animate(e,b,a,j);return c},css:function(a,g){if(g!==undefined){var f={};f[a]=g;a=f}h=d._api().fp_css(e,a);b(c,h);return c},show:function(){this.display="block";d._api().fp_showPlugin(e);return c},hide:function(){this.display="none";d._api().fp_hidePlugin(e);return c},toggle:function(){this.display=d._api().fp_togglePlugin(e);return c},fadeTo:function(i,a,b){if(typeof a=="function"){b=a;a=500}if(b){var h=f();g[h]=b}this.display=d._api().fp_fadeTo(e,i,a,h);this.opacity=i;return c},fadeIn:function(a,b){return c.fadeTo(1,a,b)},fadeOut:function(a,b){return c.fadeTo(0,a,b)},getName:function(){return e},getPlayer:function(){return d},_fireEvent:function(f,k){if(f=="onUpdate"){var h=d._api().fp_getPlugin(e);if(!h)return;b(c,h);delete c.methods;if(!i){a(h.methods,function(){var a=""+this;c[a]=function(){var f=[].slice.call(arguments),b=d._api().fp_invoke(e,a,f);return b=="undefined"?c:b}});i=true}}var j=g[f];if(j){j.apply(c,k);if(f.substring(0,1)=="_")delete g[f]}}})};function g(o,p,i){var g=this,m=null,t,v,q=[],s={},r={},w,x,u,z,A,y;b(g,{id:function(){return w},isLoaded:function(){return m!==null},getParent:function(){return o},hide:function(a){if(a)o.style.height="0px";if(m)m.style.height="0px";return g},show:function(){o.style.height=y+"px";if(m)m.style.height=A+"px";return g},isHidden:function(){return m&&parseInt(m.style.height,10)===0},load:function(b){if(!m&&g._fireEvent("onBeforeLoad")!==false){a(c,function(){this.unload()});t=o.innerHTML;flashembed(o,p,{config:i});if(b){b.cached=true;d(r,"onLoad",b)}}return g},unload:function(){try{if(!m||m.fp_isFullscreen())return g}catch(a){return g}if(g._fireEvent("onBeforeUnload")===false)return false;m.fp_close();m=null;if(t.replace(/\s/g,"")!=="")o.innerHTML=t;g._fireEvent("onUnload");return g},getClip:function(a){if(a===undefined)a=z;return q[a]},getCommonClip:function(){return v},getPlaylist:function(){return q},getPlugin:function(b){var a=s[b];if(!a&&g.isLoaded()){var c=g._api().fp_getPlugin(b);if(c){a=new h(b,c,g);s[b]=a}}return a},getScreen:function(){return g.getPlugin("screen")},getControls:function(){return g.getPlugin("controls")},getConfig:function(a){return a?e(i):i},getFlashParams:function(){return p},loadPlugin:function(b,j,a,c){if(typeof a=="function"){c=a;a={}}var d=c?f():"_";g._api().fp_loadPlugin(b,j,a,d);var e={};e[d]=c;var i=new h(b,null,g,e);s[b]=i;return i},getState:function(){return m?m.fp_getState():-1},play:function(a){function b(){if(a!==undefined)g._api().fp_play(a);else g._api().fp_play()}if(m)b();else g.load(function(){b()});return g},getVersion:function(){var b="flowplayer.js 3.0.6";if(m){var a=m.fp_getVersion();a.push(b);return a}return b},_api:function(){if(!m)throw"Flowplayer "+g.id()+" not loaded. Try moving your call to player's onLoad event";return m},_dump:function(){console.log(r)},setClip:function(a){g.setPlaylist([a])},getIndex:function(){return u}});a("Click*,Load*,Unload*,Keypress*,Volume*,Mute*,Unmute*,PlaylistReplace,Fullscreen*,FullscreenExit,Error".split(","),function(){var a="on"+this;if(a.indexOf("*")!=-1){a=a.substring(0,a.length-1);var b="onBefore"+a.substring(2);g[b]=function(a){d(r,b,a);return g}}g[a]=function(b){d(r,a,b);return g}});a("pause,resume,mute,unmute,stop,toggle,seek,getStatus,getVolume,setVolume,getTime,isPaused,isPlaying,startBuffering,stopBuffering,isFullscreen,reset,close,setPlaylist".split(","),function(){var a=this;g[a]=function(b){if(!m)return g;var c=b===undefined?m["fp_"+a]():m["fp_"+a](b);return c=="undefined"?g:c}});g._fireEvent=function(d){if(typeof d=="string")d=[d];var c=d[0],b=d[1],e=d[2],l=d[3];i.debug&&n(d);if(!m&&c=="onLoad"&&b=="player"){m=m||k(x);A=m.clientHeight;a(q,function(){this._fireEvent("onLoad")});a(s,function(b,a){a._fireEvent("onUpdate")});v._fireEvent("onLoad")}if(c=="onLoad"&&b!="player")return;if(c=="onError")if(typeof b=="string"||typeof b=="number"&&typeof e=="number"){b=e;e=l}if(c=="onContextMenu"){a(i.contextMenu[b],function(b,a){a.call(g)});return}if(c=="onPluginEvent"){var u=b.name||b,o=s[u];if(o){o._fireEvent("onUpdate",b);o._fireEvent(e,d.slice(3))}return}if(c=="onPlaylistReplace"){q=[];var t=0;a(b,function(){q.push(new j(this,t++,g))})}var f=true;if(typeof b=="number"&&b<q.length){z=b;var h=q[b];if(h)f=h._fireEvent(c,e,l);if(!h||f!==false)f=v._fireEvent(c,e,l,h)}var p=0;a(r[c],function(){f=this.call(g,b,e);this.cached&&r[c].splice(p,1);if(f===false)return false;p++});return f};function B(){if($f(o)){$f(o).getParent().innerHTML="";u=$f(o).getIndex();c[u]=g}else{c.push(g);u=c.length-1}y=parseInt(o.style.height,10)||o.clientHeight;if(typeof p=="string")p={src:p};w=o.id||"fp"+f();x=p.id||w+"_api";p.id=x;i.playerId=w;if(typeof i=="string")i={clip:{url:i}};if(typeof i.clip=="string")i.clip={url:i.clip};i.clip=i.clip||{};if(o.getAttribute("href",2)&&!i.clip.url)i.clip.url=o.getAttribute("href",2);v=new j(i.clip,-1,g);i.playlist=i.playlist||[i.clip];var b=0;a(i.playlist,function(){var c=this;if(typeof c=="object"&&c.length)c=""+c;if(typeof c=="string")c={url:c};a(i.clip,function(a,b){if(i.clip[a]!==undefined&&c[a]===undefined&&typeof b!="function")c[a]=b});i.playlist[b]=c;c=new j(c,b,g);q.push(c);b++});a(i,function(a,b){if(typeof b=="function"){d(r,a,b);delete i[a]}});a(i.plugins,function(a,b){if(b)s[a]=new h(a,b,g)});if(!i.plugins||i.plugins.controls===undefined)s.controls=new h("controls",null,g);p.bgcolor=p.bgcolor||"#000000";p.version=p.version||[9,0];p.expressInstall="http://www.flowplayer.org/swf/expressinstall.swf";function e(a){!g.isLoaded()&&g._fireEvent("onBeforeClick")!==false&&g.load();return l(a)}t=o.innerHTML;if(t.replace(/\s/g,"")!=="")if(o.addEventListener)o.addEventListener("click",e,false);else o.attachEvent&&o.attachEvent("onclick",e);else{o.addEventListener&&o.addEventListener("click",l,false);g.load()}}if(typeof o=="string")flashembed.domReady(function(){var a=k(o);if(!a)throw"Flowplayer cannot access element: "+o;else{o=a;B()}});else B()}var c=[];function i(b){this.length=b.length;this.each=function(c){a(b,c)};this.size=function(){return b.length}}window.flowplayer=window.$f=function(){var d=null,b=arguments[0];if(!arguments.length){a(c,function(){if(this.isLoaded()){d=this;return false}});return d||c[0]}if(arguments.length==1)if(typeof b=="number")return c[b];else{if(b=="*")return new i(c);a(c,function(){if(this.id()==b.id||this.id()==b||this.getParent()==b){d=this;return false}});return d}if(arguments.length>1){var h=arguments[1],f=arguments.length==3?arguments[2]:{};if(typeof b=="string")if(b.indexOf(".")!=-1){var j=[];a(m(b),function(){j.push(new g(this,e(h),e(f)))});return new i(j)}else{var l=k(b);return new g(l!==null?l:b,h,f)}else if(b)return new g(b,h,f)}return null};b(window.$f,{fireEvent:function(){var a=[].slice.call(arguments),b=$f(a[0]);return b?b._fireEvent(a.slice(1)):null},addPlugin:function(a,b){g.prototype[a]=b;return $f},each:a,extend:b});if(document.all)window.onbeforeunload=function(){$f("*").each(function(){this.isLoaded()&&this.close()})};if(typeof jQuery=="function")jQuery.prototype.flowplayer=function(c,b){if(!arguments.length||typeof arguments[0]=="number"){var a=[];this.each(function(){var b=$f(this);b&&a.push(b)});return arguments.length?a[arguments[0]]:new i(a)}return this.each(function(){$f(this,e(c),b?e(b):{})})}})();(function(){var e=typeof jQuery=="function";function f(){if(a.done)return false;var b=document;if(b&&b.getElementsByTagName&&b.getElementById&&b.body){clearInterval(a.timer);a.timer=null;for(var c=0;c<a.ready.length;c++)a.ready[c].call();a.ready=null;a.done=true}}var a=e?jQuery:function(b){if(a.done)return b();if(a.timer)a.ready.push(b);else{a.ready=[b];a.timer=setInterval(f,13)}};function b(b,a){if(a)for(key in a)if(a.hasOwnProperty(key))b[key]=a[key];return b}function c(a){switch(g(a)){case"string":a=a.replace(new RegExp('(["\\\\])',"g"),"\\$1");a=a.replace(/^\s?(\d+)%/,"$1pct");return'"'+a+'"';case"array":return"["+i(a,function(a){return c(a)}).join(",")+"]";case"function":return'"function()"';case"object":var d=[];for(var b in a)a.hasOwnProperty(b)&&d.push('"'+b+'":'+c(a[b]));return"{"+d.join(",")+"}"}return String(a).replace(/\s/g," ").replace(/\'/g,'"')}function g(a){if(a===null||a===undefined)return false;var b=typeof a;return b=="object"&&a.push?"array":b}window.attachEvent&&window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}});function i(a,d){var c=[];for(var b in a)if(a.hasOwnProperty(b))c[b]=d(a[b]);return c}function d(a,f){var i=document.all,d='<object width="'+a.width+'" height="'+a.height+'"';if(i&&!a.id)a.id="_"+(""+Math.random()).substring(9);if(a.id)d+=' id="'+a.id+'"';if(a.w3c||!i)d+=' data="'+a.src+'" type="application/x-shockwave-flash"';else d+=' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';d+=">";if(a.w3c||i)d+='<param name="movie" value="'+a.src+'" />';var e=b({},a);e.width=e.height=e.id=e.w3c=e.src=null;for(var j in e)if(e[j]!==null)d+='<param name="'+j+'" value="'+e[j]+'" />';var g="";if(f){for(var h in f)if(f[h]!==null)g+=h+"="+(typeof f[h]=="object"?c(f[h]):f[h])+"&";g=g.substring(0,g.length-1);d+='<param name="flashvars" value=\''+g+"' />"}d+="</object>";return d}function h(c,a,e){var g=flashembed.getVersion();b(this,{getContainer:function(){return c},getConf:function(){return conf},getVersion:function(){return g},getFlashvars:function(){return e},getApi:function(){return c.firstChild},getHTML:function(){return d(a,e)}});var f=a.version,h=a.expressInstall,j=!f||flashembed.isSupported(f);if(j){a.onFail=a.version=a.expressInstall=null;c.innerHTML=d(a,e)}else if(f&&h&&flashembed.isSupported([6,65])){b(a,{src:h});e={MMredirectURL:location.href,MMplayerType:"PlugIn",MMdoctitle:document.title};c.innerHTML=d(a,e)}else if(c.innerHTML.replace(/\s/g,"")===""){c.innerHTML="<h2>Flash version "+f+" or greater is required</h2><h3>"+(g[0]>0?"Your version is "+g:"You have no flash plugin installed")+"</h3>"+(c.tagName=="A"?"<p>Click here to download latest version</p>":"<p>Download latest version from <a href='http://www.adobe.com/go/getflashplayer'>here</a></p>");if(c.tagName=="A")c.href="http://www.adobe.com/go/getflashplayer"}if(!j&&a.onFail){var i=a.onFail.call(this);if(typeof i=="string")c.innerHTML=i}}window.flashembed=function(c,d,e){if(typeof c=="string"){var g=document.getElementById(c);if(g)c=g;else{a(function(){flashembed(c,d,e)});return}}if(!c)return;var f={width:"100%",height:"100%",allowfullscreen:true,allowscriptaccess:"always",quality:"high",version:null,onFail:null,expressInstall:null,w3c:false};if(typeof d=="string")d={src:d};b(f,d);return new h(c,f,e)};b(window.flashembed,{getVersion:function(){var b=[0,0];if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){var a=navigator.plugins["Shockwave Flash"].description;if(typeof a!="undefined"){a=a.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var d=parseInt(a.replace(/^(.*)\..*$/,"$1"),10),e=/r/.test(a)?parseInt(a.replace(/^.*r(.*)$/,"$1"),10):0;b=[d,e]}}else if(window.ActiveXObject){try{var c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(h){try{c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");b=[6,0];c.AllowScriptAccess="always"}catch(g){if(b[0]==6)return}try{c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(f){}}if(typeof c=="object"){a=c.GetVariable("$version");if(typeof a!="undefined"){a=a.replace(/^\S+\s+(.*)$/,"$1").split(",");b=[parseInt(a[0],10),parseInt(a[2],10)]}}}return b},isSupported:function(a){var b=flashembed.getVersion(),c=b[0]>a[0]||b[0]==a[0]&&b[1]>=a[1];return c},domReady:a,asString:c,getHTML:d});if(e)jQuery.prototype.flashembed=function(b,a){return this.each(function(){flashembed(this,b,a)})}})()
