Moved window resize code into common.js