// IMAGENES DE LAS PESTAÑAS NO ACTIVAS
var label = new Array();
label[0] = "img/menu_inicio.gif";
label[1] = "img/menu_ambientacion.gif";
label[2] = "img/menu_reglamento.gif";
label[3] = "img/menu_personajes.gif";
label[4] = "img/menu_fotos.gif";
label[5] = "img/menu_inscripcion.gif";

// IMAGENES DE LAS PESTAÑAS ACTIVAS
var selectedLabel = new Array();
selectedLabel[0] = "img/menu_inicio2.gif";
selectedLabel[1] = "img/menu_ambientacion2.gif";
selectedLabel[2] = "img/menu_reglamento2.gif";
selectedLabel[3] = "img/menu_personajes2.gif";
selectedLabel[4] = "img/menu_fotos2.gif";
selectedLabel[5] = "img/menu_inscripcion2.gif";

// URLs DE LAS PESTAÑAS
var urlLabel = new Array();
urlLabel[0] = "index.html";
urlLabel[1] = "ambientacion_entrovia.html";
urlLabel[2] = "reglamento.html";
urlLabel[3] = "personajes.html";
urlLabel[4] = "fotos.html";
urlLabel[5] = "inscripcion.html";
// Cuando la inscripcion esté cerrada poner linea: urlLabel[5] = "inscripcion_cerrada.html";

// INSCRIPCION
function inscripcion_inscripcion() {return true;}
function inscripcion_segundo() {return true;}
function inscripcion_lista_PJs() {return false;}
function inscripcion_reservas() {return false;}

function menu(element) {
  document.writeln('<table border="0" cellspacing="0" cellpadding="0" width="100%" align="center">');
  document.writeln('    <tr> ');
  document.writeln('      <td width="1%"><img src="img/menu_izqda.gif"></td>');
  for (i=0; i<label.length; i++)
  {
    //alert("loop("+ i +")");
    if (i==element) 
    {
      //alert("SELECTED["+ i +"]");
      document.writeln('      <td width="1%"><img src="'+ selectedLabel[i] +'" border="0"></td>');  
    }
    else 
    {
      //alert("selected["+ i +"]");
      document.writeln('      <td width="1%"><a href="'+ urlLabel[i] +'"><img src="'+ label[i] +'" border="0"></a></td>');  
    }
    document.writeln('      <td background="img/menu_barra.gif" width="20%"></td>');
  }
  document.writeln('      <td width="1%"><img src="img/menu_dcha.gif"></td>');
  document.writeln('    </tr>');
  document.writeln('  </table>');
}

// Función que permite cambiar texto de una página HTML de forma dinámica
// Usar en la página html: <div id="nombreDiv">texto</div>
// y en javascript:    changeText("nombreDiv","nuevo texto");
function changeText(divName, newText) {
  document.getElementById(divName).innerHTML=newText;
  }

