// speed of news changing
var iChangeSpeed = 5000; // miliseconds to wait before each scroll step
var iChangeNewsIndex = 0;


function ChangeNewsStep(bContinue)
{
	// news div
	objMainNewsText = document.getElementById("main_news_text");
	objMainNewsPicture = document.getElementById("main_news_picture");
	
	// change news
	objMainNewsText.innerHTML = "<a class='box_latest_news_text_red' style='cursor:pointer;text-decoration:none;' href='article.php?t=1&a="+newsId[iChangeNewsIndex]+"'>"+newsTitle[iChangeNewsIndex]+"<br /></a><a class='box_latest_news_text_grey'>"+newsText[iChangeNewsIndex]+"</a>";
	objMainNewsPicture.innerHTML = "<a href='article.php?t=1&a="+newsId[iChangeNewsIndex]+"'><img src='"+newsPicture[iChangeNewsIndex]+"' title='"+newsTitle[iChangeNewsIndex]+"' alt='"+newsTitle[iChangeNewsIndex]+"' /></a>";

	// scroll again (infinite loop)
	if (bContinue)
		ChangeNews();
}

function ChangeNews()
{
	iChangeNewsIndex++;
	if (iChangeNewsIndex>=15)
		iChangeNewsIndex = 0;
	setTimeout("ChangeNewsStep(true)", iChangeSpeed);
}

ChangeNews();
