function Menus() {   this.menus = Menus.arguments;   this.show = menusShow;   this.hide = menusHide;   this.toggle = menusToggle;   this.visible = menusVisible;   this.setTimer = menusSetTimer;   this.clearTimer = menusClearTimer;   this.names = new Array(this.menus.length);   this.last = -1;   var i;   for (i = 0;i < this.menus.length;i++) {      this.names[this.menus[i].name] = i;   }}function menusVisible(name) {   var index = this.names[name];   return(this.menus[index].visible());}function menusToggle(name) {   var visible = this.visible(name);   if (visible) {      this.hide(name);   }   else {      this.show(name);   }}function menusShow(name, e, dx, dy, rx, ry) {   if (this.overlay) {      var i;      for (i = 0;i < this.overlay.length;i++) {         var obj = document.getElementById(this.overlay[i]);         if (obj) {            obj.style.visibility = 'hidden';         }      }   }   if (this.last >= 0) {      this.menus[this.last].hide();   }   var index = this.names[name];   this.menus[index].show(e, dx, dy, rx, ry);   this.last = index;}function menusHide(name) {   var index = this.last;   if (name) {      index = this.names[name];   }   if (index >= 0) {      this.menus[index].hide();   }   this.last = -1;   if (this.overlay) {      var i;      for (i = 0;i < this.overlay.length;i++) {         var obj = document.getElementById(this.overlay[i]);         if (obj) {            obj.style.visibility = 'visible';         }      }   }}function menusSetTimer(name) {   var index = this.names[name];   if (index >= 0) {    this.menus[index].setTimer(this.name);   }}function menusClearTimer(name) {   var index = this.names[name];   if (index >= 0) {    this.menus[index].clearTimer();   }}function Menu(name, type, timer) {   this.name = name;   if (!type) {      type = 'visibility';   }   if (!timer) {      timer = 500;   }   this.type = type;   this.timer = timer;   this.show = menuShow;   this.hide = menuHide;   this.visible = menuVisible;   this.setTimer = menuSetTimer;   this.clearTimer = menuClearTimer;}function menuVisible() {   var obj = document.getElementById(this.name);   if (this.type == 'visibility') {      if (obj.style.visibility == 'visible') {         return(true);      }      else {         return(false);      }   }   else {      if (obj.style.display == this.type) {         return(true);      }      else {         return(false);      }   }}function menuShow(e, dx, dy, rx, ry) {   this.clearTimer();   var obj = document.getElementById(this.name);   if (e) {      var x = 0, y = 0, xMax = 0, yMax = 0;      x = getXPos(e);      y = getYPos(e);      if (document.all) {         xMax = document.body.clientWidth + document.body.scrollLeft;         yMax = document.body.clientHeight + document.body.scrollTop;         //dx += rx;         //dy += ry;      }      else if (document.getElementById) {         xMax = window.innerWidth + window.pageXOffset;         yMax = window.innerHeight + window.pageYOffset;      }      obj.style.left = (x + dx) + 'px';      obj.style.top = (y + dy) + 'px';   }   if (this.type == 'visibility') {   	  obj.style.visibility = 'visible';	  obj.style.zIndex = '99';	  }   else {      obj.style.display = this.type;   }}function menuHide() {   this.clearTimer();   var obj = document.getElementById(this.name);   var page = document.getElementById((this.name).replace('-menu','-page'));   if (page == null) {       if (this.type == 'visibility') {          obj.style.visibility = 'hidden';       }       else {          obj.style.display = 'none';       }    }}function menuSetTimer(name) {   var page = document.getElementById((this.name).replace('-menu','-page'));   if (page == null)    this.timerid = setTimeout(name+".hide('"+this.name+"')", this.timer);}function menuClearTimer() {   var page = document.getElementById((this.name).replace('-menu','-page'));   if (this.timerid && page == null) {      clearTimeout(this.timerid);   }}function Rollovers(name, path, on, off, ext) {   this.name = name;   this.path = path;   this.on = on;   this.off = off;   this.ext = ext;   this.onImages = new Array();   this.offImages = new Array();   this.add = rolloversAdd;   this.turnOn = rolloversTurnOn;   this.turnOff = rolloversTurnOff;}function rolloversAdd() {   for (var i=0;i < rolloversAdd.arguments.length;i++) {      var k = rolloversAdd.arguments[i];      this.onImages[k] = new Image();      this.onImages[k].src = this.path+k+this.on+'.'+this.ext;      this.offImages[k] = new Image();      this.offImages[k].src = this.path+k+this.off+'.'+this.ext;   }}function rolloversTurnOn(key) {   var d = document.getElementById(this.name+'-'+key);   d.src = this.onImages[key].src;}function rolloversTurnOff(key) {   var d = document.getElementById(this.name+'-'+key);   d.src = this.offImages[key].src;}function getXPos(id) {   var obj = document.getElementById(id);   if (!obj) {      return(0);   }   var x = 0;   if (obj.offsetParent) {      while (obj.offsetParent) {         x += obj.offsetLeft;         obj = obj.offsetParent;      }   }   else if (obj.x) {      x += obj.x;   }   return(x);}function getYPos(id) {   var obj = document.getElementById(id);   if (!obj) {      return(0);   }   var y = 0;   if (obj.offsetParent) {      while (obj.offsetParent) {         y += obj.offsetTop;         obj = obj.offsetParent;      }   }   else if (obj.y) {      x += obj.y;   }   return(y);}
