Move page interaction JS to top of file