split off the javascript in a separate file