moved javascript out of index.php