Refactored code for nav to work better in Umbraco