added document.ready and window.resize functions