// this is from david flanagan's "javascript: the definitive guide".

var geometry = {};

if (window.innerWidth) { //all but ie
	geometry.viewportx = function () { return window.innerWidth; };
	geometry.viewporty = function () { return window.innerHeight; };
}
else if (document.documentElement && document.documentElement.clientWidth) { //ie 6, with doctype...
	geometry.viewportx = function () { return document.documentElement.clientWidth; };
	geometry.viewporty = function () { return document.documentElement.clientHeight; };
}
else if (document.body.clientWidth) { //ie 4, 5, and 6 no doctype...
	geometry.viewportx = function () { return document.body.clientWidth; };
	geometry.viewporty = function () { return document.body.clientHeight; };
}