// jQuery plugin - Simple RSS Aggregator
(function($){
    $.fn.aRSSFeed = function() {
        return this.each( function(){
            var $Cont = $(this);
            var iMaxNum = parseInt($Cont.attr( 'rssnum' ) || 0);
            var sFeedURL = $Cont.attr('rss_url');

            if (sFeedURL == undefined)
                return false;

			$.get(sFeedURL, function(data) {
				$Cont.html(data);
				$('.RSSAggrCont ul li').hide();
				$('.RSSAggrCont ul li:first').show(); 
				Rotate();
			});
			
        } );
    };
})(jQuery);


function Rotate(){
var current = $('.RSSAggrCont ul li:visible');
var next = current.next().length ? current.next() : current.parent().children(':first'); 
current.hide();
next.show();
setTimeout(Rotate, 5000);
} 
