function botaoPadrao(texto, letras, link, target) { //letra n=normal d=desabilitado letras = letras.toLowerCase(); document.write(''); if (letras.substring(0,1) == "n") { document.write(''); document.write(''); document.write(''); } else { document.write(''); document.write(''); document.write(''); } document.write('
' + texto + '' + texto + '
'); } function botaoPadraoSub(texto, letras, link, target) { //letra n=normal d=desabilitado letras = letras.toLowerCase(); document.write(''); if (letras.substring(0,1) == "n") { document.write(''); document.write(''); document.write(''); } else { document.write(''); document.write(''); document.write(''); } document.write('
' + texto + '' + texto + '
'); } function botaoPadraoSubSub(texto, letras, link, target) { //letra n=normal d=desabilitado letras = letras.toLowerCase(); document.write(''); if (letras.substring(0,1) == "n") { document.write(''); document.write(''); document.write(''); } else { document.write(''); document.write(''); document.write(''); } document.write('
' + texto + '' + texto + '
'); } function botaoEventoNome(texto, letras, evento, nome){ letras = letras.toLowerCase(); document.write(''); if (letras.substring(0,1) == "n") { document.write(''); document.write(''); document.write(''); } else { document.write(''); document.write(''); document.write(''); } document.write('
' + texto + '' + texto + '
'); } function botaoEvento(texto, letras, link, evento, target){ letras = letras.toLowerCase(); document.write(''); if (letras.substring(0,1) == "n") { document.write(''); document.write(''); document.write(''); } else { document.write(''); document.write(''); document.write(''); } document.write('
' + texto + '' + texto + '
'); } function botaoDiv(texto, letras, link, id, target) { letras = letras.toLowerCase(); if (letras.substring(0,2) == "dd") { document.write('
'); document.write(''); document.write(''); document.write(''); document.write(''); document.write('
' + texto + '
'); document.write('
'); document.write(''); } else { // letras=dn document.write(''); document.write('
'); document.write(''); document.write(''); document.write(''); document.write(''); document.write('
' + texto + '
'); document.write('
'); } } function fGerenciaBotoes(form) { f = document.forms[form]; intNumItensSelecionados=contaCheckboxs(f); if (intNumItensSelecionados>0) { trocaStatusBotao('excluir1',true); trocaStatusBotao('excluir2',true); if (intNumItensSelecionados==1) { trocaStatusBotao('editar1',true); trocaStatusBotao('editar2',true); } else { trocaStatusBotao('editar1',false); trocaStatusBotao('editar2',false); } } else { trocaStatusBotao('excluir1',false); trocaStatusBotao('excluir2',false); trocaStatusBotao('editar1',false); trocaStatusBotao('editar2',false); } } function fGerenciaBotoesExcluir(form) { f = document.forms[form]; intNumItensSelecionados=contaCheckboxs(f); if (intNumItensSelecionados>0) { trocaStatusBotao('excluir1',true); trocaStatusBotao('excluir2',true); } else { trocaStatusBotao('excluir1',false); trocaStatusBotao('excluir2',false); } } function fGerenciaBotoesExcluirMultiplos(form, botao1, botao2,preCheck) { f = document.forms[form]; intNumItensSelecionados=contaCheckboxsMultiplos(f,preCheck); if (intNumItensSelecionados>0) { trocaStatusBotao(botao1,true); trocaStatusBotao(botao2,true); } else { trocaStatusBotao(botao1,false); trocaStatusBotao(botao2,false); } } function fGerenciaBotoesDetalhes(form) { f = document.forms[form]; intNumItensSelecionados=contaCheckboxs(f); if (intNumItensSelecionados>0) { trocaStatusBotao('excluir1',true); trocaStatusBotao('excluir2',true); if (intNumItensSelecionados==1) { trocaStatusBotao('detalhes1',true); trocaStatusBotao('detalhes2',true); trocaStatusBotao('editar1',true); trocaStatusBotao('editar2',true); } else { trocaStatusBotao('detalhes1',false); trocaStatusBotao('detalhes2',false); trocaStatusBotao('editar1',false); trocaStatusBotao('editar2',false); } } else { trocaStatusBotao('excluir1',false); trocaStatusBotao('excluir2',false); trocaStatusBotao('detalhes1',false); trocaStatusBotao('detalhes2',false); trocaStatusBotao('editar1',false); trocaStatusBotao('editar2',false); } } function fGerenciaBotoesDetalhes2(form) { f = document.forms[form]; intNumItensSelecionados=contaCheckboxs(f); if (intNumItensSelecionados>0) { trocaStatusBotao('excluir1',true); trocaStatusBotao('excluir2',true); trocaStatusBotao('editar1',true); trocaStatusBotao('editar2',true); if (intNumItensSelecionados==1) { trocaStatusBotao('detalhes1',true); trocaStatusBotao('detalhes2',true); } else { trocaStatusBotao('detalhes1',false); trocaStatusBotao('detalhes2',false); } } else { trocaStatusBotao('excluir1',false); trocaStatusBotao('excluir2',false); trocaStatusBotao('detalhes1',false); trocaStatusBotao('detalhes2',false); trocaStatusBotao('editar1',false); trocaStatusBotao('editar2',false); } } function fGerenciaBotoesDetalhes3(form) { f = document.forms[form]; intNumItensSelecionados=contaCheckboxs(f); if (intNumItensSelecionados>0) { if (intNumItensSelecionados==1) { trocaStatusBotao('detalhes1',true); trocaStatusBotao('detalhes2',true); } else { trocaStatusBotao('detalhes1',false); trocaStatusBotao('detalhes2',false); } } else { trocaStatusBotao('detalhes1',false); trocaStatusBotao('detalhes2',false); } } function trocaStatusBotao(div,habilita) { if (habilita) { document.all[div+'n'].style.display="inline"; document.all[div+'d'].style.display="none"; } else { document.all[div+'d'].style.display="inline"; document.all[div+'n'].style.display="none"; } } function contaCheckboxs(f) { intNumItensSelecionados=0; for (var j = 0; j < f.elements.length; j++ ) { if (f.elements[j].type == "checkbox") { if (f.elements[j].checked) { intNumItensSelecionados++; } } } return intNumItensSelecionados; } function contaCheckboxsMultiplos(f,preCheck) { intNumItensSelecionados=0; for (var j = 0; j < f.elements.length; j++ ) { if (f.elements[j].type == "checkbox") { if (f.elements[j].name.length >= preCheck.length) { if (f.elements[j].name.substring(0,preCheck.length)== preCheck && f.elements[j].checked) { intNumItensSelecionados++; } } } } return intNumItensSelecionados; } function contaRadios(f, preCheck){ intNumItens= 0; for (var j = 0; j < f.elements.length; j++ ) { if (f.elements[j].type == "radio") { if (f.elements[j].name.length >= preCheck.length) { if (f.elements[j].name.substring(0,preCheck.length)== preCheck) { intNumItens++; } } } } return intNumItens; } function contaRadiosSelecionados(f, preCheck){ intNumItens= 0; for (var j = 0; j < f.elements.length; j++ ) { if (f.elements[j].type == "radio") { if (f.elements[j].name.length >= preCheck.length) { if (f.elements[j].name.substring(0,preCheck.length)== preCheck && f.elements[j].checked) { intNumItens++; } } } } return intNumItens; } function fGerenciaBotoesEscrita(form) { f = document.forms[form]; intNumItensSelecionados=contaCheckboxs(f); if (intNumItensSelecionados>0) { trocaStatusBotao('excluir1',true); trocaStatusBotao('excluir2',true); if (intNumItensSelecionados==1) { trocaStatusBotao('detalhes1',true); trocaStatusBotao('detalhes2',true); trocaStatusBotao('editar1',true); trocaStatusBotao('editar2',true); } else { trocaStatusBotao('detalhes1',false); trocaStatusBotao('detalhes2',false); trocaStatusBotao('editar1',false); trocaStatusBotao('editar2',false); } } else { trocaStatusBotao('excluir1',false); trocaStatusBotao('excluir2',false); trocaStatusBotao('detalhes1',false); trocaStatusBotao('detalhes2',false); trocaStatusBotao('editar1',false); trocaStatusBotao('editar2',false); } } function fGerenciaBotoesLeitura(form) { f = document.forms[form]; intNumItensSelecionados=contaCheckboxs(f); if (intNumItensSelecionados>0) { if (intNumItensSelecionados==1) { trocaStatusBotao('detalhes1',true); trocaStatusBotao('detalhes2',true); } else { trocaStatusBotao('detalhes1',false); trocaStatusBotao('detalhes2',false); } } else { trocaStatusBotao('detalhes1',false); trocaStatusBotao('detalhes2',false); } } function fLinkEditar(target,form,view){ f = document.forms[form]; for (var j = 0; j < f.elements.length; j++ ) { if (f.elements[j].type == "checkbox") { if (f.elements[j].checked) { window.location.href = target + '?jboEvent=Edit&viewobject=' + view + '&jboRowKey=' + f.elements[j].value; } } } } function fLinkGenerico (link) { if (link!=null && link!="") { window.location.href = link; } } /*function fLinkEditarExtra(target,form,view, extraparameters){ f = document.forms[form]; for (var j = 0; j < f.elements.length; j++ ) { if (f.elements[j].type == "checkbox") { if (f.elements[j].checked) { window.location.href = target + '?jboEvent=Edit&viewobject=' + view + '&jboRowKey=' + f.elements[j].value + extraparameters; } } } } */ function fLinkDetalhes(target,form,view){ f = document.forms[form]; for (var j = 0; j < f.elements.length; j++ ) { if (f.elements[j].type == "checkbox") { if (f.elements[j].checked) { window.location.href = target + '?viewobject=' + view + '&jboRowKey=' + f.elements[j].value; } } } } function t(width, height) { document.write(''); } function abreJanela(url, nome, largura, altura) { var newwindow = window.open(url, nome, 'location=no,menubar=no,status=no,scrollbars=yes,resizable=no,width=' + largura +',height='+ altura); newwindow.focus(); } function linha(altura) { if (altura==null) altura=1; document.write(''); document.write(''); document.write(''); document.write('
'); document.write('
'); } function trocarTabsGeneralizado( tab , numTabs ){ var i; for (i=0; i < numTabs; i++ ) { if (i == tab) { document.all[ 'tab'+ i ].style.display='inline'; document.all[ 'conteudotab' + i ].style.display='inline'; } else { document.all[ 'tab'+ i ].style.display='none'; document.all[ 'conteudotab' + i ].style.display='none'; } } } function trocarTabs( tab ){ switch( tab ){ case 0: if(document.all['numTab']) document.all['numTab'].value = '0' document.all[ 'tab0' ].style.display='inline'; document.all[ 'tab1' ].style.display='none'; if (document.all[ 'tab2' ]) document.all[ 'tab2' ].style.display='none'; if (document.all[ 'tab3' ]) document.all[ 'tab3' ].style.display='none'; if (document.all[ 'tab4' ]) document.all[ 'tab4' ].style.display='none'; if (document.all[ 'tab5' ]) document.all[ 'tab5' ].style.display='none'; if (document.all[ 'tab6' ]) document.all[ 'tab6' ].style.display='none'; document.all[ 'conteudotab0' ].style.display='inline'; document.all[ 'conteudotab1' ].style.display='none'; if (document.all[ 'conteudotab2' ]) document.all[ 'conteudotab2' ].style.display='none'; if (document.all[ 'conteudotab3' ]) document.all[ 'conteudotab3' ].style.display='none'; if (document.all[ 'conteudotab4' ]) document.all[ 'conteudotab4' ].style.display='none'; if (document.all['filtroAtivo1']){ document.all[ 'filtroAtivo1' ].style.display='inline'; document.all[ 'filtroInativo1' ].style.display='none'; } if (document.all['filtroAtivo2']){ document.all[ 'filtroAtivo2' ].style.display='inline'; document.all[ 'filtroInativo2' ].style.display='none'; } if (document.all['filtroUserName']){ document.all['filtroUserName'].style.display='inline'; document.all['filtroUserBody'].style.display='inline'; } if (document.fNotificacoes) if (document.fNotificacoes.flgDocumento) document.fNotificacoes.flgDocumento.value=""; break; case 1: if(document.all['numTab']) document.all['numTab'].value = '1' document.all[ 'tab1' ].style.display='inline'; document.all[ 'tab0' ].style.display='none'; if (document.all[ 'tab2' ]) document.all[ 'tab2' ].style.display='none'; if (document.all[ 'tab3' ]) document.all[ 'tab3' ].style.display='none'; if (document.all[ 'tab4' ]) document.all[ 'tab4' ].style.display='none'; if (document.all[ 'tab5' ]) document.all[ 'tab5' ].style.display='none'; if (document.all[ 'tab6' ]) document.all[ 'tab6' ].style.display='none'; document.all[ 'conteudotab1' ].style.display='inline'; document.all[ 'conteudotab0' ].style.display='none'; if (document.all[ 'conteudotab2' ]) document.all[ 'conteudotab2' ].style.display='none'; if (document.all[ 'conteudotab3' ]) document.all[ 'conteudotab3' ].style.display='none'; if (document.all[ 'conteudotab4' ]) document.all[ 'conteudotab4' ].style.display='none'; if (document.all['filtroAtivo1']){ document.all[ 'filtroAtivo1' ].style.display='inline'; document.all[ 'filtroInativo1' ].style.display='none'; } if (document.all['filtroAtivo2']){ document.all[ 'filtroAtivo2' ].style.display='inline'; document.all[ 'filtroInativo2' ].style.display='none'; } if (document.all['filtroUserName']){ document.all['filtroUserName'].style.display='none'; document.all['filtroUserBody'].style.display='none'; } if (document.fNotificacoes) if (document.fNotificacoes.flgDocumento) document.fNotificacoes.flgDocumento.value=""; break; case 2: if(document.all['numTab']) document.all['numTab'].value = '2' document.all[ 'tab2' ].style.display='inline'; document.all[ 'tab0' ].style.display='none'; document.all[ 'tab1' ].style.display='none'; if (document.all[ 'tab3' ]) document.all[ 'tab3' ].style.display='none'; if (document.all[ 'tab4' ]) document.all[ 'tab4' ].style.display='none'; if (document.all[ 'tab5' ]) document.all[ 'tab5' ].style.display='none'; if (document.all[ 'tab6' ]) document.all[ 'tab6' ].style.display='none'; document.all[ 'conteudotab2' ].style.display='inline'; document.all[ 'conteudotab0' ].style.display='none'; document.all[ 'conteudotab1' ].style.display='none'; if (document.all[ 'conteudotab3' ]) document.all[ 'conteudotab3' ].style.display='none'; if (document.all[ 'conteudotab4' ]) document.all[ 'conteudotab4' ].style.display='none'; if (document.all['filtroAtivo1']){ document.all[ 'filtroAtivo1' ].style.display='none'; document.all[ 'filtroInativo1' ].style.display='inline'; } if (document.all['filtroAtivo2']){ document.all[ 'filtroAtivo2' ].style.display='none'; document.all[ 'filtroInativo2' ].style.display='inline'; } if (document.fNotificacoes) if (document.fNotificacoes.flgDocumento) document.fNotificacoes.flgDocumento.value="1"; break; case 3: document.all[ 'tab3' ].style.display='inline'; document.all[ 'tab2' ].style.display='none'; document.all[ 'tab0' ].style.display='none'; document.all[ 'tab1' ].style.display='none'; if (document.all[ 'tab4' ]) document.all[ 'tab4' ].style.display='none'; if (document.all[ 'tab5' ]) document.all[ 'tab5' ].style.display='none'; if (document.all[ 'tab6' ]) document.all[ 'tab6' ].style.display='none'; document.location.href = "../tramitacao/lst_receber.jsp" break; case 4: document.all[ 'tab4' ].style.display='inline'; document.all[ 'tab3' ].style.display='none'; document.all[ 'tab2' ].style.display='none'; document.all[ 'tab0' ].style.display='none'; document.all[ 'tab1' ].style.display='none'; if (document.all[ 'tab5' ]) document.all[ 'tab5' ].style.display='none'; if (document.all[ 'tab6' ]) document.all[ 'tab6' ].style.display='none'; document.location.href = "../tramitacao/lst_encaminhar.jsp" break; case 5: document.all[ 'tab5' ].style.display='inline'; document.all[ 'tab6' ].style.display='none'; document.all[ 'tab4' ].style.display='none'; document.all[ 'tab3' ].style.display='none'; document.all[ 'tab2' ].style.display='none'; document.all[ 'tab0' ].style.display='none'; document.all[ 'tab1' ].style.display='none'; document.location.href = "../analise/referencia.jsp" break; case 6: document.all[ 'tab6' ].style.display='inline'; document.all[ 'tab5' ].style.display='none'; document.all[ 'tab4' ].style.display='none'; document.all[ 'tab3' ].style.display='none'; document.all[ 'tab2' ].style.display='none'; document.all[ 'tab0' ].style.display='none'; document.all[ 'tab1' ].style.display='none'; document.location.href = "../analise/produtividade.jsp" break; } }