window.size = function() { var w = 0; var h = 0; //IE if(!window.innerWidth) { //strict mode if(!(document.documentElement.clientWidth == 0)) { w = document.documentElement.clientWidth; h = document.documentElement.clientHeight; } //quirks mode else { w = document.body.clientWidth; h = document.body.clientHeight; } } //w3c else { w = window.innerWidth; h = window.innerHeight; } return {width:w,height:h}; } function resizeWin(){ var winheight = Math.round(window.size().height); if(winheight < 800){ $('maincontainer').style.height = '800px'; $('leftcol').style.height = '800px'; } else { $('maincontainer').style.height = '100%'; $('leftcol').style.height = '100%'; } } var hW = Math.round(window.size().width/2); var hH = Math.round(window.size().height/2);