/*
	BreadCrumbs.js
	Errol Sayre
	esayre@olemiss.edu
	
	Provided by the Office of Research and Sponsored Programs
	The University of Mississippi
	
	This script is free to be used but provides no warranty of function or quality.
*/

// BreadCrumb configuration
// set up the site prefix
var sitePrefix = "/";
	// Please note that we don't use the whole prefix, just the important
	//	part that we need for the server so as to make this script easy for
	//	us to migrate between testing and live server. You can use whatever you
	//	like here.

// set up the bread crumb separator text
var breadCrumbSeparator = " > ";

// set up our list of crumb items
	// The bread crumb items refer to items on your site that require special
	//	labels. You can specify a label specifically using the URI of the
	//	file/folder or generically for all occurences of a file/folder.
var breadCrumbLabels = new Array();
// generic labels

breadCrumbLabels["/"] = "USITC Home";
breadCrumbLabels["/index.htm"] = "Home";
breadCrumbLabels["/accessibility.htm"] = "Accessibility";
breadCrumbLabels["/acronyms.htm"] = "USITC Acronyms";
// specific labels


breadCrumbLabels["/site_map/"] = "USITC Site Map";
breadCrumbLabels["/press_room/about_usitc.htm"] = "About the International Trade Commission";

breadCrumbLabels["/calendar/"] = "This Week's Calendar of Events";
breadCrumbLabels["/calendar/future.htm"] = "Upcoming Calendar Events";

breadCrumbLabels["/contact_us.htm"] = "Contact Us";
breadCrumbLabels["/delivery.htm"] = "Delivery and Pick-Up Policy";

breadCrumbLabels["/docket_services/"] = "Docket Services";
breadCrumbLabels["/docket_services/about.htm"] = "About Docket Services";
breadCrumbLabels["/docket_services/codingmanual.htm"] = "EDIS Coding Manual";
breadCrumbLabels["/docket_services/faq.htm"] = "Frequently Asked Questions (FAQ)";
breadCrumbLabels["/docket_services/staff.htm"] = "Staff";


breadCrumbLabels["/employment/"] = "Office of Human Resources";
breadCrumbLabels["/employment/benefits.htm"] = "Benefits";
breadCrumbLabels["/employment/hiring_process.htm"] = "Hiring Process";
breadCrumbLabels["/employment/employee_forms.htm"] = "Personnel Forms";
breadCrumbLabels["/employment/meritsystem.htm"] = "Merit System Principles";
breadCrumbLabels["/employment/positions.htm"] = "Careers at USITC";
breadCrumbLabels["/employment/security.htm"] = "Security Eligibility";
breadCrumbLabels["/employment/worklife_program.htm"] = "Worklife Program";
breadCrumbLabels["/employment/usitc_facts.htm"] = "USITC Facts";

breadCrumbLabels["/ethics/"] = "USITC Ethics Program";

breadCrumbLabels["/equal_employment/"] = "Office of Equal Employment Opportunity";
breadCrumbLabels["/equal_employment/nofearactdata.htm"] = "No Fear Act Data";
breadCrumbLabels["/equal_employment/africanamericanprograms.htm"] = "African American Employment Programs";
breadCrumbLabels["/equal_employment/asianamericanprograms.htm"] = "Asian American/Asian Pacific Programs";
breadCrumbLabels["/equal_employment/federalwomensprogram.htm"] = "Federal Women's Program";
breadCrumbLabels["/equal_employment/hispanic_latino.htm"] = "Hispanic/Latino Program";
breadCrumbLabels["/equal_employment/nativeamericansprograms.htm"] = "Native American Programs";
breadCrumbLabels["/equal_employment/disabilities.htm"] = "Persons with Disabilities";

breadCrumbLabels["/faqs/"] = "Frequently Asked Questions";
breadCrumbLabels["/faqs/import_injury_faqs.htm"] = "Import Injury FAQs";
breadCrumbLabels["/faqs/tariff_affairs_faqs.htm"] = "Tariff Affairs FAQs";

breadCrumbLabels["/general_information.htm"] = "USITC General Information";
breadCrumbLabels["/glossary.htm"] = "USITC Glossary ";

breadCrumbLabels["/intellectual_property/337_stats.htm"] = "Section 337 Statistics";
breadCrumbLabels["/intellectual_property/contacts.htm"] = "Staff Directory for Office of Unfair Import Investigations";
breadCrumbLabels["/intellectual_property/int_prop_publications.htm"] = "337 Publications";
breadCrumbLabels["/intellectual_property/inv_his.htm"] = "337 Investigational History";
breadCrumbLabels["/intellectual_property/pilot_mediation.htm"] = "Pilot Mediation Program for Investigations Under Section 337 of the Tariff Act of 1930";

