moved the javascript for scales and parameter selection into a .js file

moved out of being inline. Prevents HTML errors being detected by the tests