function Carousel(el) {
	
	var $el = el;
	$el.data('carousel', this);
	var move = -1;
	var delay = 30;
	var pos = 0;
	var width = $el.width();
	var id = null;
	var needAnimation = Boolean($('#carousel').width() < width);
	
	if (needAnimation)
		$el.find('.range').clone().appendTo($el);
	else
		$el.addClass('static');
	$el.css('left',  pos);
	
	// Carousel interaction
	$el.hover(
		function(){
			$(this).data('carousel').stop();
		},
		function(){
			$(this).data('carousel').play();
		}
	);
	
	this.play = function(){
		this.stop();
		$el.css('display', 'block');
		
		if (needAnimation)
			id = window.setInterval(this.move, delay);
	}
	
	this.move = function(){
		$el.css('left', (pos += move) % width);
	}
	
	this.stop = function(display){
		if (display)
			$el.css('display', display);
		clearInterval(id);
	}
	
}

