Separated the javascript to a new file.