function buildWebCrumb(siteRoot) {
//HomePage is hardCoded here
homePage = "/index.html";
var crumb = new Array();
pageHref = document.location.href;
//Strip off page name from this 
lastSlash = pageHref.lastIndexOf("/");
pageHref = pageHref.substr(0,lastSlash);

//remove home - this unfortunatley is hardcoded!
urlsofar = siteRoot;
homeStart = pageHref.indexOf(urlsofar);
pageHref = pageHref.substr(homeStart + urlsofar.length);
crumb[0] = "<a class='webcrumbLink' href='" +urlsofar+homePage+"'>Home</a>";

//Only process rest of Crumbs if we are not on home page
crumbNumber=1;
if (homePage.indexOf(pageHref) == -1) {
  processCrumbs = true;
} else {
  processCrumbs = false;
}

//build rest of crumbs - crumb is from '/' until next '/' or end
while (processCrumbs == true) {
  nextSlash = pageHref.indexOf('/',1);
  if (nextSlash == -1) { //last crumb found
    processCrumbs = false;
    nextSlash = pageHref.length+1;
  }
  

  nextCrumb = pageHref.substr(0,nextSlash);
  urlsofar = urlsofar + nextCrumb;
  pageName = nextCrumb.substr(1);
  // Remove Underscore and make capilatize words
  pageName = pageName.replace(/_/g,' ');
  pageName = pageName.replace(/\b\w+\b/g,function(word) {return word.substring(0,1).toUpperCase() + word.substring(1)});
  // following code is to make all of webcrumb clickable, to make all clickable apart from
  // final crumb, comment ot next line, and un-comment commentout if block below
  crumb[crumbNumber] = "<a class='webcrumbLink' href='" +urlsofar+nextCrumb+".html'>"+pageName+"</a>";
  //if (processCrumbs) { 
  // crumb[crumbNumber] = "<a class='webcrumbLink' href='" +urlsofar+nextCrumb+".html'>"+pageName+"</a>";
  //} else {
  // crumb[crumbNumber] = "<span class='webcrumbNoLink'>"+pageName+"</span>";
  //}
  pageHref= pageHref.substr(nextSlash);
  crumbNumber = crumbNumber +1;
}

var list="";
for (x=0;x<crumb.length;x++) {
  list = list + "&nbsp;>&nbsp;" + crumb[x];
}

document.write(list);

}

function MM_openBrWindow(theURL,winName,features)
{ //v2.0
window.open(theURL,winName,features);

}
