var JASlideshow = new Class({ initialize: function(options){ this.options = Object.extend({ buttons : {}, interval:5000, handle_event: 'click', button_event: 'click', box: {}, size: 240, mode: 'horizontal', items:[], handles:[], onWalk:{}, animation: 'fade', autoPlay: false }, options || {}); this.items = this.options.items; this.modes = {horizontal:['left','width'], vertical:['top','height']}; this.box = $(this.options.box); this.buttons = {previous: [], next: [], play: [], playback: [], stop: []}; if(this.options.buttons){ for(var action in this.options.buttons){ this.addActionButtons(action, $type(this.options.buttons[action])=='array' ? this.options.buttons[action] : [this.options.buttons[action]]); } } this.handles = this.options.handles; if(this.handles){ this.addHandleButtons(this.handles); } //this.fx = new Fx.Style(this.box,this.modes[this.options.mode][0],this.options.fxOptions||{duration:500,wait:false}); this.currentIndex = this.options.startItem || 0; this.previousIndex = null; this.nextIndex = null; this._auto = null; this.initFx(); if(this.options.autoPlay) this.play(this.options.interval,'next',true); this.walk (this.currentIndex); }, previous: function(manual){ this.lastIndex = this.currentIndex; this.currentIndex += this.currentIndex>0 ? -1 : this.items.length-1; this.walk(null,manual); }, next: function(manual){ this.lastIndex = this.currentIndex; this.currentIndex += this.currentIndex0 ? -1 : this.items.length-1); this.nextIndex = this.currentIndex + (this.currentIndex