Moved JavaScript into it's own file