/**
 * Newsflash
 * @copyright celanio GmbH
 */


var nf_timeout = 10000;
var nf_context;
var nf_total_items = 0;
var nf_current_item = 0;

function nf_scrollNext()
{
	$($(".newsflash_item", nf_context).get(nf_current_item)).slideUp("slow", function () {
		nf_current_item++;
		if (nf_current_item >= nf_total_items) nf_current_item = 0;
		$($(".newsflash_item", nf_context).get(nf_current_item)).slideDown("slow", function () {
			window.setTimeout("nf_scrollNext()", nf_timeout)
		});
	});

};


$(document).ready(function () {
	if ($(".newsflash").length > 0 && $(".newsflash > .newsflash_item").length > 1)
	{
		nf_context = $(".newsflash");
		nf_total_items = $(".newsflash_item", nf_context).length;
		$(".newsflash_item", nf_context).hide();
		nf_scrollNext();
	}
});
