Código javascript
:
Ver originalvar Div=document.getElementById('div');
Div.style.position='fixed';
var w=parseInt(Div.style.width);
var h=parseInt(Div.style.height);
Div.style.left=(document.body.offsetWidth/2-(w/2))+'px';
Div.style.top=(document.body.offsetHeight/2-(h/2))+'px';