// JavaScript: para cabeçalhos da página
//
// Leônidas de Oliveira Brandão
// http://www.matematica.br

/*
 [14/09/2006]
 - div.menuTOPO: tinha
                     top: 18px;
                     left:  8px;
                     right:  8px;
 - div.menu: tinha
                     top: 68px;
                     left: 6px;
                     width: 150px;
 - table: fazia com q/ caixa com menus ficasse c/ tamanho fixo
                     width: 780px;
*/

// Definir uma variável para cada página página a ser 'acessada'

// def. no corpo do HTML, p.e., em 'index.html'
// var lang,        // = "pt",  // default: português

var
    pag,
    linkEN, linkPT,
    lang,

    introducao   = '&raquo; <A HREF="index.html" title="">&nbsp;'+sec_index_br+'</A>', // Introdução
    gd           = '&raquo; <A HREF="gd.html" title="">&nbsp;'+sec_gd_br+'</A>', //- Geometria Interativa
    java         = '&raquo; <A HREF="java.html">&nbsp;'+sec_java_br+' o iGeom</A>', // Executando o iGeom
    linguas      = '&raquo; <A HREF="linguas.html" title="">&nbsp;'+sec_linguas_br+'</A>', //- iGeom em outras línguas
    operacao1    = '&raquo; <A HREF="operacao1.html" title="">&nbsp;'+sec_modos_br+'</A>', //- Modos de operação
    botoes1      = '&raquo; <A HREF="botoes1.html" title="">&nbsp;'+sec_botoes_br+'</A>', //- Barra de botões
    script1      = '&raquo; <A HREF="script1.html" title="">&nbsp;'+sec_script_en+'</A>', //- Algoritmos (<i>script</i>)
    exercicios   = '&raquo; <A HREF="exercicios.html" title="">&nbsp;'+sec_exercicios_br+'</A>', //- Autoria e avaliação
    ex_basico1   = '&raquo; <A HREF="ex_basico1.html" title="">&nbsp;'+sec_ex_basico1_br+'</A>', //- Construções básicas
    ex_razao_aurea_pentagono
                 = '&raquo; <A HREF="ex_razao_aurea_pentagono.html" title="">&nbsp;'+sec_ex_razao_aurea_br+'</A>', //- Razão áurea e pentágono regular
    ex_conicas1  = '&raquo; <A HREF="ex_conicas1.html" title="">&nbsp;'+sec_ex_conicas1_br+'</A>', //- Construção de cônicas
    ex_fractais1 = '&raquo; <A HREF="ex_fractais1.html" title="">&nbsp;'+sec_fractais1_br+'</A>', //- Fractais e recorrência
    str_exemplos = "Exemplos";

// 
// window.opener.location.reload();
function defineLang (lg) {
 lang = lg;
 }


// Define texto para troca de lingua
var VERSAO_EN = "[English version]";
var VERSAO_PT = "[Versão Português]";

