moved more js from html files to js files