Moved js into new file

New js file and close