- if(this.get(0) == document) {\r
-\r
- var test1 = document.body.scrollHeight;\r
- var test2 = document.body.offsetHeight;\r
- if (test1 > test2) return document.body.scrollHeight;\r
- else return document.body.offsetHeight; \r
- }\r
+ if ( this.get(0) == document )\r
+ return Math.max( document.body.scrollHeight, document.body.offsetHeight );\r