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