// open a pop-up window containing imgFile of w x h dimensions
function zoom(imgFile,w,h) {
  var nw = window.open("","_blank","toolbar=no,menubar=no,"+
    "location=no,width="+(w+30)+",height="+(h+60));
  var d = nw.document;
  if(d.open) d.open();
  d.writeln("<html><head><title>"+imgFile+" - HDAC</title>");
  d.writeln('<link rel="stylesheet" href="style.css">');
  d.writeln('<meta http-equiv="Content-Script-Type" ' +
    'content="text/javascript"></head>');
  d.writeln('<body link="#800000" bgcolor="#999999" ' +
    'background="bg.gif">');
  d.writeln('<p><font size="-2" style="font-size: 11px;">');
  d.writeln('<b style="font-weight: 700;">');
  d.writeln('&nbsp;&nbsp;&nbsp;&nbsp;');
  d.writeln('<a href="javascript:window.close();">');
  d.writeln('<font color="#FFFFFF">Close Window');
  d.writeln("</font></a></b></font></p>");
  d.writeln('<img src="'+imgFile+'" width="'+w+'" height="'+h+'">');
  d.writeln("</body></html>");
  if(d.close) d.close();
}

// connect anchors with id first, second, to zoom window
function connect(first,second,imgFile,w,h) {
  if(window.open && document.write) {
    var uri = 'javascript:zoom("' + imgFile + '",' +
      w + ',' + h + ');';
    if(document.getElementById) { // w3c dom
      var i = document.getElementById(first);
      if(i && i.href) i.href= uri;
      var i = document.getElementById(second);
      if(i && i.href) i.href= uri;
    } else if(document.all) { // msie dhtml
      var i = document.all[first];
      if(i && i.href) i.href= uri;
      var i = document.all[second];
      if(i && i.href) i.href= uri;
    }
  }
}
