moving nav selection javascript to footer