timerID=0;

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function funMarcaMenu(varID) {
	var varTodos = document.getElementsByName("itemMenuAtivo");	
	for(i=0;i<varTodos.length;i++){
		if(i==varID){
			varTodos[i].style.visibility = "visible";
			
		} else {
			//varTodos[i].className = "itemMenu" + varID;
			varTodos[i].style.visibility = "hidden";
		}
	}
}

function funAbreSubMenu(varID) {
	var varTodos = document.getElementsByName("subMenu");
	varTop = -72;
	//varLeft = screen.width/2 - 243;
	
	// AQUI ENTRAM AS ESPECIFICAÇÕES DE LARGURA E POSICIONAMENTO À ESQUERDA
	
	// PARA O FIREFOX
	if (varID == 0 ){
		varLeft = 354-66;
		varWidth = 140;
	} else if (varID == 1 ){
		varLeft = 459-66;
		varWidth = 187;
	} else if (varID == 2 ){
		varLeft = 611-66;
		varWidth = 135;
	} else if (varID == 3 ){
		varLeft = 685-66;
		varWidth = 110;
	}
	
	// PARA O INTERNET EXPLORER
	if(navigator.appName.toLowerCase()=="microsoft internet explorer"){
		varTop = varTop+13;
		varLeft = varLeft+0;
	}
	varTop = varTop + "px";
	varLeft = varLeft + "px";
	varWidth = varWidth + "px";
	for(i=0;i<varTodos.length;i++){
		if(i==varID){
			varTodos[i].style.top = varTop;
			varTodos[i].style.left = varLeft;
			varTodos[i].style.width = varWidth;
			varTodos[i].style.visibility = "visible";
		} else {
			varTodos[i].style.visibility = "hidden";
		}
	}
}

function funZeraSubMenu() {
	var varTodos = document.getElementsByName("subMenu");
	for(i=0;i<varTodos.length;i++){
		varTodos[i].style.visibility = "hidden";
	}
}

function SelecionaAnos(varGrupoAnos,varID){
	var varTodos = document.getElementsByName(varGrupoAnos);
	var varTodosSub = document.getElementsByName("abaEscondida2");
	for(i=0;i<varTodos.length;i++){
		if (i == varID){
			varTodos[i].style.display = "block";
			varTodosSub[i].className = "azul";
			//document.getElementById("Aba"+varGrupoAnos+i).src = "Imgs/"+varSubSecao+"/Aba"+varGrupoAnos+i+"Ativo.gif";
		} else {
			varTodos[i].style.display = "none";
			varTodosSub[i].className = "desativado";
			//document.getElementById("Aba"+varGrupoAnos+i).src = "Imgs/"+varSubSecao+"/Aba"+varGrupoAnos+i+".gif";
		}
	}
}

/**/
function funAbreAbaEscondida(varID) {
	var varTodos = document.getElementsByName("abaEscondida") || document.getElementById("abaEscondida");
	var varTodosConteudo = document.getElementsByName("abaEscondidaConteudo") || document.getElementById("abaEscondidaConteudo");
	var varTodosSubConteudo = document.getElementsByName("abaEscondidaConteudo2") || document.getElementById("abaEscondidaConteudo2");
	var varTodosSub = document.getElementsByName("abaEscondida2") || document.getElementById("abaEscondida2");
	for(i=0;i<4;i++){
		if(i==varID){
			varTodos[i].className = "abaAtiva";
			varTodosConteudo[i].style.display = "block";
			varTodosSubConteudo[i].style.display = "none";
			varTodosSub[i].className = "desativado";
			
		} else {
			varTodos[i].className = "abaNaoAtiva";
			varTodosConteudo[i].style.display = "none";
			varTodosSubConteudo[i].style.display = "none";
			varTodosSub[i].className = "desativado";
		}
	}	
}

function funAbreAbaEscondida2(varID) {
	var varTodos = document.getElementsByName("abaEscondida2") || document.getElementById("abaEscondida2");
	var varTodosConteudo = document.getElementsByName("abaEscondidaConteudo2") || document.getElementById("abaEscondidaConteudo2");
	for(i=0;i<50;i++){
		if(i==varID){
			varTodos[i].className = "vermelho";
			varTodosConteudo[i].style.display = "block";
		} else {
			varTodos[i].className = "desativado";
			varTodosConteudo[i].style.display = "none";
		}
	}
}

function funAbreAbaEscondida3(varID) {
	var varTodos = document.getElementsByName("abaEscondida3") || document.getElementById("abaEscondida3");
	var varTodosConteudo = document.getElementsByName("abaEscondidaConteudo3") || document.getElementById("abaEscondidaConteudo3");
	for(i=0;i<50;i++){
		if(i==varID){
			varTodos[i].className = "cinza";
			varTodosConteudo[i].style.display = "block";
		} else {
			varTodos[i].className = "desativado2";
			varTodosConteudo[i].style.display = "none";
		}
	}
}

function printThis(id) {
 url = "interna_prn.php?id="+id;
 props = "location=no,menubar=no,personalbar=no,toolbar=no";
 props += "scrollbars=yes,status=no,width=600,height=200";
 open(url,"printer",props);
}