Seperated js file

Seperated the javascript file from the main html