var stop = false;
var role = "stop";
var count = 0;
var x;
$(document).ready(function(){

	foo();
	bar();
});
	
function bar()
{
	x = setInterval("foo()", 6000);
}

function foo()
{
	$.post("getFeedArticles.php", 
	
	{ month: month, year: year }, 
	
	function(data)
	{
		if(data != "")
		{
			$("#feed_content").html(data);
			$("#feed_content").find("#"+count-1).hide("slide");
			$("#feed_content").find("#"+count).show("slide");
			if(count == $("#feed_content").find("li:last").attr("id"))
			{
				count = 0;
			}
			else
			{
				count++;
			}
		}
		else
		{
			$("#feed_content").html("<a href='news.php'>News...</a>");
		}
	}
	
    );
}