breadCrumbLabels["/open/"] = "Open Government at USITC";
breadCrumbLabels["/scripts/open/"] = "Open Government at USITC";

breadCrumbLabels["/oig/"] = "Office of Inspector General";
breadCrumbLabels["/oig/audit_reports.htm"] = "Audit, Inspection and Evaluation Reports";
breadCrumbLabels["/oig/inspection_reports.htm"] = "Inspection Reports";
breadCrumbLabels["/oig/semiannual_reports.htm"] = "Semi-Annual Reports";

breadCrumbLabels["/privacy_practices.htm"] = "Privacy Practices";




breadCrumbLabels["/press_room/"] = "Press Room";
breadCrumbLabels["/press_room/about_usitc.htm"] = "About the International Trade Commission";
breadCrumbLabels["/press_room/annual_report.htm"] = "Annual Reports";
breadCrumbLabels["/press_room/gen_info.htm"] = "What the USITC Is and Isn't";
breadCrumbLabels["/press_room/how_to_find.htm"] = "A Reporter's Guide to Finding Documents on www.usitc.gov";
breadCrumbLabels["/press_room/quick_facts.htm"] = "Quick Facts";
breadCrumbLabels["/press_room/budget_org_info.htm"] = "Budget and Organizational Information";

breadCrumbLabels["/press_room/hearing_testimony.htm"] = "Testimony";
breadCrumbLabels["/press_room/spotlight/carbon_steel_pipe_testimony.htm"] = "Certain Circular Welded Carbon Quality Steel Line Pipe from China and Korea";
breadCrumbLabels["/press_room/spotlight/gsp2008_testimony.htm"] = "Advice Concerning Possible Modifications to the U.S. Generalized System of Preferences, 2008 Review of Additions and Removals";

breadCrumbLabels["/press_room/news_release/"] = "News Releases";
breadCrumbLabels["/press_room/news_release/2009/"] = "2009 News Releases";
breadCrumbLabels["/press_room/news_release/2008/"] = "2008 News Releases";
breadCrumbLabels["/press_room/news_release/2007/"] = "2007 News Releases";
breadCrumbLabels["/press_room/news_release/2006/"] = "2006 News Releases";
breadCrumbLabels["/press_room/news_release/2005/"] = "2005 News Releases";
breadCrumbLabels["/press_room/news_release/2004/"] = "2004 News Releases";
breadCrumbLabels["/press_room/news_release/2003/"] = "2003 News Releases";
breadCrumbLabels["/press_room/news_release/2002/"] = "2002 News Releases";
breadCrumbLabels["/press_room/news_release/2001/"] = "2001 News Releases";
breadCrumbLabels["/press_room/news_release/2000/"] = "2000 News Releases";
breadCrumbLabels["/press_room/news_release/1999/"] = "1999 News Releases";
breadCrumbLabels["/press_room/news_release/1998/"] = "1998 News Releases";


breadCrumbLabels["/press_room/comm_photos.htm"] = "Commissioner Photos";
breadCrumbLabels["/press_room/bios.htm"] = "The Commissioners Biography Page";
breadCrumbLabels["/press_room/aranoff.htm"] = "Chairman Shara L. Aranoff";
breadCrumbLabels["/press_room/lane.htm"] = "Charlotte R. Lane";
breadCrumbLabels["/press_room/okun.htm"] = "Deanna Tanner Okun";
breadCrumbLabels["/press_room/pearson.htm"] = "Vice Chairman Daniel R. Pearson";
breadCrumbLabels["/press_room/pinkert.htm"] = "Dean A. Pinkert";
breadCrumbLabels["/press_room/williamson.htm"] = "Irving A. Williamson";

breadCrumbLabels["/press_room/case_stats.htm"] = "Case Statistics";
breadCrumbLabels["/press_room/general_factfinding.htm"] = "Understanding General Factfinding Investigations";
breadCrumbLabels["/press_room/statutory_resp.htm"] = "Understanding Other USITC Statutory Responsibilities";
breadCrumbLabels["/press_room/us337.htm"] = "Understanding Investigations Of Intellectual Property Infringement And Other Unfair Practices In Import Trade (Section 337) ";
breadCrumbLabels["/press_room/us_sunset.htm"] = "Understanding Five-Year (Sunset) Reviews";
breadCrumbLabels["/press_room/us_safeguard.htm"] = "Understanding Safeguard Investigations";
breadCrumbLabels["/press_room/usad.htm"] = "Understanding Antidumping & Countervailing Duty Investigations";


