(function($) {
	$.fn.rotate = function() {
		var container = $(this);
		var totale = container.find("img").size();
		if(totale == 0){
			container.hide();		
		}
		var current = 0;
		var i = setInterval(function() {
			if (current >= totale) current = 0;
			container.find("img").filter(":eq("+current+")").fadeIn("slow").end().not(":eq("+current+")").fadeOut("slow");
			current++;
		}, 5000);
		return container;
	};
})(jQuery);
