function newWindow(url, name, w, h, toolbar, scroll, resize) {
   if (!w) {
      w = 400;
   }
   if (!h) {
      h = 400;
   }
   if (!toolbar) {
      toolbar = 'no';
   }
   if (!scroll) {
      scroll = 'yes';
   }
   if (!resize) {
      resize = 'yes';
   }
   var format = 'toolbar='+toolbar+',scrollbars='+scroll+',resizable='+resize+
                ',width='+w+',height='+h;
   newWin = open(url, name, format);
   if (newWin) {
      newWin.focus();
   }
}

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 = add;
   this.turnOn = turnOn;
   this.turnOff = turnOff;
}

function add(key, file) {
   this.onImages[key] = new Image();
   this.onImages[key].src = this.path+file+this.on+'.'+this.ext;
   this.offImages[key] = new Image();
   this.offImages[key].src = this.path+file+this.off+'.'+this.ext;
}

function turnOn(key) {
   var d = document.getElementById(this.name+'-'+key);
   d.src = this.onImages[key].src;
}

function turnOff(key) {
   var d = document.getElementById(this.name+'-'+key);
   d.src = this.offImages[key].src;
}

function Menus() {
   this.menus = Menus.arguments;
   this.show = menusShow;
   this.hide = menusHide;
   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 menusShow(name) {
   if (this.last >= 0) {
      this.menus[this.last].hide();
   }
   var index = this.names[name];
   this.menus[index].show();
   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;
}

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, timer) {
   this.name = name;
   if (!timer) {
      timer = 3000;
   }
   this.timer = timer;
   this.show = menuShow;
   this.hide = menuHide;
   this.setTimer = menuSetTimer;
   this.clearTimer = menuClearTimer;
}

function menuShow() {
   this.clearTimer();
   var obj = document.getElementById(this.name);
   obj.style.visibility = 'visible';
}

function menuHide() {
   this.clearTimer();
   var obj = document.getElementById(this.name);
   obj.style.visibility = 'hidden';
}

function menuSetTimer(name) {
   this.timerid = setTimeout(name+".hide('"+this.name+"')", this.timer);
}

function menuClearTimer() {
   if (this.timerid) {
      clearTimeout(this.timerid);
   }
}
