docs: function buildNav(members) {
      var nav = '<h2><a href="index.html">Index</a></h2>',
          seen = {},
          hasClassList = false,
          classNav = '',
          globalNav = '',
  		diagramNav = '';
  	
      if (members.modules.length) {
          nav += '<h3>Modules</h3><ul>';
          members.modules.forEach(function(m) {
              if ( !hasOwnProp.call(seen, m.longname) ) {
                  nav += '<li>'+linkto(m.longname, m.name)+'</li>';
              }
              seen[m.longname] = true;
          });
          
          nav += '</ul>';
      }
      
      if (members.externals.length) {
          nav += '<h3>Externals</h3><ul>';
          members.externals.forEach(function(e) {
              if ( !hasOwnProp.call(seen, e.longname) ) {
                  nav += '<li>'+linkto( e.longname, e.name.replace(/(^"|"$)/g, '') )+'</li>';
              }
              seen[e.longname] = true;
          });
          
          nav += '</ul>';
      }
  
      if (members.classes.length) {
          members.classes.forEach(function(c) {
              if ( !hasOwnProp.call(seen, c.longname) ) {
                  classNav += '<li>'+linkto(c.longname, c.name)+'</li>';
              }
              seen[c.longname] = true;
          });
          
          if (classNav !== '') {
              nav += '<h3>Classes</h3><ul>';
              nav += classNav;
              nav += '</ul>';
          }
      }
  
      if (members.events.length) {
          nav += '<h3>Events</h3><ul>';
          members.events.forEach(function(e) {
              if ( !hasOwnProp.call(seen, e.longname) ) {
                  nav += '<li>'+linkto(e.longname, e.name)+'</li>';
              }
              seen[e.longname] = true;
          });
          
          nav += '</ul>';
      }
      
      if (members.namespaces.length) {
          nav += '<h3>Namespaces</h3><ul>';
          members.namespaces.forEach(function(n) {
              if ( !hasOwnProp.call(seen, n.longname) ) {
                  nav += '<li>'+linkto(n.longname, n.name)+'</li>';
              }
              seen[n.longname] = true;
          });
          
          nav += '</ul>';
      }
      
      if (members.mixins.length) {
          nav += '<h3>Mixins</h3><ul>';
          members.mixins.forEach(function(m) {
              if ( !hasOwnProp.call(seen, m.longname) ) {
                  nav += '<li>'+linkto(m.longname, m.name)+'</li>';
              }
              seen[m.longname] = true;
          });
          
          nav += '</ul>';
      }
  
      if (members.tutorials.length) {
          nav += '<h3>Tutorials</h3><ul>';
          members.tutorials.forEach(function(t) {
              nav += '<li>'+tutoriallink(t.name)+'</li>';
          });  
          nav += '</ul>';
      }
  	
  	// INIT: Diagrams code
  	if (Object.keys(diagrams).length) {
  		for(var g in diagrams){
              diagramNav += '<li>'+linkto(diagrams[g]._chartType+'-'+diagrams[g]._chartName, diagrams[g]._chartName)+'</li>';
          };
          nav += '<h3>Diagrams</h3><ul>' + diagramNav + '</ul>';	
  	}
  	// END: Diagrams code
      
      if (members.globals.length) {
          members.globals.forEach(function(g) {
              if ( g.kind !== 'typedef' && !hasOwnProp.call(seen, g.longname) ) {
                  globalNav += '<li>' + linkto(g.longname, g.name) + '</li>';
              }
              seen[g.longname] = true;
          });
          
          if (!globalNav) {
              // turn the heading into a link so you can actually get to the global page
              nav += '<h3>' + linkto('global', 'Global') + '</h3>';
          }
          else {
              nav += '<h3>Global</h3><ul>' + globalNav + '</ul>';
          }
      }
  
      return nav;
  }