// script actualizado a 15/5/2004 por Mário Oliveira

function criaArvore( tabelaMenus, displayBlock, subMenu ){
	var x, xTexto
	for( x = 0; x < tabelaMenus.length; x++ ){
		if ( typeof tabelaMenus[ x ][ 1 ] == "string" ){ //link
			textoHTML += '<div style="margin-left: 16px;" class="bordaLink"><a class="menuLink" href="' + tabelaMenus[ x ][ 1 ] + 
			'" target="' + tabelaMenus[ x ][ 2 ] + '">' +	tabelaMenus[ x ][ 0 ] + '</a></div>'
		}else{ //novo menu
			xTexto = x
			if ( xTexto < 10 ) xTexto = "0" + x
			textoHTML += '<div style="margin-left:6px;"><table border="0" cellspacing="0" cellpadding="0"><tr>' +
				'<td width="9" height="14" style="background: url(cruz.gif) no-repeat;">&nbsp;</td>' + 
				'<td valign="bottom"><div style="margin-left: 0px;">' + 
				'<a class="menuTitulo" href="javascript:;" onmouseover="window.status=\'\'; return true" ' +
				'onclick="mudar(\'' + subMenu + x + '\')">' +	tabelaMenus[ x ][ 0 ] + '</a></div></td></tr></table></div>'
				
			textoHTML += '<div id="' + subMenu + x + '" style="display:none; margin-left:9px; border-left:solid 1px #808000;">'
			criaArvore( tabelaMenus[ x ][ 1 ], false, subMenu + xTexto )
			textoHTML += '</div>'
		}
	}
}

function mudar( objectoId){
	objLinks = document.getElementById( objectoId )
	if ( objLinks.style.display == "none" ){
		objLinks.style.display = "block"
	}else{
		objLinks.style.display ="none"
	}
}