breadCrumbLabels["/publications.htm"] = "USITC Publications Archive";

breadCrumbLabels["/quicksubscribe.htm"] = "Free E-mail Updates from the U.S. International Trade Commission";

breadCrumbLabels["/related_sites/"] = "Related Government Links";
breadCrumbLabels["/related_sites/industry_links.htm"] = "By Industry";

breadCrumbLabels["/ind_econ_ana/"] = "Research and Analysis";

breadCrumbLabels["/research_and_analysis/africa.htm"] = "Commission Publications - Africa ";
breadCrumbLabels["/research_and_analysis/agriculture.htm"] = "Commission Publications - Agriculture";
breadCrumbLabels["/research_and_analysis/asia.htm"] = "Commission Publications - Asia";
breadCrumbLabels["/research_and_analysis/small_med_enterprises.htm"] = "Commission Publications - Small & Medium-Sized Enterprises";

breadCrumbLabels["/research_and_analysis/commission_publications.htm"] = "Commission Publications";
breadCrumbLabels["/research_and_analysis/commission_publications_yearly.htm"] = "Commission Publications by Year";
breadCrumbLabels["/research_and_analysis/free_trade_agreements.htm"] = "Commission Publications - Free Trade Agreements ";

breadCrumbLabels["/research_and_analysis/executive_briefings.htm"] = "Executive Briefings";
breadCrumbLabels["/research_and_analysis/import_restraints.htm"] = "Commission Publications - Import Restraints ";
breadCrumbLabels["/research_and_analysis/office_economics.htm"] = "Office of Economics";
breadCrumbLabels["/research_and_analysis/office_industry.htm"] = "Office of Industries";
breadCrumbLabels["/research_and_analysis/other.htm"] = "Commission Publications - Other ";
breadCrumbLabels["/research_and_analysis/other_industries.htm"] = "Commission Publications - Other Industries ";
breadCrumbLabels["/research_and_analysis/seminars_economics_archive.htm"] = "Economics Analysis Seminar Series Archive";
breadCrumbLabels["/research_and_analysis/seminars_industry_archive.htm"] = "Industry Analysis Seminar Series Archive";
breadCrumbLabels["/research_and_analysis/seminars_economics.htm"] = "Economics Analysis Seminar Series";
breadCrumbLabels["/research_and_analysis/seminars_industry.htm"] = "Industry Analysis Seminar Series";
breadCrumbLabels["/research_and_analysis/service_industries.htm"] = "Commission Publications - Service Industries";
breadCrumbLabels["/research_and_analysis/staff_products.htm"] = "Staff Publications";
breadCrumbLabels["/research_and_analysis/textile_apparel_industries.htm"] = "Commission Publications - Textile Apparel Industries";
breadCrumbLabels["/research_and_analysis/trade_preference_programs.htm"] = "Commission Publications - Trade Preference Programs";
breadCrumbLabels["/research_and_analysis/trade_shifts.htm"] = "Commission Publications - Trade Shifts";
breadCrumbLabels["/research_and_analysis/western_hemisphere.htm"] = "Commission Publications - Western Hemisphere ";
breadCrumbLabels["/research_and_analysis/year_in_trade.htm"] = "Commission Publications - Year in Trade ";
breadCrumbLabels["/research_and_analysis/ittr.htm"] = "Industry Trade and Technology Review";
breadCrumbLabels["/research_and_analysis/ier.htm"] = "International Economic Review ";

breadCrumbLabels["/secretary/"] = "Office of the Secretary";
breadCrumbLabels["/secretary/apo_forms_and_redbook.htm"] = "APO Forms and Redbook";
breadCrumbLabels["/secretary/staff.htm"] = "Staff";


breadCrumbLabels["/secretary/fed_reg_notices/"] = "Federal Register Notices";
																										

breadCrumbLabels["/secretary/fed_reg_notices/332/"] = "Industry and Economic Analysis Notices for Active Investigations";
breadCrumbLabels["/secretary/fed_reg_notices/701_731/"] = "Antidumping and Countervailing Duty Notices for Active Investigations ";
breadCrumbLabels["/secretary/fed_reg_notices/701_731/completed/"] = "Antidumping and Countervailing Duty Notices for Completed Investigations";
breadCrumbLabels["/secretary/fed_reg_notices/337/"] = "Intellectual Property Infringement and other unfair acts (section 337 notices for active investigations";	
breadCrumbLabels["/secretary/fed_reg_notices/337/completed/"] = "Intellectual Property Infringement and other unfair acts (section 337 notices for completed investigations";

