Browsers vary. There is no reliable way to take into account the height of the title bar, tool bar, scroll bar, location bar, and status bar chrome. You can approximate it at - say about 100. Also, you cannot use the exact script, obviously. It doesn't do what you want. So we may as well clean it up a bit.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
function popUp1(URL) {
var day = new Date(), id = day.getTime(),
l = screen.width ? (screen.width-300)/2 : 0,
t = screen.height ? (screen.height-500)/2 : 0;
t=t<0? 0 : t;
popUp1['i'+id]=window.open(URL,'i'+id,'toolbar,scrollbars,location,statusbar,width=300,height=400,left='+l+',top='+t);
}
</script>
</head>
<body>
<a href="http://google.com/" onclick="popUp1(this.href);return false;">Open</a>
</body>
</html>
Bookmarks