Moved page javascript out of the view like a good boy