// JavaScript Document
// Written by James Devine- jamesserver@gmail.com
function breadcrumbs(){
  sURL = new String;
  bits = new Object;
  var x = 0;
  var stop = 0;
  var output = "<a class=\"crumbs\" href=..>Home</a> &#187; ";
  sURL = document.URL;
  //find the stuff after last /
  var slash=sURL.lastIndexOf("/");
  sURL=sURL.slice(slash+1,sURL.length);
  
  //tokenzie url on "_"
  var section=sURL.split("-");
  for(var i=0;i<section.length-1;i++)
  {
  	var index=section[i].indexOf("_");
  	if(index==-1)
		if (i==0)
  			output+="<a href="+section[i]+".html>" + section[i].charAt(0).toUpperCase()+section[i].substring(1)+"</a> &#187; ";
		else
		{
			output+="<a href="+section[0];
			for(var j=0; j<i; j++)
				output+="-"+section[i];
			output+=".html>" + section[i].charAt(0).toUpperCase()+section[i].substring(1)+"</a> &#187; ";
		}
  	else
  	{
		output+="<a href="+section[i]+".html>";
  		var words=section[i].split("_");
  		for(var j=0;j<words.length;j++)
  			output+=words[j].charAt(0).toUpperCase()+words[j].substring(1)+" ";
  		output+="</a> &#187; ";
  	}
  }
  //write the breadcrumb, removing everything after the last "-"
  document.write(output + document.title.substring(0,document.title.lastIndexOf("-")));
}
