moved JS to separate file

all the JS from index.html to js/main.js