moved javascript out of html pages and into own file.