Moved jQuery functions from head to .js file