var index = 1; var menu_time = 16000;
var anterior = 4;
var timer = setTimeout('trocaMsg()',menu_time); 
function trocaMsg() {
	index = index%4 +1;
	channel(index);
	tempo();
}
function tempo() {
	clearTimeout(timer);
	timer = setTimeout("trocaMsg()",menu_time);
}
function channel(id) {
	index = id;
	if (id != null){
	document.getElementById("tvn" + anterior).className= "transp";
	document.getElementById("tvn" + id).className = "opac";
	document.getElementById('tvshow').innerHTML = document.getElementById('tv' + id).innerHTML;
	anterior = id;
	}
}
function tvch(id, out) 
	{
	if (out == 1){
	clearTimeout(timer);
	channel(id);
	}
	else {tempo();}
}
function stopanima(out) 
	{
	if (out == 1){
		clearTimeout(timer);
	}else {
		tempo();
	}
}