Create functions.js

remove JS from index.php