How do i detect the browser's height and width?

Hi, I’m building a site for a company, and I’m having problems when it is viewed in different screen resolutions.

Basically, the header and footer stays put at the top and bottom, my problem is that when viewed on a larger screen resolution, the content part does not extend to the full height of the screen, thus leaving a gap between the content and the footer.

Is there a way for me (in javascript or asp) to detect the browser’s height and and use that value to define in css the content’s div height, so that even if the actual text isn’t long enough, the background will still extend all the way to the bottom?

Also I’m having trouble in ensuring the entire page is centered at all times.