var start = 0;
var len = 3;
var ncount = 6;
var timing = 4000;
var timerId;

function news_init()
{
	for(i=0;i<len;i++) {
		showNews(i);
	}
	
	for(i=len;i<ncount;i++) {
		hideNews(i);
	}
}

function news_next()
{
	toHide = start;
	toShow = (start + len) % ncount; 
	
	hideNews(toHide);
	showNews(toShow);
	
	start = (start + 1) % ncount;
	
	timerId = setTimeout("news_next()",timing);
}

function showNews(index)
{
	document.getElementById('n'+index).style.display = '';
}

function hideNews(index)
{
	document.getElementById('n'+index).style.display = 'none';
}



news_init();
timerId = setTimeout("news_next()",timing);


function showAllNews()
{
	clearTimeout ( timerId );
	for(i=0;i<ncount;i++) {
		showNews(i);
	}
}

