Slideshow.KenBurns=new Class({Extends:Slideshow,options:{pan:[100,100],zoom:[50,50]},initialize:function(d,f,a){a.overlap=true;a.resize=true;["pan","zoom"].each(function(b){if($chk(this[b])){if($type(this[b])!="array")this[b]=[this[b],this[b]];this[b].map(function(g){return(g.toInt()||0).limit(0,100)})}},a);this.parent(d,f,a)},_show:function(d){this.image.retrieve("morph")||["a","b"].each(function(c){this[c].set("tween",{duration:this.options.duration,link:"cancel",onStart:this._start.bind(this), onComplete:this._complete.bind(this),property:"opacity"}).get("morph",{duration:this.options.delay+this.options.duration*2,link:"cancel",transition:$arguments(0)})},this);this.image.set("styles",{bottom:"auto",left:"auto",right:"auto",top:"auto"});var f=["top left","top right","bottom left","bottom right"][this.counter%4].split(" ");f.each(function(c){this.image.setStyle(c,0)},this);dh=this.height/this.preloader.height;dw=this.width/this.preloader.width;delta=dw>dh?dw:dh;var a={},b=$random.run(this.options.zoom)/ 100+1,g=Math.abs($random.run(this.options.pan)/100-1);["height","width"].each(function(c,i){var e=Math.ceil(this.preloader[c]*delta),h=(e*b).toInt();a[c]=[h,e];if(dw>dh||i){e=this[c]-this.image[c];h=(e*g).toInt();a[f[i]]=[h,e]}},this);var j=this.firstrun&&this.options.paused;if(d||j){this._center(this.image);this.image.get("morph").cancel();j?this.image.get("tween").cancel().set(0).start(1):this.image.get("tween").cancel().set(1)}else{this.image.get("morph").start(a);this.image.get("tween").set(0).start(1)}}});
