var swapimages = new Array();

function initswaps() {
  if (document.getElementById) {
    var p = document.getElementById("hovers");
    if (!p) return;
    var alist = p.getElementsByTagName("a");
    for (var i=0; i<alist.length; i++) {
      var a = alist[i];
      swapimages[i] = new Image();
      swapimages[i].src = a.href;
      a.index = i;
      a.onmouseover = swap;
      a.onclick = zip;
      a.style.cursor = 'default';
    }
  }
}

function zip() {return false;}

function swap() {
  document.images.targetimage.src = swapimages[this.index].src;
  document.getElementById("caption").childNodes[0].data = this.title;
  return true;
}

function popup(filename, win, width, height) {
  var s = 'toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,' +
  'copyhistory=no,width=' + width + ',height=' + height;
  window.open(filename, win, s);
}

