Nice javascript to set window size for popups

This is some spiffy javascript to get the proper sizes of the window for say a nifty colorbox popup;

An example of using it is like this;

Dont forget to bind the window resize to reset your size variables;

Enjoy!