function setActive() {
  
  aObj = document.getElementById('nav').getElementsByTagName('a');
  for (var i = 0; i < aObj.length; i++) {
    if (document.location.href == aObj[i].href) {
      aObj[i].className = 'active';
    }
  }
}

window.onload = setActive;

function showMessage(msg, color="white", time=5000) {
  $('<div />', {
      "class": 'popupNachricht',
      text: msg
    }).appendTo("#popupBox")
      .delay(time)
      .fadeOut(1000);;
}