(function($) {                                          // Compliant with jquery.noConflict()
$.fn.AdvSharing = function(o) {
    o = $.extend({
        speed: 100000,
        easing: null,
        start: 0
    }, o || {});

    return this.each(function() {                           // Returns the element collection. Chainable.

        var div = $(this), fUl = $("ul:first", div);
        
        div.append(fUl.clone());
        
        var lUl = $("ul:last", div), tLi = $("li", lUl), tl = tLi.size(), curr = o.start;
        
        lUl.hide();
        fUl.empty();
        
        showAdv(curr);
        
        setInterval(function() { showAdv(curr); }, o.speed);
        
        function showAdv(to) {
                fUl.animate({opacity: 1}, 0, o.easing,
                    function() {
                        fUl.html($("li:eq(" + curr + ")", lUl).clone());
                        if(curr == tl - 1)
                            curr = 0;
                        else   
                            curr++;
                    }
                );
            return false;
        };
    });
};
})(jQuery);
