var Scrollslider = new Class({
	Implements: [Options, Events],
	
	options: {
		itemclass: 'scroll',
		duration: 1000,
		transition: Fx.Transitions.Bounce.easeOut
	},

	initialize: function(element,options){
		this.setOptions(options);
		this.element = document.id(element);
		this.scrollitems = $$('.'+ this.options.itemclass);
		
		this.scrollimageareaFx = new Fx.Scroll(this.element, {
			offset: {
				'x': 0,
				'y': 0
			},
			transition: this.options.transition,
			duration: this.options.duration,
			link: 'chain'
		});
	},
	
	doScrollToElement: function(i) {
		var that = this;
		this.scrollimageareaFx.toElement(that.scrollitems[i]);
	},
	
	scrollPrevious: function(i) {
		var that = this;
		//if (i >= 0)
		this.scrollimageareaFx.toElement(that.scrollitems[i]);
	},
	scrollNext: function(i) {
		var that = this;
		//if (i <= that.scrollitems.length)
		this.scrollimageareaFx.toElement(that.scrollitems[i]);
	},
	
	getItemLength: function() {
		//console.log(this.scrollitems.length);
		return this.scrollitems.length;
	}
});
