(function($) {

	$.fn.rotate = function(o){
		o = $.extend(
		{
			speed:3
		}, o);
		$(this).each(function(){
			var i = $(this);
			
			var timeout;
			function decale(){
				
				var theitem = i.find('div:visible');
				theitem.hide();
				if(theitem.next().length != 0 && !theitem.next().hasClass("lien")){
					theitem.next().show();
				}else{
					i.find('div:first-child').show();
				}
				
				timeout = setTimeout(function(){
					decale();
				},o.speed*1000);
			}
			
			i.find('div:first-child').show();
			timeout = setTimeout(function(){
				decale();
			},o.speed*1000);
		});
	};

})(jQuery);
