Wrap JS functions in document.ready statement