function Is()
{
  var agent = navigator.userAgent.toLowerCase();
  this.major = parseInt(navigator.appVersion);
  this.minor = parseFloat(navigator.appVersion);
  this.ns = ((agent.indexOf('mozilla') != -1) && ((agent.indexOf('spoofer') == -1) && (agent.indexOf('compatible') == -1)));
  this.ns2 = (this.ns && (this.major == 2));
  this.ns3 = (this.ns && (this.major == 3));
  this.ns4b = (this.ns && (this.minor < 4.04));
  this.ns4 = (this.ns && (this.major >= 4));
  this.ie = (agent.indexOf('msie') != -1);
  this.ie3 = (this.ie && (this.major == 2));
  this.ie4 = (this.ie && (this.major >= 4));
  this.op3 = (agent.indexOf('opera') != -1);
  this.win = (agent.indexOf('win') != -1);
  this.mac = (agent.indexOf('mac') != -1);
  this.unix = (agent.indexOf('x11') != -1);
}

is = new Is();
if (is.ns4)
{
  doc = "document";
  sty = ".style";
  htm = ".document";
}
else if (is.ie4)
{
  doc ="document.all";
  sty = ".style";
  htm = "";
}

// Precarga de imágenes
principal_on = new Image(); principal_on.src = "images/tab_principal_on.png";
principal_off = new Image(); principal_off.src = "images/tab_principal.png";
alumnos_off = new Image(); alumnos_off.src = "images/tab_alumnos.png";
alumnos_on = new Image(); alumnos_on.src = "images/tab_alumnos_on.png"
profesorado_off = new Image(); profesorado_off.src = "images/tab_profesorado.png";
profesorado_on = new Image(); profesorado_on.src = "images/tab_profesorado_on.png";
investigacion_off = new Image(); investigacion_off.src = "images/tab_investigacion.png";
investigacion_on = new Image(); investigacion_on.src = "images/tab_investigacion_on.png";
licenciatura_off = new Image(); licenciatura_off.src = "images/tab_licenciatura.png";
licenciatura_on = new Image(); licenciatura_on.src = "images/tab_licenciatura_on.png";
ciclo_off = new Image(); ciclo_off.src = "images/tab_3ciclo.png";
ciclo_on = new Image(); ciclo_on.src = "images/tab_3ciclo_on.png";
estructura_off = new Image(); estructura_off.src = "images/tab_estructura.png";
estructura_on = new Image(); estructura_on.src = "images/tab_estructura_on.png";
decision_off = new Image(); decision_off.src = "images/tab_decision.png";
decision_on = new Image(); decision_on.src = "images/tab_decision_on.png";
enlaces_off = new Image(); enlaces_off.src = "images/tab_enlaces.png";
enlaces_on = new Image(); enlaces_on.src = "images/tab_enlaces_on.png";

flechita = new Image(); flechita.src ="images/arrow.png";

function conmuta(img, estado)
{
  // Conmuta el estado de una imagen
  if (is.ns4)
  eval('document["' + img + '"].src = ' + img + '_' + estado + '.src');
  else if (is.ie4)
  eval('document.all["' + img + '"].src = ' + img + '_' + estado + '.src');
}

function tip()
{
  // Si se llama SIN ARGUMENTOS esconde la capa
  if (arguments.length == 0)
    document.getElementById("tipinfo").style.visibility = "hidden";
  else
  // Si tiene argumentos, pone el texto recibido en el primero el la capa TIPINFO
  {
    if (is.ns4)
    {
      document.getElementById("tipinfo").innerHTML = '<img src="images/arrow.png" alt="->" align="middle"> ' + arguments[0];
      document.getElementById("tipinfo").style.visibility = "visible";
    }
    else if (is.ie4)
    {
      document.all["tipinfo"].innerHTML = '<img src="images/arrow.png" alt="->" align="middle"> ' + arguments[0];
      document.all["tipinfo"].style.visibility = "visible";
    }
  }
}

