  var menu = new Array();
  var menuActivo = null;
  // เมนู
  function am() {
    if (menuActivo != this) {
      if (menuActivo) menuActivo.ocultar();
      menuActivo = this;
      this.mostrar();
    }
  }
  function mm() {
    eval(this.capaRefStr + this.estiloRefStr + '.visibility = "visible"');
    this.domRef.style.display = "block";
  }
  function om() {
    eval(this.capaRefStr + this.estiloRefStr + '.visibility = "hidden"');
    this.domRef.style.display = "none";
  }
  function cpm(top, left) {
    eval(this.capaRefStr + this.estiloRefStr + this.topRefStr + ' = top');
    eval(this.capaRefStr + this.estiloRefStr + this.leftRefStr + ' = left');
    this.domRef.style.display = "none";
  }
  function Menu(capaID, top, left, width) {
    this.activar = am;
    this.mostrar = mm;
    this.ocultar = om;
    this.cambiarPosicion = cpm;
    this.domRef = document.getElementById(capaID);
    this.domRef.style.width = width;
    this.capaRefStr = 'document.all["'+capaID+'"]';
    this.estiloRefStr = '.style';
    this.topRefStr = '.pixelTop';
    this.leftRefStr = '.pixelLeft';
    this.cambiarPosicion(top, left);
  }
  // Manejo de eventos
  function oma(e) {
    if (menuActivo) {
      menuActivo.ocultar();
      menuActivo = null;
    }
  }
  //Calculo de posicion
  function grl(imgElem) {
    xPos = eval(imgElem).offsetLeft;
    tempEl = eval(imgElem).offsetParent;
    while (tempEl != null) {
      xPos += tempEl.offsetLeft;
      tempEl = tempEl.offsetParent;
    }
    return xPos;
  }
  function grt(imgElem) {
    yPos = eval(imgElem).offsetTop;
    tempEl = eval(imgElem).offsetParent;
    while (tempEl != null) {
      yPos += tempEl.offsetTop;
      tempEl = tempEl.offsetParent;
    }
    return yPos+22;
  }
