var currentNews = 0;
var container = "visibleNews";	

/**
 * Switches the current news item, to the next in line.
 *
 * The way this is done is traversing through the item called news<count>,
 * where the <count> is replaced by a number going from 0-2 to 0 (in a loop).
 */
function newsSwitch() {
	// Update counter
	currentNews++;
	if (currentNews == 3) {
		currentNews = 0;
	}
	
	var news = $('news' + currentNews);
	$(container).innerHTML = news.innerHTML;	
}

/**
 * Initiates the NewsTicker.
 *
 * Switches the visible news item every 10 seconds.
 */
function initiateNewsTicker() {	
	$(container).innerHTML = $("news0").innerHTML;
	new PeriodicalExecuter(function(e) {
		newsSwitch();
	}, 10);	
}
