<!--- filename: mypage.html ---->
<html>
....blah blah blah
<script language=JavaScript src=/Javascript/center.js></script>
</html>
/*******************************
filename: center.js
********************************/
var xMax = screen.width, yMax = self.screen.availHeight;
if (document.body.clientWidth)
{
lnBodyClientWidth=document.body.clientWidth
lnBodyClientHeight=document.body.clientHeight
}
else
{
lnBodyClientWidth=window.innerWidth
lnBodyClientHeight=window.innerHeight
}
xOffset = (xMax - lnBodyClientWidth)/2, yOffset = (yMax -
lnBodyClientHeight)/2;
self.moveTo(xOffset,yOffset)
<!-- javascript size resize browser client width window offset move -->