code: private int calculateEndLevel() {
  
          int result = 0;
          if (m_navRootPath != null) {
              // where are we? (start level)
  
              StringTokenizer counter = new StringTokenizer(m_navRootPath, "/", false);
              // one less as level 0 nav elements accepted is one level (depth 1).
              result = counter.countTokens() - 1;
              if (!CmsResource.isFolder(m_navRootPath)) {
                  // cut stuff like system/workpalce/locale/de/help/index.html
                  result--;
              }
              result += m_depth;
          }
          if (result < 0) {
              result = 0;
          }
          return result;
      }
docs: Calculates and returns the navigation end level.<p>
  
  @return the navigation end level