function onw(file, title, width, height) {
	var win = window.open(file, title, 'toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,width=' + width + ',height=' + height + ',dependent=yes');
	if (win) {
		win.focus();
		var w2 = win.document.getElementsByTagName('body');
		if (w2) {
			w2[0].style.margin = w2[0].style.padding = 0;
		}
		
	}
	return win;
}

function openPopup (imageURL, caption) {

/*
Author:   John Gardner
Written:  8th November 2003
Updated:  27th January 2004

Calling sequence: <a href="a.jpg" onclick="return openPopup('a.jpg','Caption');">

The first parameter is the URL of the image to be opened, and the second 
parameter is the caption for the image which is displayed in the window title
and in the alt property of the image tag.

Note that the calling sequence will simply open the image in the main window if
JavaScript isn't enabled.
  
*/

  var windowTop = 100;                // Top position of popup
  var windowLeft = 100                // Left position of popup
  var defaultWidth = 550;             // Default width (for browsers that cannot resize)
  var defaultHeight = 400;            // Default height (for browsers that cannot resize)
  var onLoseFocusExit = false;         // Set if window to exit when it loses focus
  var undefined;

  // Set up the window open options
  var Options = "width=" + defaultWidth + ",height=" + defaultHeight + ",top=" + windowTop + ",left=" + windowLeft + ",toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,dependent=yes"
  
  var myScript = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n" +
    "<html><head><title>" + caption + "\</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\n" +
    "<script language=\"JavaScript\" type=\"text/javascript\">\n" +
    "function resizewindow () {\n" +
    "  var width = document.myimage.width;\n" + 
    "  var height = document.myimage.height;\n";
  
  // Netscape  
  if (navigator.appName.indexOf("Netscape") != -1) { 
    myScript = myScript +  "  window.innerHeight = height;\n  window.innerWidth = width;\n"
  }
   
  // Opera 
  else if (navigator.appName.indexOf("Opera") != -1) {
    myScript = myScript +  "  window.resizeTo (width+12, height+51);\n"
  }
  
  // Microsoft 
  else if (navigator.appName.indexOf("Microsoft") != -1) { 
  	if (navigator.appName.indexOf("MSIE 7.0") != -1)
	    myScript = myScript + "  window.resizeTo (width+12, height+71);\n" 
	else
	    myScript = myScript + "  window.resizeTo (width+12, height+51);\n" 
  }
  
  // Assume a frig factor for any other browsers
  else {
    myScript = myScript + "  window.resizeTo (width+14, height+34);\n"
  }
      
  myScript = myScript + "}\n" + "window.onload = resizewindow;\n" +
    "</script>\n</head>\n" + "<body ";
    
  // If the window is required to close when it loses focus.
  if (onLoseFocusExit) {myScript = myScript + "onblur=\"self.close()\" ";}
    
  myScript = myScript + "style=\"margin: 0px; padding: 0px;\">\n" +
    "<img src=\"" + imageURL + "\" alt=\"" + caption + "\" title=\"" + caption + "\" name=\"myimage\">\n" + 
    "</body>\n" +  "</html>\n";
        
  // Diagnostic - uncomment the next line if you wish to see the script generated.   
  // alert (myScript);
  
  // Create the popup window
  var windowName = imageURL.replace(/[^a-zA-Z0-9]/g, "");
  var imageWindow = window.open ("",windowName,Options);
  imageWindow.document.write (myScript);
  imageWindow.document.close ();
  if (window.focus) imageWindow.focus();
  return false;
}

function openPopupHScroll (imageURL, caption, w) {

  var windowTop = 100;
  var windowLeft = 100;
  var defaultWidth = w;
  var defaultHeight = 400;
  var undefined;

  // Set up the window open options
  var Options = "width=" + defaultWidth + ",height=" + defaultHeight + ",top=" + windowTop + ",left=" + windowLeft + ",toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,dependent=yes,scrollbars=yes"
  
  var myScript = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n" +
    "<html><head><title>" + caption + "\</title>\n" +
    "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\n" +
    "<script language=\"JavaScript\" type=\"text/javascript\">\n" +
    "function resizewindow () {\n" +
    "  var width = " + defaultWidth + ";\n" + 
    "  var height = document.myimage.height;\n";
  
  // Netscape  
  if (navigator.appName.indexOf("Netscape") != -1) { 
    myScript = myScript +  "  window.innerHeight = height+16;\n  window.innerWidth = width;\n"
  }
   
  // Opera 
  else if (navigator.appName.indexOf("Opera") != -1) {
    myScript = myScript +  "  window.resizeTo (width+12, height+67);\n"
  }
  
  // Microsoft 
  else if (navigator.appName.indexOf("Microsoft") != -1) { 
  	if (navigator.appName.indexOf("MSIE 7.0") != -1)
	    myScript = myScript + "  window.resizeTo (width+12, height+71);\n" 
	else
	    myScript = myScript + "  window.resizeTo (width+12, height+51);\n" 
  }
  
  // Assume a frig factor for any other browsers
  else {
    myScript = myScript + "  window.resizeTo (width+14, height+34);\n"
  }
      
  myScript = myScript + "}\n" + "window.onload = resizewindow;\n</script" + ">\n</head>\n<body ";
    
  myScript = myScript + " style=\"margin: 0; padding: 0;\">\n" +
    "<img src=\"" + imageURL + "\" alt=\"" + caption + "\" title=\"" + caption + "\" name=\"myimage\"></body></html>\n";
        
  // Diagnostic - uncomment the next line if you wish to see the script generated.   
  // alert (myScript);
  
  // Create the popup window
  var windowName = imageURL.replace(/[^a-zA-Z0-9]/g, "");
  var imageWindow = window.open ("",windowName,Options);
  imageWindow.document.write (myScript);
  imageWindow.document.close ();
  if (window.focus) imageWindow.focus();
  return false;
}

function jump() {
	var sel = document.getElementById('quickjump');
	if (sel) {
		window.location.href = sel.options[sel.selectedIndex].value;
	}
}