Slideshow.Fold=new Class({Extends:Slideshow,_show:function(b){if(!this.image.retrieve("tween")){var c=this.options.overlap?{duration:this.options.duration}:{duration:this.options.duration/2};$$(this.a,this.b).set("tween",Object.merge(c,{link:"chain",onStart:this._start.bind(this),onComplete:this._complete.bind(this),property:"clip",transition:this.options.transition}))}c=this.counter%2?this.a:this.b;var a=this._rect(this.image),d=Math.ceil(a.top+(a.bottom-a.top)/2);if(b)c.get("tween").cancel().set("rect(0, 0, 0, 0)"),
this.image.get("tween").cancel().set("rect(auto, auto, auto, auto)");else if(this.options.overlap)c.get("tween").set("rect(auto, auto, auto, auto)"),this.image.get("tween").set(a.top+" "+a.left+" "+d+" "+a.left).start(a.top+" "+a.right+" "+d+" "+a.left).start(a.top+" "+a.right+" "+a.bottom+" "+a.left);else{b=function(a){this.image.get("tween").set(a.top+" "+a.left+" "+d+" "+a.left).start(a.top+" "+a.right+" "+d+" "+a.left).start(a.top+" "+a.right+" "+a.bottom+" "+a.left)}.pass(a,this);if(this.firstrun)return b();
a=this._rect(c);c.get("tween").set(a.top+" "+a.right+" "+a.bottom+" "+a.left).start(a.top+" "+a.right+" "+d+" "+a.left).start(a.top+" "+a.left+" "+d+" "+a.left).chain(b)}},_rect:function(b){b=b.getCoordinates(this.el.retrieve("images"));b.left=b.left<0?Math.abs(b.left):0;b.top=b.top<0?Math.abs(b.top):0;b.right=b.right>this.width?b.left+this.width:b.width;b.bottom=b.bottom>this.height?b.top+this.height:b.height;return b}});

