Split JS between header and footer