breadCrumbLabels["/secretary/fed_reg_notices/service_lists/serv_lists_antidump.htm"] = "Service Lists - Antidumping and Countervailing Duty Investigations";
breadCrumbLabels["/secretary/fed_reg_notices/service_lists/serv_lists_sunset.htm"] = "Service Lists - Five-year (Sunset) Reviews";
breadCrumbLabels["/secretary/fed_reg_notices/Safeguard_201_204_421/"] = "Global and Special Safeguards";


breadCrumbLabels["/secretary/fed_reg_notices/hearings.htm"] = "Commission Hearings";
breadCrumbLabels["/secretary/fed_reg_notices/meetings/index.htm"] = "Commission Votes";
breadCrumbLabels["/secretary/fed_reg_notices/service_lists/"] = "Import Injury Service Lists";
breadCrumbLabels["/secretary/fed_reg_notices/rules/"] = "USITC Rules of Practice and Procedure";
breadCrumbLabels["/secretary/fed_reg_notices/sunset/"] = "Five-year (Sunset Reviews) for Active Investigations";		
breadCrumbLabels["/secretary/fed_reg_notices/Sunset/completed/"] = "Five-year (Sunset Reviews) for Completed Investigations";

breadCrumbLabels["/secretary/foia/"] = "Freedom of Information Act (FOIA) Home Page";
breadCrumbLabels["/secretary/foia/foia_faq.htm"] = "FOIA Frequently Asked Questions";
breadCrumbLabels["/secretary/foia/foia_requests.htm"] = "How to File a FOIA Request";
breadCrumbLabels["/secretary/foia/EO13392.htm"] = "Improving Agency Disclosure of Information (EO 13392)";
breadCrumbLabels["/secretary/foia/foia_readingroom.htm"] = "FOIA Public Reading Room";
breadCrumbLabels["/secretary/foia/foia_ereadingroom.htm"] = "FOIA Electronic Reading Room";
breadCrumbLabels["/secretary/foia_ereadingroom.htm"] = "Electronic Reading Room";
breadCrumbLabels["/secretary/rules/rules_public_comment.htm"] = "Recent Notices Seeking Public Comment";
breadCrumbLabels["/secretary/rules/historical_rules.htm"] = "Historical Rules-Related Notices";

breadCrumbLabels["/site_map/"] = "USITC Site Map";


breadCrumbLabels["/tariff_affairs/congress_reports/"] = "USITC Congressional Bill Reports ";
breadCrumbLabels["/tariff_affairs/congress_reports/111c.htm"] = "111th Congress";
breadCrumbLabels["/tariff_affairs/congress_reports/110c.htm"] = "110th Congress";
breadCrumbLabels["/tariff_affairs/congress_reports/109c.htm"] = "109th Congress";
breadCrumbLabels["/tariff_affairs/congress_reports/109c_pg2.htm"] = "109th Congress - Continued";
breadCrumbLabels["/tariff_affairs/congress_reports/108c.htm"] = "108th Congress - Continued";
breadCrumbLabels["/tariff_affairs/congress_reports/107c.htm"] = "107th Congress";
breadCrumbLabels["/tariff_affairs/congress_reports/106c.htm"] = "106th Congress";
breadCrumbLabels["/tariff_affairs/congress_reports/105c.htm"] = "105th Congress";

breadCrumbLabels["/tariff_affairs/"] = "Tariff Affairs Information Center";
breadCrumbLabels["/tariff_affairs/about_hts.htm"] = "About HTS";
breadCrumbLabels["/tariff_affairs/annex_index.htm"] = "Recent Free Trade Agreement Proclamation Annexes";
breadCrumbLabels["/tariff_affairs/bground/wco/"] = "Background Support for International Agreements";
breadCrumbLabels["/tariff_affairs/disclaimer.htm"] = "Classification of Exports and Imports";
breadCrumbLabels["/tariff_affairs/hts_help.htm"] = "HTS Help";
breadCrumbLabels["/tariff_affairs/modifications_hts.htm"] = "Modifications to the HTS";
breadCrumbLabels["/tariff_affairs/other_reports.htm"] = "Other Related Information";
breadCrumbLabels["/tariff_affairs/gen_info.htm"] = "Documents of the World Customs Organization";
breadCrumbLabels["/tariff_affairs/tata_pub_index.htm"] = "Tariff Affairs Publications & Related Documents";

