placed javascript from index.php into a seperate file