window.addEvent('domready', function(){

	var wrapper = $('catalog-featured');
	var container = $$('#catalog-featured .layout_featured');
	
	var wrapperWidth = wrapper.getStyle('width').toInt();
	var item = $$('#catalog-featured .item');
	var containerWidth = item[0].getStyle('width').toInt() * item.length;
	container.setStyle('width', containerWidth);
	
	var scrollDistance = containerWidth - wrapperWidth;
	var scrollTime = 1500 * item.length;
	
	var scrollFeatured = new Fx.Scroll($('catalog-featured'), {
		duration: scrollTime,
		transition: Fx.Transitions.linear,
		onComplete: function(){
				if (direction == 'right') {
					direction = 'left';
		        	scrollFeatured.start(0, 0);
		        } else {
		        	direction = 'right';
		        	scrollFeatured.start(scrollDistance, 0);
		        }
		    }
	});
	
	var direction = 'right';
	scrollFeatured.start(scrollDistance, 0);
	
});
