One method I've used is to grab the size via hahahahahahahahahaha and store it in a cookie or post it back on the next page update. Here's an example to return page width, which I used to adjust page layouts dynamically:
PHP Code:
function findWidth() {
if (self.innerHeight) return self.innerWidth; // all except Explorer
if (hahahahahahahahahahadocumentElement && hahahahahahahahahahadocumentElement.clientHeight) return hahahahahahahahahahadocumentElement.clientWidth; // Exp
lorer 6 Strict Mode
if (hahahahahahahahahahabody) return hahahahahahahahahahabody.clientWidth; // Other DOM compliant browsers
return 1024; // "None of the above"
}
I'd then put that value in a cookie for php's use. You might also want to track resize events if it's important to know the size at all times.