Refactored GlobalNav method in global.js.