Moved inline js code to its own file.