Here's a way to dynamically generate a window and resize it to the pic size.
var str = " ";
var w;
var topPos = 0;
var leftPos = 0;
var wt = 0;
var ht = 0;
var picName = "";
function getPic(pn, m, n)
{
if(screen)
{
leftPos = (screen.width - m)/2;
topPos = (screen.height - n)/2;
wt = m;
ht = n;
}
picName = pn;
w = window.open("","","toolbars=no,scrollbars=no,resizable=no,directories=no,location=no,left="+leftPos+",top="+topPos+",width="+wt+",height="+ht);
str = "<body marginwidth='0' marginheight='0' topmargin='0' leftmargin='0'>";
str += "<a href = \"javascript:self.close()\"><img src = ";
str += picName.toString();
str += " border = '0'><\/a>";
str += "<\/body>";
writeWin();
}
function writeWin()
{
if(w && w.open)
{
w.focus();
w.document.open();
w.document.write(str);
w.document.close();
}
else
{
writeWin();
}
}
and for the link put-
<a href="#" onclick="getPic('images/myPic.jpg',320,427);return false">
~mgb