changed localStorage access and navbar functionality to javascript functions