/** * Title: Gadgets (objetos marginais do mapa) * * Inclui elementos especiais no mapa * * Os elementos são opcionais e adicionam funcionalidades ao mapa. * * Namespace: * * i3GEO.gadgets * * Veja: * * */ /** * * Licença * * GPL2 * * i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet * * Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com * * Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo sob os termos da Licença * Pública Geral GNU conforme publicada pela Free Software Foundation; * * Este programa é distribuído na expectativa de que seja útil, porém, SEM NENHUMA GARANTIA; nem mesmo a * garantia implícita de COMERCIABILIDADE OU ADEQUACAtilde;O A UMA FINALIDADE ESPECÍFICA. Consulte a Licença * Pública Geral do GNU para mais detalhes. Você deve ter recebido uma cópia da Licença Pública Geral do * GNU junto com este programa; se não, escreva para a Free Software Foundation, Inc., no endereço 59 Temple Street, Suite * 330, Boston, MA 02111-1307 USA. */ if (typeof (i3GEO) === 'undefined') { var i3GEO = {}; } i3GEO.gadgets = { /** * Propriedade: PARAMETROS * * Parâmetros de inicialização dos gadgets. * * Essa variável define os parametros individuais de cada gadget e o ID do elemento HTML onde o gadget será * incluído (parametro "idhtml"). * * Cada tipo de gadget pode ter parametros específicos, descritos a seguir. * * Você pode acessar os parâmetros da seguinte forma: * * i3GEO.gadgets.PARAMETROS.mostraMenuSuspenso.deslocaEsquerda = 400; * * Para evitar o funcionamento de um gadget experimente utilizar * * Exemplo: * * i3GEO.gadgets.PARAMETROS.mostraInserirKml.idhtml = ""; * * Default: * * (start code) * * i3GEO.gadgets.PARAMETROS = { "mostraInserirKml" : { idhtml : "inserirKml" }, "mostraEscalaNumerica" : { idhtml : "escala" }, * "mostraEscalaGrafica" : { idhtml : "escalaGrafica" }, "mostraBuscaRapida" : { idhtml : "buscaRapida", servicosexternos : true, * temasmapa : false, google : true }, "mostraVisual" : { idhtml : "" }, "mostraHistoricoZoom" : { idhtml : "historicozoom" }, * "mostraMenuSuspenso" : { permiteLogin : true, marcadores : true, idhtml : "menus", deslocaEsquerda : 0, parametrosYUI : { iframe : * false, autosubmenudisplay : false, showdelay : 200, hidedelay : 500, lazyload : false } }, "mostraMenuLista" : { idhtml : * "menuLista" }, "mostraVersao" : { idhtml : "versaoi3geo" }, "mostraEmail" : { idhtml : "emailInstituicao" } }; * * (end) */ PARAMETROS : { "mostraInserirKml" : { idhtml : "inserirKml" }, "mostraEscalaNumerica" : { idhtml : "escala" }, "mostraEscalaGrafica" : { idhtml : "escalaGrafica" }, "mostraBuscaRapida" : { idhtml : "buscaRapida", servicosexternos : true, temasmapa : false, google : true }, "mostraVisual" : { idhtml : "" }, "mostraHistoricoZoom" : { idhtml : "historicozoom" }, "mostraMenuSuspenso" : { permiteLogin : true, marcadores : true, idhtml : "menus", deslocaEsquerda : 0, menuUnico : false, parametrosYUI : { iframe : false, autosubmenudisplay : false, showdelay : 200, hidedelay : 500, lazyload : false } }, "mostraMenuLista" : { idhtml : "menuLista" }, "mostraVersao" : { idhtml : "versaoi3geo" }, "mostraEmail" : { idhtml : "emailInstituicao" } }, /** * Function: mostraEmail * * Mostra o e-mail armazenado na variável i3GEO.parametros.emailInstituicao * * Parametro: * * {String} - id do elemento HTML que receberá o resultado. Esse id por default é obtido de i3GEO.gadgets.PARAMETROS */ mostraEmail : function(id) { if (typeof (console) !== 'undefined') console.info("i3GEO.gadgets.mostraEmail()"); if (arguments.length === 0 || id === "") { id = i3GEO.gadgets.PARAMETROS.mostraEmail.idhtml; } else { i3GEO.gadgets.PARAMETROS.mostraEmail.idhtml = id; } i3GEO.util.defineValor(id, "innerHTML", i3GEO.parametros.emailInstituicao); }, /** * Function: mostraVersao * * Mostra a versão atual do i3Geo armazenada na variável i3GEO.parametros.mensageminicial * * Parametro: * * {String} - id do elemento HTML que receberá o resultado. Esse id por default é obtido de i3GEO.gadgets.PARAMETROS */ mostraVersao : function(id) { if (typeof (console) !== 'undefined') console.info("i3GEO.gadgets.mostraVersão()"); if (arguments.length === 0 || id === "") { id = i3GEO.gadgets.PARAMETROS.mostraVersao.idhtml; } else { i3GEO.gadgets.PARAMETROS.mostraVersao.idhtml = id; } i3GEO.util.defineValor(id, "innerHTML", i3GEO.parametros.mensageminicia); }, /** * Function: mostraInserirKml * * Mostra no mapa a a opção para inserir kml. * * Essa opção só funciona com a API do Google carregada * * Se você não quer essa função no mapa, elimine o elemento HTML existente no mapa que contenha o id * definido em i3GEO.gadgets.PARAMETROS.mostraInserirKml.idhtml * * Parametro: * * {String} - id do elemento HTML que receberá o resultado. Esse id por default é obtido de * i3GEO.gadgets.PARAMETROS.mostraInserirKml.idhtml */ mostraInserirKml : function(id) { if (typeof (console) !== 'undefined') console.info("i3GEO.gadgets.mostraInserirKml()"); var i, ins, temp; if (arguments.length === 0) { id = i3GEO.gadgets.PARAMETROS.mostraInserirKml.idhtml; } if ($i(id)) { if (!$i("i3geo_urlkml")) { i = $inputText(id, "290", "i3geo_urlkml", "kml url", "35", "kml"); ins = "
" + i; temp = 'i3GEO.Interface.adicionaKml();'; ins += "
"; $i(id).innerHTML = ins; } } }, /** * Function: mostraEscalaNumerica * * Mostra no mapa a escala numérica. * * A escala numérica pode ser alterada pelo usuário digitando-se a nova escala. * * Se você não quer essa função no mapa, elimine o elemento HTML existente no mapa que contenha o id * definido em i3GEO.gadgets.PARAMETROS * * Parametro: * * {String} - id do elemento HTML que receberá o resultado. Esse id por default é obtido de i3GEO.gadgets.PARAMETROS */ mostraEscalaNumerica : function(id) { if (typeof (console) !== 'undefined') console.info("i3GEO.gadgets.mostraEscalaNumerica()"); var i, ins, temp, onde; if (arguments.length === 0) { id = i3GEO.gadgets.PARAMETROS.mostraEscalaNumerica.idhtml; } onde = $i(id); if (onde) { if (onde.style.display == "none") { onde.style.display = "block"; } if (!$i("i3geo_escalanum")) { i = "
" + $inputText(id, "100", "i3geo_escalanum", $trad("d10"), "10", parseInt( i3GEO.parametros.mapscale, 10)) + "
"; ins = "
" + i; temp = 'var nova = document.getElementById("i3geo_escalanum").value;'; temp += 'i3GEO.navega.aplicaEscala(i3GEO.configura.locaplic,i3GEO.configura.sid,nova);'; ins += "
"; onde.innerHTML = ins; $i("i3GEOescalanumForm").onsubmit = function() { i3GEO.navega.aplicaEscala(i3GEO.configura.locaplic, i3GEO.configura.sid, document .getElementById("i3geo_escalanum").value); return false; }; } i3GEO.eventos.adicionaEventos("NAVEGAMAPA", [ "i3GEO.gadgets.atualizaEscalaNumerica()" ]); } }, atualizaEscalaNumerica : function(escala) { var e = $i("i3geo_escalanum"); if (!e) { i3GEO.eventos.removeEventos("NAVEGAMAPA", [ "i3GEO.gadgets.atualizaEscalaNumerica()" ]); return; } if (arguments.length === 1) { e.value = escala; } else { if (i3GEO.parametros.mapscale !== "") { e.value = parseInt(i3GEO.parametros.mapscale, 10); } else { e.value = 0; } } }, /** * Function: mostraEscalaGrafica * * Mostra no mapa a escala grafica como um elemento fora do mapa. * * Se você não quer essa função no mapa, elimine o elemento HTML existente no mapa que contenha o id * definido em i3GEO.gadgets.PARAMETROS(escala) * * Parametro: * * {String} - id do elemento HTML que receberá o resultado. Esse id por default é obtido de i3GEO.gadgets.PARAMETROS */ mostraEscalaGrafica : function(id) { if (arguments.length === 0) { id = i3GEO.gadgets.PARAMETROS.mostraEscalaGrafica.idhtml; } var ins; if ($i(id)) { if (!$i("imagemEscalaGrafica")) { ins = ""; $i(id).innerHTML = ins; } i3GEO.gadgets.atualizaEscalaGrafica(); i3GEO.eventos.adicionaEventos("NAVEGAMAPA", [ "i3GEO.gadgets.atualizaEscalaGrafica()" ]); } }, /** * Function: atualizaEscalaGrafica * * Atualiza a escala gráfica * */ atualizaEscalaGrafica : function() { var e = $i("imagemEscalaGrafica"); if (!e) { i3GEO.eventos.removeEventos("NAVEGAMAPA", [ "i3GEO.gadgets.atualizaEscalaGrafica()" ]); return; } temp = function(retorno) { eval(retorno.data); $i("imagemEscalaGrafica").src = scaimagem; }; i3GEO.php.escalagrafica(temp); }, /** * Function: mostraBuscaRapida * * Mostra a opção de busca rápida de lugares por palavra digitada. * * Se você não quer essa função no mapa, elimine o elemento HTML existente no mapa que contenha o id * definido em i3GEO.gadgets.PARAMETROS (buscaRapida) * * Onde a busca será feita é controlado pela variável i3GEO.gadgets.PARAMETROS.mostraBuscaRapida * * Parametro: * * {String} - id do elemento HTML que receberá o resultado. Esse id por default é obtido de i3GEO.gadgets.PARAMETROS */ mostraBuscaRapida : function(id) { // TODO implementar a separacao do template mustache em arquivos em disco if (typeof (console) !== 'undefined') console.info("i3GEO.gadgets.mostraBuscaRapida()"); var ins, temp, fbusca, hashMustache, templateMustache; if (arguments.length === 0) { id = i3GEO.gadgets.PARAMETROS.mostraBuscaRapida.idhtml; } i3GEO.gadgets.mostraBuscaRapida.id = id; temp = $i(id); if (temp) { // monta a interface hashMustache = { "idform" : "i3GEObotaoFormBuscaRapida" + id, "idinput" : "valorBuscaRapida" + id, "link" : i3GEO.configura.locaplic + "/ajuda_usuario.php?idcategoria=8&idajuda=71", "branco" : i3GEO.configura.locaplic + "/imagens/branco.gif", "ajuda" : $trad("p13"), "prop" : "i3GEObotaoPropriedadesBuscaRapida" + id, "busca" : "i3GEObotaoBuscaRapida" + id }; templateMustache = "" + "" + " " + " " + " " + " " + "
" + "
" + "
" + "
" + "
"; ins = Mustache.render(templateMustache, hashMustache); temp.innerHTML = ins; // funcao de busca fbusca = function() { // sem condicoes de busca if (i3GEO.gadgets.PARAMETROS.mostraBuscaRapida.google === false && i3GEO.gadgets.PARAMETROS.mostraBuscaRapida.servicosexternos === false && i3GEO.gadgets.PARAMETROS.mostraBuscaRapida.temasmapa === false) { i3GEO.janela.tempoMsg($trad("x35")); return; } // nao digitou palavra if ($i("valorBuscaRapida" + id).value === "") { i3GEO.janela.tempoMsg($trad("x36")); return; } // janela com a rotina e o resultado da busca i3GEO.janela.cria("300px", "280px", i3GEO.configura.locaplic + "/ferramentas/buscarapida/index.htm", "", "", "
"+$trad("o2")+"
"); return false; }; $i("i3GEObotaoBuscaRapida" + id).onclick = fbusca; $i("i3GEObotaoFormBuscaRapida" + id).onsubmit = fbusca; $i("i3GEObotaoPropriedadesBuscaRapida" + id).onclick = function() { var janela, hashMustache, templateMustache, ins, interno = "", externo = "", google = ""; if (i3GEO.gadgets.PARAMETROS.mostraBuscaRapida.servicosexternos) { externo = "checked"; } if (i3GEO.gadgets.PARAMETROS.mostraBuscaRapida.temasmapa) { interno = "checked"; } if (i3GEO.gadgets.PARAMETROS.mostraBuscaRapida.google) { google = "checked"; } hashMustache = { "externo" : externo, "interno" : interno, "google" : google, "titulo" : $trad("x37"), "servExt" : $trad("x38"), "servMap" : $trad("x39"), "googlemaps" : false, "ajuda" : $trad("x40") }; if (i3GEO.Interface.ATUAL === "googlemaps") { hashMustache["googlemaps"] = true; } templateMustache = "" + "

{{titulo}}:

" + "" + " " + " " + " " + " " + " " + " " + " " + " " + "{{#googlemaps}}" + " " + " " + " " + " " + "{{/googlemaps}}" + "
{{servExt}}
{{servMap}}
Google

{{ajuda}}

"; ins = i3GEO.util.parseMustache(templateMustache, hashMustache); janela = i3GEO.janela.cria("300px", "150px", "", "", "", "
"+$trad("s5")+"
", "i3GEOpropriedadesBuscaRapida" + id); janela[0].setBody("
" + ins + "
"); }; } }, /** * Function: mostraHistoricoZoom * * Mostra na barra de zoom os ícones que controlam a visualização do histórico da * navegação sobre o mapa * * Parametro: * * {String} - id do elemento HTML que receberá o resultado. Esse id por default é obtido de i3GEO.gadgets.PARAMETROS */ mostraHistoricoZoom : function(id) { if (typeof (console) !== 'undefined') console.info("i3GEO.gadgets.mostraHistoricoZoom()"); if (arguments.length === 0) { id = i3GEO.gadgets.PARAMETROS.mostraHistoricoZoom.idhtml; } if ($i(id)) { marcadorZoom = ""; var ins = ""; } else { ins += "6px;'>"; } ins += ""; ins += ""; ins += ""; ins += "
 
"; $i(id).innerHTML = ins; } }, /** * i3GEO.gadgets.visual (depreciado) * * Gera os ícones e controla as opções de modificação do visual do mapa. * * O visual consiste na definição dos ícones utilizados no mapa. O visual pode ser modificado na * inicialização ou então escolhido pelo usuário. * * Os visuais disponíveis são definidos no servidor e consistem em diretórios localizados em * i3geo/imagens/visual. A lista de visuais disponíveis é obtida na inicialização do i3geo. * * Os ícones para mudança do visual são incluídos no elemento HTML definido em * i3geo.gadgets.PARAMETROS.visual */ visual : { /** * Constrói os ícones de escolha do visual. * * Parametro: * * id {String} - id do elemento que receberá os ícones (opcional) */ inicia : function(id) { alert("A i3GEO.gadgets.visual foi depreciado"); }, /** * Troca o visual atual. A lista de visuais disponíveis é obtida em i3GEO.parametros.listavisual * * Parametro: * * visual {String} - nome do visual que será utilizado. */ troca : function(visual) { alert("A i3GEO.gadgets.visual foi depreciado"); } }, /** * Function: mostraMenuSuspenso * * Mostra o menu suspenso com opções extras de análise, ajuda, etc * * Paradefinir os ícones existentes nos elementos principais do menu, edite o arquivo i3geo/css/botoes2.css e acrescente o * estilo desejado. Utilize # para se referenciar ao elemento, cujo identificador é composto por "menu"+chave, exemplo * #menuinterface ou #menuajuda * * O objeto YAHOO.widget.MenuBar resultante pode ser obtido na variável i3GEOoMenuBar * * i3GEOoMenuBar pode ser manipulado com os métodos da biblioteca YUI * * Exemplo: * * (start code) i3GEOoMenuBar.getMenuItem("omenudataInterface1").cfg.setProperty("text", "zzzzzz"); * * i3GEOoMenuBar.getMenuItem("omenudataInterface1").destroy(); (end) * * Para executar uma operação após o menu ser montado, utilize a propriedade * i3GEO.gadgets.PARAMETROS.mostraMenuSuspenso.finaliza, por exemplo (a string é executada por meio da função * eval do javascript) * * Exemplo: * * (start code) i3GEO.gadgets.PARAMETROS.mostraMenuSuspenso.finaliza = * 'i3GEOoMenuBar.getMenuItem("omenudataInterface1").cfg.setProperty("text", "");'; (end) * * O conteúdo do menu é baseado na variável i3GEO.configura.oMenuData * * Parametro: * * {String} - id do elemento HTML que receberá o resultado. Esse id por default é obtido de i3GEO.gadgets.PARAMETROS */ mostraMenuSuspenso : function(id) { if (typeof (console) !== 'undefined') console.info("i3GEO.gadgets.mostraMenuSuspenso()"); var menuUnico, objid, i, estilo, t, onMenuBarBeforeRender, temp, i3GEOoMenuBarLocal, ms = i3GEO.gadgets.PARAMETROS.mostraMenuSuspenso, confm = i3GEO.configura.oMenuData, ins = "", alinhamento = ""; if (arguments.length === 0) { id = ms.idhtml; } else { ms.idhtml = id; } objid = $i(id); if (!objid) { return; } // cria o menu se ainda não existir if (i3GEO.util.trim(objid.innerHTML) === "") { try { if (ms.marcadores === true) { // complementa o array com os dados para o menu de // marcadores i3GEO.configura.oMenuData = i3GEO.marcador.adicionaMenuSuspenso(i3GEO.configura.oMenuData); } } catch (e) { } // inclui opcoes admin try { if (ms.permiteLogin === true || (ms.permiteLogin != false && i3GEO.parametros.editor === "sim")) { i3GEO.configura.oMenuData = i3GEO.login.adicionaMenuSuspenso(i3GEO.configura.oMenuData); } } catch (e) { } // monta um menu unico menuUnico = function(){ var menu = i3GEO.configura.oMenuData.menu, submenus = i3GEO.configura.oMenuData.submenus, menuUnico = {}, n = 0, s, tempMenu, m = 0, idts, idt; menuUnico["menu"] = [ { nome : " MENU", id : "menuUnico" } ]; menuUnico["submenus"] = { "menuUnico" : [] }; for (n in menu) { if (menu[n].id) { s = submenus[menu[n].id]; tempMenu = []; for (m in s) { if (s[m].url) { tempMenu.push(s[m]); } else{ if (s[m].submenu && s[m].submenu.itemdata) { idts = s[m].submenu.itemdata[0]; tempMenu.push({ text: s[m].text }); for (idt = 0; idt < idts.length; idt++) { tempMenu.push(idts[idt]); } } } } if(tempMenu.length > 0){ menuUnico["submenus"]["menuUnico"].push({ id : menu[n].id + "Menu", text : menu[n].nome, submenu : { id : menu[n].id + "Sub", itemdata : [ tempMenu ] } }); } } } i3GEO.configura.oMenuData = menuUnico; confm = i3GEO.configura.oMenuData; }; if(i3GEO.parametros.w < 700 || ms.menuUnico === true){ menuUnico(); } i3GEOoMenuBar = YAHOO.widget.MenuManager; if (objid) { objid.className = "yuimenubar"; temp = $i("contemMenu"); if (temp) { temp.className = "yui-navset"; } if (ms.deslocaEsquerda) { alinhamento = "left:" + ms.deslocaEsquerda * -1 + "px;"; } // ajusta a altura caso não tenha sido especificado no // HTML if (temp && (!temp.style.height || parseInt(temp.style.height) === 0)) { temp.style.height = "30px"; } if (objid.style.height && parseInt(objid.style.height, 10) === 0) { objid.style.height = "0px"; } ins += '
' + ''; ins += '
'; objid.innerHTML = ins; if (i3GEO.Interface.ATUAL === "googleearth") { i3GEO.gadgets.PARAMETROS.mostraMenuSuspenso.parametrosYUI.iframe = true; } i3GEOoMenuBarLocal = new YAHOO.widget.MenuBar(id, i3GEO.gadgets.PARAMETROS.mostraMenuSuspenso.parametrosYUI); onMenuBarBeforeRender = function(p_sType, p_sArgs) { var nomeMenu = "", nomeSub, subs = i3GEO.configura.oMenuData.submenus, conta = 0; for (nomeMenu in subs) { if ($i("menu" + nomeMenu)) { nomeSub = subs[nomeMenu]; if (nomeSub !== "") { i3GEOoMenuBarLocal.getItem(conta).cfg.setProperty('submenu', { id : nomeMenu, itemdata : nomeSub }); } conta += 1; } } }; // esses eventos fazem com que os itens de um menu fiquem sempre // sobre outros elementos do mapa temp = $i("contemMenu"); if (temp) { i3GEOoMenuBarLocal.subscribe("beforeShow", function() { $i("contemMenu").style.zIndex = 5000; return; }, i3GEO.configura.oMenuData.submenus); i3GEOoMenuBarLocal.subscribe("beforeHide", function() { $i("contemMenu").style.zIndex = 1; return; }, i3GEO.configura.oMenuData.submenus); } i3GEOoMenuBar.addMenu(i3GEOoMenuBarLocal); i3GEOoMenuBarLocal.beforeRenderEvent.subscribe(onMenuBarBeforeRender); i3GEOoMenuBarLocal.render(); } } // // marca o tipo de interface em uso // temp = [ "omenudataInterface1", "omenudataInterface2", "omenudataInterface3", "omenudataInterface4", "omenudataInterface5" ]; n = temp.length; while (n > 0) { n -= 1; i = i3GEOoMenuBar.getMenuItem(temp[n]); if (i) { i.cfg.setProperty("checked", false); } } try { temp = ""; switch (i3GEO.Interface.ATUAL) { case "openlayers": temp = "omenudataInterface2"; break; case "googlemaps": temp = "omenudataInterface4"; break; case "googleearth": temp = "omenudataInterface5"; break; } if (temp != "" && $i(temp)) { i3GEOoMenuBar.getMenuItem(temp).cfg.setProperty("checked", true); } } catch (e) { if (typeof (console) !== 'undefined') console.warning("i3GEO.gadgets.mostraMenuSuspenso() "); } // // desabilita opções em interfaces específicas // temp = [ "omenudataFerramentas7b", "omenudataArquivos3", "omenudataJanelas1", "omenudataJanelas3", "omenudataFerramentas2a" ]; n = temp.length; while (n > 0) { n -= 1; i = i3GEOoMenuBar.getMenuItem(temp[n]); if (i) { i.cfg.setProperty("disabled", false); } } try { temp = []; switch (i3GEO.Interface.ATUAL) { case "openlayers": temp = [ "omenudataArquivos3", "omenudataJanelas1" ]; break; case "googlemaps": temp = [ "omenudataArquivos3", "omenudataJanelas1", "omenudataJanelas3" ]; break; case "googleearth": temp = [ "omenudataFerramentas7b", "omenudataArquivos3", "omenudataJanelas3", "omenudataFerramentas2a" ]; break; } ; n = temp.length; while (n > 0) { n -= 1; i = i3GEOoMenuBar.getMenuItem(temp[n]); if (i) { i.cfg.setProperty("disabled", true); } } } catch (e) { } // // corrige problemas de estilo // temp = objid.style; temp.backgroundPosition = "0px -1px"; temp.border = "0px solid white"; // if(navm) // {temp.borderBottom = "2px solid white";} // if(navm && i3GEO.Interface.ATUAL === "googlemaps") // {temp.border = "2px dotted white";} if (ms.finaliza && ms.finaliza != "") { eval(ms.finaliza); } }, /** * Function: mostraMenuLista * * Mostra as opções existentes no menu suspenso porém na forma de uma lista de opções * * O conteúdo do menu é baseado na variável i3GEO.configura.oMenuData * * Parametro: * * {String} - id do elemento HTML que receberá o resultado. Esse id por default é obtido de i3GEO.gadgets.PARAMETROS */ mostraMenuLista : function(id) { var objid, n, i, sub, nomeMenu = "", ms = i3GEO.gadgets.PARAMETROS.mostraMenuLista, confm = i3GEO.configura.oMenuData, ins = "", subs = i3GEO.configura.oMenuData.submenus; if (arguments.length === 0) { id = ms.idhtml; } else { ms.idhtml = id; } objid = $i(id); if (objid) { n = confm.menu.length; for (i = 0; i < n; i += 1) { ins += ''; } objid.innerHTML = ins; for (nomeMenu in subs) { if ($i("menulista_" + nomeMenu)) { sub = subs[nomeMenu]; n = sub.length; ins = ""; for (i = 0; i < n; i++) { ins += "

" + sub[i].text + ""; } $i("menulista_" + nomeMenu).innerHTML += ins; } } } } };