// Menu de opções superiores: Início:... | iGeom:... | Exemplos:...
// Define qual a página atual: retira link da página atual e muda cor de letra
function pagina (path,pg,language) {
  var esq = '&curren; <DFN class="menuC"> &nbsp;', dir = '&nbsp;</DFN>'; // « = &laquo;
  pag  = pg;
  // link para troca de lingua
  linkEN = ' <A HREF="'+path+'en/'+pag+'?lang=en" TITLE="'+VERSAO_EN+'" name="lingua">'+
           '    <IMG SRC="../imagens/flag-us.gif" ALT="'+VERSAO_EN+'" align="top" title=""></A>\n';
  //       '    <IMG SRC="../imagens/flag-us.gif" ALT="'+VERSAO_EN+'" align="middle" title=""></A>\n';
  linkPT = ' <A HREF="'+path+'pt/'+pag+'?lang=pt" TITLE="'+VERSAO_PT+'" onClick=defineLang("pt"); return false;>'+
           '    <IMG SRC="../imagens/flag-br.gif" ALT="'+VERSAO_PT+'"  align="top" title=""></A>\n';
  //       '    <IMG SRC="../imagens/flag-br.gif" ALT="'+VERSAO_PT+'"  align="middle" title=""></A>\n';

  var title_pt = 'lang=pt" title="clique aqui para ir para esta seção">&nbsp;';
  var title_en = 'lang=en" title="click here to get access to this section">&nbsp;';
  // links para páginas
  if (lang=="en") {
     introducao   = '&raquo; <A HREF="index.html?'+title_en+sec_index_en+'</A>',  //- Introduction
     gd           = '&raquo; <A HREF="gd.html?'+title_en+sec_gd_en+'</A>', //- Interactive Geometry
     java         = '&raquo; <A HREF="java.html?'+title_en+sec_java_en+'</A>', //- Running iGeom
     linguas      = '&raquo; <A HREF="linguas.html?'+title_en+sec_linguas_en+'</A>', //- iGeom in different language
     operacao1    = '&raquo; <A HREF="operacao1.html?'+title_en+sec_modos_en+'</A>', //- Operational modes | Ways of operation
     botoes1      = '&raquo; <A HREF="botoes1.html?'+title_en+sec_botoes_en+'</A>', //- Buttons bar
     script1      = '&raquo; <A HREF="script1.html?'+title_en+sec_script_en+'</A>', //- Algorithms (<i>script</i>)
     exercicios   = '&raquo; <A HREF="exercicios.html?'+title_en+sec_exercicios_en+'</A>', //- Authoring and evaluation
     ex_basico1   = '&raquo; <A HREF="ex_basico1.html?'+title_en+sec_ex_basico1_en+'</A>', //- Basics contructions
     ex_razao_aurea_pentagono
                  = '&raquo; <A HREF="ex_razao_aurea_pentagono.html?'+title_en+sec_ex_razao_aurea_en+'</A>', //- Golden ratio and regular pentagon
     ex_conicas1  = '&raquo; <A HREF="ex_conicas1.html?'+title_en+sec_ex_conicas1_en+'</A>', //- Constructions of conics
     ex_fractais1 = '&raquo; <A HREF="ex_fractais1.html?'+title_en+sec_fractais1_en+'</A>'; //- Fractals and recurrence
     if   (pag=="index.html")        introducao    = esq+sec_index_en+dir; //- Introduction
     else
     if   (pag=="gd.html")           gd            = esq+sec_gd_en+dir; //- Interactive Geometry
     else
     if   (pag=="java.html")         java          = esq+sec_java_en+dir; //- Running iGeom
     else
     if   (pag=="linguas.html")      linguas       = esq+sec_linguas_en+dir; //- iGeom in different language
     else
     if   (pag=="operacao1.html")    operacao1     = esq+sec_modos_en+dir; //- Operational modes
     else
     if   (pag=="botoes1.html")      botoes1       = esq+sec_botoes_en+dir; //- Buttons bar
     else
     if   (pag=="script1.html")      script1       = esq+sec_script_en+dir; //- Algorithms (<i>script</i>)
     else
     if   (pag=="exercicios.html")   exercicios   = esq+sec_exercicios_en+dir; //- Authoring and evaluation
     else
     if   (pag=="ex_basico1.html")   ex_basico1   = esq+sec_ex_basico1_en+dir; //- Basics contructions
     else
     if   (pag=="ex_razao_aurea_pentagono.html")
                         ex_razao_aurea_pentagono = esq+sec_ex_razao_aurea_en+dir; //- Golden ratio and regular pentagon
     else
     if   (pag=="ex_conicas1.html")  ex_conicas1  = esq+sec_ex_conicas1_en+dir; //- Constructions of conics
     else
     if   (pag=="ex_fractais1.html") ex_fractais1 = esq+sec_fractais1_en+dir; //- Fractals and recurrence
     }
  else {
     introducao   = '&raquo; <A HREF="index.html?'+title_pt+sec_index_br+'</A>',  // Introdução
     gd           = '&raquo; <A HREF="gd.html?'+title_pt+sec_gd_br+'</A>', // Geometria Interativa
     java         = '&raquo; <A HREF="java.html?'+title_pt+sec_java_br+'</A>', // Executando o iGeom
     linguas      = '&raquo; <A HREF="linguas.html?'+title_pt+sec_linguas_br+'</A>', // iGeom em outras línguas
     operacao1    = '&raquo; <A HREF="operacao1.html?'+title_pt+sec_modos_br+'</A>', // Modos de operação
     botoes1      = '&raquo; <A HREF="botoes1.html?'+title_pt+sec_botoes_br+'</A>', // Barra de botões
     script1      = '&raquo; <A HREF="script1.html?'+title_pt+sec_script_br+'</A>', // Algoritmos (<i>script</i>)
     exercicios   = '&raquo; <A HREF="exercicios.html?'+title_pt+sec_exercicios_br+'</A>', // Autoria e avaliação
     ex_basico1   = '&raquo; <A HREF="ex_basico1.html?'+title_pt+sec_ex_basico1_br+'</A>', // Construções básicas
     ex_razao_aurea
                  = '&raquo; <A HREF="ex_razao_aurea_pentagono.html?'+title_pt+sec_ex_razao_aurea_br+'</A>', // Razão áurea e pentágono regular
     ex_conicas1  = '&raquo; <A HREF="ex_conicas1.html?'+title_pt+sec_ex_conicas1_br+'</A>', // Construção de cônicas
     ex_fractais1 = '&raquo; <A HREF="ex_fractais1.html?'+title_pt+sec_fractais1_br+'</A>'; // Fractais e recorrência
     if   (pag=="index.html")        introducao   = esq+sec_index_br+dir; //- Introdução
     else
     if   (pag=="gd.html")           gd           = esq+sec_gd_br+dir; //- Geometria Interativa - Dinâmica
     else
     if   (pag=="java.html")         java         = esq+sec_java_br+dir; //- Executando o iGeom
     else
     if   (pag=="linguas.html")      linguas      = esq+sec_linguas_br+dir; //- iGeom em outras línguas
     else
     if   (pag=="operacao1.html")    operacao1    = esq+sec_modos_br+dir; //- Modos de operação
     else
     if   (pag=="botoes1.html")      botoes1      = esq+sec_botoes_br+dir; //- Barra de botões
     else
     if   (pag=="script1.html")      script1       = esq+sec_script_br+dir; //- Algoritmos (<i>script</i>)
     else
     if   (pag=="exercicios.html")   exercicios   = esq+sec_exercicios_br+dir; //- Autoria e avaliação
     else
     if   (pag=="ex_basico1.html")   ex_basico1   = esq+sec_ex_basico1_en+dir; //- Construções básicas
     else
     if   (pag=="ex_razao_aurea_pentagono.html")
                         ex_razao_aurea_pentagono = esq+sec_ex_razao_aurea_en+dir; //- Razão áurea e pentágono regular
     else
     if   (pag=="ex_conicas1.html")  ex_conicas1  = esq+sec_ex_conicas1_br+dir; //- Construção de cônicas
     else
     if   (pag=="ex_fractais1.html") ex_fractais1 = esq+sec_fractais1_br+dir; //- Fractais e recorrência
     }
 }


