(function(){ /*! * jQuery Rambling Slider * http://github.com/egonzalez0787/rambling.slider * http://ramblinglabs.com * * Copyright 2011-2012, Rambling Labs * Released under the MIT license. * http://www.opensource.org/licenses/mit-license.php * * January 2012 * * Based on jQuery Nivo Slider by Gilbert Pellegrom */ var g,f,e,b,a;var d=Array.prototype.indexOf||function(m){for(var k=0,j=this.length;k=1;m<=1?l++:l--){k=parseInt(Math.random()*l);n=[this[k],this[--l]],this[l]=n[0],this[k]=n[1]}return this};Array.prototype.contains=function(i){return d.call(this,i)>=0};Array.prototype.where=function(i){var l,m,k,j;j=[];for(m=0,k=this.length;mm;0<=m?k++:k--){n(k)}if(l%2){j.push(this[m])}return j};(function(i){i.fn.reverse=[].reverse;i.fn.shuffle=[].shuffle;i.fn.sortOutIn=function(){return i(Array.prototype.sortOutIn.apply(this))};i.fn.sortInOut=function(){return this.sortOutIn().reverse()};i.fn.as2dArray=function(j){var k,l,m;m=0;l=0;k=i("");k[m]=i("");this.each(function(){k[m][l]=i(this);l++;if(l===j){m++;l=0;return k[m]=i("")}});return k};i.fn.containsFlash=function(){return this.find("object,embed").length};return i.fn.equals=function(k){var j;j=true;j=this.length===k.length;this.each(function(l,m){return j=j&&m===k.get(l)});return j}})(jQuery);g=(function(){function i(k,j,l){this.slider=k;this.settings=j;this.vars=l;this.boxer=new f(this.slider)}i.prototype.createBoxes=function(k,j){var l,o,m,n,p;if(k==null){k=this.settings.boxCols}if(j==null){j=this.settings.boxRows}m=Math.round(this.slider.width()/k);o=Math.round(this.slider.height()/j);l=this.slider.find("#rambling-animation");p=c(function(s){var r,q;q=[];for(r=0;0<=k?rk;0<=k?r++:r--){q.push(c(function(t){return l.append(this.boxer.getRamblingBox(m,o,s,t,this.settings,this.vars))},this)(r))}return q},this);for(n=0;0<=j?nj;0<=j?n++:n--){p(n)}return this.slider.find(".rambling-box")};return i})();a=typeof global!=="undefined"&&global!==null?global:window;a.RamblingBoxGenerator=g;f=(function(){function i(j){this.slider=j}i.prototype.getBox=function(m,o,n,l,k){var j;j={opacity:0,left:m*l,top:o*n,width:l===(k.boxCols-1)?this.slider.width()-(m*l):m,height:o,overflow:"hidden"};return $('
').css(j)};i.prototype.getRamblingBox=function(o,q,s,l,m,p){var j,n,k,r;n=this.getBox(o,q,s,l,m);j=m.alignBottom?q*(m.boxRows-(s+1)):"auto";r=m.alignBottom?"auto":s*q;k={display:"block",width:this.slider.width(),left:-(l*o),top:m.alignBottom?"auto":-r,bottom:m.alignBottom?-j:"auto"};n.css({top:r,bottom:j});n.append("");n.find("img").css(k);return n};return i})();a=typeof global!=="undefined"&&global!==null?global:window;a.RamblingBoxer=f;e=(function(){function i(k,j,l){this.slider=k;this.settings=j;this.vars=l;this.slicer=new b(this.slider)}i.prototype.getOneSlice=function(j){if(j==null){j=this.vars.currentSlideElement}return this.createSlices(1,j)};i.prototype.createSlices=function(m,o){var k,j,l,n;if(m==null){m=this.settings.slices}if(o==null){o=this.vars.currentSlideElement}l=Math.round(this.slider.width()/m);k=this.slider.find("#rambling-animation");n=c(function(p){return k.append(this.slicer.getRamblingSlice(l,p,m,o,this.settings))},this);for(j=0;0<=m?jm;0<=m?j++:j--){n(j)}return this.slider.find(".rambling-slice")};return i})();a=typeof global!=="undefined"&&global!==null?global:window;a.RamblingSliceGenerator=e;b=(function(){function i(j){this.slider=j}i.prototype.getSlice=function(l,j,k){var m;m={left:l*j,width:j===(k-1)?this.slider.width()-(l*j):l,height:0,opacity:0,overflow:"hidden"};return $('
').css(m)};i.prototype.getRamblingSlice=function(o,j,n,p,m){var l,k;l=this.getSlice(o,j,n);l.append('');k={display:"block",width:this.slider.width(),left:-j*o,bottom:m.alignBottom?0:"auto",top:m.alignBottom?"auto":0};l.find("img").css(k);return l};return i})();a=typeof global!=="undefined"&&global!==null?global:window;a.RamblingSlicer=b;(function(k){var l,j,i;i=["stop","start","option","effect","destroy","previousSlide","nextSlide","slide","theme"];k.fn.ramblingSlider=function(){var r,s,n,m,o,p,q;n=arguments[0],o=2<=arguments.length?h.call(arguments,1):[];s=d.call(i,n)>=0;m=typeof n==="string";p=this.data("rambling:slider");r=function(t,u){return !u.length||(t==="option"&&u.length===1&&typeof u[0]==="string")};if(p){if(s){q=p[n].apply(p,o);if(r(n,o)){return q}else{return this}}else{if(m){return k.error("Method '"+n+"' not found.")}else{return k.error("Slider already initialized.")}}}else{if(s||m){return k.error("Tried to call method '"+n+"' on element without slider.")}}return this.each(function(u,v){var t;t=k(this);if(t.data("rambling:slider")){return}p=new l(this,n);t.data("rambling:slider",p);p.initialize();return p.run()})};k.fn.ramblingSlider.defaults={slices:15,boxCols:8,boxRows:4,speed:500,pauseTime:4500,manualAdvance:false,captionOpacity:0.8,theme:"default",alignBottom:false,effect:"random",startSlide:0,directionNav:true,directionNavHide:true,controlNav:true,controlNavThumbs:false,controlNavThumbsFromRel:false,controlNavThumbsSearch:".jpg",controlNavThumbsReplace:"_thumb.jpg",adaptImages:false,useLargerImage:true,keyboardNav:true,pauseOnHover:true,prevText:"Prev",nextText:"Next",imageTransitions:null,flashTransitions:null,imageFlashTransitions:null,transitionGroups:[],transitionGroupSuffixes:[],beforeChange:function(){},afterChange:function(){},slideshowEnd:function(){},lastSlide:function(){},afterLoad:function(){}};j=["startSlide","directionNav","directionNavHide","controlNav","controlNavThumbs","controlNavThumbsFromRel","controlNavThumbsSearch","controlNavThumbsReplace","adaptImages","useLargerImage","keyboardNav","pauseOnHover","prevText","nextText","imageTransitions","flashTransitions","imageFlashTransitions","transitionGroups","transitionGroupSuffixes","afterLoad"];return l=function(B,K){var y,U,S,H,al,ak,x,r,ag,F,w,ab,D,Q,ae,p,T,v,N,G,af,z,o,Y,V,I,ai,A,P,M,aj,Z,C,u,ac,t,X,R,ah,ad,J,n,aa,q,s,O,L,E,m,W;s=k(B);F=s.children(":not(#rambling-animation)");ad=k.extend({},k.fn.ramblingSlider.defaults,K);O=0;ag=0;o=null;z=null;Q=null;E=[];L=[];W={currentSlide:0,currentSlideElement:"",previousSlideElement:"",totalSlides:0,running:false,paused:false,stopped:false};s.data("rambling:vars",W);C=new e(s,ad,W);aj=new g(s,ad,W);this.stop=function(){W.stopped=true;return s};this.start=function(){W.stopped=false;return s};this.previousSlide=function(){n("prev");return s};this.nextSlide=function(){n("next");return s};this.slide=function(){var am,an;an=1<=arguments.length?h.call(arguments,0):[];if(!an.length){return W.currentSlide}am=an[0]%W.totalSlides;if(!(W.running||W.totalSlides===1)){W.currentSlide=am-1;Z(s,F,ad,"control")}return s};this.destroy=function(){s.find("#rambling-animation,.rambling-slice,.rambling-box,.rambling-caption,.rambling-directionNav,.rambling-controlNav").remove();s.removeClass("ramblingSlider adaptingSlider");s.removeAttr("style");s.data("rambling:vars",null);s.data("rambling:slider",null);s.unbind("rambling:finished");s.unbind("hover");u();s.children().show().children().show();return s};this.option=c(function(){var ao,an,am,ap;am=1<=arguments.length?h.call(arguments,0):[];if(!am.length){return ad}ao=am[0],ap=am[1];an=typeof ao==="object";if(ao==="effect"){return this.effect.apply(this,ap?[ap]:void 0)}if(ao==="theme"){return this.theme.apply(this,ap?[ap]:void 0)}if(an){return k.extend(ad,ao)}else{if(ap!=null){if(d.call(j,ao)>=0){return k.error("Slider already running. Option '"+ao+"' cannot be changed.")}return ad[ao]=ap}else{return ad[ao]}}},this);this.effect=function(){var am;am=1<=arguments.length?h.call(arguments,0):[];if(!am.length){return ad.effect}ad.effect=am[0];return s};this.theme=function(){var ao,an,am;am=1<=arguments.length?h.call(arguments,0):[];if(!am.length){return ad.theme}an=ad.theme;ad.theme=am[0];ao=["theme-"+an,"theme-"+k.fn.ramblingSlider.defaults.theme];s.parents(ao.map(function(ap){return"."+ap}).join(",")).removeClass(ao.join(" ")).addClass("theme-"+ad.theme);return s};this.initialize=function(){R();W.currentSlide=ad.startSlide=ad.startSlide%W.totalSlides;t(F);X();y();S();U(F);H();if(ad.pauseOnHover){s.hover(Y,m)}ac();return w()};this.run=function(){if(!ad.manualAdvance&&W.totalSlides>1){return O=window.setInterval((function(){return Z(s,F,ad,false)}),ad.pauseTime)}};ah=function(){o=k.extend({},k.fn.ramblingSlider.defaults.imageTransitions,ad.imageTransitions);z=k.extend({},k.fn.ramblingSlider.defaults.imageFlashTransitions,ad.imageFlashTransitions);Q=k.extend({},k.fn.ramblingSlider.defaults.flashTransitions,ad.flashTransitions);E=G("transitionGroups");return L=G("transitionGroupSuffixes")};G=function(am){var an;an=[];k.each(k.fn.ramblingSlider.defaults[am],function(ao,ap){return an.push(ap)});k.each(ad[am],function(ao,ap){return an.push(ap)});return an};R=c(function(){this.effect(ad.effect);this.theme(ad.theme);ah();s.css({position:"relative"});s.addClass("ramblingSlider");W.totalSlides=F.length;I();if(ad.adaptImages){V()}return ai()},this);I=function(){return s.prepend(k('
').css({width:s.width(),height:s.height(),overflow:"hidden"}))};V=function(){return s.addClass("adaptingSlider")};ai=function(){var an,am;am=s.find("#rambling-animation");F.each(function(){var ap,ao;ap=k(this);ap.css({display:"none"});ao=ap.clone().addClass("slideElement");if(ao.containsFlash()){if(!ao.find("param[name=wmode]").length){ao.find("object").prepend('')}ao.find("embed").attr({wmode:"opaque"})}return am.append(ao)});F=am.children();F.each(function(){var at,ao,ap,ar,aq;at=k(this);ar=null;if(at.is("a")&&!at.containsFlash()){ar=at.addClass("rambling-imageLink");at=at.find("img:first")}ap=at.width()||at.attr("width");ao=at.height()||at.attr("height");if(ap>s.width()&&ad.useLargerImage){s.width(ap)}if(ao>s.height()&&(ad.useLargerImage||!ad.adaptImages)){s.height(ao)}aq=at.find("object,embed");aq.height(s.height());aq.width(s.width());if(ar){ar.css({display:"none"})}return at.css({display:"none"})});an=t(F);if(an.is("a")){return an.css({display:"block"})}};y=function(){s.append(k('

').css({display:"none",opacity:ad.captionOpacity}));return A(ad)};S=function(){var am;if(ad.directionNav&&W.totalSlides>1){am=k("");s.append(am);if(ad.directionNavHide){am.hide();s.hover((function(){return am.show()}),(function(){return am.hide()}))}s.find("a.rambling-prevNav").live("click",function(){return n("prev")});return s.find("a.rambling-nextNav").live("click",function(){return n("next")})}};U=c(function(){var ao,an,ap,am,ar,aq;am=this;if(ad.controlNav){ap=k('
');s.append(ap);ar=function(at){var au;if(ad.controlNavThumbs){au=F.eq(at);if(!au.is("img")){au=au.find("img:first")}if(ad.controlNavThumbsFromRel){return ap.append("")}else{return ap.append("")}}else{return ap.append(""+(at+1)+"'")}};for(an=0,aq=F.length;0<=aq?anaq;0<=aq?an++:an--){ar(an)}ao=s.find(".rambling-controlNav a");ao.filter(":eq("+W.currentSlide+")").addClass("active");return ao.live("click",function(){if(W.running){return false}if(k(this).hasClass("active")){return false}u();X();return am.slide(k(this).attr("rel"))})}},this);H=function(){if(ad.keyboardNav){return k(window).keypress(function(am){if(am.keyCode===37){n("prev")}if(am.keyCode===39){return n("next")}})}};ac=c(function(){var am;am=this;return s.bind("rambling:finished",function(){var an;W.running=false;an=k(F.get(W.currentSlide));an.siblings().css({display:"none"});if(an.is("a")){an.css({display:"block"})}if(O===""&&!W.paused){am.run()}X();s.find(".rambling-slice,.rambling-box").remove();return ad.afterChange.call(this)})},this);w=function(){if(ad.imageTransitions){k.extend(o,ad.imageTransitions)}if(ad.imageFlashTransitions){k.extend(z,ad.imageFlashTransitions)}if(ad.flashTransitions){return k.extend(Q,ad.flashTransitions)}};A=function(an){var am,ao;am=s.find(".rambling-caption");ao=W.currentSlideElement.attr("title");if(ao){if(ao.startsWith("#")){ao=k(ao).html()}if(am.css("display")==="block"){am.find("p").fadeOut(an.speed,function(){var ap;ap=k(this);ap.html(ao);return ap.fadeIn(an.speed)})}else{am.find("p").html(ao)}return am.fadeIn(an.speed)}else{return am.fadeOut(an.speed)}};t=function(am){var an;an=k(am.get(W.currentSlide));W.previousSlideElement=W.currentSlideElement;W.currentSlideElement=an;if(an.is("a")&&!an.containsFlash()){W.currentSlideElement=an.find("img:first")}return an};u=function(){window.clearInterval(O);return O=""};Y=function(){W.paused=true;return u()};m=c(function(){W.paused=false;if(O===""){return this.run()}},this);n=function(am){if(W.running||W.totalSlides===1){return false}u();if(am==="prev"){W.currentSlide-=2}return Z(s,F,ad,am)};X=function(){var am;am=s.find(".currentSlideElement");if(am.equals(W.currentSlideElement)){return}am.removeClass("currentSlideElement alignTop alignBottom").css({display:"none","z-index":0});am=W.currentSlideElement;am.siblings(".slideElement").css({display:"none"});am.addClass("currentSlideElement").addClass(ad.alignBottom?"alignBottom":"alignTop");am.css({display:"block","z-index":0});return am.find("img").css({display:"block"})};v=function(){var am;am=ad.effect.split(",");k.each(E,function(an,ap){var ao;if(am.contains(ap)){ao=[am.indexOf(ap),1];k.each(L,function(aq,ar){return ao.push(""+ap+ar)});return am.splice.apply(am,ao)}});return am};T=function(){var ap,an,am,ao;ao=[];am=[];if(W.currentSlideElement.containsFlash()){if(W.previousSlideElement.containsFlash()){am=Q;an=Q.slideInRight}else{am=z;an=z.fadeOut}}else{am=o;an=o.fadeIn}ap=v();ao=[].fromObject(am,function(aq,ar){return aq});if(ad.effect!=="random"){ao=ao.where(function(aq){return ap.contains(aq)})}ao=ao.map(function(aq){return am[aq]});ao["default"]=an;return ao};N=function(){var am;am=T();return am.random()||am["default"]};M=function(){return s.trigger("rambling:finished")};x=function(am){var an;an=C.getOneSlice();an.css({top:(ad.alignBottom?"auto":0),bottom:(ad.alignBottom?0:"auto")});return an.animate(am.apply(an,[s,k.extend({},ad)])||{width:s.width()},ad.speed*2,"",function(){if(ad.afterChange){ad.afterChange.apply(an)}return M()})};r=function(am,ao){var an;an=C.createSlices();ag=0;if(ao){an=ao.apply(an)}return an.each(function(ap,ar){var aq,at;at=k(ar);if(ap===ad.slices-1){aq=M}window.setTimeout((function(){return at.animate(am.apply(at,[ap,ar])||{},ad.speed,"",aq)}),100+ag);return ag+=50})};al=function(am,ao){var an;an=aj.createBoxes();ag=0;if(ao){an=ao.apply(an)}return am.apply(an,[M])};ak=function(am,an){return al(function(ar){var aq,at,ap,av,au,ao;aq=this;av=ad.boxCols*ad.boxRows;ap=0;ao=[];for(at=0,au=ad.boxCols*2;0<=au?atau;0<=au?at++:at--){ao.push((function(ax){var ay,az,aw;aw=[];for(ay=0,az=ad.boxRows;0<=az?ayaz;0<=az?ay++:ay--){aw.push((function(aB){var aA,aC;if(ax>=0&&ax