$(function(){
	$.ajax({
		url     : '/php/feed.php',
		type    : 'GET',
		dataType: 'xml',
		cache   : false,
		success : function(r){
			var html  = [];
			html.push('<ul>');
			$('item', r).each(function(){
				html.push([
				'<li>',
				'<a href="'+ $('link', this).text() +'">',
				$('title', this).text(),
				'</a></li>'
				].join(''));
			})
			html.push('</ul>');
			$('#information_text').html(html.join(''));				
			var news = $('#information_text li');
			var time = 5000;
			var prev = 0; 
			var next = 1;
			news.hide();
			var timer = function(){
				setTimeout(function() {
					news.eq(prev).fadeOut(500, function(){
						news.eq(next).fadeIn(500, timer);
						prev = next;
						next = (news.size() == next + 1) ? 0 : next + 1;
					});
				}, time);
			};
			news.eq(0).fadeIn(500, timer);
		}
	});
});