<!--

// showpic.js
// Simple function to open an image in a new window.

// (c)2004 Mark Hennessy - http://www.mhennessy.f9.co.uk/


// Opens the image using SHOWPIC.HTM, which gets around the image resize "feature".
//
// IMPORTANT:    if in a sub-folder, current_folder must be
//               defined on the calling HTML page!
//

var current_folder = "";
var allow_jpg = true;
var allow_gif = true;

function showpic(img) {
  var url   = "showpic.htm?"
  if (current_folder != ""){   //Are we in the root, or a subfolder?
    url = "../" + url          //Not root. This ensures that SHOWPIC.HTM is found...
    }
  if (img.substring(0,7) != "http://"){  //Is image local to site?
    img = current_folder + "/" + img     //Yes, ensure right path
    }
  chrome="status=no,scrollbars=yes,resizable=yes,width=400,height=300,left=0,top=0";

  var flag = false;

  if ((img.match(".jpg")) && (allow_jpg)) flag = true;
  if ((img.match(".gif")) && (allow_gif)) flag = true;

  if (flag) {
    window.open(url + img,"",chrome);
    }
  else {
    alert('Due to recent problems with excess bandwidth, the enlarged version of this image is currently unavailable. I apologise for the inconvenience.');
    }
  }
// -->
