I have this script that I got from some free JS site somewhere. Does anyone know why it doesn't work in NN4?

Code:
n = (document.layers) ? 1:0
ie = (document.all) ? 1:0

if (n) {
	windowWidth = window.innerWidth-16
	windowHeight = window.innerHeight
}
if (ie) {
	windowWidth = document.body.offsetWidth-20
	windowHeight = document.body.offsetHeight
}

document.writeln('<STYLE TYPE="text/css">');
document.writeln('<\!--');
document.writeln('#centerLayer {position:absolute; left:'+(windowWidth/2-780/2)+'; top:'+(windowHeight/2-440/2)+'; width:780; height:440; clip:rect(0,780,440,0); background-image: url(img/bg.gif); background-color: #FFFFFF; z-index:1' );
document.writeln('-->');
document.writeln('</STYLE>');
Thanks.

G