Moved weather function outside of document.ready