The following script displays a pop up window with an image on it. However the problem that I see is that the window does not pop up at the center of the screen.
<HTML>
<Head>
<Script Language=”JavaScript”>
function openFullSize(Pix)
{
nullIMG.src = Pix;
wStr = nullIMG.width;
offsetW = wStr;
wStr = wStr+20;
wStr = “width=”+wStr;
hStr = nullIMG.height;
offsetH = hStr;
hStr = hStr+20;
hStr = “height=”+hStr;
lStr = (screen.width-50-offsetW)/2;
lStr = “left=”+lStr;
tStr = (screen.availHeight-90-offsetH)/2;
tStr = “top=”+tStr;
window.open(Pix,”FullSize”,”toolbar=0,status=0,scrollbars=yes, “+tStr+”,”+lStr+”,”+wStr+”,”+hStr+” “);
}
function buildSupport()
{
styleStr = “<Style> .placeHolder {Position:Absolute;Top:-2000;};</Style>”;
divStr = “<Div class=placeHolder><IMG Src=Null ID=nullIMG></Div>”
document.write(styleStr);
document.write(divStr);
}
buildSupport();
</Script>
<Body>
<center>
<H3>Thumbnail link to clean, dynamically sized window</H3>
<a href=javascript:openFullSize(‘screenshot2.jpg’)><img src=’screenshot2.jpg’ width=’140′ height=’105′ alt=’Click to enlarge’></a>
</center>
</Body>
</HTML>
How do I solve the problem?