Retrieving the window width/height in JS
Getting the window width in JS is usually done via window.innerWidth. IE sucks is different, as usual, though, so you have to use a fallback.
var width = (window.innerWidth || document.body.clientWidth);
Note that the value returned is a Number representing the width of the viewport in pixels. If you stuff it into a CSS value don't forget to add +"px".
I bet you can guess how to get the height!