(function($) {

$.fn.extend({
    Exel_FrontpageTopElement: function() {
        this.each(function() {
            function entered(item) {
                //setTimeout(function() {
                    $(item).find("h3 span, .innertext").animate({"opacity": 1.0}, 700);
                //}, 1000);
            }
            
            function left(item) {
                $(item).find("h3 span, .innertext").css("opacity", 0);
            }
            
            $(this).scroller({vertical: true, circular: true, autoScrollInterval: 3000, scrollSpeed: 0.8,
                leftView: left, enteredView: entered});
            $(this).find(".ScrollerItems>li").each(function() { left(this); });
            
            /*texts.each(function() {
                var t = $(this);
                var parts = t.text().split(/\s+/), i;
                t.empty();
                for (i = 0; i < parts.length; i++) {
                    var e = $(document.createElement("span"));
                    if (i == 0)
                        e.addClass("first");
                    t.append(e.text(parts[i]).append("&nbsp;"));
                }
            });
            
            var textFadeInCallback = function() {
                if (this.nextSibling)
                    $(this.nextSibling).animate({opacity: 1.0}, 200, textFadeInCallback);
                else if (autoTimer)
                    autoTimer = setTimeout(function() { gotoImage((current + 1) % bgs.length) }, 5000);
            };*/

            /*texts.not(texts.eq(current)).animate({opacity: 0.0}, 500).end()
                .eq(current).animate({opacity: 1.0}, 500)
                .children().css("opacity", 0.0)
                .eq(0).animate({opacity: 1.0}, 1000, textFadeInCallback);*/
        });
    }
});

})(jQuery)