Switched to jQuery for width/heights of window. Also compensates better for scrollbars when centering.