/*******************************************************
*                 B R E A D C R U M B S                *
*                                                      *
* Modified and implimented for the DMOHP by David Mart *
*                                                      *
*                                                      *
*******************************************************/

// ====================
// ===== Features =====
// ====================
// This script allows you to:
//    * Rename folders in the breadcrumb        see Folder Names
//    * Exclude folders from the breadcrumb     see Folders to Exclude
//    * Add extra links to the breadcrumb       see Extra Crumbs
//    * Add extra links after a crumb           see Extra Crumbs After
//    * Change the link of breadcrumb element   see Change a Crumb's Link


// ====================
// ==== Parameters ====
// ====================
var documentLocation = 'breadcrumb'; // SPAN or DIV ID for breadcrumb location
var folderNameCount = 0; // Increments the place counter for the folderNames list
var excludedFolderCount = 0; // Increments the place counter for the excludedFolders list
var includedFolderBeforeCount = 0; // Increments the place counter for the includedFolders... lists
var includedFolderAfterCount = 0; // Increments the place coutner for the includeFoldersAfter... lists

folderNames = new Object(); // List containing the exact folder names to be replaced and the desired text representation
textNames = new Object(); // List containing the desired text to be displayed in the breadcrumb for the related folder in folderNames

excludedFolders = new Object(); // List containing folders names to exclude from the breadcrumb
includeFoldersName = new Object(); // List containing extra crumbs (links) to include in the breadcrumb
includeFoldersLink = new Object(); // List containing the link for the extra crumb
includeFoldersBefore = new Object(); // List containing the element with the extra link should occur before

includeFoldersAfter = new Object(); // List containing extra crumbs (links) to include after the specified crumb
includeFoldersAfterName = new Object();  // List containing the desired text to be displayed for the specified crumb
includeFoldersAfterLink = new Object(); // List containing the element link for the extra crumb


// ================
// = Folder Names =
// ================
// This section allows you to enter the name of a folder in the breadcrumb that you would like replaced with text
// Entries are made in the form: addFolderName('FOLDER_NAME','TEXT_NAME');
//
// where FOLDER_NAME is replaced by the name of the folder and
// TEXT_NAME is replaced by the desired text

  // --- Oral History Project folders --- //
addFolderName('grhc','Home');
addFolderName('dakotamemories','Dakota Memories');
addFolderName('collections','Special Collections');
addFolderName('memorial','Memorials');
addFolderName('public','Public Events');
addFolderName('locations','Locations');
addFolderName('order','Orders');
addFolderName('workshops','Workshops');
addFolderName('presentations','Presentations');
addFolderName('forum','Forums');



  // --- Heritage Tour folders --- //
addFolderName('heritage','Heritage Tour');
addFolderName('addresources','Additional Resources');
addFolderName('comments','Comments');
addFolderName('photos','Photos');
addFolderName('about_us','About Us');


  // --- Oral History Project and Heritage Tour shared folder names --- //
addFolderName('news','News');
addFolderName('itinerary','Itinerary');

  // --- Narrator Profiles --- //


// ======================
// = Folders to Exclude =
// ======================
// This section allows you to specify folders you would like omitted from the breadcrumb
// Entries are made in the form: addExcludedFolder('FOLDER_NAME');
//
// where FOLDER_NAME is replaced by the name of the folder to be omitted

  // --- Oral History Project folders --- //
addExcludedFolder('2005');
addExcludedFolder('2006');
addExcludedFolder('2007');
addExcludedFolder('2008');
addExcludedFolder('2009');



  // --- 2005 --- //
addExcludedFolder('boschee_a','');
addExcludedFolder('buck_a','');
addExcludedFolder('buck_l','');
addExcludedFolder('dewald_e','');
addExcludedFolder('drefs_e','');
addExcludedFolder('fercho_c','');
addExcludedFolder('fiechtner_m','');
addExcludedFolder('fischer_e','');
addExcludedFolder('fischer_r','');
addExcludedFolder('hartmann_m','');
addExcludedFolder('herman_h','');
addExcludedFolder('heyne_m','');
addExcludedFolder('kaseman_a','');
addExcludedFolder('kaseman_l','');
addExcludedFolder('kleingartner_r','');
addExcludedFolder('klundt_l','');
addExcludedFolder('long_c','');
addExcludedFolder('presler_l','');
addExcludedFolder('schaffer_e','');
addExcludedFolder('schlecht_e','');
addExcludedFolder('schott_a','');
addExcludedFolder('wanner_g','');
addExcludedFolder('zimmerman_delmar','');
addExcludedFolder('zimmerman_deloris','');
  // --- 2006 --- //
