function getpagesize () { var xscroll,yscroll; if (window.innerheight && window.scrollmaxy) { xscroll = window.innerwidth + window.scrollmaxx; yScroll = window.innerHeight + window.scrollMaxY; } else if ( Document.body.scrollheight > document.body.offsetheight) { // all but Explorer Mac xScroll = document.body.scrollWidth; yscroll = document.body.scrollheight; }else{// Explorer mac...would also work in explorer 6 strict, mozilla and Safari xScroll = Document.body.offsetwidth; yscroll = document.body.offsetHeight; } var windowWidth, windowHeight; if (self.innerheight) { // all except explorer windowWidth = self.innerWidth; windowHeight = self.innerHeight; } else if (document.documentelement && Document.documentElement.clientHeight) { // explorer 6 strict mode windowwidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else if (document.body) {// other explorers windowwidth = document.body.clientWidth; windowheight = document.body.clientheight; } // for small pages with total height less then height of the viewport var pageWidth,pageHeight; if (yscroll < windowheight) { pageHeight = windowHeight; }else{ pageheight = yscroll; } if (xscroll < windowwidth) { pagewidth = windowwidth; } else{ pagewidth = xscroll; } return { "PageWidth":p agewidth, "PageHeight":p ageheight } }//alert (GetPageSize (). PageHeight)