/* [JavaScript] menu.js ---------------------------------------------\
|Autor: Vitor M. N. Fernandes > http://vmnf.net > vmnf@yahoo.com     |
|Data: 13/Março/2001                                                 |
|--------------------------------------------------------------------|
|Descrição:                                                          |
|  Escreve no documento o código HTML correspondente                 | 
|  à barra de navegação - menu e submenu.                            | 
|--------------------------------------------------------------------|
|Versões:                                                            |
|  V1.00-13/Março/2001: Versão inicial                               |
|--------------------------------------------------------------------|
|Parâmetros:                                                         |
|  menu_activo: Menu Activo (surge em bold com o submenu respectivo) |
|  submenu_activo: Caso nenhum activo => valor -1                    |
\-------------------------------------------------------------------*/
menu=[
  //Texto,Link,Cor      
  ["Entrada",    "index2.html","#000066",1],
  ["Localização","localizacao/index.html","#333399",1],
  ["Actividades","actividades/index.html","#cc3333",1],
  ["Projectos",  "projectos/index.html","#cc6600",1],
  ["AE",         "AssociacaoEstudantes/index.html","#cccc00",1],
  ["Serviços",   "servicos/index.html","#003333",1],
  ["Gestão",     "gestao/index.html","#663300",1],
  ["Informações","informacoes/index.html","#666666",1],
  ["Publicidade","publicidade/index.html","#000000",1]
];
/*------------------------------------------------------------------*/
submenu=[
  //Número de subitems,[Texto,Link,...]
  /*Entrada*/
  [7,"Áreas","areas.html",1,
     "Sites","sites.html",1,
     "O Projecto","projecto.html",1,
     "Comentários","comentarios.html",1,
     "Versões","versoes.html",1,
     "Bugs","bugs.html",1,
     "Página de Entrada","/index.html",1,
  ],
  /*Localização*/
  [3,"História","/localizacao/historia/index.html",1,
     "Mapa","/localizacao/mapa/index.html",1,
     "Panorâmicas","/localizacao/panoramicas/index.html",1,
  ],
  /*Actividades*/
  [9,"Plano Actividades","/actividades/PlanoActividades/index.html",0,
     "Clubes","/actividades/clubes/index.html",1,
     "Concursos","/actividades/concursos/index.html",1,
     "Maratonas","/actividades/maratonas/index.html",1,
     "Inter-Escolas","/actividades/Inter-Escolas/index.html",1,
     "Rádio","/actividades/radio/index.html",1,
     "Teatro","/actividades/teatro/index.html",1,
     "Boletim Inform.","/actividades/BoletimInformativo/index.html",1,
     "Jornal","/actividades/jornal/index.html",0,
  ],
  /*Projectos*/
  [3,"BigSchool","/projectos/BigSchool/index.html",1,
     "Miss-Mister","/projectos/Miss-Mister/index.html",1,
     "Viagem de Finalistas","/projectos/ViagemFinalistas/index.html",1,
  ],
  /*AE*/
  [1,"Listas","/ae/listas/index.html",0,
  ],
  /*Serviços*/
  [6,"Refeitório","/servicos/refeitorio/index.html",1,
     "Bar","/servicos/bar/index.html",1,
     "Biblioteca","/servicos/biblioteca/index.html",1,
     "Centro de Recursos","/servicos/CentroRecursos/index.html",1,
     "Papelaria","/servicos/papelaria/index.html",1,
     "Reprografia","/servicos/reprografia/index.html",1,
  ],
  /*Gestão*/
  [5,"AE (Assembleia de Escola)","/gestao/ae/index.html",0,
     "Pedagógico","/gestao/pedagogico/index.html",0,
     "CE (Conselho Executivo)","/gestao/ce/index.html",0,
     "Secretaria","/gestao/secretaria/index.html",0,
     "Regulamentos","/gestao/regulamentos/index.html",0,
  ],
  /*Informações*/
  [4,"Departamentos","/informacoes/departamentos/index.html",1,
     "Grupos","/informacoes/grupos/index.html",0,
     "Professores","/informacoes/professores/index.html",0,
     "Horários","/informacoes/horarios/index.html",0,
  ],
  /*Publicidade*/
  [4,"Como Anunciar","/publicidade/anunciar.html",1,
     "Preçários","/publicidade/precarios.html",1,
     "Contactos","/publicidade/contactos.html",1,
     "Regras & Factos","/publicidade/RegrasFactos.html",1,
  ],
];
/*------------------------------------------------------------------*/
function dw_Menu(menu_activo, submenu_activo){
  document.write('<table width=100% border=0 cellpadding=0 cellspacing=0 bgcolor="#000066">');
  document.write('<td width=100 height=100 rowspan=3>');
  document.write('<img src="/imagens/ESSJTalha_logotipo.gif" width=100 height=100 alt="Escola Secundária de São João da Talha - Logotipo"></td>');
  document.write('<td width=15 valign=bottom bgcolor="#0099cc">');
  document.write('<img src="/imagens/canto.gif" width=15 height=15 alt=""></td>');
  document.write('<td width=* height=60 colspan=10 bgcolor="#0099cc">');
  document.write('<table border=0 cellspacing=0 cellpadding=0 width=100%><tr><td width=* align=center >');
    document.write('<img src="/imagens/pub2.gif" width=15 height=60 border=0 alt="Publicidade - Clique aqui para saber como anunciar nestas páginas!">');
    document.write('<img src="/imagens/pub/banner_pub.gif" width=468 height=60 alt="Publicidade">');
    document.write('</td><td width=166 valign=top bgcolor=#ffff00>');
    document.write('<a href="/versoes.html" target=_top><img src="/imagens/VersaoBeta.gif" border=0 width=99 height=25 align=center alt="Versão Beta"></a>');
    document.write('<nobr><font face=arial color=#000000 size=1>&nbsp;<b>2001.04.07</b><br>Bugs, Links quebrados,<br> outros,... <a href="/bugs.html" target=_top><font color="#000000"><b>Clique Aqui</b></font></a>!</nobr></font>');
  document.write('</td></tr></table>');
  document.write('</td>');
  document.write('</tr>');
  document.write('<tr>');
  document.write('<td width=15>');
  document.write('</td>');
  //FOR
  for (i=0;i<=8;i++){
    document.write('<td height=20 align=center bgcolor="',menu[i][2],'">');
    document.write('<font face=Arial size=1>');
    document.write('&nbsp;<a href="/',menu[i][1],'" target=_top>');
    if (menu_activo==i){
      document.write('<b>');
    }
    document.write(menu[i][0]);
    if (menu_activo==i){
      document.write('</b>');
    }
    document.write('</A>&nbsp;');
    document.write('</font>');
    document.write('</td>');
  }
  //FOR
  document.write('<td height=20 width=* bgcolor="#000066">');
  document.write('&nbsp;');
  document.write('</td>');
  document.write('</tr>');
  document.write('<tr>');
  document.write('<td width=15');
  document.write('</td>');
  document.write('<td width=* height=20 colspan=10 bgcolor="',menu[menu_activo][2],'">');
  document.write('<font face=Arial size=1>');
  document.write('<nobr>&nbsp;&nbsp;<img src="/imagens/seta2.gif" width=20 height=16 border=0 valign=bottom>&nbsp;&nbsp;');
  //FOR
  for (i=0;i<submenu[menu_activo][0]-1;i++){
    if(submenu[menu_activo][(i+1)*3]==1){
      document.write('<a href="',submenu[menu_activo][(i+1)*3-1],'" target=_top>');
      if (submenu_activo==i){
        document.write('<b>');
      };
    };
    document.write(submenu[menu_activo][(i+1)*3-2]);
    if(submenu[menu_activo][(i+1)*3]==1){
      if (submenu_activo==i){
        document.write('</b>');
      }
      document.write('</a> | ');
    }else{
      document.write(' | ');
    }
  };
  if(submenu[menu_activo][(i+1)*3]==1){
    document.write('<a href="',submenu[menu_activo][(submenu[menu_activo][0]*3-1)],'" target=_top>');
    if (submenu_activo==i){
      document.write('<b>');
    }
  }
  document.write(submenu[menu_activo][(submenu[menu_activo][0]*3-2)]);
  if(submenu[menu_activo][(i+1)*3]==1){
    if (submenu_activo==i){
      document.write('<b>');
    }
    document.write('</a>');
  }
  //FOR
  document.write('</nobr>');
  document.write('</font>');
  document.write('</td>');
  document.write('</tr>');
  document.write('</table>');
  //document.write('<hr size=1>');
};//dw_Menu
/*------------------------------------------------------------------*/
