(function($){
	$.fn.alnetisScroller = function(options) {

	var defaults = {
	 speed: 700,
	 height: 140,
	 activeColor: '#fff',
	 inactiveColor: '#5d717e'
	};
	var options = $.extend(defaults, options);
		
	return this.each(function() {
		
		var obj = $(this);
		
		// on colore l'élément du milieu dans la couleur "active"
		$('#'+obj.attr('id')+' ul li:eq(1) p').css({color: options.activeColor});
		
		$('#'+obj.attr('id')+' a.down').click(function() {
			$('#'+obj.attr('id')+' ul li p').css({color: options.inactiveColor});
			var first = $('#'+obj.attr('id')+' ul li:first').html();
			$('#'+obj.attr('id')+' ul li:first').animate({marginTop: -options.height}, options.speed, function() {$(this).remove();});
			var last = '<li>'+first+'</li>';
			$('#'+obj.attr('id')+' ul').append(last);
			$('#'+obj.attr('id')+' ul li:eq(2) p').css({color: options.activeColor});
		});
		$('#'+obj.attr('id')+' a.up').click(function() {
			$('#'+obj.attr('id')+' ul li p').css({color: options.inactiveColor});
			var last = $('#'+obj.attr('id')+' ul li:last').html();
			var first = '<li>'+last+'</li>';
			$('#'+obj.attr('id')+' ul').prepend(first);
			$('#'+obj.attr('id')+' ul li:first').css({marginTop: -options.height}).animate({marginTop: 0}, options.speed, function() {$('#'+obj.attr('id')+' ul li:last').remove();});
			$('#'+obj.attr('id')+' ul li:eq(1) p').css({color: options.activeColor});
		});
		
	});
	};
})(jQuery);
