

/*
 * Newsticker
 *
 * @authoer: Johannes Weber (jw@ovos.at)
*/

var lastId = 0;	//id des zuletzt angezeigten items
var anzahl = 0;	//anzahl der elemente


function getNews() {
	var actId = lastId+1;
	if(actId >= anzahl)
	{

		actId = 0;
	}

	if(newsItems[actId]) {
		lastId = actId;

		//newsTitle newsContent
		$('#newsTitle, #newsContent').animate({opacity : '0'}, 500, function() {
			$('#newsTitle').html(newsItems[actId].title);
			$('#newsContent').html(newsItems[actId].content);

			$('#newsTitle, #newsContent').animate({opacity : '100'}, 1300);
		});
	}
}

$(document).ready(function() {
	var interval = 10000;	//intervall in millisec
	anzahl = countItems;

	window.setInterval("getNews()", interval);
 });