Moving JavaScript to the Footer Breaks the Website