// Carrega cabeçalho da página atual
function carregaCabecalho (path) {
 // alert('[pagina] lang='+lang);
 // var cmp = ' class="menuC"';
 if (lang=="en") {
    link = linkPT;
    str_exemplos = "Examples";
    }
 else {
    lang = "pt"; // página 'default' => PT
    link = linkEN;
    str_exemplos = "Exemplos";
    }
 caminho = path;
 // alert(' path='+path+' lang='+lang+' caminho='+caminho);
 cabecalho = 
 //'   <div CLASS="fundoTOPO">\n'+
 '   <DIV CLASS="menuTOPO">\n'+
 '       <TABLE WIDTH="100%" CLASS="menuTOPO" cellpadding="0" cellspacing="0">\n'+
 '        <TR><TD ALIGN="LEFT" CLASS="menuTOPO"><nobr>&nbsp;\n'+
 '            <A HREF="http://www.matematica.br/igeom/">iGeom</A>\n'+
 '            :: Geometria Interativa na Internet :: \n'+
 '            <A HREF="http://www.matematica.br/igeom">http://www.matematica.br/igeom</A>\n'+
 '            </TD></nobr>\n'+
 '            <TD ALIGN="RIGHT" CLASS="menuTOPO">\n'+
 // '           <TABLE CLASS="menuTOPO" ><TR><TD ALIGN="LEFT" CLASS="menuTOPO"><nobr>\n'+
 // '              <IMG SRC="'+caminho+'imagens/igeom.gif" align="top"></nobr></TD>\n'+
 // '              <IMG SRC="'+caminho+'imagens/igeom.gif" align="middle"></nobr></TD>\n'+
 '            <TD ALIGN="RIGHT" CLASS="menuTOPO"><nobr>\n'+link+'</nobr></TD>'+
 // '            </TR></TABLE>\n'+
 '            </TD>\n'+
 '       </TR></TABLE>\n'+
 '   </DIV>\n'+
 '   <TABLE CLASS="menu" cellpadding="0" cellspacing="0">\n'+
 '    <TR> <TD CLASS="menu1" colspan="3"></TD></TR>\n'+
 '    <TR> \n'+
 '    <TD CLASS="menuC">&nbsp;\n'+
 '     <B>Início</B><BR>\n'+
 '     &nbsp;&nbsp;  '+introducao+'<BR>\n'+
 '     &nbsp;&nbsp;  '+gd+'<BR>\n'+
 '     &nbsp;&nbsp;  '+java+'<BR>\n'+
 '     &nbsp;&nbsp;  '+linguas+'\n'+
 '    </TD>\n'+
 '    <TD CLASS="menuC">&nbsp;<B>iGeom</B><BR>\n'+
 '     &nbsp;&nbsp;  '+operacao1+'<BR>\n'+
 '     &nbsp;&nbsp;  '+botoes1+'<BR>\n'+
 '     &nbsp;&nbsp;  '+script1+'<BR>\n'+
 '     &nbsp;&nbsp;  '+exercicios+'\n'+
 '    </TD> \n'+
 '    <TD CLASS="menuC">&nbsp;<B>'+str_exemplos+'</B><BR>\n'+
 '     &nbsp;&nbsp;  '+ex_basico1+'<BR>\n'+
 '     &nbsp;&nbsp;  '+ex_razao_aurea_pentagono+'<BR>\n'+
 '     &nbsp;&nbsp;  '+ex_conicas1+'<BR>\n'+
 '     &nbsp;&nbsp;  '+ex_fractais1+'\n'+
 '    </TD> \n'+
 '    </TR> \n'+
 '    <TR> <TD CLASS="menu2" colspan="3"></TD></TR>\n'+
 '   </TABLE>\n'+
 // '   <HR BORDER=1 WIDTH=100%>\n'+
 //'    </div>'+
 '    \n';
 document.write(cabecalho);
 }


