IE7 and document.body.offsetHeight;

I have this javascript code
That I use to set flash height in html.
It works but in IE7 it doesnt

alert shows that winH is 0

must I use something else instead of document.body.offsetHeight;?


if (parseInt(navigator.appVersion)>3) {
	if (navigator.appName=="Netscape") {
		winH = window.innerHeight;
	}
	if (navigator.appName.indexOf("Microsoft")!=-1) {
		winH = document.body.offsetHeight;
	}
}
window.alert(winH+" "+flashH)

if(winH<flashH)
{
	setFlashHeight('flash_div',flashH);
} else {
	setHeightToPerc('flash_div');
}

Please help!