(function(p,b,y){function q(){var a=b('button[id^\x3d"genesis-mobile-"]').attr("id");if("undefined"!==typeof a){"none"===l(a)&&(b(".menu-toggle, .genesis-responsive-menu .sub-menu-toggle").removeClass("activated").attr("aria-expanded",!1).attr("aria-pressed",!1),b(".genesis-responsive-menu, .genesis-responsive-menu .sub-menu").attr("style",""));var c=b(".genesis-responsive-menu .js-superfish"),d="destroy";"function"===typeof c.superfish&&("none"===l(a)&&(d={delay:100,animation:{opacity:"show",height:"show"},
dropShadows:!1,speed:"fast"}),c.superfish(d));r(a);t(a)}}function u(){var a=b(this),c=a.next("nav");a.attr("id","genesis-mobile-"+b(c).attr("class").match(/nav-\w*\b/))}function t(a){if(null!=f){var c=f[0],d=b(f).filter(function(a){if(0<a)return a});"none"!==l(a)?(b.each(d,function(a,d){b(d).find(".menu \x3e li").addClass("moved-item-"+d.replace(".","")).appendTo(c+" ul.genesis-nav-menu")}),b(k(d)).hide()):(b(k(d)).show(),b.each(d,function(a,d){b(".moved-item-"+d.replace(".","")).appendTo(d+" ul.genesis-nav-menu").removeClass("moved-item-"+
d.replace(".",""))}))}}function v(){var a=b(this);m(a,"aria-pressed");m(a,"aria-expanded");a.toggleClass("activated");a.next("nav").slideToggle("fast")}function w(){var a=b(this),c=a.closest(".menu-item").siblings();m(a,"aria-pressed");m(a,"aria-expanded");a.toggleClass("activated");a.next(".sub-menu").slideToggle("fast");c.find(".sub-menu-toggle").removeClass("activated").attr("aria-pressed","false");c.find(".sub-menu").slideUp("fast")}function r(a){var c=n();0< !b(c).length||b.each(c,function(d,
c){var e=c.replace(".","");d="genesis-"+e;var h="genesis-mobile-"+e;"none"==l(a)&&(d="genesis-mobile-"+e,h="genesis-"+e);e=b('.genesis-skip-link a[href\x3d"#'+d+'"]');null!==f&&c!==f[0]&&e.toggleClass("skip-link-hidden");0<e.length&&(c=e.attr("href"),c=c.replace(d,h),e.attr("href",c))})}function l(a){a=p.getElementById(a);return window.getComputedStyle(a).getPropertyValue("display")}function m(a,b){a.attr(b,function(a,b){return"false"===b})}function k(a){return b.map(a,function(a,b){return a}).join(",")}
function n(){var a=[];null!==f&&b.each(f,function(b,d){a.push(d.valueOf())});b.each(e.others,function(b,d){a.push(d.valueOf())});return 0<a.length?a:null}var g="undefined"===typeof genesis_responsive_menu?"":genesis_responsive_menu,e={},f=[];b.each(g.menuClasses,function(a){e[a]=[];b.each(this,function(c,d){c=b(d);1<c.length?b.each(c,function(c,g){c=d+"-"+c;b(this).addClass(c.replace(".",""));e[a].push(c);"combine"===a&&f.push(c)}):1==c.length&&(e[a].push(d),"combine"===a&&f.push(d))})});"undefined"==typeof e.others&&(e.others=[]);1==f.length&&(e.others.push(f[0]),f=e.combine=null);var x={init:function(){if(0!=b(n()).length){var a="undefined"!==typeof g.menuIconClass?g.menuIconClass:"dashicons-before dashicons-menu",c="undefined"!==typeof g.subMenuIconClass?g.subMenuIconClass:"dashicons-before dashicons-arrow-down-alt2",d=b("\x3cbutton /\x3e",{"class":"menu-toggle","aria-expanded":!1,"aria-pressed":!1}).append(g.mainMenu),h=b("\x3cbutton /\x3e",{"class":"sub-menu-toggle","aria-expanded":!1,"aria-pressed":!1}).append(b("\x3cspan /\x3e",
{"class":"screen-reader-text",text:g.subMenu}));b(k(e)).addClass("genesis-responsive-menu");b(k(e)).find(".sub-menu").before(h);null!==f?(h=e.others.concat(f[0]),b(k(h)).before(d)):b(k(e.others)).before(d);b(".menu-toggle").addClass(a);b(".sub-menu-toggle").addClass(c);b(".menu-toggle").on("click.genesisMenu-mainbutton",v).each(u);b(".sub-menu-toggle").on("click.genesisMenu-subbutton",w);b(window).on("resize.genesisMenu",q).triggerHandler("resize.genesisMenu")}}};b(p).ready(function(){null!==n()&&
x.init()})})(document,jQuery);
jQuery(function($){
const disableTooltips=window.matchMedia('(hover: none)').matches;
if(disableTooltips) return;
window._paq=window._paq||[];
const TRIGGER_SEL='.tooltip-begriff';
const OPEN_CLASS='is-open';
const LEAVE_DELAY_MS=180;
let openState={ $trigger:null, $box:null, timer:null };
function decodeDesc(desc){
if(!desc) return '';
const $ta=$('<textarea/>').html(desc);
return $ta.val().replace(/&lt;br\s*\/?&gt;/gi,'<br>');
}
function ensureId($el){
let id=$el.attr('data-tooltip-id');
if(!id){
id='tb-' + Math.random().toString(36).slice(2,9);
$el.attr('data-tooltip-id', id);
}
return id;
}
function getTooltipKey($el){
return $el.data('begriff')||$el.data('title')||$.trim($el.text());
}
function classifyKind(rawUrl, rawLinktext){
let u=null;
try { u=new URL(rawUrl, window.location.origin); } catch(e){}
if(u&&u.hostname&&u.hostname!==window.location.hostname){
if(/(openjur|bundesverfassungsgericht|bundessozialgericht|prinz|sozialgerichtsbarkeit|juris|bverwg|justiz|\.bundesgerichtshof)/i.test(u.hostname)){
return 'recht';
}
return 'extern';
}
const path=(u&&u.pathname) ? u.pathname:'';
if(/^\/tag\//i.test(path)){
const slug=path.toLowerCase();
if(/\/tag\/(%C2%A7-|§-|sg|wo|vw|rv|vv|bg|be|ba|bu|bk|bs|anlage)/i.test(path)){
return 'gesetz';
}
if(/\/tag\/(%C2%A7-|§-|sg|wo|vw|rv|vv|bg|be|ba|bu|bk|bs|anlage|nr|vorbe)/i.test(path)){
return 'vorschrift';
}
return 'stichwort';
}
if(/^\/(buergergeld|sozialhilfe|sozialversicherungsrecht|allgemeines-sozialrecht)(\/|$)/i.test(path)){
return 'intro';
}
if(u) return 'beitrag';
const lt=(rawLinktext||'').toLowerCase();
if(lt.includes('paragraf')||lt.includes('gesetz')) return 'gesetz';
if(lt.includes('einführungsseite')||lt.includes('einfuehrungsseite')) return 'intro';
if(lt.includes('beitrag')) return 'beitrag';
return 'stichwort';
}
function buildBox($trigger){
const title=$trigger.data('title')||$.trim($trigger.text());
const descHtml=decodeDesc($trigger.data('desc')||'');
const url=$trigger.attr('href')||'#';
let linktext=$trigger.data('linktext')||'Link';
if(linktext==='Beitrag')        linktext='zum Beitrag';
if(linktext==='Einführungsseite') linktext='zur Einführungsseite';
const kind=classifyKind(url, linktext);
const id=ensureId($trigger);
const key=getTooltipKey($trigger)||'(ohne)';
const $box=$('<div/>', {
'class': 'tooltip-box',
'id': 'box-' + id,
'role': 'dialog',
'aria-hidden': 'true'
}).css({ 'z-index': 9999 }).attr({
'data-linktext': linktext,
'data-kind': kind
});
$box.attr('data-href', url);
if(kind!=='gesetz'){
$box.addClass('tb-clickbox');
$box.on('click', function(e){
if($(e.target).closest('a.tooltip-title-link, a.tooltip-end-link').length) return;
const href=$(this).attr('data-href');
if(!href||href==='#') return;
const k=$(this).attr('data-kind');
if(k==='recht'||k==='extern'){
window.open(href, '_blank', 'noopener');
}else{
window.location.href=href;
}});
}
let $titleEl;
if((kind==='beitrag'||kind==='intro')&&url&&url!=='#'){
$titleEl=$('<a/>', {
'class': 'tooltip-title tooltip-title-link',
href: url,
text: title,
'data-tooltip-id': id,
'data-tooltip-key': key,
'data-linktext': linktext,
target: '_self'
});
}else if((kind==='recht'||kind==='extern')&&url&&url!=='#'){
$titleEl=$('<a/>', {
'class': 'tooltip-title tooltip-title-link',
href: url,
text: title,
'data-tooltip-id': id,
'data-tooltip-key': key,
'data-linktext': linktext,
target: '_blank',
rel: 'noopener noreferrer'
});
}else{
$titleEl=$('<strong/>', { 'class': 'tooltip-title', text: title });
}
const $descEl=$('<div/>', { 'class':'tooltip-desc' }).html(descHtml);
const targetAttrs=((kind==='recht'||kind==='extern') ? { target:'_blank', rel:'noopener noreferrer' }:{});
let nativeTitle='Öffnen';
if(kind==='beitrag')      nativeTitle='Zum Beitrag: ' + title;
if(kind==='intro')        nativeTitle='Zur Einführungsseite: ' + title;
if(kind==='gesetz')       nativeTitle='Zur Vorschrift: ' + title;
if(kind==='vorschrift')   nativeTitle='Zum Paragrafen: ' + title;
if(kind==='stichwort')    nativeTitle='Zum Stichwort: ' + title;
if(kind==='recht')        nativeTitle='Rechtsprechung öffnen';
if(kind==='extern')       nativeTitle='Externer Link: ' + title;
const $linkEl=(url&&linktext)
? $('<a/>', Object.assign({
'class': 'tooltip-link tooltip-end-link',
'data-tooltip-id': id,
'data-tooltip-key': key,
'data-linktext': linktext,
href: url,
text: linktext,
title: nativeTitle
}, targetAttrs))
: null;
$trigger
.attr('data-tooltip-key', key)
.attr('data-kind', kind)
.addClass('tb-kind-' + kind);
$box.append($titleEl, $descEl);
if($linkEl) $box.append($linkEl);
if(kind!=='gesetz'){
$box.addClass('tb-clickbox');
$box.on('click', function(e){
if($(e.target).closest('a').length) return;
const href=$(this).attr('data-href');
if(!href||href==='#') return;
const k=$(this).attr('data-kind');
if(k==='recht'||k==='extern'){
window.open(href, '_blank', 'noopener');
}else{
window.location.href=href;
}});
}
$('body').append($box);
return $box;
}
function positionBox($trigger, $box){
const rect=$trigger[0].getBoundingClientRect();
const scrollY=window.scrollY||window.pageYOffset;
const scrollX=window.scrollX||window.pageXOffset;
const gap=8;
const vw=document.documentElement.clientWidth;
let top=rect.bottom + scrollY + gap;
let left=rect.left   + scrollX;
const bw=Math.min(($box.outerWidth()||350), vw - 16);
const overflowRight=(left + bw) - (scrollX + vw - 8);
if(overflowRight > 0) left=left - overflowRight - 8;
if(left < 8 + scrollX) left=8 + scrollX;
$box.css({ position: 'absolute', top, left, maxWidth: '92vw', width: 'auto' });
}
function attachBoxHover($box){
$box.on('mouseenter', ()=> { if(openState.timer){ clearTimeout(openState.timer); }});
$box.on('mouseleave', scheduleClose);
}
function trackEndShown($box, key){
if(!('IntersectionObserver' in window)) return;
const endEl=$box.find('a.tooltip-end-link').get(0);
if(!endEl) return;
let fired=false;
const io=new IntersectionObserver((entries)=> {
entries.forEach(entry=> {
if(fired) return;
if(entry.isIntersecting){
_paq.push(['trackEvent','Tooltip','endShown', key, 1]);
fired=true;
io.disconnect();
}});
}, { root: null, threshold: 0.25 });
io.observe(endEl);
}
function openTip($trigger){
if(openState.timer) clearTimeout(openState.timer);
if(openState.$box&&openState.$trigger&&openState.$trigger[0]!==$trigger[0]){
closeTip(openState.$trigger);
}
let $box=openState.$box;
if(!$box||(openState.$trigger&&openState.$trigger[0]!==$trigger[0])){
$box=buildBox($trigger);
attachBoxHover($box);
}
positionBox($trigger, $box);
$box.addClass(OPEN_CLASS).attr('aria-hidden','false');
const key=$trigger.attr('data-tooltip-key')||getTooltipKey($trigger);
_paq.push(['trackEvent','Tooltip','open', key, 1]);
if(!$box.data('endTracked')){
trackEndShown($box, key);
$box.data('endTracked', true);
}
$trigger.data('hoverStart', Date.now());
$trigger.attr({
'aria-expanded':'true',
'role':'button',
'tabindex':'0',
'aria-controls': $box.attr('id')
});
openState={ $trigger, $box, timer:null };}
function scheduleClose(){
if(openState.timer) clearTimeout(openState.timer);
openState.timer=setTimeout(function(){
if(openState.$trigger) closeTip(openState.$trigger);
}, LEAVE_DELAY_MS);
}
function closeTip($trigger){
if(openState.timer) clearTimeout(openState.timer);
const key=$trigger ? ($trigger.attr('data-tooltip-key')||getTooltipKey($trigger)):'(ohne)';
const t0=$trigger ? ($trigger.data('hoverStart')||0):0;
if(t0){
const ms=Math.max(0, Date.now() - t0);
_paq.push(['trackEvent','Tooltip','hoverMs', key, Math.round(ms)]);
$trigger.removeData('hoverStart');
}
if(openState.$box){
openState.$box.removeClass(OPEN_CLASS).attr('aria-hidden','true');
}
if($trigger){
$trigger.attr('aria-expanded','false');
}
openState={ $trigger:null, $box:null, timer:null };}
$(document)
.on('mouseenter', TRIGGER_SEL, function(){ openTip($(this)); })
.on('mouseleave', TRIGGER_SEL, function(){ scheduleClose(); });
$(document).on('keydown', function(e){
if(e.key==='Escape'){
if(openState.$trigger) closeTip(openState.$trigger);
}
if((e.key==='Enter'||e.key===' ')&&$(e.target).closest(TRIGGER_SEL).length){
e.preventDefault();
openTip($(e.target).closest(TRIGGER_SEL));
}});
$(document).on('click', 'a.tooltip-end-link', function(e){
const $a=$(this);
const id=$a.data('tooltipId');
const $tr=$('a.tooltip-begriff[data-tooltip-id="'+ id +'"]').first();
const key=$a.data('tooltipKey')||$tr.attr('data-tooltip-key')||'(ohne)';
const href=$a.attr('href')||'';
_paq.push(['trackEvent','Tooltip','click', key, 1]);
if(!$a.attr('target')){
e.preventDefault();
setTimeout(function(){ window.location.href=href; }, 150);
}});
});
(function($){
$(document).ready(function(){
$(window).on('scroll', function(){
if($(this).scrollTop() > 500){
$('.top-btn').addClass('visible');
}else{
$('.top-btn').removeClass('visible');
}});
$('#scroll-to-top').on('click', function(e){
e.preventDefault();
$('html, body').animate({ scrollTop: 0 }, 500);
});
function resolveAnchorTarget(hash){
if(!hash||hash.length < 2) return $();
var $target=$(hash);
if(!$target.length) return $();
if(hash==='#text'&&$target.is('div.tipp3#text')){
var $h2=$target.prevAll('h2').first();
if($h2.length) return $h2;
}
if((hash==='#kommentierung'||hash==='#liste')&&$target.is('div, section, article')){
var $h2k=$target.prevAll('h2').first();
if($h2k.length) return $h2k;
}
return $target;
}
$('a[href*="#"]:not([href="#"])').on('click', function(e){
var hash=this.hash;
var $target=resolveAnchorTarget(hash);
if($target.length){
e.preventDefault();
$('html, body').animate({
scrollTop: $target.offset().top
}, 500);
}});
var hash=window.location.hash;
if(hash&&hash.length > 1){
setTimeout(function(){
var $target=resolveAnchorTarget(hash);
if($target.length){
$('html, body').animate({
scrollTop: $target.offset().top
}, 500);
}}, 500);
}
var $menuToggle=$('#genesis-mobile-nav-primary');
function updateMainMenuTitle(){
var expanded=$menuToggle.attr('aria-expanded')==='true';
$menuToggle.attr('title',
expanded ? 'Hauptnavigation schließen':'Hauptnavigation öffnen'
);
}
if($menuToggle.length){
updateMainMenuTitle();
$menuToggle.on('click', function(){
setTimeout(function(){
updateMainMenuTitle();
window._paq=window._paq||[];
var expanded=$menuToggle.attr('aria-expanded')==='true';
_paq.push([
'trackEvent',
'Menu',
expanded ? 'Hauptmenü geöffnet':'Hauptmenü geschlossen',
window.location.pathname
]);
}, 5);
});
}
function updateSubToggleTitle($btn){
var expanded=$btn.attr('aria-expanded')==='true';
$btn.attr('title', expanded ? 'Untermenü schließen':'Untermenü öffnen');
}
$('.sub-menu-toggle').each(function(){
updateSubToggleTitle($(this));
});
$(document).on('click', '.sub-menu-toggle', function(){
var $btn=$(this);
setTimeout(function(){
updateSubToggleTitle($btn);
window._paq=window._paq||[];
var expanded=$btn.attr('aria-expanded')==='true';
var label=$.trim($btn.siblings('a, span').first().text())||'(ohne Label)';
_paq.push([
'trackEvent',
'Submenu',
expanded ? 'Submenü geöffnet':'Submenü geschlossen',
label
]);
}, 5);
});
$(document).on('click', '.beitragsliste-ul .beitragsliste-card a', function(){
var $a=$(this);
var title=$.trim($a.find('h3').text())||$a.attr('title')||'(ohne Titel)';
var href=$a.attr('href')||'';
window._paq=window._paq||[];
_paq.push([
'trackEvent',
'Beitragskarten',
'Klick',
title + ' | ' + href
]);
});
$(document).on('click', '.cpseo-breadcrumb .breadcrumb-link', function(){
var $a=$(this);
var label=$.trim($a.text())||'(ohne Titel)';
var href=$a.attr('href')||'';
window._paq=window._paq||[];
_paq.push([
'trackEvent',
'Breadcrumb',
'Klick',
label + ' | ' + href
]);
});
});
(function(){
window._paq=window._paq||[];
function trackScroll(){
var scrollPos=window.scrollY + window.innerHeight;
var pageHeight=document.documentElement.scrollHeight;
var percent=Math.round((scrollPos / pageHeight) * 100);
if(percent >=25&&!trackScroll._25){
_paq.push(['trackEvent','Scroll','scroll',25]);
trackScroll._25=true;
}
if(percent >=50&&!trackScroll._50){
_paq.push(['trackEvent','Scroll','scroll',50]);
trackScroll._50=true;
}
if(percent >=75&&!trackScroll._75){
_paq.push(['trackEvent','Scroll','scroll',75]);
trackScroll._75=true;
}
if(percent >=90&&!trackScroll._90){
_paq.push(['trackEvent','Scroll','scroll',90]);
trackScroll._90=true;
}}
window.addEventListener('scroll', trackScroll);
})();
})(jQuery);