move inline js to its own file