Refactored out js for static pages in it's own file