var $el=function(el)
{
  return document.getElementById(el);
}

// muestra el cabezal

var ShowCabezal= function()
{
  $el('contenedor-cabecera').style.display="block";
  $el('contenedor-cabecera-trasera').style.display="none";
//  $el('horario').style.display="block";
}

// muestra la parte trasera del cabezal

var ShowTrasera= function()
{
  $el('contenedor-cabecera').style.display="none";
  $el('contenedor-cabecera-trasera').style.display="block";
//  $el('horario').style.display="none";
  setTimeout("ShowCabezal()",600); 
}

var hndTimeOut;

// comprueba si estan cargadas las imagenes

var CheckComplete=function()
{
  var cont=0;
  
  for(i in arrImagenes)
  {
    if(lista_imagenes[i].complete)
    {
      cont++;
    }
    if (cont==lista_imagenes.length)
    {
      clearInterval(hndTimeOut);
      setTimeout("ShowTrasera()",2000); 
    }
  }
}


/*
 * Función que se ejecuta al cargar la página
 */


load = function(bCheckNews)
{
  // detectar IE
  
  var ie6 = document.getElementById && document.all&&(navigator.appVersion.indexOf("MSIE 6.")>=0);
  
  if(ie6!=true)
  { 
    hndScrollBars=new CScrollBars('content');
    hndScrollBars.CreateBars();
  }
   
  window.onresize = function()
  {
     hndScrollBars.TestResize();
  }
  
  if($el('firstfield'))
  {
    $el('firstfield').focus();
  }
  
  
  hndTimeOut=setInterval('CheckComplete()',500);
  
}


/*
 *  funcion que se ejecuta al pasar el raton sobre un boton, cambia el color
 *  de texto de ese boton
 */

var MenuOver = function (id)
{
  if(id=='who')
  {
    $el('label-who-1').style.color='#FFED00';
    $el('label-who-2').style.color='#FFED00';
  }
  else
  {
    $el(id).style.color='#FFED00';
  }
  
  $el('light-img').src = 'img/light_2.png';
}

var MenuOut = function (id)
{
  if(id=='who')
  {
    $el('label-who-1').style.color='#FFFFFF';
    $el('label-who-2').style.color='#FFFFFF';
  }
  else
  {
    $el(id).style.color='#FFFFFF';
  }
  
  $el('light-img').src = 'img/light_1.png';
}

