// Função para evitar erros no javascript
function Nada() { return; }

function isExplorer(){
return (navigator.appName == "Microsoft Internet Explorer");
}

function layerIsVisible(nmLayer){
if(isExplorer()){
var Layer = document.all.tags("DIV")[nmLayer];
return (Layer.visibility == "visible");
}

//É netscape
return (document.layers[nmLayer].visibility == "show");

}

// Para mudar a cor de fundo dos layers
function Cor(nomeLayer,onOff) {
  var acaoLayer = "";
  if( isExplorer() ) {
    if(onOff == 0) {
      acaoLayer = nomeLayer + ".className='off2'";
    } else if(onOff == 1) {
      acaoLayer = nomeLayer + ".className='on2'";
    } else if(onOff == 2) {
      acaoLayer = nomeLayer + ".className='off'";
    } else if(onOff == 3) {
      acaoLayer = nomeLayer + ".className='on'";
    }
  }
  eval(acaoLayer);
}

// Para alterar a cor de fundo das TDs dos Layers
function corOn(idTD,idx) {

  if(idx == 0){ // Menu Horizontal
    idTD.style.backgroundColor = '#EBEBEB';
  } else { // idx == 1 => Menu Laranja
    idTD.style.backgroundColor = '#F7F7F7';
  }
  idTD.style.cursor = 'hand';
}
function corOff(idTD) {
  idTD.style.backgroundColor = '';
}
function corcategoria(idTD,idx) {

  if(idx == 0){ // Menu Horizontal
    idTD.style.backgroundColor = '#E6E6E6';
  } else { // idx == 1 => Menu Laranja
    idTD.style.backgroundColor = '#F7F7F7';
  }
  idTD.style.cursor = 'hand';
}
function corOff(idTD) {
  idTD.style.backgroundColor = '';
}

// Adaptação da MM_showHideLayers()
function SH() { //v3.0
var i,v,obj,args=SH.arguments;
for (i=0; i<=(args.length-2); i+=2)
if ((obj=MM_findObj(args[i]))!=null) {
v=args[i+1];
(v == 'h')?(v = "hide"):(v = "show");
if (obj.style) {
obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v;
}
obj.visibility=v;
}
}

function MM_showHideLayers() { //v3.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3)
 if ((obj=MM_findObj(args[i]))!=null) {
 v=args[i+2];
 if (obj.style) {
  obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v;
  }
 obj.visibility=v;
}
}

function MM_findObj(n, d) { //v4.0
    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 && document.getElementById)
        x=document.getElementById(n);
    return x;
}

function selOn(ctrl) {
	ctrl.style.backgroundColor = '#EBEBEB';
	//ctrl.style.cursor = 'hand';
}
function selOff(ctrl) {
	ctrl.style.backgroundColor = '';
}