function sublinharMenu(){
}


function redireciona(targ,selObj,restore){ //v3.0
	  var form;
	  var i=0;
	 
	  for (i=0; i<document.forms.length; i++) {
		  if (document.forms[i].name=='formCombo'){
			form = document.forms[i];
		  }
	  }	  
	  form.action = "/comum/action/redirecionamentoExterno.do";
	  form.submit();
}  

function redirecionaComString(targ,selObj,restore){ //v3.0
	var form;
	var i=0;
	
	for (i=0; i<document.forms.length; i++) {
		if (document.forms[i].name=='formCombo'){
			form = document.forms[i];
			form.sistema.value = selObj;
		}
	}	  
	form.action = "/comum/action/redirecionamentoExterno.do";
	form.submit();
}  

var navItems = null;
navItems = document.getElementsByTagName("li");

function vertical(){
	for (var i=0; i< navItems.length; i++) {
		if(navItems[i].className == "submenu") { 
			if(navItems[i].getElementsByTagName('ul')[0] != null){ 
				switch(navItems[i].parentNode.className){
				case "menuHorizontalVertical":
					navItems[i].onmouseover=function() {this.getElementsByTagName('ul')[0].style.display="block";this.style.background="#a7ce8d";} 
					navItems[i].onmouseout=function() {this.getElementsByTagName('ul')[0].style.display="none";this.style.background="#a7ce8d";}
				break;
				case "menuLateral": case "menuLinkTexto":
					// n�o aplica nada, pois estes menus n�o possuem anima��o
				break;
				case "AcessoExclusivo":
					navItems[i].onmouseover=function() {this.getElementsByTagName('ul')[0].style.display="block";} 
					navItems[i].onmouseout=function() {this.getElementsByTagName('ul')[0].style.display="none";}
					break;
				default:
					navItems[i].onmouseover=function() {this.getElementsByTagName('ul')[0].style.display="block";this.style.background="transparent";} 
					navItems[i].onmouseout=function() {this.getElementsByTagName('ul')[0].style.display="none";this.style.background="transparent";}
				}
			}
		}
	} 
} 

function horizontal(){ 
	var nomePai;
	var corBG;
	var corTx;
	for (var i=0; i< navItems.length; i++) { 
		if((navItems[i].className == "menuPai") || (navItems[i].className == "submenu")){ 
			if(navItems[i].getElementsByTagName('ul')[0] != null){ 
				switch(navItems[i].parentNode.className){
					case "menuLateral": case "menuLinkTexto":
						// n�o aplica nada, pois estes menus n�o possuem anima��o
					break;
					case "AcessoExclusivo":
						navItems[i].onmouseover=function() {this.getElementsByTagName('ul')[0].style.display="block";} 
						navItems[i].onmouseout=function() {this.getElementsByTagName('ul')[0].style.display="none";}
						break;
					default:
						/*
						** nomePai deve recever elmentoAtual.parentNode.parentNode.className
						** devido o uso do <div> entre o menu e a coluna
						*/
						nomePai = navItems[i].parentNode.parentNode.parentNode.className;
						if (nomePai == "menuContextual"){
							corBG = "#A8CF8D";
							corTx = "#007C4B";
						}
						else {
							corBG = "transparent";
							corTx = "#FFFFFF";
						}
						/* fun��o onmouseover no menu */
						navItems[i].onmouseover=function() {

							this.getElementsByTagName('ul')[0].style.display="block";
							this.style.background=corBG;
							
							if (this.className == "menuPai") {
								for (var j=0; j< navItems.length; j++) { 
									if (navItems[j].className == "submenu") {
										navItems[j].getElementsByTagName('ul')[0].style.left = navItems[j].offsetWidth;
										navItems[j].getElementsByTagName('ul')[0].style.top = 0;
									}
								}
							}
							
							if (navigator.appName == "Microsoft Internet Explorer") {
								var pai = this;
								while(pai.childNodes[0].className != "menuPai")	{
									pai = pai.parentNode;
									if(pai.className == "menuPai" || pai.className == "submenu"){
									pai.getElementsByTagName('ul')[0].style.display="block";
									}
								}
								pai = null;
								this.getElementsByTagName('iframe')[0].style.display="block";
								this.getElementsByTagName('iframe')[0].style.width =  this.getElementsByTagName('ul')[0].offsetWidth;
								this.getElementsByTagName('iframe')[0].style.height = this.getElementsByTagName('ul')[0].offsetHeight;
								if(this.className == "submenu"){
									this.getElementsByTagName('iframe')[0].style.left = this.offsetWidth;
									this.getElementsByTagName('iframe')[0].style.top = 0;
								}
							}
						} 
						/* fun��o onmouseout no menu */
						navItems[i].onmouseout=function() {
						var lis = this.getElementsByTagName('li');
						for (var j=0; j< lis.length; j++) {
							if (lis[j].className == "submenu"){
								lis[j].getElementsByTagName('ul')[0].style.display="none";
							}
						}
							this.getElementsByTagName('ul')[0].style.display="none";
							if (navigator.appName == "Microsoft Internet Explorer") {
								this.getElementsByTagName('iframe')[0].style.display="none";
							}
							this.style.background="transparent";	
						}
					break;
				}
			}
		}
	} 
} 
