// Original script by Paul Davis - http://www.kaosweaver.com
// Documented and updated for RhinoWeb by PZAHNLE - 8/2006

//Args Definitions: 
//	base=your base URL (homepage)
//	delStr=The delimiter is the identifier between the crumbs on the trail e.g. >> or :
//	defp=The default page is the page that will load whenever a crumb is clicked on. This has to be universal and has to be in every directory that will have a breadcrumb trail going through it. Usually, index.html or default.html
//  cStyle=This is the CSS to apply to the crumb trail
//  tStyle=This is the CSS to apply to the title page
//  dStyle=This is the CSS to apply to the delimiter
//  nl=(binary)This option will display the title of this page (from the header) on to a new line. Otherwise it will appear just after the end of the crumbs on the current line

function breadCrumbs(base,delStr,defp,cStyle,tStyle,dStyle,nl) { 
	loc=window.location.toString();subs=loc.substr(loc.indexOf(base)+base.length+1).split("/");
	// document.write('<a href="'+getLoc(subs.length-1)+defp+'" class="'+cStyle+'">Home</a>  '+'<span class="'+dStyle+'">'+delStr+'</span> ');
	 //document.write('<span class="'+dStyle+'">'+delStr+'</span> ');
	 a=(loc.indexOf(defp)==-1)?1:2;for (i=0;i<(subs.length-a);i++) { subs[i]=makeCaps(unescape(subs[i]));
	 document.write('<a href="'+getLoc(subs.length-i-2)+defp+'" class="'+cStyle+'">'+subs[i]+'</a>  '+'<span class="'+dStyle+'">'+delStr+'</span> ');}
	 if (nl==1) document.write("<br>");document.write('<span class="'+tStyle+'">'+document.title+'</span>');
}
function makeCaps(a) {
  g=a.split(' ');for (l=0;l<g.length;l++) g[l]=g[l].toUpperCase().slice(0,1)+g[l].slice(1);
  return g.join(" ");
}
function getLoc(c) {
  var d="";
	if (c>0) for (k=0;k<c;k++) d=d+"../";
		 return d;
}
	