Fixed bug in JS that caused window.onresize event not to fire.