немного упростил =) <html> <head> <meta content="text/html; charset=windows-1251" http-equiv="content-type" /> <script type="text/javascript"> function findDimensions() { var height = 0; if(window.innerWidth) height = window.innerHeight; else if(document.body && document.body.clientWidth) height = document.body.clientHeight; var h = document.getElementById("layer"); if(h) h.style.height = height - 100 + "px"; } if (window.addEventListener) window.addEventListener("load", findDimensions, false); else if (window.attachEvent) window.attachEvent("onload", findDimensions); </script> </head> <body> <div id="layer" style="width:500px; border:2px solid #bb0000;"></div> </body> </html>