// Thumbnail Script
// (c) RJHM van den Bergh/comweb.nl, 2001
// support@comweb.nl
// 
// Edited by Scott Zimmer 6/2007
//
// This script opens a enlarge picture of a thumbnail.
// With the onUnload you can close the enlarged thumbnail when the user leaves the page.
//

var popupHandle;

function popup(picUrlString, capUrlString)
{

  // Always close the old one, so only one at a time is open
  if(popupHandle || popupHandle!=null)
  {
    if (!popupHandle.closed) popupHandle.close();
  }
  popupHandle=null;

  // create a feature string for the popup
  var windowWidth
  var windowHeight
    //var x=(screen.width-windowWidth)/2
  //var y=(screen.height-windowHeight)/2
  var featureString = "toolbar=no,scrollbars=no,resizable=no"
  //featureString += ',left='+x + ',top='+y
  //featureString += ',width='+windowWidth+',height='+windowHeight
featureString += ',width='+535+',height='+500

  // html content of the popup
  var htmlString = "<html><head><title>" + capUrlString + "</title><link rel=\"stylesheet\" type=\"text/css\" href=\"bomerpop.css\"></head>"
  htmlString += "<body onclick=\"self.close()\">"
  htmlString += "<div align=\"center\"><table><tr><td align=\"center\">"
  htmlString += "<IMG SRC=\"" + picUrlString + "\" BORDER=\"0\" WIDTH=" +windowWidth+ " HEIGHT=" +windowHeight+ ">"
  htmlString += "</td></tr><tr><td align=\"center\"><p>" + capUrlString + "</td></tr></table>"
  htmlString += "<div class=\"closewindow\">"  
  htmlString += "<A HREF=\"javascript:window.close();\" title=\"Close.\" >X Close Window</A>"  
  htmlString += "</div></div></body></html>"

  popupHandle = window.open("" ,"popup",featureString)
  popupHandle = window.open("" ,"popup")
  popupHandle.document.clear();
  popupHandle.document.writeln(htmlString);
  popupHandle.focus();
  popupHandle.document.close(); // should trigger the picture loading.
  return popupHandle;

}

function winclose()
{
  if (window.popupHandle!=null && !window.popupHandle.closed)
  {
    window.popupHandle.close();
  }
}

function doNothing(){} // does nothing but required by JavaScript in this case
//