I got this code from this question (How to get document height and width without using jquery) :
width = Math.max(
document.documentElement.clientWidth,
document.body.scrollWidth,
document.documentElement.scrollWidth,
document.body.offsetWidth,
document.documentElement.offsetWidth
);
How reliable is it? It doesn't seem to work as expected on Opera 12 - but that's rather old now.
Other than that browser it seems to be OK.