
String.prototype.startsWith = function(str) { return (this.match("^"+str)==str)}
String.prototype.endsWith =   function(str) { return (this.match(str+"$")==str)}

function getStyle(elem, name) {
    if (elem.style[name]) {
        return elem.style[name];
    } else if (elem.currentStyle) {
        return elem.currentStyle[name];
    }
    else if (document.defaultView && document.defaultView.getComputedStyle) {
        name = name.replace(/([A-Z])/g, "-$1");
        name = name.toLowerCase();
        s = document.defaultView.getComputedStyle(elem, "");
        return s && s.getPropertyValue(name);
    } else {
        return "";
    }
}

var tags = {'TD':'', 'A':'', 'DIV':'', 'SPAN':''};

function font(scale) {
  var all = document.getElementsByTagName("*");
  for (var i=0; i < all.length; i++) {
    var n = all[i];
    if (n.nodeName.toUpperCase() in tags) {
      var s = n.getAttribute("__old__font__size");
      if (typeof s == "undefined" || s == "" || s == null) s = getStyle(n, "font-size");
      if (typeof s == "undefined" || s == "" || s == null) s = getStyle(n, "fontSize");
      if (typeof s != "undefined" && s != null) {
        n.setAttribute("__old__font__size", s);
        if (s.endsWith("pt")) {
          n.style.fontSize = Math.floor(parseInt(s) * scale) + "pt";
        } else {
          if (s.endsWith("px")) {
            n.style.fontSize = Math.floor(parseInt(s) * scale) + "px";
          }
        }
      }
    }
  }
}

window.onload = function() {
  var n = document.getElementById("dnn_dnnBREADCRUMB_lblBreadCrumb");
  var i = document.createElement("SPAN");
  i.style.fontFamily = "Tahoma";
  i.style.fontSize = "10px";
  i.style.fontWeight = "bold";
  i.style.color = "#666666";
  i.style.marginLeft = "100px";
  i.innerHTML = "Lettergrootte:&nbsp;" +
    "<span onclick='font(1.0);' style='cursor: pointer; font-size: 10px; font-family: arial;'>A</span>&nbsp;" +
    "<span onclick='font(1.1);' style='cursor: pointer; font-size: 12px; font-family: arial;'>A</span>&nbsp;" +
    "<span onclick='font(1.2);' style='cursor: pointer; font-size: 14px; font-family: arial;'>A</span>&nbsp;";
  n.appendChild(i);
}