	var Slider = new Class({
			options : {
				sliderDiv : null,
				btnPrev : null,
				btnNext : null,
				autoRoll : null
		},
		Implements : [Options],
		
		initialize: function(widget, options){
			this.options = options;
			this.widget = widget;
			this.sliderDiv = this.widget.getElement(this.options.sliderDiv);
			this.sliderElements = this.sliderDiv.getElements('div.layout_short');
			this.btnPrev = this.widget.getElement(this.options.btnPrev);
			this.btnNext = this.widget.getElement(this.options.btnNext);
			this.currentElement = 0;
			this.elementsDisplayed = 1;
			if(this.widget.id == 'scroller') {
				this.elementsDisplayed = 2;
			};
			if(this.sliderElements.length <= this.elementsDisplayed) {
				this.btnPrev.destroy();
				this.btnNext.destroy();
			};
			this.roller = null;
			this.timer = null;
			this.createRollers();
			this.eventsRoller();
			if(this.options.autoRoll && this.sliderElements.length > 1){
				this.autoRoll();
			};
		},

		createRollers: function(){
			this.roller = new Fx.Scroll(this.sliderDiv,{
				'link' : 'cancel',
				'transition' : 'quad:out',
				'duration' : 500,
				'wheelStops' : false
			});
		},
		
		eventsRoller: function(){
			this.btnPrev.addEvent('click', function(e) {
				e.stop();
				this.scrollToPrev();
			}.bind(this));
			
			this.btnNext.addEvent('click', function(e) {
				e.stop();
				this.scrollToNext();
			}.bind(this));
		},
		
		scrollToPrev: function(){
			if(this.widget.id == 'scroller'){
				this.btnNext.setStyle('cursor', 'pointer');
				this.btnNext.setStyle('background-position', '0 0');
			};
			if(this.currentElement >= 1){
				this.currentElement -= 1;
				this.roller.toElement(this.sliderElements[this.currentElement]);
			}else {
				if(this.widget.id == 'slider'){
					/*this.currentElement = this.sliderElements.length - 1;
					this.roller.toElement(this.sliderElements[this.currentElement]);*/
					$clear(this.timer);
					this.timer = null;
					this.timer = this.scrollToNext.periodical(7000, this);
				};
			};
			if(this.widget.id == 'scroller'){
				if(this.currentElement == 0){
						this.btnPrev.setStyle('cursor', 'default');
						this.btnPrev.setStyle('background-position', '0 -22px');
				};
			};
		},
		
		scrollToNext: function(){
			if(this.widget.id == 'scroller'){
				this.btnPrev.setStyle('cursor', 'pointer');
				this.btnPrev.setStyle('background-position', '0 0');
			};
			if(this.currentElement < this.sliderElements.length - this.elementsDisplayed){
				this.currentElement += 1;
				this.roller.toElement(this.sliderElements[this.currentElement]);
			}else {
				if(this.widget.id == 'slider'){
					/*this.currentElement = 0;
					this.roller.toElement(this.sliderElements[this.currentElement]);*/
					$clear(this.timer);
					this.timer = null;
					this.timer = this.scrollToPrev.periodical(7000, this);
				};
			};
			if(this.widget.id == 'scroller'){
				if(this.currentElement == this.sliderElements.length - this.elementsDisplayed){
						this.btnNext.setStyle('cursor', 'default');
						this.btnNext.setStyle('background-position', '0 -22px');
				};
			};
		},
		
		autoRoll: function(){
			this.timer = this.scrollToNext.periodical(7000, this);
		}
		
	});