var MAIN_WIDTH = 960; function globalResize() { var main = $('main'); var mainBlack = document.getElementById("mainBlack"); var wWidth = document.documentElement.clientWidth | document.body.clientWidth; var wHeight = document.documentElement.clientHeight | document.body.clientHeight; mainBlack.style.width = ((wWidth <= MAIN_WIDTH)?MAIN_WIDTH:wWidth) + "px"; mainBlack.style.height = ((wHeight > main.clientHeight)?wHeight:main.clientHeight) + "px"; } function $(id) { return document.getElementById(id); } function findPos(obj) { var curleft = curtop = 0; if (obj.offsetParent) { curleft = obj.offsetLeft curtop = obj.offsetTop while (obj = obj.offsetParent) { curleft += obj.offsetLeft curtop += obj.offsetTop } } return [curleft, curtop]; }