Relocated the script lines from the bottom of the boddies to the bottom of the heads in the html templates