﻿function makeBreadCrumbPath(frontPageName,divider) {
 frontPageName = frontPageName ? frontPageName : " ";
 divider = divider ? divider : ">";
 var parts = location.pathname.split("/");
 var crumbs = new Array(); 
 // front page 
 var curPath = "/";
 crumbs[0]="<a href='/'>" + frontPageName + "<\/a>";
 // crumbs on path
 for(var i=1;i<parts.length-1;i++) {
  curPath += parts[i] + "/";
  crumbs[i] = "<a href=\"" + curPath + "\">" +"<span style='font-size:9pt;color:#000080;text-decoration:none'>"+
   parts[i].charAt(0).toUpperCase() +
   parts[i].substring(1) +"<\/span>"+
   "<\/a>";
 }
 // this page
 crumbs[i]="<span style='font-size:9pt;color:#000080;text-decoration:none'>" + document.title + "<\/span>";

 var crumbpath = crumbs.join(divider);
 return crumbpath;
}

document.write("<span style='font-size:9pt;color:#000080;text-decoration:none'>Du er her: <\/span>"+makeBreadCrumbPath(""," > "));
