Skip to content

Instantly share code, notes, and snippets.

@elclanrs
Created February 7, 2013 04:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elclanrs/4728677 to your computer and use it in GitHub Desktop.
Save elclanrs/4728677 to your computer and use it in GitHub Desktop.
/*!
jquery.paginate.js
*/
(function(d){d.fn.paginate=function(i){var h=d.extend({},d.fn.paginate.d,i);return this.each(function(){var j=d(this),k=d.meta?d.extend({},h,j.data()):h;selectedpage=k.start;d.fn.draw(k,j,selectedpage)})};var g=0,f=0,b=0,c=navigator.appName,e=navigator.appVersion;if(e.indexOf("MSIE 7.0")>0){var a="ie7"}d.fn.paginate.d={count:5,start:12,display:5,scrollSpeed:7,border:true,border_color:"#fff",text_color:"#8cc59d",background_color:"black",border_hover_color:"#fff",text_hover_color:"#fff",background_hover_color:"#fff",rotate:true,images:true,mouse:"slide",onChange:function(){return false},modID:""};d.fn.draw=function(y,w,p){if(y.display>y.count){y.display=y.count}var s=w;g=s.parent().width();var r=d(document.createElement("input")).attr("type","hidden").attr("name","jPag-modID").attr("value",y.modID);var C=s.children();var k=C.eq(0),l=C.eq(1);C=k.children();var B=C.eq(0),F=C.eq(1);C=l.children();var j=C.eq(1),x=C.eq(0);var D=d(document.createElement("div")).addClass("jPag-paging-list"),m=d(document.createElement("ul")).addClass("jPag-pages").addClass("blackLink"),A=(y.display-1)>>1,t=p-A,h;var z=y.count,E=1;while(z--){var u=d(document.createElement("li")).addClass("pointer");if(E==p){u.html('<span class="jPag-current paginationBg bold pointer">'+E+"</span>");h=u;m.append(u);E++;break}else{u.html("<a>"+E+"</a>")}m.append(u);E++}while(z--){m.append(d(document.createElement("li")).addClass("pointer").html('<a class="paginationBgHover">'+E+"</a>"));E++}D.append(m);D.insertAfter(k);s.append(r);d.fn.applystyle(y,s,B,m,D,l,k);var n=f-k.outerWidth();D.css("width",f+"px");k.css("right",f+k.outerWidth()+"px");x.hover(function(){thumbs_scroll_interval=setInterval(function(){var i=D.scrollLeft()+1;D.scrollLeft(i)},y.scrollSpeed)},function(){clearInterval(thumbs_scroll_interval)});F.hover(function(){thumbs_scroll_interval=setInterval(function(){var i=D.scrollLeft()-1;D.scrollLeft(i)},y.scrollSpeed)},function(){clearInterval(thumbs_scroll_interval)});x.mousedown(function(){thumbs_mouse_interval=setInterval(function(){var i=D.scrollLeft()+3;D.scrollLeft(i)},y.scrollSpeed)}).mouseup(function(){clearInterval(thumbs_mouse_interval)});F.mousedown(function(){thumbs_mouse_interval=setInterval(function(){var i=D.scrollLeft()-3;D.scrollLeft(i)},y.scrollSpeed)}).mouseup(function(){clearInterval(thumbs_mouse_interval)});B.click(function(i){D.animate({scrollLeft:"0px"});D.find("li").eq(0).click()});j.click(function(i){D.animate({scrollLeft:b+"px"});D.find("li").eq(y.count-1).click()});D.find("li").click(function(J){if(h.html()==d(this).html()){return}var i=d(this).parent().parent().parent();h.html("<a>"+h.find(".jPag-current").html()+"</a>");var K=d(this).find("a").html();d(this).addClass("pointer").html('<span class="jPag-current paginationBg bold pointer">'+K+"</span>");h=d(this);d.fn.applystyle(y,i,B,m,D,l,k);var I=(this.offsetLeft)/2;var H=D.scrollLeft()+I;var o=I-(n/2);D.animate({scrollLeft:I+o-B.parent().width()+"px"});var G=i.find("input[name=jPag-modID]").attr("value");if(d(this).closest(".jPaginate").hasClass("primaryPaging")||!d(this).closest(".jPaginate").hasClass("secondaryPaging")){y.onChange(G,K)}d(this).closest(".jPaginate-mainContainer").siblings(".jPaginate-mainContainer").find(".jPaginate[name="+d(this).closest(".jPaginate").attr("name")+"]").find(".jPag-pages").find("li").eq(K*1-1).click()});var v=D.find("li").eq(y.start-1);v.attr("id","tmp");var q=document.getElementById("tmp").offsetLeft/2;v.removeAttr("id");var C=q-(n/2);D.animate({scrollLeft:q+C-B.parent().width()+"px"})};d.fn.applystyle=function(p,l,j,n,m,h,k){var i=l.children(".jPag-control-front");m.css("margin-right",h.outerWidth()+"px");b=0;f=0;l.find(".jPag-pages").css("width",1+(l.find(".jPag-pages").outerWidth()*2));l.find("li").each(function(q,r){var o=d(this).outerWidth(false);b+=o});if(b>g-k.outerWidth()-h.outerWidth()){f=g-k.outerWidth()-h.outerWidth()}else{f=b}n.css("width",b+1+"px")}})(jQuery);
/*
* Easy Slider 1.7 - jQuery plugin
* written by Alen Grakalic
* http://cssglobe.com/post/4004/easy-slider-15-the-easiest-jquery-plugin-for-sliding
*
* Copyright (c) 2009 Alen Grakalic (http://cssglobe.com)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* Built for jQuery library
* http://jquery.com
*
*/
(function(e){e.fn.easySlider=function(t){var n={prevId:"prevBtn",prevText:"Previous",nextId:"nextBtn",nextText:"Next",controlsShow:true,controlsBefore:"",controlsAfter:"",controlsFade:true,firstId:"firstBtn",firstText:"First",firstShow:false,lastId:"lastBtn",lastText:"Last",lastShow:false,vertical:false,speed:800,auto:false,pause:2e3,continuous:false,numeric:false,numericId:"controls"};var t=e.extend(n,t);this.each(function(){function c(n){n=parseInt(n)+1;e("li","#"+t.numericId).removeClass("current");e("li#"+t.numericId+n).addClass("current")}function h(){if(a>u)a=0;if(a<0)a=u;if(!t.vertical){e("ul",n).css("margin-left",a*i*-1)}else{e("ul",n).css("margin-left",a*s*-1)}o=true;if(t.numeric)c(a)}function d(r,f){if(o){o=false;var l=a;switch(r){case"next":a=l>=u?t.continuous?a*1+1:u:a*1+1;break;case"prev":a=a<=0?t.continuous?a*1-1:0:a*1-1;break;case"first":a=0;break;case"last":a=u;break;default:a=r;break}var c=Math.abs(l-a);var m=c*t.speed;if(!t.vertical){p=a*i*-1;e("ul",n).animate({marginLeft:p},{queue:false,duration:m,complete:h})}else{p=a*s*-1;e("ul",n).animate({marginTop:p},{queue:false,duration:m,complete:h})}if(!t.continuous&&t.controlsFade){if(a==u){e("a","#"+t.nextId).hide();e("a","#"+t.lastId).hide()}else{e("a","#"+t.nextId).show();e("a","#"+t.lastId).show()}if(a==0){e("a","#"+t.prevId).hide();e("a","#"+t.firstId).hide()}else{e("a","#"+t.prevId).show();e("a","#"+t.firstId).show()}}if(f)clearTimeout(v);if(t.auto&&r=="next"&&!f){v=setTimeout(function(){d("next",false)},c*t.speed+t.pause)}}}var n=e(this);var r=e("li",n).length;var i=e("li",n).width();var s=e("li",n).height();var o=true;n.width(i);n.height(s);n.css("overflow","hidden");var u=r-1;var a=0;e("ul",n).css("width",r*i);if(t.continuous){e("ul",n).prepend(e("ul li:last-child",n).clone().css("margin-left","-"+i+"px"));e("ul",n).append(e("ul li:nth-child(2)",n).clone());e("ul",n).css("width",(r+1)*i)}if(!t.vertical)e("li",n).css("float","left");if(t.controlsShow){var f=t.controlsBefore;if(t.numeric){f+=' <span id="'+t.prevId+'"><a href="javascript:void(0);">'+t.prevText+"</a></span>";f+=' <span id="'+t.nextId+'"><a href="javascript:void(0);">'+t.nextText+"</a></span>";f+='<ol id="'+t.numericId+'"></ol>'}else{if(t.firstShow)f+='<span id="'+t.firstId+'"><a href="javascript:void(0);">'+t.firstText+"</a></span>";f+=' <span id="'+t.prevId+'"><a href="javascript:void(0);">'+t.prevText+"</a></span>";f+=' <span id="'+t.nextId+'"><a href="javascript:void(0);">'+t.nextText+"</a></span>";if(t.lastShow)f+=' <span id="'+t.lastId+'"><a href="javascript:void(0);">'+t.lastText+"</a></span>"}f+=t.controlsAfter;e(n).after(f)}if(t.numeric){for(var l=0;l<r;l++){e(document.createElement("li")).attr("id",t.numericId+(l+1)).addClass("left").css("display","block").html("<a rel="+l+' href="javascript:void(0);">'+(l+1)+"</a>").appendTo(e("#"+t.numericId)).click(function(){d(e("a",e(this)).attr("rel"),true)})}e("a","#"+t.nextId).click(function(){d("next",true)});e("a","#"+t.prevId).click(function(){d("prev",true)})}else{e("a","#"+t.nextId).click(function(){d("next",true)});e("a","#"+t.prevId).click(function(){d("prev",true)});e("a","#"+t.firstId).click(function(){d("first",true)});e("a","#"+t.lastId).click(function(){d("last",true)})}var v;if(t.auto){v=setTimeout(function(){d("next",false)},t.pause)}if(t.numeric)c(0);if(!t.continuous&&t.controlsFade){e("a","#"+t.prevId).hide();e("a","#"+t.firstId).hide()}})}})(jQuery);
/**
* flowplayer.js 3.0.3. The Flowplayer API
*
* Copyright 2008 Flowplayer Oy
*
* This file is part of Flowplayer.
*
* Flowplayer is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Flowplayer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Flowplayer. If not, see <http://www.gnu.org/licenses/>.
*
* Version: 3.0.3 - Wed Jan 07 2009 13:22:30 GMT-0000 (GMT+00:00)
*/
(function(){function e(e){console.log("$f.fireEvent",[].slice.call(e))}function t(e){if(!e||typeof e!="object"){return e}var n=new e.constructor;for(var r in e){if(e.hasOwnProperty(r)){n[r]=t(e[r])}}return n}function n(e,t){if(!e){return}var n,r=0,i=e.length;if(i===undefined){for(n in e){if(t.call(e[n],n,e[n])===false){break}}}else{for(var s=e[0];r<i&&t.call(s,r,s)!==false;s=e[++r]){}}return e}function r(e){return document.getElementById(e)}function i(e,t,r){if(e&&t){n(t,function(t,n){if(!r||typeof n!="function"){e[t]=n}})}}function s(e){var t=e.indexOf(".");if(t!=-1){var r=e.substring(0,t)||"*";var i=e.substring(t+1,e.length);var s=[];n(document.getElementsByTagName(r),function(){if(this.className&&this.className.indexOf(i)!=-1){s.push(this)}});return s}}function o(e){e=e||window.event;if(e.preventDefault){e.stopPropagation();e.preventDefault()}else{e.returnValue=false;e.cancelBubble=true}return false}function u(e,t,n){e[t]=e[t]||[];e[t].push(n)}function a(){return"_"+(""+Math.random()).substring(2,10)}function c(s,c,p){function k(){function t(e){if(!d.isLoaded()&&d._fireEvent("onBeforeClick")!==false){d.load()}return o(e)}if($f(s)){$f(s).getParent().innerHTML="";x=$f(s).getIndex();h[x]=d}else{h.push(d);x=h.length-1}C=parseInt(s.style.height,10)||s.clientHeight;if(typeof c=="string"){c={src:c}}E=s.id||"fp"+a();S=c.id||E+"_api";c.id=S;p.playerId=E;if(typeof p=="string"){p={clip:{url:p}}}p.clip=p.clip||{};if(s.getAttribute("href",2)&&!p.clip.url){p.clip.url=s.getAttribute("href",2)}g=new f(p.clip,-1,d);p.playlist=p.playlist||[p.clip];var e=0;n(p.playlist,function(){var t=this;if(typeof t=="object"&&t.length){t=""+t}if(!t.url&&typeof t=="string"){t={url:t}}n(p.clip,function(e,n){if(t[e]===undefined&&typeof n!="function"){t[e]=n}});p.playlist[e]=t;t=new f(t,e,d);y.push(t);e++});n(p,function(e,t){if(typeof t=="function"){u(w,e,t);delete p[e]}});n(p.plugins,function(e,t){if(t){b[e]=new l(e,t,d)}});if(!p.plugins||p.plugins.controls===undefined){b.controls=new l("controls",null,d)}c.bgcolor=c.bgcolor||"#000000";c.version=c.version||[9,0];c.expressInstall="http://www.flowplayer.org/swf/expressinstall.swf";m=s.innerHTML;if(m.replace(/\s/g,"")!==""){if(s.addEventListener){s.addEventListener("click",t,false)}else if(s.attachEvent){s.attachEvent("onclick",t)}}else{if(s.addEventListener){s.addEventListener("click",o,false)}d.load()}}var d=this,v=null,m,g,y=[],b={},w={},E,S,x,T,N,C;i(d,{id:function(){return E},isLoaded:function(){return v!==null},getParent:function(){return s},hide:function(e){if(e){s.style.height="0px"}if(v){v.style.height="0px"}return d},show:function(){s.style.height=C+"px";if(v){v.style.height=N+"px"}return d},isHidden:function(){return v&&parseInt(v.style.height,10)===0},load:function(e){if(!v&&d._fireEvent("onBeforeLoad")!==false){n(h,function(){this.unload()});m=s.innerHTML;flashembed(s,c,{config:p});if(e){e.cached=true;u(w,"onLoad",e)}}return d},unload:function(){try{if(v&&v.fp_isFullscreen()){}}catch(e){return}if(v&&m.replace(/\s/g,"")!==""&&!v.fp_isFullscreen()&&d._fireEvent("onBeforeUnload")!==false){v.fp_close();s.innerHTML=m;d._fireEvent("onUnload");v=null}return d},getClip:function(e){if(e===undefined){e=T}return y[e]},getCommonClip:function(){return g},getPlaylist:function(){return y},getPlugin:function(e){var t=b[e];if(!t&&d.isLoaded()){var n=d._api().fp_getPlugin(e);if(n){t=new l(e,n,d);b[e]=t}}return t},getScreen:function(){return d.getPlugin("screen")},getControls:function(){return d.getPlugin("controls")},getConfig:function(e){return e?t(p):p},getFlashParams:function(){return c},loadPlugin:function(e,t,n,r){if(typeof n=="function"){r=n;n={}}var i=r?a():"_";d._api().fp_loadPlugin(e,t,n,i);var s={};s[i]=r;var o=new l(e,null,d,s);b[e]=o;return o},getState:function(){return v?v.fp_getState():-1},play:function(e){function t(){if(e!==undefined){d._api().fp_play(e)}else{d._api().fp_play()}}if(v){t()}else{d.load(function(){t()})}return d},getVersion:function(){var e="flowplayer.js 3.0.3";if(v){var t=v.fp_getVersion();t.push(e);return t}return e},_api:function(){if(!v){throw"Flowplayer "+d.id()+" not loaded. Try moving your call to player's onLoad event"}return v},_dump:function(){console.log(w)},setClip:function(e){d.setPlaylist([e])},getIndex:function(){return x}});n("Click*,Load*,Unload*,Keypress*,Volume*,Mute*,Unmute*,PlaylistReplace,Fullscreen*,FullscreenExit,Error".split(","),function(){var e="on"+this;if(e.indexOf("*")!=-1){e=e.substring(0,e.length-1);var t="onBefore"+e.substring(2);d[t]=function(e){u(w,t,e);return d}}d[e]=function(t){u(w,e,t);return d}});n("pause,resume,mute,unmute,stop,toggle,seek,getStatus,getVolume,setVolume,getTime,isPaused,isPlaying,startBuffering,stopBuffering,isFullscreen,reset,close,setPlaylist".split(","),function(){var e=this;d[e]=function(t){if(!v){return d}var n=t===undefined?v["fp_"+e]():v["fp_"+e](t);return n=="undefined"?d:n}});d._fireEvent=function(t,i,s,o){if(p.debug){e(arguments)}if(!v&&t=="onLoad"&&i=="player"){v=v||r(S);N=v.clientHeight;n(y,function(){this._fireEvent("onLoad")});n(b,function(e,t){t._fireEvent("onUpdate")});g._fireEvent("onLoad")}if(t=="onLoad"&&i!="player"){return}if(t=="onError"){if(typeof i=="string"||typeof i=="number"&&typeof s=="number"){i=s;s=o}}if(t=="onContextMenu"){n(p.contextMenu[i],function(e,t){t.call(d)});return}if(t=="onPluginEvent"){var u=i.name||i;var a=b[u];if(a){a._fireEvent("onUpdate",i);a._fireEvent(s)}return}if(t=="onPlaylistReplace"){y=[];var l=0;n(i,function(){y.push(new f(this,l++,d))})}var c=true;if(i===0||i&&i>=0&&i<y.length){T=i;var h=y[i];if(h){c=h._fireEvent(t,s,o)}if(!h||c!==false){c=g._fireEvent(t,s,o,h)}}var m=0;n(w[t],function(){c=this.call(d,i,s);if(this.cached){w[t].splice(m,1)}if(c===false){return false}m++});return c};if(typeof s=="string"){flashembed.domReady(function(){var e=r(s);if(!e){throw"Flowplayer cannot access element: "+s}else{s=e;k()}})}else{k()}}function p(e){this.length=e.length;this.each=function(t){n(e,t)};this.size=function(){return e.length}}var f=function(e,t,r){var s=this;var o={};var f={};s.index=t;if(typeof e=="string"){e={url:e}}i(this,e,true);n("Begin*,Start,Pause*,Resume*,Seek*,Stop*,Finish*,LastSecond,Update,BufferFull,BufferEmpty,BufferStop".split(","),function(){var e="on"+this;if(e.indexOf("*")!=-1){e=e.substring(0,e.length-1);var n="onBefore"+e.substring(2);s[n]=function(e){u(f,n,e);return s}}s[e]=function(t){u(f,e,t);return s};if(t==-1){if(s[n]){r[n]=s[n]}if(s[e]){r[e]=s[e]}}});i(this,{onCuepoint:function(e,n){if(arguments.length==1){o.embedded=[null,e];return s}if(typeof e=="number"){e=[e]}var i=a();o[i]=[e,n];if(r.isLoaded()){r._api().fp_addCuepoints(e,t,i)}return s},update:function(e){i(s,e);if(r.isLoaded()){r._api().fp_updateClip(e,t)}var n=r.getConfig();var o=t==-1?n.clip:n.playlist[t];i(o,e,true)},_fireEvent:function(e,u,a,l){if(e=="onLoad"){n(o,function(e,n){if(n[0]){r._api().fp_addCuepoints(n[0],t,e)}});return false}if(t!=-1){l=s}if(e=="onCuepoint"){var c=o[u];if(c){return c[1].call(r,l,a)}}if(e=="onStart"||e=="onUpdate"){i(l,u);if(!l.duration){l.duration=u.metaData.duration}else{l.fullDuration=u.metaData.duration}}var h=true;n(f[e],function(){h=this.call(r,l,u,a)});return h}});if(e.onCuepoint){var l=e.onCuepoint;s.onCuepoint.apply(s,typeof l=="function"?[l]:l);delete e.onCuepoint}n(e,function(t,n){if(typeof n=="function"){u(f,t,n);delete e[t]}});if(t==-1){r.onCuepoint=this.onCuepoint}};var l=function(e,t,r,s){var o={};var u=this;var f=false;if(s){i(o,s)}n(t,function(e,n){if(typeof n=="function"){o[e]=n;delete t[e]}});i(this,{animate:function(n,i,s){if(!n){return u}if(typeof i=="function"){s=i;i=500}if(typeof n=="string"){var f=n;n={};n[f]=i;i=500}if(s){var l=a();o[l]=s}if(i===undefined){i=500}t=r._api().fp_animate(e,n,i,l);return u},css:function(n,s){if(s!==undefined){var o={};o[n]=s;n=o}t=r._api().fp_css(e,n);i(u,t);return u},show:function(){this.display="block";r._api().fp_showPlugin(e);return u},hide:function(){this.display="none";r._api().fp_hidePlugin(e);return u},toggle:function(){this.display=r._api().fp_togglePlugin(e);return u},fadeTo:function(t,n,i){if(typeof n=="function"){i=n;n=500}if(i){var s=a();o[s]=i}this.display=r._api().fp_fadeTo(e,t,n,s);this.opacity=t;return u},fadeIn:function(e,t){return u.fadeTo(1,e,t)},fadeOut:function(e,t){return u.fadeTo(0,e,t)},getName:function(){return e},_fireEvent:function(t,s){if(t=="onUpdate"){var a=r._api().fp_getPlugin(e);if(!a){return}i(u,a);delete u.methods;if(!f){n(a.methods,function(){var t=""+this;u[t]=function(){var n=[].slice.call(arguments);var i=r._api().fp_invoke(e,t,n);return i=="undefined"?u:i}});f=true}}var l=o[t];if(l){l.call(u,s);if(t.substring(0,1)=="_"){delete o[t]}}}})};var h=[];window.flowplayer=window.$f=function(){var e=null;var i=arguments[0];if(!arguments.length){n(h,function(){if(this.isLoaded()){e=this;return false}});return e||h[0]}if(arguments.length==1){if(typeof i=="number"){return h[i]}else{if(i=="*"){return new p(h)}n(h,function(){if(this.id()==i.id||this.id()==i||this.getParent()==i){e=this;return false}});return e}}if(arguments.length>1){var o=arguments[1];var u=arguments.length==3?arguments[2]:{};if(typeof i=="string"){if(i.indexOf(".")!=-1){var a=[];n(s(i),function(){a.push(new c(this,t(o),t(u)))});return new p(a)}else{var f=r(i);return new c(f!==null?f:i,o,u)}}else if(i){return new c(i,o,u)}}return null};i(window.$f,{fireEvent:function(e,t,n,r,i){var s=$f(e);return s?s._fireEvent(t,n,r,i):null},addPlugin:function(e,t){c.prototype[e]=t;return $f},each:n,extend:i});if(document.all){window.onbeforeunload=function(){$f("*").each(function(){if(this.isLoaded()){this.close()}})}}if(typeof jQuery=="function"){jQuery.prototype.flowplayer=function(e,n){if(!arguments.length||typeof arguments[0]=="number"){var r=[];this.each(function(){var e=$f(this);if(e){r.push(e)}});return arguments.length?r[arguments[0]]:new p(r)}return this.each(function(){$f(this,t(e),n?t(n):{})})}}})();(function(){function t(){if(n.done){return false}var e=document;if(e&&e.getElementsByTagName&&e.getElementById&&e.body){clearInterval(n.timer);n.timer=null;for(var t=0;t<n.ready.length;t++){n.ready[t].call()}n.ready=null;n.done=true}}function r(e,t){if(t){for(key in t){if(t.hasOwnProperty(key)){e[key]=t[key]}}}return e}function i(e){var t="";for(var n in e){if(e[n]){t+=[n]+"="+s(e[n])+"&"}}return t.substring(0,t.length-1)}function s(e){switch(o(e)){case"string":e=e.replace(new RegExp('(["\\\\])',"g"),"\\$1");e=e.replace(/^\s?(\d+)%/,"$1pct");return'"'+e+'"';case"array":return"["+u(e,function(e){return s(e)}).join(",")+"]";case"function":return'"function()"';case"object":var t=[];for(var n in e){if(e.hasOwnProperty(n)){t.push('"'+n+'":'+s(e[n]))}}return"{"+t.join(",")+"}"}return String(e).replace(/\s/g," ").replace(/\'/g,'"')}function o(e){if(e===null||e===undefined){return false}var t=typeof e;return t=="object"&&e.push?"array":t}function u(e,t){var n=[];for(var r in e){if(e.hasOwnProperty(r)){n[r]=t(e[r])}}return n}function a(e,t){var n='<embed type="application/x-shockwave-flash" ';if(e.id){r(e,{name:e.id})}for(var s in e){if(e[s]!==null){n+=s+'="'+e[s]+'"\n '}}if(t){n+="flashvars='"+i(t)+"'"}n+="/>";return n}function f(e,t,n){var s='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';s+='width="'+e.width+'" height="'+e.height+'"';if(!e.id&&document.all){e.id="_"+(""+Math.random()).substring(5)}if(e.id){s+=' id="'+e.id+'"'}s+=">";if(document.all){e.src+=(e.src.indexOf("?")!=-1?"&":"?")+Math.random()}s+='\n <param name="movie" value="'+e.src+'" />';var o=r({},e);o.id=o.width=o.height=o.src=null;for(var u in o){if(o[u]!==null){s+='\n <param name="'+u+'" value="'+o[u]+'" />'}}if(t){s+='\n <param name="flashvars" value=\''+i(t)+"' />"}if(n){s+=a(e,t)}s+="</object>";return s}function l(e,t){return f(e,t,true)}function c(e,t){var n=navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length;return n?a(e,t):f(e,t)}var e=typeof jQuery=="function";var n=e?jQuery:function(e){if(n.done){return e()}if(n.timer){n.ready.push(e)}else{n.ready=[e];n.timer=setInterval(t,13)}};if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}})}window.flashembed=function(e,t,i){var s={src:"#",width:"100%",height:"100%",version:null,onFail:null,expressInstall:null,debug:false,allowfullscreen:true,allowscriptaccess:"always",quality:"high",type:"application/x-shockwave-flash",pluginspage:"http://www.adobe.com/go/getflashplayer"};if(typeof t=="string"){t={src:t}}r(s,t);var o=flashembed.getVersion();var u=s.version;var a=s.expressInstall;var f=s.debug;if(typeof e=="string"){var l=document.getElementById(e);if(l){e=l}else{n(function(){flashembed(e,t,i)});return}}if(!e){return}if(!u||flashembed.isSupported(u)){s.onFail=s.version=s.expressInstall=s.debug=null;e.innerHTML=c(s,i);return e.firstChild}else if(s.onFail){var h=s.onFail.call(s,flashembed.getVersion(),i);if(h===true){e.innerHTML=h}}else if(u&&a&&flashembed.isSupported([6,65])){r(s,{src:a});i={MMredirectURL:location.href,MMplayerType:"PlugIn",MMdoctitle:document.title};e.innerHTML=c(s,i)}else{if(e.innerHTML.replace(/\s/g,"")!==""){}else{e.innerHTML="<h2>Flash version "+u+" or greater is required</h2>"+"<h3>"+(o[0]>0?"Your version is "+o:"You have no flash plugin installed")+"</h3>"+"<p>Download latest version from <a href='"+s.pluginspage+"'>here</a></p>"}}return e};r(window.flashembed,{getVersion:function(){var e=[0,0];if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){var t=navigator.plugins["Shockwave Flash"].description;if(typeof t!="undefined"){t=t.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var n=parseInt(t.replace(/^(.*)\..*$/,"$1"),10);var r=/r/.test(t)?parseInt(t.replace(/^.*r(.*)$/,"$1"),10):0;e=[n,r]}}else if(window.ActiveXObject){try{var i=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(s){try{i=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");e=[6,0];i.AllowScriptAccess="always"}catch(o){if(e[0]==6){return}}try{i=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(u){}}if(typeof i=="object"){t=i.GetVariable("$version");if(typeof t!="undefined"){t=t.replace(/^\S+\s+(.*)$/,"$1").split(",");e=[parseInt(t[0],10),parseInt(t[2],10)]}}}return e},isSupported:function(e){var t=flashembed.getVersion();var n=t[0]>e[0]||t[0]==e[0]&&t[1]>=e[1];return n},domReady:n,asString:s,getHTML:c,getFullHTML:l});if(e){jQuery.prototype.flashembed=function(e,t){return this.each(function(){flashembed(this,e,t)})}}})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment