fx.Filmstrip = Class.create();
fx.Filmstrip.prototype = Object.extend(new fx.Base(), {
	
	initialize: function(element, options) {
		this.now     = 0;
		this.nowStop = 0;
		this.element = $(element);
		this.setOptions(options);
	},
	
	increase: function() {
		this.element.style.left = this.now + "px";
	},
	
	scrollPrevious: function() {
		if (this.timer != null) return;
		
		toStep = this.nowStop <= 1
			? 1
			: this.nowStop--;

		this.scroll(toStep);
	},
	
	scrollNext: function(stepNbr) {
		if (this.timer != null) return;
		
		toStep = (this.nowStop + 1) >= stepNbr
			? stepNbr
			: this.nowStop + 2;

		this.scroll(toStep);
	},
	
	scroll: function(toStep) {
		if (this.timer != null) return;
		
		
		this.nowStop = toStep - 1;
		
		this.from = this.now;
		this.to   = -(this.nowStop * this.options.stepSize);
		
		if (this.from == this.to) return;
		this.go();
	}
	
});