added javascript for header function