function getDocumentWidth() {
var w1 = window.innerWidth; // Width (in pixels) of the browser window viewport including, if rendered, the vertical scrollbar.
var w2 = document.documentElement.clientWidth;
var w3 = document.body.clientWidth;
return Math.max(w1, w2, w3);
}
function getDocumentHeight() {
var h1 = window.innerHeight; // Height (in pixels) of the browser window viewport including, if rendered, the horizontal scrollbar.
var h2 = document.documentElement.clientHeight;
var h3 = document.body.clientHeight;
return Math.max(h1, h2, h3);
}