If you search Google for PHP/JS browser resolution detection, you'll get a ton of stuff. Otherwise I can find something for you when I'm at work tomorrow.
Alternatively you could design your site to have a liquid layout. http://www.maxdesign.com.au/presentation/liquid/
Hope that helps!