// Photo Pop Script for Story Pages
var newWindow;
var newContent;

function writeToWindow() {
  newWindow.document.write(newContent);
  newWindow.document.close();
}

function photoPop(photo,title,caption,credit,pW,pH) {
var w = pW;
var h = pH + 40;


if (pW == 450)
var dim = "hz";
else
var dim = "vr";
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
var dimensions = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable=yes';
newWindow = window.open("","funeralPhoto",dimensions);
newContent = "<html>" + "<head>";
newContent += "<title>"+title+"</title>";
newContent += "</head>";
newContent += "<body marginheight=0 marginwidth=0 topmargin=0 leftmargin=0 onLoad=\"window.focus();window.moveTo("+winl+","+wint+");window.resizeTo("+(w+10)+","+(h+50)+");\">";
newContent += "<table width=\"100%\">";
newContent += "<tr><td>";
newContent += "<img src=\"images/" + photo + "\" width=\"" + w + "\"></img>";
newContent += "</td></tr>";
newContent += "<tr align=\"center\"><td>";
newContent += "<b>"+caption+"</b>";
newContent += "</td></tr></table>";
newContent += "</body>" + "</html>";

// alert(newContent);

setTimeout("writeToWindow()",50);

}