JavaScript Res Detection in Firefox

I’m trying to use a JavaScript detection to determine the user’s screen resolution. My script works fine in every browser except Firefox. No matter what resolution I use, my alert notifies me that I’m using 1024x768.

What could I be doing wrong?


<html>
<head>

<script language="Javascript1.1">
 
function detect(){
if(screen.height<864){
alert("Sorry. your current resolution is "+screen.width+" by "+screen.height+".  If possible please change your 
resolution.")
}
else{
alert("Whoa, nice resolution.")
}
 
}

</script>
</head>

<body onLoad="detect()">
</body>

</html>