// File: dir-path.js
//
// Developed for Nuggets Hoops, by DecaTech Solutions, Inc.
//
// last modified: 11/26/2001

// Shows: NuggetsHoops / <Dir-Path> /
// Handles multi-level directory structure, and paths ending in a file!

var g_url = "";
//var href = document.location.href;
var split_url = document.URL.split("/");

// Loop thorough the splits starting after http:// 
// and ending on the parent directory of the current document
for (var i=2; i<split_url.length-1; i++) 
{
  // Start rebuilding the url to link each level
  g_url = g_url + split_url[i] +"/";
  
  if (i==2)
    document.write("<a href='http://" + g_url +"'>NuggetsHoops</a>");
  else
    document.write("<a href='http://" + g_url +"'>" + split_url[i] + "</a>"); 

  // Check to see if the last directory was written to avoid
  // an extra > after the parent directory of the current page
  if (i != split_url.length-2) 
    document.write(" > "); 
}
