I've done similar, but use JavaScript to do it for me as well. It's not the most elegant JS but it works. I used this when I had a div that needed to be maximum size, and it had a side bar, top and bottom bar etc. So when the browser window was resized I had to quickly adjust the container div (which was a map).
You want your markup to look like (I think you have this already):
<div id="container">
<div id="title">Title</div>
<div id="main"></div>
<div id="footer></div>
</div>
Script:
var browserWidth = 0;
var browserHeight = 0;
function getSize() {
if( typeof( window.innerWidth ) == 'number' )
{
//Non-IE
isIE = false;
browserWidth = window.innerWidth;
browserHeight = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
browserWidth = document.documentElement.clientWidth;
browserHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//They're not running IE7 / FireFox2. Older browser. Find some technology
//to destroy their computer so they're forced to upgrade.
browserWidth = document.body.clientWidth;
browserHeight = document.body.clientHeight;
}
}
function updateMapSize() {
//IE7 is 21 pixels LESS than FireFox.
//Pretty much we want to keep the map to the maximum size alloted.
getSize();
//top section
var height = browserHeight - 200;
document.getElementById("main").style.height = height;
document.getElementById("container").style.height = browserHeight ;
document.getElementById("container").style.width= browserWidth ;
setTimeout("updateMapSize()", 250);
}