var menuImages = new Array();
function createMenu() {
  if (!document.images[0].getAttribute) return;
  if ( createMenu.arguments.length > 0 ) {
    var target, img;
    for (var x=0; x<createMenu.arguments.length; x++) {
      target = createMenu.arguments[x];
      if ( ! document.images[target] ) break;
      img = document.images[target];
      menuImages.length++;
      menuImages[target] = new Array(1);
      menuImages[target]['off'] = new Image(); menuImages[target]['off'].src = img.src;
      if (img.getAttribute( "over" )) {
        menuImages[target].length++;
        menuImages[target]['over'] = new Image(); menuImages[target]['over'].src = img.getAttribute( "over" );
        img.onmouseover = function () { this.src = menuImages[this.name]['over'].src; }
        img.onmouseout = function () { this.src = menuImages[this.name]['off'].src; }
      }
      if (img.getAttribute( "down" )) {
        menuImages[target].length++;
        menuImages[target]['down'] = new Image(); menuImages[target]['down'].src = img.getAttribute( "down" );
        img.onmousedown = function () { this.src = menuImages[this.name]['down'].src; }
        img.onmouseup = function () { this.src = (menuImages[this.name]['over']) ? menuImages[this.name]['over'].src : menuImages[this.name]['off'].src; }
      }
    }
  } else return;
}