Carrousel = new Class({
	initialize: function(frame, slider, buttons, sliderIn){
		this.frame = frame;
		this.slider = slider;
		this.showing = sliderIn;
		this.long = this.showing.length;
		localThis = this;

		this.slider.setStyles({'width': 10000, 'position':'absolute'});
		this.frame.setStyles({'overflow': 'hidden', 'position' : 'relative'});

		size = this.showing[0].getSize();
		//$('t').set('html', this.frame.get('html'));
		this.fxSlide = new Fx.Tween(this.slider).start('left', 0);
		this.fxShow = new Fx.Tween(this.frame).start('height',size.y+10);

		buttons.each(function(el, ind){
			el.addEvent('click', function(event){
				event.stop();
				buttons.each(function(el2){el2.removeClass('select');});
				if( ind >= localThis.long )ind2 = ind%this.long;
				else ind2 = ind + localThis.long;
				if( $chk( buttons[ind2]) )buttons[ind2].addClass('select');
				el.addClass('select');
				localThis.show( ind );
			});
		});
	},
	show: function( ind ){
		if( ind >= this.long )ind = ind%this.long;
		//$('t').set('html', long + ' ' + ind);
		leftSlider = 0;
		for( i=0; i < ind; i++){
			coord = this.showing[i].getSize();
			leftSlider += coord.x;
		}
		coord = this.showing[ind].getSize();
		this.fxSlide.start('left', -1*leftSlider );
		this.fxShow.start('height', coord.y+10);
	}
});