// Breadcrumb maker ver. 0.2  1/15/04 Jim Dryden
/*  
Writes out the web doc directory path to serve as a rudimentary navigation aid for browsers.
version 0.2 : Brian does regexp to clean out tilde character in directory names.
*/
<!--
function buildDepth(iterations)
{
    var iterations=iterations-3;
    var depthStr="";
    for (i=0; i < iterations; i ++)
	    {
        depthStr=depthStr + "../";
    }
    return depthStr;
}
function buildBreadCrumbTrail()
{
	var unwantedChars = new RegExp(/~/g); // matches tilde (~) for the global string
    var constituentFolders = new Array(); // declare new array to hold folder names
    var rawURL = unescape(document.location.toString()); // value is the unescaped url
	var currentURL = rawURL.replace(unwantedChars, ""); // current url after regexp cleaning
        var currentURL = currentURL.replace('ict.nmsu.edu',"ICT");
    constituentFolders=currentURL.split("/"); // folders names are parsed into the array
    var outputStr="";
    for (count=2; count < (constituentFolders.length-1); count ++)
    {
        outputStr=outputStr +  " <ul><li> <a href='" + buildDepth((constituentFolders.length-count)+1) + " '>" + constituentFolders[count] + "</a></ul></li>";
    }
    document.write(outputStr);
}
// -->
