﻿function breadcrumb(){
    Location = new String;
    Level = new Object;
    var counter = 0;
    var stop = 0;
    var display = "<A HREF=\"/\">Home</A> » ";

    Location = location.href;
    Location = Location.slice(8,Location.length);
    LevelStart = Location.indexOf("/");
    Location = Location.slice(LevelStart+1,Location.length)

    while(!stop){
      LevelStart = Location.indexOf("/");
      if (LevelStart != -1){
        Level[counter] = Location.slice(0,LevelStart)
        Location = Location.slice(LevelStart+1,Location.length);
      }else{
        stop = 1;
      }
      counter++;
    }

    for(var i in Level){
      display += "<A HREF=\"";

      for(y=1;y<counter-i;y++){
        display += "../";
      }
      display += Level[i] + "/\">" + Level[i] + "</A> » ";
    }
    document.write(display);
  }