﻿function subOn(obj){
    var objeto = document.getElementById(obj);
    objeto.style.display = "block";
}
function subOut(obj){
    var objeto = document.getElementById(obj);
    objeto.style.display = "none";
}
var statusPalito = 1;
function subPalito(obj){
    var objeto = document.getElementById(obj);
    if(statusPalito == 1){
        objeto.style.display = "block";
        statusPalito = 0;
    }else{
        objeto.style.display = "none";
        statusPalito = 1;
    }        
}

function on(menu){
    botao = document.getElementById(menu);
    botao.src="../Imagens/"+menu+"On.gif";
}
function off(menu){
    botao = document.getElementById(menu);
    botao.src="../Imagens/"+menu+".gif";
}

function localizaObj(n, d) { 
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

var tamanho = 11;
function tamanhoFonte( objeto, tipo )
{
    var obj;
    obj = localizaObj(objeto);
    if (tipo == 1){
        if ( tamanho < 17 ) tamanho += 2;
    } else {
        if ( tamanho > 9 ) tamanho -= 2;
    }
    obj.style.fontSize = tamanho + 'px';
}

/* Funções para o popup em div */

var divPopupFlash = null;

function exibePopupFlash(div, conteudo, iWidth, iHeight){
    div = document.getElementById(div);
    
    if (div != null)
    {
      divPopupFlash = div;
      div.innerHTML = conteudo;
      div.style.width = iWidth;
      div.style.heigth = iHeight;
      div.style.top = (screen.height - iHeight)/2;
      marginleft = -(iWidth/2);
      div.style.marginLeft = marginleft + "px";
      div.style.left = "50%";
      div.style.top = "50%";
      div.style.display = 'block';
    }
}

function ocultaPopupFlash()
{
    if (divPopupFlash != null)
    {
        divPopupFlash.innerHTML = '';
        divPopupFlash.display = 'none';
    }
}

function exibePopup(sUrl, iWidth, iHeight){
    var newWin = window.open( sUrl, 'popup', 'scrollbars=no, toolbar=no, location=no, directories=no, status=no, menubar=no, resizable=no, copyhistory=no, height='+iHeight+', width='+iWidth+', top='+(screen.height - iHeight)/2+', left='+(screen.width - iWidth)/2);
}

/* Fim funções para popup em div */

function inverteVisibilidade(div)
{
    div = document.getElementById(div);
    
    if (div != null)
    {
        if (div.style.display != 'none')
            div.style.display = 'none'
        else
            div.style.display = 'block';
    }
}