function crumble(divider, base, title, reverse) {
   var loc = window.location.href, h = 0, i = 0;
   var arr = new Array(), ret = "", n = 0, j = 0; 
   var arrn = new Array(), idx = 0, prefix = null;
   var arrLn = 0, arrnLn = 0, s = 0;

   var spc = /%20/g; // pattern to replace encoded spaces
   
   // setup constants
   if (!divider)
      divider = " > ";
   if (!base)
      base = "";
   if (!title)
      title = "You Are Here!";
   
   // cover all the bases by checking for three
   idx = loc.indexOf("///");
   
   // get the protocol
   prefix = loc.substring(0, ((idx != -1) ? 
                              (idx + 3) : (loc.indexOf("//") + 2)));
   
   // get the URL
   loc = loc.substring(((idx != -1) ? 
                       (idx + 3) : (loc.indexOf("//") + 2)));
   
   // split URL for short names in crumbs
   arrn = loc.split("/");
   arrnLn = arrn.length;
   
   // crumbleize start
   for (j = 0; j < arrnLn; ++j) {
      idx = loc.indexOf(("/"), h);
      if (idx != -1) {
         arr[j] = prefix + loc.substring(0, idx + 1) + base;
         h = idx + 1;
      }
      else {
         arr[j] = prefix + loc.substring(h) + base;
      }
   }
   
   // walk backwards
   if (reverse) {
      arr.reverse();
      arrn.reverse();
      ret = title + divider;
      i = 1;
      n = 0;
      s = 2;
   }
   else { // walk fowards start
      i = 0;
      n = 1;
      s = 1;
   }
   
   // crumbleize finish
   arrLn = arr.length;
   for (i = i; i < arrLn - n; ++i) {
      if (i != s) {
         ret += "<a href=\"" + arr[i].replace(spc, " ") +
                "\" title=\"" + 
                arrn[i].replace(spc, " ") + "\">" + 
                arrn[i].replace(spc, " ") + "</a>";
         if (i != arrLn - n - 1)
            ret += divider;
      }
   }
   
   // walk fowards finish
   if (!reverse)
      ret += divider + title;
   
   // drop crumbs
   document.write(ret);
   document.close();
}
