merge js into index

made javascript only 1 function, so just moved it into the index.html file.