Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(c,d){this.elements=this.subject=$$(c);this.parent(d)},compute:function(l,k,i){var p={};for(var o in l){var r=l[o],n=k[o],m=p[o]={};for(var q in r){m[q]=this.parent(r[q],n[q],i)}}return p},set:function(e){for(var h in e){var f=e[h];for(var g in f){this.render(this.elements[h],g,f[g],this.options.unit)}}return this},start:function(p){if(!this.check(p)){return this}var k={},i={};for(var o in p){var m=p[o],r=k[o]={},l=i[o]={};for(var q in m){var n=this.prepare(this.elements[o],q,m[q]);r[q]=n.from;l[q]=n.to}}return this.parent(k,i)}});var Loop=new Class({loopCount:0,isStopped:true,isLooping:false,loopMethod:$empty,setLoop:function(d,e){if(this.isLooping){this.stopLoop();var f=true}else{var f=false}this.loopMethod=d;this.loopDelay=e||3000;if(f){this.startLoop()}return this},stopLoop:function(){this.isStopped=true;this.isLooping=false;$clear(this.periodical);return this},startLoop:function(b){if(this.isStopped){var b=(b)?b:this.loopDelay;this.isStopped=false;this.isLooping=true;this.periodical=this.looper.periodical(b,this)}return this},resetLoop:function(){this.loopCount=0;return this},looper:function(){this.loopCount++;this.loopMethod(this.loopCount);return this}});var SlideShow=new Class({Implements:[Options,Events,Loop],options:{delay:7000,transition:"crossFade",duration:"500",autoplay:false},initialize:function(c,d){this.setOptions(d);this.setLoop(this.showNext,this.options.delay);this.element=document.id(c);this.slides=this.element.getChildren();this.current=this.slides[0];this.transitioning=false;this.setup();if(this.options.autoplay){this.play()}},setup:function(){this.setupElement().setupSlides(true);return this},setupElement:function(){var b=this.element;if(b.getStyle("position")!="absolute"&&b!=document.body){b.setStyle("position","relative")}return this},setupSlides:function(b){this.slides.each(function(a,d){this.storeTransition(a).reset(a);if(b&&d!=0){a.setStyle("display","none")}},this);return this},storeTransition:function(h){var l=h.get("class");var g=/transition:[a-zA-Z]+/;var j=/duration:[0-9]+/;var i=(l.match(g))?l.match(g)[0].split(":")[1]:this.options.transition;var k=(l.match(j))?l.match(j)[0].split(":")[1]:this.options.duration;h.store("ssTransition",i).store("ssDuration",k);return this},resetOptions:function(b){this.options=$merge(this.options,b);this.setupSlides(false);return this},getTransition:function(b){return b.retrieve("ssTransition")},getDuration:function(b){return b.retrieve("ssDuration")},show:function(i,h){i=(typeof i=="number")?this.slides[i]:i;if(i!=this.current&&!this.transitioning){this.transitioning=true;var j=(h&&h.transition)?h.transition:this.getTransition(i),k=(h&&h.duration)?h.duration:this.getDuration(i),m=this.current.setStyle("z-index",1),n=this.reset(i);var l={previous:{element:m,index:this.slides.indexOf(m)},next:{element:n,index:this.slides.indexOf(n)}};this.fireEvent("show",l);this.transitions[j](m,n,k,this);(function(){m.setStyle("display","none");this.fireEvent("showComplete",l);this.transitioning=false}).bind(this).delay(k);this.current=n}return this},reset:function(b){return b.setStyles({position:"absolute","z-index":0,display:"block",left:0,top:0}).fade("show")},nextSlide:function(){var b=this.current.getNext();return(b)?b:this.slides[0]},previousSlide:function(){var b=this.current.getPrevious();return(b)?b:this.slides.getLast()},showNext:function(b){this.show(this.nextSlide(),b);return this},showPrevious:function(b){this.show(this.previousSlide(),b);return this},play:function(){this.startLoop();this.fireEvent("play");return this},pause:function(){this.stopLoop();this.fireEvent("pause");return this},reverse:function(){var b=(this.loopMethod==this.showNext)?this.showPrevious:this.showNext;this.setLoop(b,this.options.delay);this.fireEvent("reverse");return this},toElement:function(){return this.element}});Element.Properties.slideshow={set:function(d){var c=this.retrieve("slideshow");if(c){c.pause()}return this.eliminate("slideshow").store("slideshow:options",d)},get:function(b){if(b||!this.retrieve("slideshow")){if(b||!this.retrieve("slideshow:options")){this.set("slideshow",b)}this.store("slideshow",new SlideShow(this,this.retrieve("slideshow:options")))}return this.retrieve("slideshow")}};Element.implement({playSlideShow:function(b){this.get("slideshow",b).play();return this},pauseSlideShow:function(b){this.get("slideshow",b).pause();return this}});SlideShow.adders={transitions:{},add:function(c,d){this.transitions[c]=d;this.implement({transitions:this.transitions})},addAllThese:function(b){$A(b).each(function(a){this.add(a[0],a[1])},this)}};$extend(SlideShow,SlideShow.adders);SlideShow.implement(SlideShow.adders);SlideShow.add("fade",function(h,e,g,f){h.set("tween",{duration:g}).fade("out");return this});Fx.Elements.implement({setTransition:function(b){this.elements=this.subject=$$(b);return this}});SlideShow.helpers={fxElements:new Fx.Elements};SlideShow.addAllThese([["none",function(h,e,g,f){h.setStyle("display","none");return this}],["crossFade",function(h,e,g,f){h.set("tween",{duration:g}).fade("out");e.set("tween",{duration:g}).fade("in");return this}],["fadeThroughBackground",function(j,f,h,g){var i=h/2;f.set("tween",{duration:i}).fade("hide");j.set("tween",{duration:i,onComplete:function(){f.fade("in")}}).fade("out")}],["pushLeft",function(j,f,i,g){var h=g.element.getStyle("width").toInt();f.setStyle("left",h);new Fx.Elements([j,f],{duration:i}).start({0:{left:[-h]},1:{left:[0]}});return this}],["pushRight",function(d,h,j,g){var i=g.element.getStyle("width").toInt();h.setStyle("left",-i);new Fx.Elements([d,h],{duration:j}).start({0:{left:[i]},1:{left:[0]}});return this}],["pushUp",function(d,h,j,g){var i=g.element.getStyle("height").toInt();h.setStyle("top",i);new Fx.Elements([d,h],{duration:j}).start({0:{top:[-i]},1:{top:[0]}});return this}],["pushDown",function(d,h,j,g){var i=g.element.getStyle("height").toInt();h.setStyle("top",-i);new Fx.Elements([d,h],{duration:j}).start({0:{top:[i]},1:{top:[0]}});return this}],["blindRight",function(d,h,j,g){var i=g.element.getStyle("width").toInt();h.setStyles({left:-i,"z-index":2}).set("tween",{duration:j}).tween("left",0);return this}],["blindLeft",function(d,h,j,g){var i=g.element.getStyle("width").toInt();h.setStyles({left:i,"z-index":2}).set("tween",{duration:j}).tween("left",0);return this}],["blindUp",function(d,h,j,g){var i=g.element.getStyle("height").toInt();h.setStyles({top:i,"z-index":2}).set("tween",{duration:j}).tween("top",0);return this}],["blindDown",function(d,h,j,g){var i=g.element.getStyle("height").toInt();h.setStyles({top:-i,"z-index":2}).set("tween",{duration:j}).tween("top",0);return this}],["blindDownFade",function(d,g,h,f){this.blindDown(d,g,h,f).fade(d,g,h,f)}],["blindUpFade",function(d,g,h,f){this.blindUp(d,g,h,f).fade(d,g,h,f)}],["blindLeftFade",function(d,g,h,f){this.blindLeft(d,g,h,f).fade(d,g,h,f)}],["blindRightFade",function(d,g,h,f){this.blindRight(d,g,h,f).fade(d,g,h,f)}]]);
