function getheightofdoc () {
	var x,y;
	var test1 = document.body.scrollHeight;
	var test2 = document.body.offsetHeight;
	var test3 = document.documentElement.scrollHeight;
					
	if (test1 > test2) // all but Explorer Mac
	{
		if (test1 > test3) {
			x = document.body.scrollWidth;
			y = document.body.scrollHeight;
		}
		else {
			x = document.documentElement.scrollWidth;
			y = document.documentElement.scrollHeight;
		}
	}
	else // Explorer Mac;
	     //would also work in Explorer 6 Strict, Mozilla and Safari
	{
		if (test1 > test3) {
			x = document.body.offsetWidth;
			y = document.body.offsetHeight;
		}
		else {
			x = document.documentElement.scrollWidth;
			y = document.documentElement.scrollHeight;
		}			
	}
	return(y);
}
