moved all javascripts to the top of the document