(function ( $ ){
    $.fn.scTicker = function (options) {

        var settings = {
            interval: 5000
        };

        if ( options ) {
            $.extend( settings, options );
        }

        var children = this.children();
        var index = 0;

        setInterval(function(){
            if (index < children.length) {
                var child = $(children[index]);
                child.slideUp('slow', function() {
                    $(this).parent().append($(child));
                    $(child).show();
                });
                index++;
            }

            if (index == children.length) {
                index = 0;
            }

        }, settings['interval']);
    }
})( jQuery );

$(document).ready( function(){
    if (jQuery('#footer-events').length > 0) {
        jQuery('#footer-events').scTicker('');
    }
});
