[ How to: ] Global (Page or section) navigation with event hooks and deeplinking - Glidias/Kilogaiajax GitHub Wiki
Basically, if you follow the //GLOBAL NAVIGATION
example as found in https://github.com/Glidias/Kilogaiajax/blob/master/js/main.js, it should work in most cases as a "catch-all" solution. It should even work with nested navigation links. What it does is, it scans through all anchor tags and applies a "selected" class to any relevant links based off the destination branch Gaiajax.api.getTargetPage().path
.