breadCrumbLabels["/trade_remedy/"] = "Import Injury";
breadCrumbLabels["/trade_remedy/731_ad_701_cvd/investigations/active_index.htm"] = "Antidumping and Countervailing Duty Investigations";
breadCrumbLabels["/trade_remedy/731_ad_701_cvd/pub_opinion_index.htm"] = "Commission Opinions on AD-CVD Investigations ";
breadCrumbLabels["/trade_remedy/731_ad_701_cvd/understanding_ad_cvd.htm"] = "Understanding AD-CVD Investigations ";
breadCrumbLabels["/trade_remedy/about_global_safeguard_inv.htm"] = "About Global Safeguard Investigations";
breadCrumbLabels["/trade_remedy/ad_cvd_orders.htm"] = "AD/CVD Duty Orders ";
breadCrumbLabels["/trade_remedy/byrd_amendment.htm"] = "Byrd Amendment";
breadCrumbLabels["/trade_remedy/global_safeguards.htm"] = "Global and Special Safeguard Investigations";
breadCrumbLabels["/trade_remedy/publications/opinions_index.htm"] = "AD/CVD Publications ";
breadCrumbLabels["/trade_remedy/publications/"] = "Trade Remedy Publications ";

breadCrumbLabels["/trade_remedy/question.htm"] = "Generic Questionnaires";
breadCrumbLabels["/trade_remedy/publications/safeguard_pubs.htm"] = "Safeguard Publications ";
breadCrumbLabels["/trade_remedy/sunset_reviews.htm"] = "Five-year (Sunset Reviews)";
breadCrumbLabels["/trade_remedy/trade_laws.htm"] = "Trade Laws";
breadCrumbLabels["/trade_remedy/trao/"] = "Trade Remedy Assistance";
breadCrumbLabels["/trade_remedy/trao/trao_program_info.htm"] = "Program Information";
breadCrumbLabels["/trade_remedy/trao/trade_laws.htm"] = "Laws";
breadCrumbLabels["/trade_remedy/USC-Title_19_1671-1677.htm"] = "U.S.C. - Title 19 Customs Duties: AD/CVD 1671-1677";

breadCrumbLabels["/web_privacy_notice.htm "] = "Web Privacy Notice";



//breadCrumbLabels["images/"] = "Images Folder";

