After checking out a few places the best results are gained by using:
document.body.clientHeight and document.body.clientWidth
These seem to work with all browsers except Netscape 4.
document.documentElement.clientHeight and document.documentElement.clientWidth
are also worth trying, but do not work for ie 5 & some ie 6 browsers.
I did try:
window.innerHeight and window.innerWidth
but these do not work with ie at all, and so are pretty useless.
I used this with
docprint = window.open(url, "modal", "height="+document.body.clientHeight+", width="+document.body.clientWidth);
docprint.focus();
Update: try
document.documentElement.clientHeight
document.documentElement.clientWidth
seems to work on all browsers including IE 7 and 8
More Information: http://www.howtocreate.co.uk/tutorials/javascript/browserwindow