Fixing the problem of header and footer javascripts in all pages