Event.addBehavior({
	'div#rss_feed_content': function() {
		this.update('Loading&#8230;');
		
		var current = 0;
		var feed_link = function(properties) {
			return $a({'href': properties.link, 'target': '_blank'}, properties.title);
		};
		
		FeedBurner.addBurner(new FeedBurner.Base('http://www.decodeyou.com', {
			onSuccess: function(entries) {
				var update_feed_link = function(index) {
					var feed_container = $('rss_feed_content');
					Effect.Fade(feed_container, {afterFinish: function() {
						feed_container.update(feed_link(entries[index]));
						Effect.Appear(feed_container);
					}});
				};
				update_feed_link(current);
				
				new PeriodicalExecuter(function() {
					current = (current + 1) % entries.size();
					update_feed_link(current);
				}, 10);
			},
			
			onError: function(code, message) {
				this.update(feed_link({link: 'http://www.decodeyou.com', title: 'Visit our blog for the latest news & discussions about genetics & how they relate to your health.'}));
			}.bind(this)
		}));
	}
});