addExcludedFolder('axtmann_n','');
addExcludedFolder('bender_a','');
addExcludedFolder('bertsch_e','');
addExcludedFolder('black_j','');
addExcludedFolder('boechler_r','');
addExcludedFolder('boechler_w','');
addExcludedFolder('brossart_v','');
addExcludedFolder('degenstein_l','');
addExcludedFolder('dobler_s','');
addExcludedFolder('ebach_m','');
addExcludedFolder('eckroth_l','');
addExcludedFolder('engelhart_f','');
addExcludedFolder('engelhart_j','');
addExcludedFolder('erbele_r','');
addExcludedFolder('ferner_b','');
addExcludedFolder('ferner_c','');
addExcludedFolder('herauf_l','');
addExcludedFolder('herr_r','');
addExcludedFolder('hoffart_a','');
addExcludedFolder('hoffart_f','');
addExcludedFolder('jahner_m','');
addExcludedFolder('johner_j','');
addExcludedFolder('johner_l','');
addExcludedFolder('johner_p','');
addExcludedFolder('johnson_l','');
addExcludedFolder('keen_g','');
addExcludedFolder('ketterling_e','');
addExcludedFolder('klein_j','');
addExcludedFolder('kocher_p','');
addExcludedFolder('kohlman_j','');
addExcludedFolder('konrad_v','');
addExcludedFolder('kraft_g','');
addExcludedFolder('kraft_p','');
addExcludedFolder('krismer_c','');
addExcludedFolder('lang_e','');
addExcludedFolder('lang_p','');
addExcludedFolder('laturnus_r','');
addExcludedFolder('leippi_m','');
addExcludedFolder('leippi_w','');
addExcludedFolder('meier_j','');
addExcludedFolder('presler_v','');
addExcludedFolder('riehl_a','');
addExcludedFolder('riehl_j','');
addExcludedFolder('rost_norma','');
addExcludedFolder('rost_norman','');
addExcludedFolder('schall_n','');
addExcludedFolder('schell-smith_m','');
addExcludedFolder('schumacher_e','');
addExcludedFolder('schwab_i','');
addExcludedFolder('sehn_v','');
addExcludedFolder('sellinger_a','');
addExcludedFolder('sellinger_m','');
addExcludedFolder('senger_a','');
addExcludedFolder('vetter_j','');
addExcludedFolder('vetter_w','');
addExcludedFolder('wald_b','');
addExcludedFolder('wald_c','');
addExcludedFolder('wald_f','');
addExcludedFolder('wald_m','');
addExcludedFolder('weber_m','');
addExcludedFolder('welder_p','');
addExcludedFolder('zeiler_d','');
addExcludedFolder('zeiler_r','');
  // --- 2007 --- //
addExcludedFolder('bauman_c','');
addExcludedFolder('bauman_m','');
addExcludedFolder('berger_p','');
addExcludedFolder('black_e','');
addExcludedFolder('doll_a','');
addExcludedFolder('fiechtner_h','');
addExcludedFolder('gross_m','');
addExcludedFolder('hauck_p','');
addExcludedFolder('helbling_j','');
addExcludedFolder('helbling_s','');
addExcludedFolder('helfrich_l','');
addExcludedFolder('heyne_a','');
addExcludedFolder('johnson_r','');
addExcludedFolder('klein_r','');
addExcludedFolder('koepplin_i','');
addExcludedFolder('kurtz_b','');
addExcludedFolder('meidinger_c','');
addExcludedFolder('miller_j','');
addExcludedFolder('miller_m','');
addExcludedFolder('miller_r','');
addExcludedFolder('miltenberger_e','');
addExcludedFolder('mutschelknaus_e','');
addExcludedFolder('nagel_a','');
addExcludedFolder('nagel_p','');
addExcludedFolder('nill_r','');
addExcludedFolder('rasch_e','');
addExcludedFolder('roesler_e','');
addExcludedFolder('schauer_i','');
addExcludedFolder('schmidt_a','');
addExcludedFolder('schneider_j','');
addExcludedFolder('schwan_f','');
addExcludedFolder('schwan_s','');
addExcludedFolder('selensky_edward','');
addExcludedFolder('selensky_elaine','');
addExcludedFolder('senger_m','');
addExcludedFolder('sibley_m','');
addExcludedFolder('smith_m','');
addExcludedFolder('sperling_e','');
addExcludedFolder('thurn_h','');
addExcludedFolder('thurn_m','');
addExcludedFolder('tschaekofske_c','');
addExcludedFolder('werth_g','');
addExcludedFolder('buck_a','');
  // --- 2008 --- //
