window.addEvent('domready', function () {
	
	var duration = 300,
	
		links = $$('div.tabs a'),
		
		tab = new Carousel.Extra({
			container: 'buckets',
			scroll: 3,
			circular: true,
			current: 0,
			previous: $('arrow-left'),
			next: $('arrow-right'),
			previous: links.shift(),
			next: links.pop(),
			/* mode: 'horizontal', */
			onChange: function (index) {
			
				links.each(function (el, off) {
				
					el[off == index ? 'addClass' : 'removeClass']('selected')
				})
			},
			fx: {
			
				duration: duration
			}
		});
		
	links.each(function (el, index) {
	
		el.addEvent('click', function (e) {
			
			e.stop();
			
			tab.move(index);
		})
	})
});
