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

