
window.onload = inicializar;

onLoad="MM_preloadImages('rond_b.gif','rond_w.gif','backg_top.gif','imgs/lineball.gif')"

// Objeto de deteccion del navegador
function DetectorNavegador() {
  this.NS4 = document.layers;
  this.IE4 = document.all;
  this.DOM = document.getElementById;
  this.DHTML = this.NS4 || this.IE4 || this.DOM;
}

var soporta = new DetectorNavegador();
var menu = new Array();
var menuActivo = null;

// Objeto Menu
function activarMenu() {
  if (soporta.DHTML && menuActivo != this) {
    if (menuActivo) menuActivo.ocultar();
    menuActivo = this;
    this.mostrar();
  }
}

function mostrarMenu() {
  eval(this.capaRefStr + this.estiloRefStr + '.visibility = "visible"');
  if (soporta.DOM)
	this.domRef.style.display = "block";
}

function ocultarMenu() {
  eval(this.capaRefStr + this.estiloRefStr + '.visibility = "hidden"');
}

function cambiarPosicionMenu(top, left) {
  eval(this.capaRefStr + this.estiloRefStr + this.topRefStr + ' = top');
  eval(this.capaRefStr + this.estiloRefStr + this.leftRefStr + ' = left');
  if (soporta.DOM)
	this.domRef.style.display = "none";
}

function Menu(capaID, top, left, width) {
  this.activar = activarMenu;
  this.mostrar = mostrarMenu;
  this.ocultar = ocultarMenu;
  this.cambiarPosicion = cambiarPosicionMenu;
  if (soporta.DOM) {
    this.domRef = document.getElementById(capaID);
	this.domRef.style.width = width;
    this.domRef.style.display = "none";
  }	
  this.capaRefStr = (soporta.NS4) ?
    'document["'+capaID+'"]' :
    ((soporta.IE4) ? 'document.all["'+capaID+'"]' : 'this.domRef');
  this.estiloRefStr = (soporta.NS4) ? '' : '.style';
  this.topRefStr = (soporta.IE4) ? '.pixelTop' : '.top';
  this.leftRefStr = (soporta.IE4) ? '.pixelLeft' : '.left';
  this.cambiarPosicion(top, left);
}

// Manejo de eventos
function ocultarMenuActivo(e) {
  if (menuActivo) {
    menuActivo.ocultar();
    menuActivo = null;
  }
}

// Inicializacion
function inicializar() {
  if (soporta.DHTML) {
    if (soporta.NS4)
      document.captureEvents(Event.MOUSEUP);
    document.onmouseup = ocultarMenuActivo;
  }
  menu[0] = new Menu("menu0", 65, 308, 240);
  menu[1] = new Menu("menu1", 0);
  }



// Obrir finestra
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
