jQuery(document).ready(function(e){"undefined"!=window.BorlabsCookie&&e('[href*="#borlabs-cookies-preferences"]').on("click",function(e){e.preventDefault(),window.BorlabsCookie.openCookiePreference()})}),jQuery(document).on("ready",function(){BASE.onReady(),CONTENT.onReady(),FORMS.onReady(),YOUTUBE.onReady()});var BASE={onReady:function(){BASE.postsCounterOfTwo=1,BASE.postsCounterOfThree=1,BASE.postsCounterOfFour=1,BASE.initAnimation(),BASE.isInViewport(200,".animation-block:not(.in-viewport)"),BASE.isInViewport(0,".top-anchor-trigger"),BASE.initParallax(),BASE.addRowClasses(),jQuery(".block-accordion").on("click",".is-expandable .header",BASE.toggleAccordion),BASE.initAccordionDeeplink(),jQuery('a[href^="#"]').on("click",BASE.scrollTo),jQuery('a[href^="#"]').on("click",BASE.setLeadSubject),jQuery(document).on("click","section.is-cropped .load-more",BASE.showCutshort)},initAnimation:function(){jQuery(".is-animated").imagesLoaded(function(){jQuery.each(jQuery(".animation-block.in-viewport"),function(e,t){jQuery.each(jQuery(".is-animated:not(.show)",t),function(e,t){setTimeout(function(){jQuery(t).addClass("show")},100*e)})})}),jQuery.each(jQuery(".is-animated"),function(e,t){jQuery(".animation-block").has(t).length||jQuery(t).addClass("show")})},isInViewport:function(e=0,t=""){""!=t&&(inView.offset(e),inView(t).on("enter",e=>{e.classList.add("in-viewport"),BASE.initAnimation()}).on("exit",e=>{e.classList.remove("in-viewport")}))},initParallax:function(){if(!(jQuery(".is-parallax").length<1)){var e=document.querySelectorAll(".block-visual.is-parallax img");new simpleParallax(e,{scale:"1"})}},addRowClasses:function(){jQuery(".column.block-post:not(.is-counted)").each(function(e,t){var r=jQuery(t),o=BASE.postsCounterOfTwo%2==0?2:BASE.postsCounterOfTwo%2,n=BASE.postsCounterOfThree%3==0?3:BASE.postsCounterOfThree%3,a=BASE.postsCounterOfFour%4==0?4:BASE.postsCounterOfFour%4,i="is-counted is-"+o+"of2 is-"+n+"of3 is-"+a+"of4";r.addClass(i),BASE.postsCounterOfTwo++,BASE.postsCounterOfThree++,BASE.postsCounterOfFour++,r.hasClass("is-focused")&&(2!=o&&BASE.postsCounterOfTwo++,3!=n&&BASE.postsCounterOfThree++,4!=a&&BASE.postsCounterOfFour++)})},initAccordionDeeplink:function(){if(!(jQuery(".block-accordion").length<1&&""==window.location.href)){var e=window.location.hash.substr(1);jQuery('a[name="'+e+'"]').next(".is-expandable").find(".header").trigger("click")}},toggleAccordion:function(e){e.preventDefault();var t=jQuery(this),r=t.closest(".is-expandable"),o=t.closest(".block-accordion");jQuery(".is-expandable",o).not(r).removeClass("is-open").find(".body").slideUp("fast"),t.closest(".is-expandable").toggleClass("is-open").find(".body").slideToggle("fast")},setLeadSubject:function(){if(!(jQuery(this).data("subject").length<1)){var e=jQuery(this).attr("href"),t=jQuery(this).data("subject");jQuery(e+" input[name=srd-subject]").val(t),console.log("in")}},scrollTo:function(){var e=jQuery(this).attr("href"),t=jQuery("nav.section.nav").outerHeight();return jQuery("html, body").animate({scrollTop:jQuery(e).offset().top-t},"slow"),!1},showCutshort:function(e){e.preventDefault();let t=jQuery(this).closest("section.is-cropped");jQuery(this).addClass("is-loading"),jQuery("li.is-last ~ li",t).hide(),jQuery.each(jQuery("li",t),function(e,r){setTimeout(function(){jQuery(r).fadeIn("slow"),e+1==jQuery("li",t).length&&jQuery(".list-more",t).hide()},25*e)})}},CONTENT={onReady:function(){jQuery(".blog").length<1||(CONTENT.initSidebar(),jQuery(document).on("click",".blog a.load-more",CONTENT.paginateFilter))},initSidebar:function(){"undefined"!=typeof srdBlogContent&&void 0!==srdBlogContent.taxonomy_slug&&""!=srdBlogContent.taxonomy_slug&&(jQuery("#sidebar-blog .menu.cat li").removeClass("current-cat"),jQuery("#sidebar-blog .menu.cat").find('[data-slug="'+srdBlogContent.taxonomy_slug+'"]').addClass("current-cat"))},paginateFilter:function(){return CONTENT.context=jQuery(this),CONTENT.target=jQuery(".results"),CONTENT.taxonomy=jQuery(CONTENT.context).data("taxonomy"),CONTENT.slug=jQuery(CONTENT.context).data("slug"),CONTENT.page=parseInt(jQuery(CONTENT.context).data("page"))+1,jQuery(CONTENT.context).addClass("is-loading"),CONTENT.def=new jQuery.Deferred,CONTENT.getContent(),jQuery.when(CONTENT.def).then(function(){CONTENT.placeResult()}),!1},getContent:function(){jQuery.ajax({url:srdJS.ajaxurl,type:"POST",data:"action=get_content&taxonomy="+CONTENT.taxonomy+"&slug="+CONTENT.slug+"&page="+CONTENT.page,success:function(e){return CONTENT.response=e,CONTENT.def.resolve()},error:function(e,t,r){console.log("AJAX Error: "+t+" "+r)}})},placeResult:function(){jQuery(CONTENT.target).append(CONTENT.response),BASE.addRowClasses(),BASE.initAnimation(),jQuery(CONTENT.context).data("page",CONTENT.page).removeClass("is-loading")}},FORMS={onReady:function(){jQuery("form.form-lead").length<1||jQuery(document).on("click",".form-lead .srd-submit",FORMS.initSubmit)},initSubmit:function(){return FORMS.context=jQuery(this).closest("form"),FORMS.formname=jQuery("input[name=srd-form-name]",FORMS.context).val(),FORMS.DEFvalidation=new jQuery.Deferred,FORMS.validateForm(),jQuery.when(FORMS.DEFvalidation).then(function(){FORMS.error<1&&FORMS.sendForm()}),!1},validateForm:function(){return FORMS.error=0,jQuery.each(jQuery("input.required, select.required, textarea.required",FORMS.context),function(e,t){if(jQuery(t).removeClass("is-danger"),jQuery(t).parent().find("p.is-danger").remove(),"SELECT"==jQuery(t).prop("nodeName")){if(0==jQuery("option:selected",t).val()){var r=jQuery(t).data("errormsg");jQuery(t).addClass("is-danger"),jQuery(t).parent().append('
'+r+"
"),FORMS.error++}}else if("email"==jQuery(t).attr("type")){if(0==new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i).test(jQuery(t).val())||""==jQuery(t).val()){r=jQuery(t).data("errormsg");jQuery(t).addClass("is-danger"),jQuery(t).parent().append(''+r+"
"),FORMS.error++}}else if("checkbox"==jQuery(t).attr("type")){if(!jQuery(t).prop("checked")){r=jQuery(t).data("errormsg");jQuery(t).addClass("is-danger"),jQuery(t).parent().append(''+r+"
"),FORMS.error++}}else if("radio"==jQuery(t).attr("type")){if(0==jQuery('[name="'+jQuery(t).attr("name")+'"]:checked').length&&-1==jQuery.inArray(jQuery(t).data("errormsg"),FORMS.error)){r=jQuery(t).data("errormsg");jQuery(t).addClass("is-danger"),jQuery(t).parent().append(''+r+"
"),FORMS.error++}}else if("submit"==jQuery(t).attr("type"))console.log("submit");else if(""==jQuery(t).val()){r=jQuery(t).data("errormsg");jQuery(t).addClass("is-danger"),jQuery(t).parent().append(''+r+"
"),FORMS.error++}}),FORMS.DEFvalidation.resolve()},sendForm:function(){var e=jQuery(FORMS.context).serialize();jQuery.ajax({type:"POST",url:srdJS.ajaxurl,data:"action=submitform&"+e,success:function(e,t,r){var o=new RegExp(/[0]$/),n=(e=jQuery.trim(e.replace(o,"")),"");console.log(e);try{var a=jQuery.parseJSON(e)}catch(e){jQuery(FORMS.context).after('Es ist ein unbekannter Fehler aufgetreten.