move javascript from header to footer