addExcludedFolder('backfish_h','');
addExcludedFolder('bauman_a','');
addExcludedFolder('bendewald_r','');
addExcludedFolder('brosz_b','');
addExcludedFolder('buck_e','');
addExcludedFolder('buerkley_a','');
addExcludedFolder('dockter_h','');
addExcludedFolder('flegel_m','');
addExcludedFolder('frank_e','');
addExcludedFolder('fregien_a','');
addExcludedFolder('gab_r','');
addExcludedFolder('gebhardt_e','');
addExcludedFolder('gebhardt_l','');
addExcludedFolder('graf_a','');
addExcludedFolder('haupt_w','');
addExcludedFolder('huber_d','');
addExcludedFolder('jerger_e','');
addExcludedFolder('johnson','');
addExcludedFolder('johnson_e','');
addExcludedFolder('kittler_e','');
addExcludedFolder('klettke_m','');
addExcludedFolder('kraft_l','');
addExcludedFolder('lapp_s','');
addExcludedFolder('mathern_j','');
addExcludedFolder('merkel_w','');
addExcludedFolder('miller_m','');
addExcludedFolder('opp_e','');
addExcludedFolder('ost_g','');
addExcludedFolder('rath_t','');
addExcludedFolder('rath_w','');
addExcludedFolder('rudolph_o','');
addExcludedFolder('schlenker_a','');
addExcludedFolder('schlenker_h','');
addExcludedFolder('stern_s','');
addExcludedFolder('wiederanders_r','');
addExcludedFolder('wolf_r','');
addExcludedFolder('zuern_e','');
  // --- 2009 --- //
addExcludedFolder('becker_d','');
addExcludedFolder('becker_j','');
addExcludedFolder('berger_r','');
addExcludedFolder('bitz_m','');
addExcludedFolder('eissinger_t','');
addExcludedFolder('erbele_r','');
addExcludedFolder('fichter_m','');
addExcludedFolder('geiszler_e','');
addExcludedFolder('gross_j','');
addExcludedFolder('gross_m','');
addExcludedFolder('hauck_m','');
addExcludedFolder('hecker_v','');
addExcludedFolder('hellmuth_l','');
addExcludedFolder('hellmuth_w','');
addExcludedFolder('hoff_l','');
addExcludedFolder('hutmacher_a','');
addExcludedFolder('knell_v','');
addExcludedFolder('leier_b','');
addExcludedFolder('leier_j','');
addExcludedFolder('miller_d','');
addExcludedFolder('mock_c','');
addExcludedFolder('opp_e','');
addExcludedFolder('urlacher_eleanor','');
addExcludedFolder('urlacher_emilia','');
addExcludedFolder('urlacher_f','');
addExcludedFolder('urlacher_j','');
addExcludedFolder('wolbaum_h','');
addExcludedFolder('wolbaum_m','');
addExcludedFolder('zeigler_d','');

  // --- Heritage Tour folders --- //
addExcludedFolder('tour09');
addExcludedFolder('germanhouse');
addExcludedFolder('grasslands');
addExcludedFolder('kchall');
addExcludedFolder('homestead');
addExcludedFolder('johncemetery');
addExcludedFolder('sisters');
addExcludedFolder('luthercemetery');
addExcludedFolder('maryscemetery');
addExcludedFolder('peterpaul');
addExcludedFolder('reception');
addExcludedFolder('sodhouse');
addExcludedFolder('standrew');
addExcludedFolder('stanthony');
addExcludedFolder('tabernacle');

  // --- Oral History Project and Heritage Tour shared folder names --- //
addExcludedFolder('files');
addExcludedFolder('images');


// ================
// = Extra Crumbs =
// ================
// This section allows you to enter crumbs into the breadcrumb that aren't represented by a folder
// Entries are made in the form: addIncludedFolder('TEXT_NAME','LINK_TO_PAGE','CRUMB_TO_INSERT_BEFORE');
// where TEXT_NAME is replaced by the desired text and
// LINK_TO_PAGE is replaced by the link the inserted crumb should go to and
// CRUMB_TO_INSERT_BEFORE is replaced by the name of the folder this link should occur before in the breadcrumb
//
// NOTE: Only one crumb can be specified for each CRUMB_TO_INSERT_BEFORE, if more than one is specified only the first will appear
//
// Example: To insert a link to the "archive.html" page before the "Profile" link in the following breadcrumb you would use:
//          Home > Dakota Memories > Profile
//     addIncludedFolder('Narrator Profiles','/grhc/dakotamemories/archive.html','2005');

  // --- Oral History Project folders --- //
