﻿
 var title = document.getElementsByTagName('h1')[0].innerHTML;
  

<!-- Paste this code into an external JavaScript file named: breadcrumbs.js  -->

/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Copperfield Publishing :: http://www.copperfieldpub.com/ */

function Crumb(Path, Name, Url) {
 	this.Path	= Path;
 	this.Name	= Name;
 	this.Url	= Url;
}

BagOCrumbs = new Array();

// add new directories here.  the format:
// Path: the name of the directory
// Name: the text you want to display onscreen
// Url:  the URL to the page for this group page or book

BagOCrumbs[0] = new Crumb("pickle-recipes", "Pickle Recipes", "/pickle-recipes/menu-pickles.htm");
BagOCrumbs[1] = new Crumb("bread-recipes", "Bread Recipes", "/bread-recipes/menu-breads.htm");
BagOCrumbs[2] = new Crumb("salad-recipes", "Salad Recipes", "/salad-recipes/menu-salads.htm");
BagOCrumbs[3] = new Crumb("dip-recipes", "Dip Recipes", "/dip-recipes/menu-dips.htm");
BagOCrumbs[4] = new Crumb("soup-recipes", "Soup Recipes", "/soup-recipes/menu-soups.htm");
BagOCrumbs[5] = new Crumb("rice-recipes", "Rice Recipes", "/rice-recipes/menu-rice.htm");
BagOCrumbs[6] = new Crumb("drink-recipes", "DrinkRecipes", "/drink-recipes/menu-drinks.htm");
BagOCrumbs[7] = new Crumb("dessert-recipes", "Dessert Recipes", "/dessert-recipes/menu-desserts.htm");
BagOCrumbs[8] = new Crumb("egg-recipes", "Egg Recipes", "/egg-recipes/menu-eggs.htm");
BagOCrumbs[9] = new Crumb("fried-food-recipes", "Fried Food Recipes", "/fried-food-recipes/menu-fried-food.htm");
BagOCrumbs[10] = new Crumb("fish-recipes", "Fish Recipes", "/fish-recipes/menu-fish.htm");
BagOCrumbs[11] = new Crumb("cheese-recipes", "Cheese Recipes", "/cheese-recipes/menu-cheese.htm");
BagOCrumbs[12] = new Crumb("chicken-recipes", "Chicken Recipes", "/chicken-recipes/menu-chicken.htm");
BagOCrumbs[13] = new Crumb("meat-recipes", "Meat Recipes", "/meat-recipes/menu-meat.htm");
BagOCrumbs[14] = new Crumb("accessories", "Accessories", "/accessories/main.htm");
BagOCrumbs[15] = new Crumb("advice", "Advice", "/advice/advice-main.htm");

// ... we build the path and display it

var i, x;
// the character below displays between the directories; you can change it if you like.
strConcat = " > ";
strUrl = document.location.href;
strList = "<a href='/'>Home</a>";
strDebug = "";
aryDirs = strUrl.split("/");
for (x=0; x < aryDirs.length; x++) {
	 for(i = 0; i < BagOCrumbs.length; i++) {
			 if (BagOCrumbs[i].Path.toLowerCase() == aryDirs[x].toLowerCase()) {
	                      strList += strConcat + "<a href='" + BagOCrumbs[i].Url + "'>" + BagOCrumbs[i].Name + "</a>";
			 i = BagOCrumbs.length;
		}
}
}

// comment out the next line to eliminate the display of the document's title
// the character below displays between the directory and the document's title; you can change it if you like.

strList += " > " + document.title;
document.write(strList);






