Updated the javascript to be in it's own javascript file.