var currentIndex = 0;
var val;
function startSwitch() {
	val = setInterval("autoSwitch()", 6000);
}
function stopSwitch() {
	clearInterval(val);
}
function autoSwitch() {
	currentIndex++;
	if(currentIndex > 4) {
		currentIndex = 0;
	}
	updateNewsGenus(currentIndex);
}
function updateNewsGenus(index) {
	// 还原所有默认状态
	var newsGenus = document.getElementsByName("newsGenus");
	var newsList = document.getElementsByName("newsList");
	for(var i = 0; i < newsGenus.length; i++) {
		newsGenus[i].background = "images/baner2_85x24.gif";
		newsList[i].style.display = "none";
	}
	
	// 设定当前状态
	newsGenus[index].background = "images/baner_85x24.gif";
	newsList[index].style.display = "block";
}