addIncludedFolder('Narrator Profiles','/grhc/dakotamemories/archive.html','2005');
addIncludedFolder('Narrator Profiles','/grhc/dakotamemories/archive.html','2006');
addIncludedFolder('Narrator Profiles','/grhc/dakotamemories/archive.html','2007');
addIncludedFolder('Narrator Profiles','/grhc/dakotamemories/archive.html','2008');
addIncludedFolder('Narrator Profiles','/grhc/dakotamemories/archive.html','2009');



  // --- Heritage Tour folders --- //

  // --- Oral History Project and Heritage Tour shared folder names --- //


// ======================
// = Extra Crumbs After =
// ======================
// This section allows you to enter crumbs into the breadcrumb that you would like to appear after another crumb
// Entries are made in the form: addIncludedFolderAfter('TEXT_NAME','LINK_TO_PAGE','CRUMB_TO_INSERT_AFTER');
// where TEXT_NAME is replaced by the desired text and
// LINK_TO_PAGE is replaced by the link the inserted crumb should go to and
// CRUMB_TO_INSERT_AFTER is replaced by the name of the folder this link should occur after in the breadcrumb
//
// NOTE: Only one crumb can be specified for each CRUMB_TO_INSERT_AFTER, if more than one is specified only the first will appear
//
// Example: To insert a link to the "audio.html" page before the "Profile" link in the following breadcrumb you would use:
//          Home > Dakota Memories > Profile
//addIncludedFolderAfter('About Us','/grhc/dakotamemories/comments.html','dakotamemories');

  // --- Oral History Project folders --- //


  // --- Heritage Tour folders --- //

  // --- Oral History Project and Heritage Tour shared folder names --- //

// =========================
// = Change a Crumb's Link =
// =========================
// This section allows you to change the link of a specific crumb.  This should be done for all breadcrumbs that point to
// a folder that does not contain the file 'index.html'.
// Entries are made in the form: addLinkChange('FOLDER_NAME','TEXT_NAME','LINK_TO_PAGE');
// where FOLDER_NAME is replaced by the name of the folder to be omitted and
// TEXT_NAME is replaced by the desired text and
// LINK_TO_PAGE is replaced by the link the inserted crumb should go to
//
// Example: To change the link of the "Itinerary" in the following breadcrumb you would use:
//          Home > Dakota Memories > Heritage Tour > itinerary
//     addLinkChange('itinerary','Itinerary','/grhc/dakotamemories/heritage/itinerary/index.html');


  // --- Oral History Project folders --- //
addLinkChange('questions','Questions','/grhc/dakotamemories/aboutus/questions/interviewquestions.html');
addLinkChange('collections','Special Collections','/grhc/dakotamemories/collections/special_collections.html');
addLinkChange('movieclips','Video Clips','/grhc/dakotamemories/movieclips/video.html');
addLinkChange('staff','Staff','/grhc/dakotamemories/aboutus/staff/staff.html');
addLinkChange('aboutus','About Us','/grhc/dakotamemories/aboutus/aboutus.html');
addLinkChange('funding','Funding','/grhc/dakotamemories/aboutus/funding/funding.html');




