Tricky page navigation solution

WordPress is so good at so many things, but page navigation is not one of them.  I think it is because WordPress is a platform and page navigation is a bridge between design and development.

In steps this code from wphacks called “Page Sensitive Multi-Level Navigation

The mission was to display sub-pages of the current page you are on in the left nav and once you hit the bottom of the hierarchy to show pages which are parallel to that page within the same branch of the hierarchy.

If you have a ton of levels of nav – this code is for you.