function displayBreadCrumbs(attempts)
{
	// locate the breadcrumb container
	var theBreadCrumbBar = null;
	if (document.all)
	{
		theBreadCrumbBar = document.all.BreadCrumbBar;
	}
	else
	{
		theBreadCrumbBar = document.getElementById("BreadCrumbBar");
	}
	
	// check to make sure that we have our breadcrumb bar
	if (theBreadCrumbBar != null)
	{
		// get the current url
		// we'll want to ensure that we get the start of our site so, we'll
		//	ignore everything up to and including our site prefix
		var thePath = location.href;
		var theProtocol = "";
		var theSite = "";
		
		// strip out the protocol from the path
		theProtocol = thePath.substring(0, thePath.indexOf("://") + 3);
		thePath = thePath.substring(thePath.indexOf("://") + 3);
		
		// strip out the site name
		theSite = thePath.substring(0, thePath.indexOf(sitePrefix));
		thePath = thePath.substring(thePath.indexOf(sitePrefix));
		
		// strip out the site prefix
		thePath = thePath.substring(thePath.indexOf(sitePrefix) + sitePrefix.length);
		
		// remove hash links
		var theHash = "";
		if (thePath.indexOf("#") > -1)
		{
			theHash = thePath.substring(thePath.indexOf("#"));
			thePath = thePath.substring(0, thePath.indexOf("#"));
		}
		
		// break out the individual pieces of the location
		var crumbs = thePath.split("/");
		var currentPath = sitePrefix;
		var crumbCount = 0;
		
		// add a "home" link
		// create a bread crumb container
		var breadCrumb = document.createElement("span");
		breadCrumb.setAttribute("class", "breadCrumb");
		
		// determine the crumb label
		// first use the default
		var crumbLabel = "Welcome to the USITC";
		
		// second look for a generic label
		if ((breadCrumbLabels[sitePrefix] != null))
		{
			crumbLabel = breadCrumbLabels[sitePrefix];
		}
		
		// third look for a specific label
		if ((breadCrumbLabels[currentPath] != null))
		{
			crumbLabel = breadCrumbLabels[currentPath];
		}
		
		// add the text
		// check to see if there are any crumbs after this one
		if ((0 < crumbs.length) &&
			((crumbs[0].toLowerCase().indexOf(".htm") == -1) || 
			(crumbs[0].toLowerCase().indexOf(".asp") == -1)) && 
			(crumbs[0] != ""))
		{
			// create a new link
			var linkTag = document.createElement("a");
			linkTag.href = theProtocol + theSite + currentPath;
			linkTag.appendChild(document.createTextNode(crumbLabel));
			breadCrumb.appendChild(linkTag);
		}
	else
		{
			// add the text together
			breadCrumb.appendChild(document.createTextNode(crumbLabel));
		}
		theBreadCrumbBar.appendChild(breadCrumb);
		
		// increment our count of crumbs
		crumbCount++;
		
		// loop through the crumbs
		for (var crumbIndex = 0; crumbIndex < crumbs.length; crumbIndex++)
		{
			if (! isHiddenCrumb(crumbs[crumbIndex])) {
				// setup the current path
				currentPath += crumbs[crumbIndex];
				if (crumbIndex + 1 < crumbs.length)
				{
					currentPath += "/";
				}
				
				if ((crumbs[crumbIndex] != "") &&
					((crumbs[crumbIndex].toLowerCase().indexOf(".htm") == -1) ||
					(crumbs[crumbIndex].toLowerCase().indexOf(".asp") == -1)))
				{
					// add this crumb to the list
					// create a bread crumb container
					var breadCrumb = document.createElement("span");
					breadCrumb.setAttribute("class", "breadCrumb");
					
					// add a greater than to the left hand side
					if (crumbCount > 0)
					{
						breadCrumb.appendChild(document.createTextNode(breadCrumbSeparator));
					}
					
					// determine the crumb label
					// first use the crumb itself
					var crumbLabel = crumbs[crumbIndex].replace(/_/g, " ");
					crumbLabel = crumbLabel.replace(/\.htm.*$/gi, "");
					crumbLabel = crumbLabel.replace(/\.asp.*$/gi, "");
					crumbLabel = crumbLabel.capitalize();
					
					// second look for a generic label
					if ((breadCrumbLabels[crumbs[crumbIndex]] != null))
					{
						crumbLabel = breadCrumbLabels[crumbs[crumbIndex]];
					}
					
					// third look for a specific label
					if ((breadCrumbLabels[currentPath] != null))
					{
						crumbLabel = breadCrumbLabels[currentPath];
					}
					
					// add the text
					// check to see if there are any crumbs after this one
					if ((crumbIndex + 1 < crumbs.length) &&
						((crumbs[crumbIndex + 1].toLowerCase().indexOf(".htm") == -1) ||
						(crumbs[crumbIndex + 1].toLowerCase().indexOf(".asp") == -1)) &&
						(crumbs[crumbIndex + 1] != ""))
					{
						// create a new link
						var linkTag = document.createElement("a");
						linkTag.href = theProtocol + theSite + currentPath;
						linkTag.appendChild(document.createTextNode(crumbLabel));
						breadCrumb.appendChild(linkTag);
					}
					else
					{
						// add the text together
						breadCrumb.appendChild(document.createTextNode(crumbLabel));
					}
	
					theBreadCrumbBar.appendChild(breadCrumb);
					
					// increment our count of crumbs
					crumbCount++;
				}
			}	
		}
	}
	else if (attempts < 5)
	{
		// try again in a few seconds
		attempts++;
		setTimeout("displayBreadCrumbs(" + attempts + ");", 1000);
	}
}

// add a handy function to the string class
String.prototype.capitalize = function()
{
	return this.replace(/\w+/g, function(a)
	{
		return a.charAt(0).toUpperCase() + a.substr(1).toLowerCase();
	});
};


function isHiddenCrumb (crumb) {
		
	//hidden url paths 
	var hiddenCrumbs = new Array();

	hiddenCrumbs[hiddenCrumbs.length] = "scripts";

	var isHidden = false;
	
	for (var hiddenCrumbIndex = 0; hiddenCrumbIndex < hiddenCrumbs.length; hiddenCrumbIndex++) {
		if (hiddenCrumbs[hiddenCrumbIndex].toLowerCase() == crumb.toLowerCase()) {
			isHidden = true;
		}
	}	

	return isHidden;
}

// set us up to display bread crumbs
displayBreadCrumbs(1);
