﻿(function(){function m(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,e){if(!a)return;var b,c=0,f=a.length;if(f===undefined){for(b in a)if(e.call(a[b],b,a[b])===false)break}else for(var d=a[0];c<f&&e.call(d,c,d)!==false;d=a[++c]);return a}function j(a){return document.getElementById(a)}function b(b,c,d){if(typeof c!="object")return b;if(b&&c)a(c,function(c,a){if(!d||typeof a!="function")b[c]=a});return b}function n(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(){if(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 i=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];if(e.isLoaded())e._api().fp_addCuepoints(a,h,b);return c},update:function(a){b(c,a);if(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){if(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(f&&"onBeforeBegin,onMetaData,onStart,onUpdate,onResume".indexOf(g)!=-1){b(d,f);if(f.metaData)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},g=function(d,h,e,i){var g={},c=this,j=false;if(i)b(g,i);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=e._api().fp_animate(d,b,a,j);return c},css:function(a,g){if(g!==undefined){var f={};f[a]=g;a=f}h=e._api().fp_css(d,a);b(c,h);return c},show:function(){this.display="block";e._api().fp_showPlugin(d);return c},hide:function(){this.display="none";e._api().fp_hidePlugin(d);return c},toggle:function(){this.display=e._api().fp_togglePlugin(d);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=e._api().fp_fadeTo(d,i,a,h);this.opacity=i;return c},fadeIn:function(b,a){return c.fadeTo(1,b,a)},fadeOut:function(b,a){return c.fadeTo(0,b,a)},getName:function(){return d},getPlayer:function(){return e},_fireEvent:function(f,k){if(f=="onUpdate"){var h=e._api().fp_getPlugin(d);if(!h)return;b(c,h);delete c.methods;if(!j){a(h.methods,function(){var a=""+this;c[a]=function(){var f=[].slice.call(arguments),b=e._api().fp_invoke(d,a,f);return b==="undefined"||b===undefined?c:b}});j=true}}var i=g[f];if(i){i.apply(c,k);if(f.substring(0,1)=="_")delete g[f]}}})};function h(n,p,k){var h=this,o=null,u,t,q=[],r={},s={},v,x,w,A,y,B;b(h,{id:function(){return v},isLoaded:function(){return o!==null},getParent:function(){return n},hide:function(a){if(a)n.style.height="0px";if(o)o.style.height="0px";return h},show:function(){n.style.height=B+"px";if(o)o.style.height=y+"px";return h},isHidden:function(){return o&&parseInt(o.style.height,10)===0},load:function(b){if(!o&&h._fireEvent("onBeforeLoad")!==false){a(c,function(){this.unload()});u=n.innerHTML;if(u&&!flashembed.isSupported(p.version))n.innerHTML="";flashembed(n,p,{config:k});if(b){b.cached=true;d(s,"onLoad",b)}}return h},unload:function(){if(u.replace(/\s/g,"")!==""){if(h._fireEvent("onBeforeUnload")===false)return h;try{if(o){o.fp_close();h._fireEvent("onUnload")}}catch(a){}o=null;n.innerHTML=u}return h},getClip:function(a){if(a===undefined)a=A;return q[a]},getCommonClip:function(){return t},getPlaylist:function(){return q},getPlugin:function(a){var b=r[a];if(!b&&h.isLoaded()){var c=h._api().fp_getPlugin(a);if(c){b=new g(a,c,h);r[a]=b}}return b},getScreen:function(){return h.getPlugin("screen")},getControls:function(){return h.getPlugin("controls")},getConfig:function(a){return a?e(k):k},getFlashParams:function(){return p},loadPlugin:function(b,j,a,c){if(typeof a=="function"){c=a;a={}}var e=c?f():"_";h._api().fp_loadPlugin(b,j,a,e);var d={};d[e]=c;var i=new g(b,null,h,d);r[b]=i;return i},getState:function(){return o?o.fp_getState():-1},play:function(a,c){function b(){if(a!==undefined)h._api().fp_play(a,c);else h._api().fp_play()}if(o)b();else h.load(function(){b()});return h},getVersion:function(){var b="flowplayer.js 3.1.4";if(o){var a=o.fp_getVersion();a.push(b);return a}return b},_api:function(){if(!o)throw"Flowplayer "+h.id()+" not loaded when calling an API method";return o},setClip:function(a){h.setPlaylist([a]);return h},getIndex:function(){return w}});a("Click*,Load*,Unload*,Keypress*,Volume*,Mute*,Unmute*,PlaylistReplace,ClipAdd,Fullscreen*,FullscreenExit,Error,MouseOver,MouseOut".split(","),function(){var a="on"+this;if(a.indexOf("*")!=-1){a=a.substring(0,a.length-1);var b="onBefore"+a.substring(2);h[b]=function(a){d(s,b,a);return h}}h[a]=function(b){d(s,a,b);return h}});a("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 a=this;h[a]=function(c,d){if(!o)return h;var b=null;if(c!==undefined&&d!==undefined)b=o["fp_"+a](c,d);else b=c===undefined?o["fp_"+a]():o["fp_"+a](c);return b==="undefined"||b===undefined?h:b}});h._fireEvent=function(e){if(typeof e=="string")e=[e];var c=e[0],b=e[1],d=e[2],p=e[3],f=0;if(k.debug)m(e);if(!o&&c=="onLoad"&&b=="player"){o=o||j(x);y=o.clientHeight;a(q,function(){this._fireEvent("onLoad")});a(r,function(b,a){a._fireEvent("onUpdate")});t._fireEvent("onLoad")}if(c=="onLoad"&&b!="player")return;if(c=="onError")if(typeof b=="string"||typeof b=="number"&&typeof d=="number"){b=d;d=p}if(c=="onContextMenu"){a(k.contextMenu[b],function(b,a){a.call(h)});return}if(c=="onPluginEvent"){var u=b.name||b,n=r[u];if(n){n._fireEvent("onUpdate",b);n._fireEvent(d,e.slice(3))}return}if(c=="onPlaylistReplace"){q=[];var v=0;a(b,function(){q.push(new i(this,v++,h))})}if(c=="onClipAdd"){if(b.isInStream)return;b=new i(b,d,h);q.splice(d,0,b);for(f=d+1;f<q.length;f++)q[f].index++}var g=true;if(typeof b=="number"&&b<q.length){A=b;var l=q[b];if(l)g=l._fireEvent(c,d,p);if(!l||g!==false)g=t._fireEvent(c,d,p,l)}a(s[c],function(){g=this.call(h,b,d);if(this.cached)s[c].splice(f,1);if(g===false)return false;f++});return g};function z(){if($f(n)){$f(n).getParent().innerHTML="";w=$f(n).getIndex();c[w]=h}else{c.push(h);w=c.length-1}B=parseInt(n.style.height,10)||n.clientHeight;if(typeof p=="string")p={src:p};v=n.id||"fp"+f();x=p.id||v+"_api";p.id=x;k.playerId=v;if(typeof k=="string")k={clip:{url:k}};if(typeof k.clip=="string")k.clip={url:k.clip};k.clip=k.clip||{};if(n.getAttribute("href",2)&&!k.clip.url)k.clip.url=n.getAttribute("href",2);t=new i(k.clip,-1,h);k.playlist=k.playlist||[k.clip];var b=0;a(k.playlist,function(){var c=this;if(typeof c=="object"&&c.length)c={url:""+c};a(k.clip,function(b,a){if(a!==undefined&&c[b]===undefined&&typeof a!="function")c[b]=a});k.playlist[b]=c;c=new i(c,b,h);q.push(c);b++});a(k,function(a,b){if(typeof b=="function"){if(t[a])t[a](b);else d(s,a,b);delete k[a]}});a(k.plugins,function(a,b){if(b)r[a]=new g(a,b,h)});if(!k.plugins||k.plugins.controls===undefined)r.controls=new g("controls",null,h);r.canvas=new g("canvas",null,h);p.bgcolor=p.bgcolor||"#000000";p.version=p.version||[9,0];p.expressInstall="http://www.flowplayer.org/swf/expressinstall.swf";function e(a){if(!h.isLoaded()&&h._fireEvent("onBeforeClick")!==false)h.load();return l(a)}u=n.innerHTML;if(u.replace(/\s/g,"")!==""){if(n.addEventListener)n.addEventListener("click",e,false);else if(n.attachEvent)n.attachEvent("onclick",e)}else{if(n.addEventListener)n.addEventListener("click",l,false);h.load()}}if(typeof n=="string")flashembed.domReady(function(){var a=j(n);if(!a)throw"Flowplayer cannot access element: "+n;else{n=a;z()}});else z()}var c=[];function k(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 k(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 g=arguments[1],f=arguments.length==3?arguments[2]:{};if(typeof b=="string")if(b.indexOf(".")!=-1){var l=[];a(n(b),function(){l.push(new h(this,e(g),e(f)))});return new k(l)}else{var i=j(b);return new h(i!==null?i:b,g,f)}else if(b)return new h(b,g,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){h.prototype[a]=b;return $f},each:a,extend:b});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);if(b)a.push(b)});return arguments.length?a[arguments[0]]:new k(a)}return this.each(function(){$f(this,e(c),b?e(b):{})})}})();(function(){var e=typeof jQuery=="function",f={width:"100%",height:"100%",allowfullscreen:true,allowscriptaccess:"always",quality:"high",version:null,onFail:null,expressInstall:null,w3c:false,cachebusting:false};if(e){jQuery.tools=jQuery.tools||{};jQuery.tools.flashembed={version:"1.0.4",conf:f}}function j(){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(j,13)}};function b(b,a){if(a)for(key in a)if(a.hasOwnProperty(key))b[key]=a[key];return b}function d(a){switch(i(a)){case "string":a=a.replace(new RegExp('(["\\\\])',"g"),"\\$1");a=a.replace(/^\s?(\d+)%/,"$1pct");return '"'+a+'"';case "array":return "["+g(a,function(a){return d(a)}).join(",")+"]";case "function":return '"function()"';case "object":var c=[];for(var b in a)if(a.hasOwnProperty(b))c.push('"'+b+'":'+d(a[b]));return "{"+c.join(",")+"}"}return String(a).replace(/\s/g," ").replace(/\'/g,'"')}function i(a){if(a===null||a===undefined)return false;var b=typeof a;return b=="object"&&a.push?"array":b}if(window.attachEvent)window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}});function g(a,d){var c=[];for(var b in a)if(a.hasOwnProperty(b))c[b]=d(a[b]);return c}function c(j,e){var a=b({},j),i=document.all,c='<object width="'+a.width+'" height="'+a.height+'"';if(i&&!a.id)a.id="_"+(""+Math.random()).substring(9);if(a.id)c+=' id="'+a.id+'"';if(a.cachebusting)a.src+=(a.src.indexOf("?")!=-1?"&":"?")+Math.random();if(a.w3c||!i)c+=' data="'+a.src+'" type="application/x-shockwave-flash"';else c+=' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';c+=">";if(a.w3c||i)c+='<param name="movie" value="'+a.src+'" />';a.width=a.height=a.id=a.w3c=a.src=null;for(var h in a)if(a[h]!==null)c+='<param name="'+h+'" value="'+a[h]+'" />';var g="";if(e){for(var f in e)if(e[f]!==null)g+=f+"="+(typeof e[f]=="object"?d(e[f]):e[f])+"&";g=g.substring(0,g.length-1);c+='<param name="flashvars" value=\''+g+"' />"}c+="</object>";return c}function h(d,a,e){var g=flashembed.getVersion();b(this,{getContainer:function(){return d},getConf:function(){return a},getVersion:function(){return g},getFlashvars:function(){return e},getApi:function(){return d.firstChild},getHTML:function(){return c(a,e)}});var f=a.version,j=a.expressInstall,i=!f||flashembed.isSupported(f);if(i){a.onFail=a.version=a.expressInstall=null;d.innerHTML=c(a,e)}else if(f&&j&&flashembed.isSupported([6,65])){b(a,{src:j});e={MMredirectURL:location.href,MMplayerType:"PlugIn",MMdoctitle:document.title};d.innerHTML=c(a,e)}else if(d.innerHTML.replace(/\s/g,"")===""){d.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>"+(d.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(d.tagName=="A")d.onclick=function(){location.href="http://www.adobe.com/go/getflashplayer"}}if(!i&&a.onFail){var h=a.onFail.call(this);if(typeof h=="string")d.innerHTML=h}if(document.all)window[a.id]=document.getElementById(a.id)}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;if(typeof d=="string")d={src:d};var i=b({},f);b(i,d);return new h(c,i,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(f){try{c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");b=[6,0];c.AllowScriptAccess="always"}catch(g){if(b[0]==6)return b}try{c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(g){}}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:d,getHTML:c});if(e)jQuery.fn.flashembed=function(a,c){var b=null;this.each(function(){b=flashembed(this,a,c)});return a.api===false?this:b}})()
