/****************************************************/
/*  Yahoo-Style Paths, Second Version               */
/*  Written by Seth Dillingham                      */
/*  Wednesday, July 19, 2000                        */
/*                                                  */
/*  This version replaces a given character in      */
/*  in directory names with a space (ie "_" -> " ") */
/****************************************************/

var docPath = new String( window.location.pathname )
var aParts = docPath.split( "/" )

// set the path separator to anything you want
var pathSeparator = "&nbsp;|&nbsp;"
var pathString = "/"
var wordSeparator = "_"  // the char to replace with a space
var ix
var part
var i


for ( i = 1; i <= aParts.length - 1; i++ )
{
    pathString += aParts[ i ] + "/";
    
    if ( i < aParts.length - 1 )
    {
        // we haven't yet reched the last item, so make a link to the directory
        document.write( );
        
        ix = 0;
        ix = aParts[ i ].indexOf( wordSeparator, ix );
        
        if ( ix != -1 )  // there is a wordSeparator char in the directory name
        {
            var aNameParts = aParts[ i ].split( wordSeparator );
            document.write( aNameParts.join( " " ) );
        }
        else
        {
            document.write( aParts[ i ] );
        }
    }
    else
    {
        // we've reached the last item in the URL, so just list the page's title
        document.write( document.title );
    }
    
    // if we haven't reached the last item yet, then
    if ( i < aParts.length - 1 )
    {
        // close the A tag
        document.write( "</A>" );
        
        // write the separator (the text between items)
        document.write( pathSeparator );
    }
}
