Может, вот так подойдёт? Не надо лепить js там, где можно обойтись версткой.
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <style>
        html, body {
            height: 100%;
        }
        div {
            width: 100%;
        }
        #container {
            height: 100%;
            display: table;
            background: red;
        }
        #div1 {
            display: table-row;
            min-height: 80px;
            max-height: 250px;
            background: yellow;
        }
        #div2 {
            display: table-row;
            background: blue;
        }
    </style>
    <title></title>
</head>
<body>
<div id="container">
    <div id="div1"> </div>
    <div id="div2"> </div>
</div>
</body>
</html>
P. S. Ну, конечно, не заработает в IE < 8.