// JavaScript Document
// Pop-Up Embedder Script by David Battino, www.batmosphere.com; Object tag implementation by Mark Levitt, http://digitalmedia.oreilly.com
var UniqueID = 314 // Make each link open in a new window.
var newWinOffset = 0 // Position of first pop-up
var popwidth, popheight, newwidth, newheight;
function PicPopOpen(picwidth,picheight,picdesc,picfilepath) {

newwidth = picwidth*1.0  // Adjust the constant to make the image bigger
newheight = picheight*1.0

if( (picwidth/picheight) > 1 ) {   //For pictures that are wider than they are tall
  popheight = (newheight*1.15);
  popwidth = (newwidth*1.1);
} else {
  popheight = (newheight*1.1);
  popwidth = (newwidth*1.15);
}

// popwidth = (picwidth*1.05);
// popwidth = (picwidth + 50);
// popheight = (picheight*1.1);
PlayWin = window.open('',UniqueID,'width=' + popwidth +',height=' + popheight +',top=' + newWinOffset +',left=0,resizable=1,scrollbars=1,titlebar=0,toolbar=0,menubar=0,status=0,directories=0,personalbar=0');
PlayWin.focus(); 
var winContent = "<HTML><HEAD><TITLE>" + picdesc + "</TITLE></HEAD><BODY bgcolor='#FFFFFF'>";
winContent += "<div align='center'><IMG SRC='" + picfilepath + "' width='" + newwidth + "' height='" + newheight + "' border='1'></div>";  
winContent += "<P align='center' style='color:#000099;font-size:13px;font-family:Arial,sans-serif;font-weight:bold'>" + picdesc + "</P>";
winContent += "</BODY></HTML>";
PlayWin.document.write(winContent);
PlayWin.document.close(); // "Finalizes" new window
UniqueID = UniqueID + 1
// newWinOffset = newWinOffset + 20 // subsequent pop-ups will be this many pixels lower.
}
