<!--
/* Objeto TNavegador */
function TNavegador() {
this.NS4 = document.layers;
this.NS6 = document.all;
this.IE4 = document.all;
this.DHTML = this.NS4 || this.NS6 || this.IE4;
}
var Navegador = new TNavegador();
var Menu = new Array();
var MenuActivo = null; // Inicialmente no hay menús activos
/* Métodos de TMenu */
/* TMenu.Activar */
function ActivarTMenu() {
if (Navegador.DHTML && MenuActivo != this) {
// Podría ser null, de ahí la comparación
if (MenuActivo) MenuActivo.Ocultar();
MenuActivo = this;
this.Mostrar();
}
}
/* TMenu.Mostrar */
function MostrarTMenu() {
eval(this.sRefCapa + this.sRefEstilo
+ '.visibility = "visible"');
}
/* TMenu.OcultarTMenu */
function OcultarTMenu() {
eval(this.sRefCapa + this.sRefEstilo
+ '.visibility = "hidden"');
}
/* TMenu.MoverA */
function MoverTMenuA(x, y) {
if (Navegador.DHTML) {
eval(this.sRefCapa + this.sRefEstilo
+ this.sRefTop + ' = y');
eval(this.sRefCapa + this.sRefEstilo
+ this.sRefLeft + ' = x');
}
}
/* Objeto TMenu */
function TMenu(IdCapa, PosX, PosY) {
this.Activar = ActivarTMenu;
this.Mostrar = MostrarTMenu;
this.Ocultar = OcultarTMenu;
this.MoverA = MoverTMenuA;
this.sRefCapa = Navegador.NS4 ? 'document["' + IdCapa + '"]' :
'document.all["' + IdCapa + '"]';
this.sRefEstilo = Navegador.NS4 ? '' : '.style';
this.sRefLeft = Navegador.NS4 ? '.left' : '.pixelLeft';
this.sRefTop = Navegador.NS4 ? '.top' : '.pixelTop';
this.MoverA(PosX, PosY);
}
function OcultarTMenuActivo(e) {
if (MenuActivo) {
MenuActivo.Ocultar();
MenuActivo = null;
}
}
function InicializarTMenus() {
if (Navegador.DHTML) {
if (Navegador.NS4)
document.captureEvents(Event.MOUSEUP);
document.onmouseup = OcultarTMenuActivo;
}
Menu[0] = new TMenu("Menu0", 195, 213);
Menu[1] = new TMenu("Menu1", 495, 213);
Menu[2] = new TMenu("Menu2", 560, 213);
}
window.onload = InicializarTMenus;
//-->

