From http://stackoverflow.com/questions/1248081/get-the-browser-viewport-dimensions-with-javascript
var w = Math.max(document.documentElement.clientWidth, window.innerWidth || 0) var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0)