move js from footer into js file