News = Class.create();
News.prototype =
{
	initialize: function(name)
	{
		this.newsItems = $$("."+name);
		if (this.newsItems.length == 1)
			this.newsItems.first().show();
		if (this.newsItems.length > 1)
		{
			this.newsItems.first().show();
			this.currentItem = 0;
			this.pe = new PeriodicalExecuter(this.drawNext.bind(this), 5);
		}
	},
	
	drawNext: function()
	{
		nextItem = (this.currentItem + 1) % (this.newsItems.length);
		new Effect.Fade(this.newsItems[this.currentItem]);
		new Effect.Appear(this.newsItems[nextItem]);
		this.currentItem = nextItem;
	}
}
