/**
 * Add mouse over eventhandlers to the menubar.
 * Only for internet explorer.
 */

function startList() {
  if (document.all&&document.getElementById) {
    navRoot = document.getElementById("nav");
    for (i=0; i<navRoot.childNodes.length; i++) {
      node = navRoot.childNodes[i];
      if (node.nodeName=="LI") {
        node.onmouseover=function() {
          this.className+=" over";
        }
        node.onmouseout=function() {
          this.className=this.className.replace(" over", "");
        }
      }
    }
  }
}

/**
 * Change image in gallery.
 */

function changeImage(imgId, newImageId) {
  document.getElementById(imgId).src=document.getElementById(newImageId).src;
  document.getElementById(imgId).alt=document.getElementById(newImageId).alt;
  document.getElementById(imgId).title=document.getElementById(newImageId).alt;
}

/**
 * Load first image of gallery.
 */

function getStartImage() {
  try {
    document.getElementById('mainImageBoard').src=document.getElementById('image1hidden').src;
    document.getElementById('mainImageBoard').alt=document.getElementById('image1hidden').alt;
    document.getElementById('mainImageBoard').title=document.getElementById('image1hidden').alt;
  }
  catch(e) {
    /* ignore */
  }
}


/**
 * onload() event handler.
 */

init = function () {
  // Load first image of gallery.
  getStartImage();
  // Start the menu in internet explorer.
  if (document.all)
    startList();
}

window.onload = init;

