animation=true;

newsScrollTimeout = 5000;
newsScrollTimer = null;
newsIndex = 0;
function startNewsscroll() {
	if(animation == false)
		return;
	index = 0;
	if(newsScrollTimer == null) {
//		if(isNaN(index) || index < 0 || index >= newsscroll.length)
//			index = 0;
		newsIndex = index;
	}
	newsScrollTimer = setTimeout("switchNewsscroll()",newsScrollTimeout);
}

function switchNewsscroll() {
	newsIndex++;
//	if(newsIndex >= newsscroll.length)
//		newsIndex = 0;
//	newsscrollDIV = document.getElementById("homeAwards");
	opacity("homeAwards", 100, 0, 150, newsIndex);
	newsScrollTimer = setTimeout("switchNewsscroll()",newsScrollTimeout);
}

function pauseNewsScroll() {
	if(newsScrollTimer == null)
		return;
	clearTimeout(newsScrollTimer);
}

function opacity(id, opacStart, opacEnd, millisec, newsIndex) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
		for(i = opacStart; i >= opacEnd; i--) {
			setTimeout("changeOpac(" + i + ",'" + id + "',"+newsIndex+")",(timer * speed));
			timer++;
		}

        opacStart = 0;
        opacEnd = 100;

		for(i = opacStart; i <= opacEnd; i++) {
			setTimeout("changeOpac(" + i + ",'" + id + "',"+newsIndex+")",(timer * speed));
			timer++;
		}
}

//change the opacity for different browsers
function changeOpac(opacity, id, newsIndex) {
	if(opacity == 0 && newsIndex != null) {
		if(newsIndex%2 == 1) {
			document.getElementById('row1').className = 'hidden';
			document.getElementById('row2').className = '';
		}
		else {
			document.getElementById('row2').className = 'hidden';
			document.getElementById('row1').className = '';
		}
	}
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}