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

