Move javascripts to documents