Moving JS to index.php