  var menu = new Array();
  var menuActivo = null;
  function am() {
     if (menuActivo != this) {
         if (menuActivo) menuActivo.ocultar();
         menuActivo = this; this.mostrar(); }
  }
  function oma(e) {
     if (menuActivo) {
         menuActivo.ocultar();
         menuActivo = null;
     }
  }

  function mm() { this.capa.visibility= "visible"; }
  function om() { this.capa.visibility= "hidden"; }
  function cpm(top, left) { this.capa.left=left; this.capa.top=top; }

  function Menu(capaID, top, left) {
    this.activar = am;
    this.mostrar = mm;
    this.ocultar = om;
    this.cambiarPosicion = cpm;
    if(document.getElementById) this.capa = document.getElementById(capaID).style;
    else if(document.layers) this.capa = document.layers[capaID];
         else if(document.all) this.capa = document.all[capaID].style;
    this.cambiarPosicion(top, left);
  }

  //Calculo de posicion
  function grl(img) {
   if(document.getElementById) x = document.images[img].offsetLeft
   else if(document.layers) x = document.images[img].x
        else if(document.all) x = document.images[img].offsetLeft
   tmp = document.images[img].offsetParent;
   while (tmp != null) { x += tmp.offsetLeft; tmp = tmp.offsetParent; }
   return x;
  }

  function grt(img) {
   if(document.getElementById) y = document.images[img].offsetTop
   else if(document.layers) y = document.images[img].y
        else if(document.all) y = document.images[img].offsetTop
   tmp = document.images[img].offsetParent;
   while (tmp != null) { y += tmp.offsetTop; tmp = tmp.offsetParent; }
   return y;
  }
