CriaLayer();

function CriaLayer() {
  i=0;

  while (arrayMenu[i]) {
    if (arrayMenu[i] == 1) {
      CriaInicioLayer(arrayMenu[i+1], arrayMenu[i+2], arrayMenu[i+3]);
      i=i+4;
      while (arrayMenu[i] == 2) {
        CriaItemLayer(arrayMenu[i+1], arrayMenu[i+2]);
        i=i+3;
      }
      CriaFimLayer();
    }
  }
}

function CriaInicioLayer(nomeLayer, x, y) {
  if (NS) document.write('<layer id="' + nomeLayer + '" onMouseOver="MostraLayer(\'' + nomeLayer + '\')" onMouseOut="EscondeLayerTempo()" left="' + x + '" top="' + y + '" width="240" z-index="1" visibility="hide">');
  if (NS) document.write('<link href="/style.css" rel="stylesheet" type="text/css">');

  if (IE || NS6) document.write('<div id="' + nomeLayer + '" onMouseOver="MostraLayer(\'' + nomeLayer + '\')" onMouseOut="EscondeLayerTempo()" style="position:absolute; left:' + x + 'px; top:' + y + 'px; width:220px; z-index:1; visibility:hidden">');

  document.write('<table border="0" cellpadding="3" cellspacing="1" width="205" bordercolorlight="#990000">');
}

function CriaItemLayer(texto, url) {
  document.write('<tr>');
  document.write('<td onMouseOver="javascript:ChangeMenu (this)" onMouseOut="javascript:ChangeMenu (this)" width="100%" bgColor="#990000"><font face="Verdana" size="2" color="#FFFFFF"><a href="' + url + '" class="linkwhite">' + texto + '</a></font></td>');
  document.write('</tr>');
}

function CriaFimLayer() {
  document.write('</table>');

  if (NS) document.write('</layer>');
  if (IE || NS6) document.write('</div>');
}

function ChangeMenu (obj) {

  if (obj.bgColor == "#bb0000") {
    obj.bgColor = "#990000";
  } else {
    obj.bgColor = "#bb0000";
  }

}

function none () {
}

function AbreJanela (URL, x, y, nome, scroll)
{
  if (nome=='') nome='_blank';

  if (x == '1') {
    tamanho="";
  } else if (x=='') {
    tamanho="width=" + (screen.availWidth-10) + ",innerWidth=" + (screen.availWidth-10) + ",height=" + (screen.availHeight-50) + ",innerHeight=" + (screen.availHeight-50) + ",top=0,left=0,scrollbars=yes";
  } else {
    tamanho="width=" + x + ",innerWidth=" + x + ",height=" + y + ",innerHeight=" + y;
    if (scroll) tamanho+=",scrollbars=yes";
  }
  
  Janela=window.open (URL, nome, tamanho);
}