// --- Locations --- //
	addLinkChange('allan','Allan','/grhc/dakotamemories/locations/allan/album.html');
	addLinkChange('beulah','Beulah','/grhc/dakotamemories/locations/beulah/album.html');
	addLinkChange('bismarck','Bismarck','/grhc/dakotamemories/locations/bismarck/album.html');
	addLinkChange('dickinson','Dickinson','/grhc/dakotamemories/locations/dickinson/album.html');
	addLinkChange('edgeley','Edgeley','/grhc/dakotamemories/locations/edgeley/album.html');
	addLinkChange('eureka','Eureka','/grhc/dakotamemories/locations/eureka/album.html');
	addLinkChange('gackle','Gackle','/grhc/dakotamemories/locations/gackle/album.html');
	addLinkChange('hague','Hague','/grhc/dakotamemories/locations/hague/album.html');
	addLinkChange('hazen','Hazen','/grhc/dakotamemories/locations/hazen/album.html');
	addLinkChange('kulm','Kulm','/grhc/dakotamemories/locations/kulm/album.html');
	addLinkChange('lehr','Lehr','/grhc/dakotamemories/locations/lehr/album.html');
	addLinkChange('linton','Linton','/grhc/dakotamemories/locations/linton/album.html');
	addLinkChange('hazen','Hazen','/grhc/dakotamemories/locations/hazen/album.html');
	addLinkChange('luseland','Luseland','/grhc/dakotamemories/locations/luseland/album.html');
	addLinkChange('neudorf','Neudorf','/grhc/dakotamemories/locations/neudorf/album.html');
	addLinkChange('revenue','Revenue','/grhc/dakotamemories/locations/revenue/album.html');
	addLinkChange('rugby','Rugby','/grhc/dakotamemories/locations/rugby/album.html');
	addLinkChange('saintanselm','Saint Anselm','/grhc/dakotamemories/locations/saintanselm/album.html');
	addLinkChange('strasburg','Strasburg','/grhc/dakotamemories/locations/strasburg/album.html');
	addLinkChange('trampinglake','Tramping Lake','/grhc/dakotamemories/locations/trampinglake/album.html');
	addLinkChange('venturia','Venturia','/grhc/dakotamemories/locations/venturia/album.html');
	addLinkChange('wishek','Wishek','/grhc/dakotamemories/locations/wishek/album.html');
	addLinkChange('zap','Zap','/grhc/dakotamemories/locations/zap/album.html');
	addLinkChange('zeeland','Zeeland','/grhc/dakotamemories/locations/zeeland/album.html');

  // --- Heritage Tour folders --- //
addLinkChange('registration','Registration','/grhc/dakotamemories/heritage/registration/registration.html');


  // --- Oral History Project and Heritage Tour shared folder names --- //

// ==========================
// ========== Code ==========
// ==========================

function addFolderName(folderName, textName){ // Generates folderNames and textNames lists
	folderNames[folderNameCount] = folderName;
	textNames[folderNameCount] = textName;
	folderNameCount++;
}
	
function addExcludedFolder(folderName){ // Generates excludedFolders list
	excludedFolders[excludedFolderCount] = folderName;
	excludedFolderCount++;
}

function addIncludedFolder(textName, linkURL, beforeFolder){
	includeFoldersName[includedFolderBeforeCount] = textName;
	includeFoldersLink[includedFolderBeforeCount] = linkURL;
	includeFoldersBefore[includedFolderBeforeCount] = beforeFolder;
	includedFolderBeforeCount++;
}

function addIncludedFolderAfter(textName, linkURL, afterFolder){
	includeFoldersAfterName[includedFolderAfterCount] = textName;
	includeFoldersAfterLink[includedFolderAfterCount] = linkURL;
	includeFoldersAfter[includedFolderAfterCount] = afterFolder;
	includedFolderAfterCount++;
}

function addLinkChange(folderName, textName, linkURL){
	addIncludedFolder(textName, linkURL, folderName);
	addExcludedFolder(folderName);
}
// ==========================
// ==== Third Party Code ====
// ==========================
/*
Photo Viewer 2.30
Language: JavaScript 1.0

Source: Web 1 Marketing, Inc.
(http://www.web1marketing.com)

Author: Josh Freedman
*/
function getObjectByID(id) {
  // Cross-browser function to return the object with the specific id

  if (document.all) { // IE
    return document.all[id];
  } else { // Netscape
    return document.getElementById(id);
  }
}


/*
Count the number of occurrences of a specific character in a string
Language: JavaScript 1.0

Source: Code Codex
(http://www.codecodex.com)
*/
String.prototype.count=function(s1) { 
	return (this.length - this.replace(new RegExp(s1,"g"), '').length) / s1.length;
}


