// Find the height of the viewport function windowHeight() { // A shortcut, in case we’re using Internet Explorer 6 in Strict Mode var de = document.documentElement; // If the innerHeight of the browser is available, use that return self.innerHeight || // Otherwise, try to get the height off of the root node ( de && de.clientHeight ) || // Finally, try to get the height off of the body element document.body.clientHeight; } // Find the width of the viewport function windowWidth() { // A shortcut, in case we’re using Internet Explorer 6 in Strict Mode var de = document.documentElement; // If the innerWidth of the browser is available, use that return self.innerWidth || // Otherwise, try to get the width off of the root node ( de && de.clientWidth ) || // Finally, try to get the width off of the body element document.body.clientWidth; }