cabecalho2 = 
'   <DIV CLASS="menuTOPO">\n'+
'       <A HREF="http://www.matematica.br/igeom/">iGeom</A>\n'+
'       :: Geometria Interativa na Internet :: <A HREF="http://www.matematica.br/igeom">http://www.matematica.br/igeom</A>\n'+
'       <IMG SRC="imagens/igeom2.gif" align="right">\n'+
'   </DIV>\n'+
'   <DIV CLASS="menu">\n'+
'     <B>Início</B><BR>\n'+
'     &nbsp;&nbsp;  <A HREF="index.html">Introdução</A><BR>\n'+
'     &nbsp;&nbsp;  <A HREF="gd.html">Geometria Interativa</A><BR>\n'+ // Dinâmica
'     &nbsp;&nbsp;  <A HREF="java.html">Executando o iGeom</A>\n'+
'     \n'+
'     <BR><BR><B>iGeom</B><BR>\n'+
'     &nbsp;&nbsp;  <A HREF="operacao1.html">Modos de operação</A><BR>\n'+
'     &nbsp;&nbsp;  <A HREF="botoes1.html">Barra de botões</A><BR>\n'+
'     &nbsp;&nbsp;  <A HREF="script1.html">Algoritmos (<i>script</i>)</A><BR>\n'+
'     &nbsp;&nbsp;  <A HREF="exercicios.html">Autoria e avaliação <!-- automática de exercícios--></A>\n'+
'     \n'+
'     <BR><BR><B>'+str_exemplos+'</B><BR>\n'+
'     &nbsp;&nbsp;  <A HREF="ex_basico1.html">Construções básicas</A><BR>\n'+
'     &nbsp;&nbsp;  <A HREF="ex_razao_aurea_pentagono.html">Razão áurea e pentágono regular</A><BR>\n'+
'     &nbsp;&nbsp;  <A HREF="ex_conicas1.html">Construção de cônicas</A><BR>\n'+
'     &nbsp;&nbsp;  <A HREF="ex_fractais1.html">Fractais e recorrência</A><BR><BR>\n'+
'   </DIV>\n'+
' <BR>&nbsp;<BR>';

rodape = 
'   <DIV CLASS="menuFUNDO">\n'+
'     \n'+
'   </DIV';




//'    <TD BACKGROUND="./imagens/fundo-cabecalho1.gif" VALIGN=BOTTOM>a<IMG SRC="./imagens/igeom-cabecalho1.gif">b\n'+
//'    </TD>\n'+
//'    <TD COLSPAN=2 BACKGROUND="./imagens/fundo-cabecalho1.gif">&nbsp;\n'+
//'    </TD></TR>\n'+
// '   <CENTER>\n'+

