function breadcrumb() {
  // Remove the query string
  var myURL = document.URL.split("?");

  // Get current URL, split it into items
  var urlItems = myURL[0].split("/");
  var prefix = urlItems[0] + "//";

  for (i=2;i<urlItems.length;i++) {
    // Write out the anchor tag
    if (i < (urlItems.length - 1) && urlItems[i+1] != "") {
      writeTag(urlItems[i],prefix);
      prefix = prefix + urlItems[i] + "/";
      document.write('&raquo;');
    } else {
      document.write('<span style="padding-left: 10px;">' + urlItems[i] + '</span>');
    }
  }
}

function writeTag(item, pre) {
  var basename = item.split("?");
  if (basename[0] != "") {
    document.write('<a href="' + pre + item  +'" class="breadcrumb">');
    document.write(basename[0]);
    document.write('</a>');
  }
}
