The following two functions return the available width and height inside the browser window. These functions can be used as variables and as the dimensions are calculated every time they are used, your script will always be using the current window size no matter what the user does to the window.
function winWid(){ return (moz) ? window.innerWidth : document.body.clientWidth; }
function winHei(){ return (moz) ? window.innerHeight : document.body.clientHeight; }
Results for this browser window:
Try resizing your window and refreshing this page to see other results
These functions require the Simple Browser Check to operate.