Navigation bar fixes

Attempt to fix custom.js so that right relative position selected.
Still a problem with off main page references.