var backGroundColor		= "";
var imagens				= new Array(

		// imagem OFF						// imagem ON

	[   "img/menu_10.gif",					"img/menu_1.gif"   ],
	[   "img/menu_11.gif",					"img/menu_2.gif"   ],
	[   "img/menu_12.gif",					"img/menu_3.gif"   ],
	[   "img/menu_13.gif",					"img/menu_4.gif"   ],
	[   "img/menu_14.gif",					"img/menu_5.gif"   ],
	[   "img/menu_15.gif",					"img/menu_6.gif"   ],
	[   "img/menu_16.gif",					"img/menu_7.gif"   ],
	[   "img/menu_17.gif",					"img/menu_8.gif"   ]

);


if (navigator.appName == "Microsoft Internet Explorer")  {
    navg = 'ie'
	topo = topoDoMenuNoIE;
	}
else
	{
    navg = 'ntsc'
	topo = topoDoMenuNoNS;
	}

	
//Conta qtos Itens tem no menu
for (i=0; i<menu.length; i++)  {
	strLinks = "";
	strIni = "<table border=0 cellpading=0 cellspacing=0 bgcolor='"+corFundoMenu+"' width=755 style=\"margin-top:20px; height:15px;\"><tr><td align=LEFT><table border=0 cellpading=0 cellspacing=0 bgcolor='#000000'><tr>";
	strFim = "</tr></table></td></tr></table>";
	//Conta qtos SubItens tem NESTE item
	for (t=0; t<menuItens.length; t++)  {
	if ( i == 0 ) {
		backGroundColor = "#000000";
	}
	if ( i == 1 ) {
		backGroundColor = "#000000";
	}
	if ( i == 2 ) {
		backGroundColor = "#000000";
	}
	if ( i == 3 ) {
		backGroundColor = "#000000";
	}
	if ( i == 4 ) {
		backGroundColor = "#000000";
	}
	
		if ( menu[i] == menuItens[t][0] )  {
			if ( strLinks == "" )  {
				strPlus = "";
			}
			else  {
				strPlus = "<td width=1 valign=top> <font size=1 color='"+corDoSeparador+"'>|</font> </td>";
			}
			strLinks = strLinks + strPlus + "<td height='1' onmouseout=this.bgColor='"+corFundoMenu+"' onmouseover=this.bgColor='"+backGroundColor+"'><a class='linkMenu' href='"+menuItens[t][2]+"'>&nbsp;" + menuItens[t][1] + "&nbsp;</a></td>";
		}
	}
	strLinks = strIni + strLinks + strFim;
	//Escreve o layer/div
	if (navg == 'ie')  {
	    document.write ("<div name=bannerie style='margin-top:"+topo+"' class=estilobanner id=estilobanner"+i+">"+strLinks+"</div>");
	}
	else
    {
		if ( document.layers )  {
			document.write ("<layer name=LayerImg style='margin-top:"+topo+"' id=LayerImg top=100 visibility=hidden z-index=4 left=375 width=380 height=50 bgcolor='#ffffff'>"+strLinks+"</layer>");
		}
		else  {
			document.write ("<div name=bannerie style='margin-top:"+topo+"' class=estilobanner id=estilobanner"+i+">"+strLinks+"</div>");
		}
	}
}

function apagatudo()  {
	for ( i=0; i<menu.length; i++ )  {
	    if (navg == 'ie') { //IE
			if ( document.all && !document.getElementById )  { // IE4
	        	document.elements["estilobanner"+i].style.visibility = 'hidden';
				imagem_atual = document.images["mnu" + i];
				imagem_atual.src = imagens[i][0];
			}
			else if (document.getElementById && document.body.style) { // IE - Últimas versões
				//alert("estilobanner" + qual);
				document.getElementById("estilobanner" + i).style.visibility="hidden";
				imagem_atual = document.getElementById("mnu" + i);
				imagem_atual.src = imagens[i][0];
			}
		}
	    else  {
			imagem_atual = document.images["mnu" + i];
			imagem_atual.src = imagens[i][0];
			if ( document.layers ) {//NS 4 e 6
				document.layers["LayerImg"+i].visibility = 'hide';
			}
			else  { //NS 7
				document.getElementById("estilobanner" + i).style.visibility="hidden";
			}
		}
	}
}

function MostraMenu(qual)
{
	apagatudo();
	
    if (navg == 'ie') { //IE
		
		if ( document.all && !document.getElementById )  { // IE4
        	document.elements["estilobanner"+qual].style.visibility = 'visible';
			// Troca a imagem do menu atual
			imagem_atual = document.images["mnu" + qual];
			imagem_atual.src = imagens[qual][1];
		}
		else if (document.getElementById && document.body.style) { // IE - Últimas versões
			//alert("estilobanner" + qual);
			document.getElementById("estilobanner" + qual).style.visibility="visible";
			// Troca a imagem do menu atual
			imagem_atual = document.getElementById("mnu" + qual);
			imagem_atual.src = imagens[qual][1];
		}
	}
    else  {
		// Troca a imagem do menu atual
		imagem_atual = document.images["mnu" + qual];
		imagem_atual.src = imagens[qual][1];
	
		if ( document.layers ) {//NS 4 e 6
			document.layers["LayerImg"+qual].visibility = 'show';
		}
		else  { //NS 7
			document.getElementById("estilobanner" + qual).style.visibility="visible";
			}
	}
}

