<!--
/* preview */
function show_image(filename, ext, sizex, sizey) {
  var window_width, window_height;

  if (! sizex)
    sizex=350;

  if (! sizey)
    sizey=180;

  // Modify the height to allow for the description (if there is one)
  //try {
  //  tmp_str=eval(filename);
  //  tmp_len=(tmp_str.length / (sizex / 5)) * 30;
  //  sizey=sizey + tmp_len;
  //}
  //catch(exception) {
  //}

  window_width=sizex + 50;
  window_height=sizey + 110;

  var loc_x=(screen.width/2)-(window_width/2);
  var loc_y=(screen.height/2)-(window_height/2);
  if (window_width>(screen.width-12)) {
    window_width = screen.width-12;
    loc_x=0;
  }
  if (window_height>(screen.height-55)) {
    window_height = screen.height-55;
    loc_y=0;
  }

  var window_str="width=" + window_width + ",height=" + window_height + ",resizable=yes,toolbar=no,menubar=no,scrollbars=1,left=" + loc_x + ",top=" + loc_y;
  filename=escape(filename);
  window_title="Preview";
  if (ext == "html") {
    path = filename + "." + ext;
    window_title="Information";
  } else if ((ext == "pdf") || (ext == "avi")) {
    path = "images/" + filename + "." + ext;
  } else if (ext == "mov") {
    path = "display_anim.html?anim=" + filename + "&ext=" + ext + "&width=" + sizex;
  } else {
    path = "display_image.html?image=" + filename + "&ext=" + ext + "&width=" + sizex;
  }
  ImageWindow = window.open(path, window_title, window_str);
  ImageWindow.focus();
}
//-->