function NavEntry(page_id, link, text) {
   var n = link.indexOf("#");

   if (n > -1)
      page = link.substr(0, n);
   else
      page = link;
 
   if (page_id == page)
      document.write("<li><a href=\"" + link + "\">&gt&gt " + text + "</a>");
   else
      document.write("<li><a href=\"" + link + "\">&gt " + text + "</a>");
}

function NavEntry2(page_id, link, base) {
   var n = link.indexOf("#");

   if (n > -1)
      page = link.substr(0, n);
   else
      page = link;

   if (page_id == page)
      file = base + "_active.png";
   else
      file = base + ".png";

   document.write("<td><a href=\"" + link + "\"><img border=0 src=\"" + file + "\"></a></td>");
}

function WriteNav(page_id) {

   document.write("The basics:");
   document.write("<ul>");
   NavEntry(page_id, "index.html#home", "Home");
   NavEntry(page_id, "index.html#lists", "Lists");
   document.write("</ul>");

   document.write("The tools:");
   document.write("<ul>");
   NavEntry(page_id, "names.html#yellow", "Find similar or grouped names");
   NavEntry(page_id, "names.html#green", "Ranks of names in a group");
   NavEntry(page_id, "names.html#green", "Rank entire name groups");
   document.write("</ul>");

   document.write("Observations and analysis");
   document.write("<ul>");
   NavEntry(page_id, "observations.html", "Naming creativity 1900-1999");
   document.write("</ul>");

   document.write("Other pages of interest");
   document.write("<ul>");
   NavEntry(page_id, "numbers.html", "Interpreting the rankings");
   NavEntry(page_id, "tech.html", "Tech notes about the tools");
   document.write("</ul>");

}

function WriteNav2(page_id) {
   document.write("<table width=\"800\" cellpadding=0 hspace=0 vspace=0 cellspacing=0 align=\"left\" valign=\"bottom\" border=0>");
   document.write("<tr><td><img src=\"title.png\" width=400 height=45></td>");
   
   NavEntry2(page_id, "index.html", "home");
   NavEntry2(page_id, "find.html", "find_names");
   NavEntry2(page_id, "names.html", "rank_names");
   NavEntry2(page_id, "observations.html", "study_trends");
   NavEntry2(page_id, "tech.html", "tech_notes");

   document.write("</tr></table>");
}
