Move js from footer to separate file