  var path    = "";
  var href    = document.location.href;
  var string  = href.split( "/" );
  var section = "main";
  // go through the URL, finding the directory after ipvi2002
  for(var i = 2; i < string.length; i++ ) {
     if(section == "www.ipvi.org") {
	section = string[i];

	if(i == (string.length - 1) ) {
		section = (section.split("."))[0];
		i = string.length;
	}

	while( i < (string.length - 1) ) {
		path += "../";
		i++;
	}
     }
     if(string[i] == "www.ipvi.org") {
        section = "" + string[i];
     }
  }

  if(section == "www.ipvi.org") {
	section = "home";
  }

// Write the sidebar list
// In the if statements, the section should be equal to the directory 
// it represents; so if the events section is in the folder "events" then, say
// section == "events"
// in the if statement.

document.write("<p class=\"mainlink\"><a href=\"" + path + "index.html\">Home</a></p>");

document.write("<p class=\"mainlink\"><a href=\"" + path + "about/index.html\">About</a></p>");
if(section == "about") {
      document.write("<div class=\"sublink\" id=\"about\">");
	document.write("<p class=\"sublink\"> - <a href=\"" + path + "about/membership.html\">Membership</a></p>");
	document.write("<p class=\"sublink\"> - <a href=\"" + path + "about/fundraising.html\">Fundraising</a></p>");
	document.write("<p class=\"sublink\"> - <a href=\"" + path + "about/board.html\">Board of Directors</a></p>");
	document.write("<p class=\"sublink\"> - <a href=\"" + path + "about/advisory.html\">Advisory Council</a></p>");
      document.write("</div>");
}

document.write("<p class=\"mainlink\"><a href=\"" + path + "news/index.html\">News</a></p>");

document.write("<p class=\"mainlink\"><a href=\"" + path + "events/index.html\">Events</a></p>");
if(section == "events") {
      document.write("<div class=\"sublink\" id=\"events\">");
	document.write("<p class=\"sublink\"> - <a href=\"" + path + "events/summer.html\">Brookfield Zoo</a></p>");
      document.write("</div>");
}

document.write("<p class=\"mainlink\"><a href=\"" + path + "services/index.html\">Services</a></p>");
if(section == "services") {
      document.write("<div class=\"sublink\" id=\"services\">");
	document.write("<p class=\"sublink\"> - <a href=\"" + path + "services/scholarship.html\">Scholarship</a></p>");
	document.write("<p class=\"sublink\"> - <a href=\"" + path + "services/representative.html\">Regional Representatives</a></p>");
	document.write("<p class=\"sublink\"> - <a href=\"" + path + "services/networking.html\">Networking</a></p>");
	document.write("<p class=\"sublink\"> - <a href=\"" + path + "services/progplan.html\">Family Programs</a></p>");
	document.write("<p class=\"sublink\"> - <a href=\"" + path + "services/publicinform.html\">Public Information</a></p>");
	document.write("<p class=\"sublink\"> - <a href=\"" + path + "services/transition.html\">Transition</a></p>");
      document.write("</div>");
}

document.write("<p class=\"mainlink\"><a href=\"" + path + "products/index.html\">Products</a></p>");
if(section == "products") {
      document.write("<div class=\"sublink\" id=\"products\">");
	document.write("<p class=\"sublink\"> - <a href=\"" + path + "products/newsletter.html\">Newsletter</a></p>");
	document.write("<p class=\"sublink\"> - <a href=\"" + path + "products/resourcecat.html\">Resource Catalog</a></p>");
	document.write("<p class=\"sublink\"> - <a href=\"" + path + "products/publicity.html\">Publicity</a></p>");
      document.write("</div>");
}

document.write("<p class=\"mainlink\"><a href=\"" + path + "join/index.html\">Join</a></p>");

document.write("<p class=\"mainlink\"><a href=\"" + path + "volunteer/index.html\">Volunteer</a></p>");

document.write("<p class=\"mainlink\"><a href=\"" + path + "donate/index.html\">Donate</a></p>");

document.write("<p class=\"mainlink\"><a href=\"" + path + "advertise/index.html\">Advertise</a></p>");

document.write("<p class=\"mainlink\"><a href=\"" + path + "links/index.html\">Links</a></p>");