/*
Breadcrumbs in JavaScript
Language: JavaScript 1.0

Source: Webreference.com
(http://www.webreference.com/js/scripts/breadcrumbs/)

Author: Justin Whitford
Modified by: David Mart
*/
function discover_breadcrumbs() {
  sURL = new String;
  bits = new Object;
  links = new Object;
  var x = 0;
  var depth = 0;
  var stop = 0;
  var output = '<font size="2"><strong>';
  var tempOutput = '';
  sURL = location.href;
  sURL = sURL.slice(8,sURL.length);
  chunkStart = sURL.indexOf("/");
  sURL = sURL.slice(chunkStart+1,sURL.length);
  
  while(!stop){
    chunkStart = sURL.indexOf("/");
	depth = sURL.count('/');
    
	if (chunkStart != -1){
      bits[x] = sURL.slice(0,chunkStart);
	  links[x] = '';
	  var done = false;
	  
	  var insertionsMade = 0;
	  var len = x + 1;
	  while(!done){ 
		  for(var m in includeFoldersBefore){ // Scan to see if this element needs to have a crumb inserted before it
			  done = true;
			  if(bits[x] == includeFoldersBefore[m]){ // Check if the current bit should have a crumb before it
				  done = false;
				  while(len > x){
					  bits[len] = bits[len-1].toString(); // Move each element below the insertion point down one space
					  links[len] = links[len-1].toString();  // Move each element below the insertion point down one space
					  len--; // Move to the previous element in the list
				  }
				  bits[len] = includeFoldersName[m].toString(); // Insert the included folder name into the list
				  links[len] = includeFoldersLink[m].toString(); // Insert the included folder link into the list
				  len = len + 2; // Return the len counter to the actual length of the lists
				  insertionsMade++;
			  }
		  }
	  }
	  x = x + insertionsMade; // Move x to the last element in the list
	  var excluded = false;
	  var replaced = false;
	  
	  for(var p in excludedFolders){ // Scan excludedFolders for the current folder name
		  if(bits[x] == excludedFolders[p]){ // Check if the current bit should be excluded from the breadcrumb
			  excluded = true; // Signify that the current bit should in fact be excluded
			  for(var h in includeFoldersAfter){ // Scan to see if this element needs to have a crumb inserted after it
				  if(bits[x] == includeFoldersAfter[h]){ // Check if the current bit should have a crumb after it
					  bits[x] = includeFoldersAfterName[h].toString();
					  links[x] = includeFoldersAfterLink[h].toString();
					  replaced = true;
				  }
			  }
			  if(!replaced){ // If the bit has not been replaced by a crumb inserted after it then delete it
				  delete bits[x];  // Erase the excluded bit from the list
				  x--; // Set the counter back to the previous bit because the current one is supposed to be excluded
			  }
		  }
	  }
	  
	  if(!excluded){ // If the current folder is not excluded begin creating the breadcrumb element
		  var includedAfter = false;
		  for(var h in includeFoldersAfter){ // Scan to see if this bit needs to have a crumb inserted after it
			  if(bits[x] == includeFoldersAfter[h]){ // Check if the current bit should have a crumb after it
				  bits[x+1] = includeFoldersAfterName[h].toString();
				  links[x+1] = includeFoldersAfterLink[h].toString();
				  includedAfter = true; // A bit has been inserted after the current one
			  }
		  }
		  
		  tempOutput = 'index.html';  // In the event that no link '../' is required, index.html will be used
		  
		  for(y = 1; y < depth; y++){ // Create the link string for the current bit
			  if (tempOutput == 'index.html'){ // The link '../' is required so remove index.html from tempOutput
				  tempOutput = '';
			  }
			  tempOutput += "../";
		  }
		  
		  links[x] = tempOutput; // Store the link for this crumb in the links list
		  
		  for(var j in folderNames){ // Scan folderNames for a text version of the current folder name
			  if(bits[x] == folderNames[j]){ // Check if the current bit should has a text version name
				  bits[x] = textNames[j].toString(); // Replace the folder name with the text version
			  }
		  }
		  
		  if(includedAfter){ // If a bit has been included after this one increment the counter to point to the included (next) bit
			  x++;
		  }
	  }
	  
	  for(var h in includeFoldersAfter){ // Scan to see if this element needs to have a crumb inserted after it
		  if(bits[x] == includeFoldersAfter[h]){ // Check if the current bit should have a crumb after it
			  bits[x+1] = includeFoldersAfterName[h].toString();
			  links[x+1] = includeFoldersAfterLink[h].toString();
			  x++;
		  }
	  }
	  
      sURL = sURL.slice(chunkStart+1,sURL.length); // Remove the leading character ('/') from sURL
    }
	else{ // If there are no more folders in the URL then stop
      stop = 1;
	}
	
    x++;
  }
  
  for(var x in bits){ // Create the output string for the breadcrumb
	  output += "<a href=\"" + links[x] + "\">" + bits[x] + "</a> <img src='/grhc/images/template-images/arrow.gif' width='8' height='7'> "
  }
  
  var breadcrumb = getObjectByID(documentLocation); // Find the location on the page to place the breadcrumb
  var z = output.lastIndexOf(" <img src"); // Remove the last arrow image from the output string
  output = output.slice(0,z) + "</strong></font>"; // Finish closing the <strong> and <font> tags in the string
  breadcrumb.innerHTML = output;
}