moved inline js into a file