function autoPlayYouTubeModal(){var n=body.find(".videoModalToggle");n.off("click");n.on("click",function(){var t=this.dataset.target,n=document.querySelector(t),i=this.dataset.videoUrl,r=i+"?autoplay=1&rel=0&showinfo=0&disablekb=1&modestbranding=1&autohide=1&color=white";n.querySelector("iframe").src=r;$(n).on("hidden.bs.modal",function(){n.querySelector("iframe").src=""})})}function initScrollFunctions(){window.onscroll=function(){scrollPosition=window.pageYOffset;stickUnstickInPageMenu()};window.dispatchEvent(new CustomEvent("scroll"))}function initResizeFunctions(){window.addEventListener("resize",function(){viewportDimensions.height=window.innerHeight;viewportDimensions.width=window.innerWidth;setTimeout(function(){$.fn.matchHeight._update();window.dispatchEvent(new CustomEvent("resize.px.parallax"))},125)});window.dispatchEvent(new CustomEvent("resize"))}function stickUnstickInPageMenu(){if(inPageNavigation){var t=header.offsetHeight,i=getComputedStyle(header).zIndex,n=getComputedStyle(inPageNavigation);scrollPosition>=t?(inPageNavigation.style.position="sticky",inPageNavigation.style.top=t+"px",inPageNavigation.style.left=0,inPageNavigation.style.zIndex=i-1):(inPageNavigation.style.position=n.position,inPageNavigation.style.top=n.top,inPageNavigation.style.left=n.left,inPageNavigation.style.zIndex=n.zIndex)}}function bindSearch(){$(".headerSearch input").keyup(function(n){if(n.keyCode===13&&n.target.value!=""){var t=$(n.target).siblings("button").data("searchurl");redirectToSearch(t,n.target.value)}});$(".headerSearch button").on("click",function(n){console.log(n);var t=$(n.currentTarget);redirectToSearch(t.data("searchurl"),t.siblings("input").val())})}function redirectToSearch(n,t){n&&t&&window.location.replace(n+"?q="+t)}function repairCmsButtons(){var n=$(".btn > a");n.each(function(){var n=$(this),t=n.parent();n.attr("class",t.attr("class"));n.parent().removeClass()})}function CaseFilterChangeListner(){$("select").on("change",function(){getFilteredCases()})}function CasePaginationButton(){$(".PagingButton").click(function(){switch(this.id){case"PreviousPage":$(".CurrentPage").val(parseInt($(".CurrentPage").val())-1);break;case"NextPage":$(".CurrentPage").val(parseInt($(".CurrentPage").val())+1);break;default:$(".CurrentPage").val(parseInt(this.id))}getFilteredCases();event.preventDefault()})}function searchButtons(){$("#SearchTerm").keyup(function(n){n.keyCode===13&&($("#SearchButton").click(),n.preventDefault())});$("#SearchButton").click(function(){return getSearchResults(),!1});$(".PagingButton").click(function(){switch(this.id){case"PreviousPage":$(".CurrentPage").val(parseInt($(".CurrentPage").val())-1);break;case"NextPage":$(".CurrentPage").val(parseInt($(".CurrentPage").val())+1);break;default:$(".CurrentPage").val(parseInt(this.id))}return getSearchResults(),!1})}function getFilteredCases(){var n=window.location.protocol+"//"+window.location.host+"/ServiceApi/PostFilteredCases";values=$("#filterForm").serializeArray();$(".casesContainer").load(n,values,function(){CasePaginationButton()})}function getSearchResults(){var n=window.location.protocol+"//"+window.location.host+"/Umbraco/Surface/searchresultspagepartialsurface/searchresultspartial",t=$("#searchResultsForm *").serializeArray(),i=$.ajax({url:n,data:t,dataType:"html",method:"get",cache:!1});i.done(function(n){history.pushState(n,"Zoeken "+$("#SearchTerm").val(),$("#SearchButton").data("searchurl")+"?q="+$("#SearchTerm").val());$("#searchResults").html(n);searchButtons()})}function initSelectric(){$(".customOptions").selectric({optionsItemBuilder:function(n){return n.value.length?'<span class="ico ico-'+n.value+'"><\/span>'+n.text:n.text}});$(".customLabel").selectric({labelBuilder:function(n){return"<strong><em>"+n.text+"<\/em><\/strong>"}});$("select").selectric({disableOnMobile:!0,nativeOnMobile:!0,expandToItemText:!0,arrowButtonMarkup:'<b class="button"><img src="/Img/up-arrow-circle-select-orange.png" ><\/b>'})}function checkIfMobile(){var n={Android:function(){return navigator.userAgent.match(/Android/i)},BlackBerry:function(){return navigator.userAgent.match(/BlackBerry/i)},iOS:function(){return navigator.userAgent.match(/iPhone|iPad|iPod/i)},Opera:function(){return navigator.userAgent.match(/Opera Mini/i)},Windows:function(){return navigator.userAgent.match(/IEMobile/i)},any:function(){return n.Android()||n.BlackBerry()||n.iOS()||n.Opera()||n.Windows()}};n.any()?$(".selectric-hide-select").css("display","block"):$(".selectric-hide-select").css("display","none")}(function(n,t,i,r){function u(t,i){var e=this,f,o,s;if(typeof i=="object"&&(delete i.refresh,delete i.render,n.extend(this,i)),this.$element=n(t),!this.imageSrc&&this.$element.is("img")&&(this.imageSrc=this.$element.attr("src")),f=(this.position+"").toLowerCase().match(/\S+/g)||[],f.length<1&&f.push("center"),f.length==1&&f.push(f[0]),(f[0]=="top"||f[0]=="bottom"||f[1]=="left"||f[1]=="right")&&(f=[f[1],f[0]]),this.positionX!==r&&(f[0]=this.positionX.toLowerCase()),this.positionY!==r&&(f[1]=this.positionY.toLowerCase()),e.positionX=f[0],e.positionY=f[1],this.positionX!="left"&&this.positionX!="right"&&(this.positionX=isNaN(parseInt(this.positionX))?"center":parseInt(this.positionX)),this.positionY!="top"&&this.positionY!="bottom"&&(this.positionY=isNaN(parseInt(this.positionY))?"center":parseInt(this.positionY)),this.position=this.positionX+(isNaN(this.positionX)?"":"px")+" "+this.positionY+(isNaN(this.positionY)?"":"px"),navigator.userAgent.match(/(iPod|iPhone|iPad)/))return this.imageSrc&&this.iosFix&&!this.$element.is("img")&&this.$element.css({backgroundImage:"url("+this.imageSrc+")",backgroundSize:"cover",backgroundPosition:this.position}),this;if(navigator.userAgent.match(/(Android)/))return this.imageSrc&&this.androidFix&&!this.$element.is("img")&&this.$element.css({backgroundImage:"url("+this.imageSrc+")",backgroundSize:"cover",backgroundPosition:this.position}),this;this.$mirror=n("<div />").prependTo(this.mirrorContainer);o=this.$element.find(">.parallax-slider");s=!1;o.length==0?this.$slider=n("<img />").prependTo(this.$mirror):(this.$slider=o.prependTo(this.$mirror),s=!0);this.$mirror.addClass("parallax-mirror").css({visibility:"hidden",zIndex:this.zIndex,position:"fixed",top:0,left:0,overflow:"hidden"});this.$slider.addClass("parallax-slider").one("load",function(){e.naturalHeight&&e.naturalWidth||(e.naturalHeight=this.naturalHeight||this.height||1,e.naturalWidth=this.naturalWidth||this.width||1);e.aspectRatio=e.naturalWidth/e.naturalHeight;u.isSetup||u.setup();u.sliders.push(e);u.isFresh=!1;u.requestRender()});s||(this.$slider[0].src=this.imageSrc);(this.naturalHeight&&this.naturalWidth||this.$slider[0].complete||o.length>0)&&this.$slider.trigger("load")}function f(r){return this.each(function(){var f=n(this),e=typeof r=="object"&&r;this==t||this==i||f.is("body")?u.configure(e):f.data("px.parallax")?typeof r=="object"&&n.extend(f.data("px.parallax"),e):(e=n.extend({},f.data(),e),f.data("px.parallax",new u(this,e)));typeof r=="string"&&(r=="destroy"?u.destroy(this):u[r]())})}(function(){for(var r=0,i=["ms","moz","webkit","o"],n=0;n<i.length&&!t.requestAnimationFrame;++n)t.requestAnimationFrame=t[i[n]+"RequestAnimationFrame"],t.cancelAnimationFrame=t[i[n]+"CancelAnimationFrame"]||t[i[n]+"CancelRequestAnimationFrame"];t.requestAnimationFrame||(t.requestAnimationFrame=function(n){var i=(new Date).getTime(),u=Math.max(0,16-(i-r)),f=t.setTimeout(function(){n(i+u)},u);return r=i+u,f});t.cancelAnimationFrame||(t.cancelAnimationFrame=function(n){clearTimeout(n)})})();n.extend(u.prototype,{speed:.2,bleed:0,zIndex:-100,iosFix:!0,androidFix:!0,position:"center",overScrollFix:!1,mirrorContainer:"body",refresh:function(){this.boxWidth=this.$element.outerWidth();this.boxHeight=this.$element.outerHeight()+this.bleed*2;this.boxOffsetTop=this.$element.offset().top-this.bleed;this.boxOffsetLeft=this.$element.offset().left;this.boxOffsetBottom=this.boxOffsetTop+this.boxHeight;var r=u.winHeight,e=u.docHeight,f=Math.min(this.boxOffsetTop,e-r),o=Math.max(this.boxOffsetTop+this.boxHeight-r,0),i=this.boxHeight+(f-o)*(1-this.speed)|0,t=(this.boxOffsetTop-f)*(1-this.speed)|0,n;i*this.aspectRatio>=this.boxWidth?(this.imageWidth=i*this.aspectRatio|0,this.imageHeight=i,this.offsetBaseTop=t,n=this.imageWidth-this.boxWidth,this.offsetLeft=this.positionX=="left"?0:this.positionX=="right"?-n:isNaN(this.positionX)?-n/2|0:Math.max(this.positionX,-n)):(this.imageWidth=this.boxWidth,this.imageHeight=this.boxWidth/this.aspectRatio|0,this.offsetLeft=0,n=this.imageHeight-i,this.offsetBaseTop=this.positionY=="top"?t:this.positionY=="bottom"?t-n:isNaN(this.positionY)?t-n/2|0:t+Math.max(this.positionY,-n))},render:function(){var n=u.scrollTop,t=u.scrollLeft,i=this.overScrollFix?u.overScroll:0,r=n+u.winHeight;this.boxOffsetBottom>n&&this.boxOffsetTop<=r?(this.visibility="visible",this.mirrorTop=this.boxOffsetTop-n,this.mirrorLeft=this.boxOffsetLeft-t,this.offsetTop=this.offsetBaseTop-this.mirrorTop*(1-this.speed)):this.visibility="hidden";this.$mirror.css({transform:"translate3d("+this.mirrorLeft+"px, "+(this.mirrorTop-i)+"px, 0px)",visibility:this.visibility,height:this.boxHeight,width:this.boxWidth});this.$slider.css({transform:"translate3d("+this.offsetLeft+"px, "+this.offsetTop+"px, 0px)",position:"absolute",height:this.imageHeight,width:this.imageWidth,maxWidth:"none"})}});n.extend(u,{scrollTop:0,scrollLeft:0,winHeight:0,winWidth:0,docHeight:1073741824,docWidth:1073741824,sliders:[],isReady:!1,isFresh:!1,isBusy:!1,setup:function(){function e(){if(f==t.pageYOffset)return t.requestAnimationFrame(e),!1;f=t.pageYOffset;o.render();t.requestAnimationFrame(e)}var f;if(!this.isReady){var o=this,s=n(i),r=n(t),h=function(){u.winHeight=r.height();u.winWidth=r.width();u.docHeight=s.height();u.docWidth=s.width()},c=function(){var n=r.scrollTop(),t=u.docHeight-u.winHeight,i=u.docWidth-u.winWidth;u.scrollTop=Math.max(0,Math.min(t,n));u.scrollLeft=Math.max(0,Math.min(i,r.scrollLeft()));u.overScroll=Math.max(n-t,Math.min(n,0))};r.on("resize.px.parallax load.px.parallax",function(){setTimeout(function(){h();o.refresh();u.isFresh=!1;u.requestRender()},250)}).on("scroll.px.parallax load.px.parallax",function(){c();u.requestRender()});h();c();this.isReady=!0;f=-1;e()}},configure:function(t){typeof t=="object"&&(delete t.refresh,delete t.render,n.extend(this.prototype,t))},refresh:function(){n.each(this.sliders,function(){this.refresh()});this.isFresh=!0},render:function(){this.isFresh||this.refresh();n.each(this.sliders,function(){this.render()})},requestRender:function(){var n=this;n.render();n.isBusy=!1},destroy:function(i){var r,f=n(i).data("px.parallax");for(f.$mirror.remove(),r=0;r<this.sliders.length;r+=1)this.sliders[r]==f&&this.sliders.splice(r,1);n(i).data("px.parallax",!1);this.sliders.length===0&&(n(t).off("scroll.px.parallax resize.px.parallax load.px.parallax"),this.isReady=!1,u.isSetup=!1)}});var e=n.fn.parallax;n.fn.parallax=f;n.fn.parallax.Constructor=u;n.fn.parallax.noConflict=function(){return n.fn.parallax=e,this};n(function(){n('[data-parallax="scroll"]').parallax()})})(jQuery,window,document);var body=$("body"),header=document.getElementsByTagName("header")[0],inPageNavigation=document.getElementsByClassName("inPageNavigation")[0],scrollPosition=0,viewportDimensions={};window.onload=function(){function n(n){$.ajax({type:"GET",url:"https://vimeo.com/api/oembed.json?url="+encodeURIComponent(n),dataType:"json",complete:function(n){n.status!=200&&body.addClass("novideoImageFallBack")}})}n("https://vimeo.com/239106609")};$(document).ready(function(){bindSearch();body.hasClass("caseOverview")&&(CaseFilterChangeListner(),CasePaginationButton(),initSelectric());repairCmsButtons();window.getComputedStyle(document.body).mixBlendMode!==undefined&&body.addClass("cssMultiply");body.hasClass("siteHome")&&autoPlayYouTubeModal();searchButtons();window.addEventListener("popstate",function(n){body.hasClass("siteSearchResults")&&$("#searchResults").html(n.state)});checkIfMobile();$(".matchHeight").matchHeight();$(".matchHeight2").matchHeight();initScrollFunctions();initResizeFunctions()})