    // Get the URL and location of a slash before the filename
    var sPath = window.location.href;
    var iLastSlash = sPath.lastIndexOf('/');
    
    // Get the filename without the extension (last slash up to the .)
    var sPage = getFileBaseName(sPath.substring(iLastSlash + 1));
    
    // Get the directory this file is in
    var iSecondLastSlash = sPath.substring(0, iLastSlash).lastIndexOf('/');
    subDir = sPath.substring(iSecondLastSlash + 1, iLastSlash);
    var parentDir = sPath.substring(window.location.host.length + 8, iSecondLastSlash);  // 8 = http:// + /
    
    var hostLength = window.location.host.length + 8;
    var URLHierarchy = sPath.substring(hostLength,iLastSlash).split('/');
    
    
    /***********************************************/
    
    var navArray = new Array();    
    var selMenuDepth = -1;
    var menuHTML = "";
    var hdrHTML = "";
    
    /***********************************************/
    
    // Object Prototypes
    function NavItem(label, href, menuRender, breadcrumbRender, childNav)
    {
    	this.label = label;
    	this.href = href;
    	this.menuRender = menuRender;
    	this.breadcrumbRender = breadcrumbRender;
    	this.childNav = ((childNav)?(new Array()):(null));
    }   
    
    function Nav()
    {
    	this.menuHTML = "";
    	this.breadcrumbHTML = "";
    	this.currHeader = "";
    	this.selInList = false;
    }


    function MenuList()
    {
    	this.html = "";
    	this.selInList = false;
    }
    
    // Builder Functions
    
    function buildHTML() {
        
        populateNavArray();
        
        var nav = BuildNav(navArray, -1, "/");
        
        nav.menuHTML = '<div id="leftNavMenu" style="width: 170px;">' + nav.menuHTML;
        nav.menuHTML += '</div>';
		nav.menuHTML += '<div id="bannerArea" style="margin:20px 0px 10px 25px;"><A HREF="http://www.keystogreen.com/" TITLE="Keys To Green Our Environmental Platform"><IMG SRC="/images/logo_KeysToGreen.gif" border="0" ALT="Keys To Green Our Environmental Platform"></A></div>';


		//nav.menuHTML += '<div id="bannerArea" style="margin:20px 0px 10px 25px;"><A HREF="http://www.arborday.org/enterprise/" TITLE="Enterprise Rent-A-Car 50 Million Tree Pledge" id="trees-banner"><IMG SRC="/images/50million_pledge_sm.gif" ALT="Enterprise Rent-A-Car 50 Million Tree Pledge" BORDER="0"></A></div>';
        
        menuHTML = nav.menuHTML;
        
        // build breadcrumb
        
        breadcrumbHTML = '<div id="breadCrumb"><a href="/index.html">Home</a>';
        breadcrumbHTML += nav.breadcrumbHTML;
        breadcrumbHTML += '</div>\n<div id="contentHeader">';
        breadcrumbHTML += nav.currHeader;
        breadcrumbHTML += '</div>';

    }
    
    function populateNavArray() {
    
        var x=0, y=0, z=0;
        
    
        // ref:  navItem(label, href, menuRender, breadcrumbRender, childNav)
        
        /* WHO WE ARE */
    	navArray[x] = new NavItem("Who We Are", "who_we_are.html", true, true, true); 
    	navArray[x].childNav[y++] = new NavItem("Neighborhood Network", "neighborhood_network.html", true, false, false);  
    	navArray[x].childNav[y++] = new NavItem("Culture of Customer Service", "customer_service.html", true, false, false);
    	navArray[x].childNav[y++] = new NavItem("Milestones", "milestones.html", true, false, false);
    	//navArray[x].childNav[y++] = new NavItem("Executive Bios", "executive_bios.html", true, false, false);
        x++; y=0; // increment / reset counters
        
    	/* WHAT WE DO */
    	navArray[x] = new NavItem("What We Do", "what_we_do.html", true, true, true);
    	navArray[x].childNav[y++] = new NavItem("Enterprise Rent-A-Car", "rent_a_car.html", true, false, false);
    	navArray[x].childNav[y++] = new NavItem("International Enterprise Car Rental Operations", "intl_operations.html", true, false, false);
    	navArray[x].childNav[y++] = new NavItem("Enterprise Fleet Management", "fleet_management.html", true, false, false);
    	navArray[x].childNav[y++] = new NavItem("Enterprise Car Sales", "car_sales.html", true, false, false);
    	navArray[x].childNav[y++] = new NavItem("Commercial Trucks", "rent_a_truck.html", true, false, false);
        x++; y=0; // increment / reset counters
    
    	
        
    	/* PRESS ROOM */
    	navArray[x] = new NavItem("Press Room", "press_room.aspx", true, true, true);
    	navArray[x].childNav[y++] = new NavItem("News Coverage", "NewsCoverage.aspx", true, false, false);
    	navArray[x].childNav[y++] = new NavItem("Press Releases", "PressReleases.aspx", true, false, false);
//    	navArray[x].childNav[y++] = new NavItem("Company Fact Sheets", "fact_sheets.html", true, false, false);
    	navArray[x].childNav[y++] = new NavItem("Media Contact Information", "media_contact_info.html", true, false, false);
    	navArray[x].childNav[y++] = new NavItem("FAQs", "faqs.html", true, false, false);
    	navArray[x].childNav[y++] = new NavItem("Awards", "awards.html", true, false, false);
    	navArray[x].childNav[y++] = new NavItem("Enterprise in Print", "enterprise_in_print.html", true, false, false);
    
    }
        
    function BuildNav(currNavArray, iDepth, rootDir) {
        
        var currNav = new Nav();
        var depth = iDepth+1;
        
        currNav.menuHTML += '<ul>\n';
        
        for (var x=0; x<currNavArray.length; x++) {
        
            var active = false;
            var childNav = null;
            
            if (currNavArray[x].menuRender) {
                currNav.menuHTML += '<li';
                
                if (inArray(URLHierarchy, getFileBaseName(currNavArray[x].href)) || sPage == getFileBaseName(currNavArray[x].href)) {
                    active = true;
                    currNav.currHeader = currNavArray[x].label;
                }
                
                if (currNavArray[x].childNav != null) {
                   childNav = BuildNav(currNavArray[x].childNav, depth, (rootDir + getFileBaseName(currNavArray[x].href) + '/')); 
                }
                
                if (childNav != null) {
                    if (childNav.selInList) {
                        active = true;
                        currNav.currHeader = childNav.currHeader;
                    }
                }
                
                if (active) {
                    currNav.menuHTML += ' class="active"';
                    if (currNavArray[x].breadcrumbRender && !(sPage == getFileBaseName(currNavArray[x].href))) {

//						Check for environmental and go to "Keys To Green".
						if (currNavArray[x].label == "Our Environmental Platform") {
							currNav.breadcrumbHTML += ' &gt; <a href="http://www.keystogreen.com/">' + currNavArray[x].label + '</a>';
						} else {
	                        currNav.breadcrumbHTML += ' &gt; <a href="' + rootDir + currNavArray[x].href + '">' + currNavArray[x].label + '</a>';
						}

					}
                    currNav.selInList = active;
                }
                currRootDir = rootDir;


//				Check for environmental and go to "Keys To Green".
				if (currNavArray[x].label == "Our Environmental Platform") {
					currNav.menuHTML += '><a href="http://www.keystogreen.com/">' +  currNavArray[x].label + '</a>';
				} else {
	                currNav.menuHTML += '><a href="' + rootDir + currNavArray[x].href + '">' +  currNavArray[x].label + '</a>';
				}
                
                if (childNav != null) {
                    if (childNav.menuHTML != "" && active) {
                        currNav.menuHTML += '\n' + childNav.menuHTML + '\n';
                        currNav.breadcrumbHTML += childNav.breadcrumbHTML;
                    }
                }
                currNav.menuHTML += '</li>\n'
            }
            
        }
        currNav.menuHTML += '</ul>\n';
        return currNav;
    }
    
    // Utility Functions
    function inArray(arr, val) {
        var inArr = false;
        for (var x=0; x<arr.length; x++) {
            
            if (arr[x] == val) {
                inArr = true; break;
                alert(arr[x] + ' : ' + val);
            }
        }
        return inArr;
    }
    
    function getFileBaseName(filename) {
        var rtn = filename.substring(0, filename.lastIndexOf("."));
        return rtn;
    }    

    // Render Functions
    function RenderMenu() {
        if (menuHTML == '') buildHTML();
        document.write(menuHTML);        
    }
    
    function RenderHeader() {
        if (breadcrumbHTML == '') buildHTML();
        document.write(breadcrumbHTML);        
    }
    
    populateNavArray();



    /***********************************************/
    
    function ValuesPopUp(pagename)
    {
      window.open("founding_values/" + pagename,'Values','WIDTH=500,HEIGHT=333,resizable=no,scrollbars=no')
    }
