(function(){
var header=document.querySelector(".elsky-header");
if(!header)return;
var sync=function(){header.classList.toggle("is-scrolled",window.scrollY>28)};
sync();
window.addEventListener("scroll",sync,{passive:true});
var path=(window.location.pathname.replace(/\/+$/,"")||"/")+"/";
var topLinks=header.querySelectorAll(".main-header-menu>a,.main-header-menu>.menu-item>.menu-link");
topLinks.forEach(function(link){
var href=(new URL(link.href,window.location.origin).pathname.replace(/\/+$/,"")||"/")+"/";
var current=(href==="/"&&path==="/")||(href!=="/"&&path.indexOf(href)===0);
if(link.textContent.indexOf("Regionen")!==-1&&/^\/photovoltaik-(bielefeld|guetersloh|herford|paderborn|lippe|minden-luebbecke|osnabrueck|soest|warendorf)\//.test(path)){current=true}
if(current){link.classList.add("is-current");link.setAttribute("aria-current","page")}
});
})();