/*############ original script by Justin Whitford.###############################
                
link to script http://www.webreference.com/js/scripts/breadcrumbs/

To call the script. Place the following code where you want the breadcrumbs to be displayed:

<script language="JavaScript">
<!--
breadcrumbs();
 -->
</script>

To change the spaces between the links for eg:-
Home  »  js  »  scripts  »  breadcrumbs  » whatever page you are on

change this line in the script below
output += bits[i] + "/\">" + bits[i] + " &nbsp;&#187;&nbsp; ";
				
################################################################################*/

function breadcrumbs(){
  sURL = new String;
  bits = new Object;
  var under = /_/g;
  var x = 0;
  var stop = 0;
  var output = "<a href=\"/\">Home</a>  >  ";
  sURL = location.href;
  sURL = sURL.slice(8,sURL.length);
  chunkStart = sURL.indexOf("/");
  sURL = sURL.slice(chunkStart+1,sURL.length)
  while(!stop){
    chunkStart = sURL.indexOf("/");
    if (chunkStart != -1){
      bits[x] = sURL.slice(0,chunkStart)
      sURL = sURL.slice(chunkStart+1,sURL.length);
    }else{
      stop = 1;
    }
    x++;
  }
  for(var i in bits){
    output += "<a href=\"";
    for(y=1;y<x-i;y++){
      output += "../";
    }
    output += bits[i] + "/\">" + bits[i] + "</a>  >  ";
  }
  document.write(output);
}

