function mod_responsive_handler(){function s(){var n=$('<div id="resposive-handler"><\/div>');for(var i in t)t[i]=$('<div class="show-on-'+i+'"><\/div>'),n.append(t[i]),n.css("display","absolute").css("top","-10000px").css("left","-10000px"),$("body").prepend(n);$(window).resize(function(){var n;r==null&&(n=new Date,r=n.getTime());var n=new Date,t=n.getTime(),i=t-r;i>o&&(r=null,e())});e()}function h(){var t,r;for(t in n)r=f+n[t],i.addClass(r)}function c(){var r,n;for(r in t)n=f+r,i.hasClass(n)&&i.removeClass(n)}function l(n){return i.hasClass(f+n)?!0:!1}function e(){var r=n,i;n=[];c();for(i in t){var f=n.indexOf(i)>=0,e=r.indexOf(i)>=0,o=$(t[i]).is(":visible");o&&!f&&(n.push(i),e||u.publish(i))}h()}function a(){for(var t in n)u.publish(n[t])}function v(n,t){u.subscribe(n,t)}function y(n){for(var i in t)u.subscribe(i,n)}function p(){return n}var f="breakpoint-",i=$("html"),r=null,o=100,u=new pattern_publisher_subscriber,n=[],t={xs:null,sm:null,md:null,lg:null,xl:null,"greater-than-xs":null,"greater-than-sm":null,"greater-than-md":null,"greater-than-lg":null,"less-than-sm":null,"less-than-md":null,"less-than-lg":null,"less-than-xl":null};return{init:s,subscribe:v,subscribe_to_all:y,republish:a,getActiveBreakpoints:p,breakpointActive:l}}function module_responsive_images(){function t(){n=$("img.responsive-image")}function i(){$(n).each(function(){var n="",t=$(this).parent().width(),i;t>0&&(n="&width="+t);i=$(this).data("location")+n;$(this).prop("src",i)})}var n=null;return{init:t,update:i}}function Carousel(){function ht(n){isDefined(n)&&(isDefined(n.automaticRotation)&&n.automaticRotation===!0&&(w=!0),isDefined(n.enableTransition)&&n.enableTransition===!0?ft=!0:s=0,isDefined(n.animationDuration)&&n.animationDuration>0&&(s=n.animationDuration),isDefined(n.forcedDisplayMode)&&(c=n.forcedDisplayMode),isDefined(n.preloadImagesEnabled)&&(b=n.preloadImagesEnabled),isDefined(n.enableThumbs)&&(k=n.enableThumbs),isDefined(n.useImgSourceMobile)&&(d=n.useImgSourceMobile));u=$($(".carousel")[0]);t=u.find(".item");t.each(function(){enableTransitions($(this),s,"opacity");bt($(this))});k&&pt();t.length>1&&$("body.pageeditor").length==0&&(vt(),it());$(document).ready(function(){at();yt()})}function ct(n){var t="";n.data("align-horizontal")&&(t+=n.data("align-horizontal"));n.data("align-vertical")&&(t+=" "+n.data("align-vertical"));n.css("background-position",t)}function lt(){return i.css("background-position")}function at(){nt(l);n.css("z-index","2");wt();ct(n);y(l);rt();tt();o.publish("showItem",{displayMode:r});b&&setTimeout(function(){g()},st)}function g(){t.each(function(n){n!=l&&y(n)})}function v(r){(y(r),nt(r),n&&i&&n.get(0)===i.get(0))||(n.css("z-index","1"),t.each(function(){var t=$(this);t.get(0)!==i.get(0)&&t.get(0)!==n.get(0)&&t.css("z-index","0")}),i.removeClass("visible"),f=!0,setTimeout(function(){tt();g();f=!1},s))}function nt(i){var r,u;if(typeof i=="number")n=$(t[i]),targetIndex=i;else for(r=0;r<t.length;r++)if($item=$(t[r]),u=$item.data("img-src"),u==i){n=$item;targetIndex=r;break}rt()}function tt(){var t=i;i=n;e=targetIndex;i.css("z-index","2");t!==null&&(t.css("z-index","0"),t.addClass("visible"));n=null;targetIndex=null}function it(){w===!0&&(a=setInterval(function(){p()},et))}function h(){clearInterval(a);setTimeout(function(){clearInterval(a);it()},ot)}function vt(){var i=$('<div class="navigation"><\/div>'),n=$('<div class="component-carousel-navigatie"><\/div>'),r=$('<a href="#" class="navigatieknop vorige"><img src="/Images/Mauritshuis/navigation-left.png"/><\/a>'),t;r.click(function(n){n.preventDefault();f||(ut(),h())});t=$('<a href="#" class="navigatieknop volgende"><img src="/Images/Mauritshuis/navigation-right.png"/><\/a>');t.click(function(n){n.preventDefault();f||(p(),h())});n.append(r);n.append(t);i.append(n);u.append(i)}function yt(){$(".items-wrapper").swipe({swipeRight:function(){f||(ut(),h())},swipeLeft:function(){f||(p(),h())}})}function pt(){t.each(function(){$(this).css("background-image","url("+$(this).data("thumb-src")+")")})}function rt(){var t=$($(n).find(".component-claim")[0]),i="left",r;t.data("align-horizontal")=="rechts"&&(i="right");r=10;t.data("offset-percentage-top")&&(r=t.data("offset-percentage-top"));responsive_handler.breakpointActive("xs")?t.css(i,"15px"):t.css(i,"40px");t.css("top",r+"%");t.show()}function wt(){r=n.data("zoom-out")==!0?"contain":"cover";c!==null&&(r=c)}function y(n){var i=$(t[n]),u=i.parent().height(),f=i.parent().width(),r,e;r=!window.matchMedia("(min-width: 767px)").matches&&d?getBaseUrl(i.data("img-mobile-src")):getBaseUrl(i.data("img-src"));e=orientation(f,u)=="horizontal"?r+"?mw="+f:r+"?mh="+u;i.css("background-image","url("+e+")")}function bt(n){var t=n.find(".button");$(".pageeditor")[0]||t.length>0&&$(t[0]).attr("href")!=""&&n.attr("onclick","window.location.href='"+$(t[0]).attr("href")+"'")}function kt(){var n=e+1;return e+1==t.length&&(n=0),n}function p(){v(kt())}function dt(){var n=e-1;return e===0&&(n=t.length-1),n}function ut(){v(dt())}function gt(){u.removeClass("visible")}function ni(){u.addClass("visible");o.publish("showItem",{displayMode:r})}function ti(t){i.css("background-size",t);r=t;t=="contain"?(i.css("background-position","auto auto"),n.data("zoom-out",!0)):n.data("zoom-out",!1);o.publish("showItem",{displayMode:t})}function ii(){return i}function ri(){return t}function ui(){return u}var o=new pattern_publisher_subscriber,u=null,w=!1,ft=!1,t=null,r="cover",c=null,l=0,e=null,s=0,et=1e4,a=null,ot=12e3,n=null,i=null,f=!1,b=!0,st=1e3,k=!0,d=!0;return{init:ht,publisher:o,showItem:v,hide:gt,show:ni,displayMode:r,setDisplayMode:ti,getActiveItem:ii,getCarouselItems:ri,getCarouselElement:ui,getAlignment:lt}}function InfiniteCarousels(n,t){function r(){$carouselComponents=$(n);$carouselComponents.each(function(){var n=new InfiniteCarousel($(this),t);n.init();i.push(n)})}var i=[];return{init:r}}function InfiniteCarousel(n,t){function k(){if(h=o.find("li"),h.length<=t.elementsPerPanel&&(t.displayNext=t.displayPrevious=!1),typeof Queue=="function")a=new Queue;else return;if(i=o.find(t.viewportSelector),i.wrap('<div class="'+t.viewportWrapClass+'" />'),s=o.find("ul").first(),p=100/t.elementsPerPanel,h.css("width",p+"%"),e=$("<nav />"),t.displayPrevious){c=$('<a class="'+t.previousClass+'">'+t.previousInnerHTML+"<\/a>");c.on("click",function(){b(-1)});e.append(c)}if(t.displayNext){l=$('<a class="'+t.nextClass+'">'+t.nextInnerHTML+"<\/a>");l.on("click",function(){b(1)});e.append(l)}o.append(e);h.each(function(){r.push($(this))});s.remove();u=w(t.elementsPerPanel);i.append(u);var n=u.outerHeight();i.css("height",n);v();$(window).resize(function(){v()})}function d(n){for(var e=$('<ul class="'+t.panelClass+'" />'),f=[],u=[],i=1;i<=n;i++)f.push(r.pop());for(f=f.reverse(),r=f.concat(r),i=1;i<=n;i++)u.push(r.pop());for(u=u.reverse(),r=r.concat(u),i=0;i<u.length;i++)e.append(u[i].clone());return e}function w(n){var f=$('<ul class="'+t.panelClass+'" />'),u=[],i;for(r.reverse(),i=1;i<=n;i++)u.push(r.pop());for(r.reverse(),r=r.concat(u),i=0;i<u.length;i++)u[i]&&f.append(u[i].clone());return f}function b(n){a.add(function(r){var e=n==1?w(t.elementsPerPanel):d(t.elementsPerPanel),o,h,s,c;e.css("width",f+"px");e.css("left",n*f+"px");i.append(e);o=e.outerHeight();$("html").hasClass("csstransforms3d")?(h=y+n*-f,u.css("transform","translate3d("+h+"px,0,0)"),setTimeout(function(){u.remove()},t.animationDuration),s=n*-f,e.css("transform","translate3d("+s+"px,0,0)"),y=s,i.css("height",o)):(i.css("transition","none"),u.css("transition","none"),e.css("transition","none"),c=n*-f+"px",u.animate({left:c},t.animationDuration,function(){u.remove()}),e.animate({left:0},t.animationDuration),i.animate({height:o},500));setTimeout(function(){u=e;executeFunction(r)},t.animationDuration)})}function v(){a.add(function(n){f=i.width();u.css("width",f+"px");setTimeout(function(){i.css("height",u.outerHeight())},200);setTimeout(function(){executeFunction(n)},200)})}function g(){i.css("height","auto");i.find(".panel").remove();i.append(s);s.css("position","static");e.remove()}var o=n,r=[],y=0,i,s,h,u,e,c,l,f,p,a,t=$.extend({elementsPerPanel:4,animationDuration:1e3,viewportSelector:".viewport",viewportWrapClass:"viewportWrap",panelClass:"panel",panelGroupClass:"panelGroup",previousClass:"previous",nextClass:"next",previousInnerHTML:"<span>Vorige<\/span>",nextInnerHTML:"<span>Volgende<\/span>",displayPrevious:!0,displayNext:!0},t);return{init:k,resize:v,destroy:g}}function Sliders(){function t(){sliderComponents=$(".component-slider");sliderComponents.each(function(){var t=new Slider($(this));t.init();n.push(t)})}var n=[];return{init:t}}function Slider(n){function y(){typeof Queue=="function"&&(l=new Queue);u=$(i.find(".slides-wrapper")[0]);t=$(i.find(".slides")[0]);s=t.find(".slide");c=t.find(".slide > *");f=$(i.find(".navigation")[0]);e=$(f.find(".previous")[0]);e.on("click",function(){v("previous")});r=$(f.find(".next")[0]);r.on("click",function(){v("next")});setTimeout(function(){var n=0;s.each(function(){n+=$(this).outerWidth()});h=$(s[0]).outerWidth();t.css("width",n+"px");a(0);p();k()},1200)}function p(){var n=0,t;c.each(function(){var i=$(this),t=$(i.find("img")[0]);t.height()>n&&(n=t.height())});c.each(function(){var r=$(this),t=$(r.find("img")[0]),i;n>t.height()&&(i=n-t.height(),t.css("padding-top",i+"px"))});t=r.height();f.css("top",n/2-t/2+"px")}function w(n){var i=u.offset().left,r=t.offset().left+n,f=Math.abs(r-i);return f<20||r>i?!0:!1}function b(n){var f=u.offset().left,e=t.offset().left+n,i=f+u.width(),r=e+t.outerWidth(),o=Math.abs(r-i);return o<50||r<i?!0:!1}function a(n){w(n)?(e.hide(),o=!0):(e.show(),o=!1);b(n)?(r.hide(),o=!0):(r.show(),o=!1)}function v(n){l.add(function(i){var u=parseInt(t.css("left").replace("px","")),r=0;r=n=="next"?-h:h;t.css("left",u+r+"px");a(r);setTimeout(function(){executeFunction(i)},800)})}function k(){i.css("height","auto");i.css("visibility","visible")}var i=n,u=null,t=null,s=null,h=null,c=null,f=null,r=null,e=null,o=!1,l=null;return{init:y}}function Popup(n){function d(){i=g();i.on("click",function(n){n.stopPropagation();o()});t=i.find(".component-popup").first();t.addClass(n.themeClass);t.on("click",function(n){n.stopPropagation()});$(window).on("resize",nt);f=t.find(".header").first();r=t.find(".content").first();k=t.find(".footer").first();e=t.find(".action-close").first();e.on("click",function(n){n.stopPropagation();n.preventDefault();o()});y(e);$("body").prepend(i);c=$("html").hasClass("lt-ie9")}function g(){return $(['<div class="module-popup">','<div class="component-popup">','<div class="header">',n.closeButtonHTML,"<\/div>",'<div class="content"><\/div>','<div class="footer"><\/div>',"<\/div>","<\/div>",].join(""))}function l(){var n=$(window).height(),i=$(window).width(),r=t.height(),u=t.width(),f=(n-r)/2,e=(i-u)/2}function a(){var n=$(window).height(),i=$(window).width(),u=t.width(),r;u>i&&t.css("width",percentageOf(i,90)+"px");r=t.outerHeight();r>n&&t.css("height",percentageOf(n,90)+"px")}function v(){var r,u;p();var f=$(window).height(),e=$(window).width(),o=$(window).width()-80,s=$(window).height()-40,i=t.find("img"),n=new Image;n.src=i.attr("src");r=n.width;u=n.height;t.css("margin-top",-(i.height()/2))}function nt(){a();l()}function tt(){layover.show("10000");i.show();a();l();setTimeout(function(){i.addClass("visible")},300)}function it(){$(window).off("resize");$(window).on("resize",v);layover.show("10000");i.show();setTimeout(function(){v();i.addClass("visible")},300)}function rt(){i.removeClass("visible");layover.hide();setTimeout(function(){i.hide()},500)}function o(){layover.hide();i.removeClass("visible");c?(i.hide(),s()):setTimeout(function(){i.hide();s()},500);h.publish("close")}function y(n){f.append(n)}function ut(n){f.prepend(n)}function s(){r.html("")}function ft(n){s();r.append(n)}function et(){i.removeClass(u)}function p(){var n=r.find("img");et();u=getImageOrientation(n);n.addClass(u);i.addClass(u)}function ot(n){i.addClass(n)}function st(){return $(t)}function ht(n,t){w(n);b(t)}function w(n){t.css("width",n+"px")}function b(n){t.css("height",n+"px")}var n=$.extend({themeClass:"component-popup-default",closeButtonHTML:'<a class="action-close icon icon-cross-zwart" href="#"><\/a>',isImgLightbox:!1,padding:20},n),h=new pattern_publisher_subscriber,i=null,t=null,f=null,r=null,k=null,e=null,u=null,c=!1;return{init:d,show:tt,showImage:it,hide:rt,close:o,addContent:ft,appendAction:y,prependAction:ut,getPopupElement:st,setDimensions:ht,setWidth:w,setHeight:b,publisher:h,setImageOrientation:p,setName:ot}}function LightboxLinks(n,t){function f(){if(typeof Queue=="function")r=new Queue;else return;if(typeof Popup=="function")i=new Popup({themeClass:t.popupThemeClass,closeButtonHTML:t.popupCloseButtonHTML,isImgLightbox:t.popupIsImgLightbox}),i.init();else return;u.on("click",t.linkSelector,function(n){n.preventDefault();e($(this))})}function e(n){var t=n.find("img").first().data("src");r.add(function(n){var r=$("<img />"),u;r=r.attr("src",t);u=new Image;u.onload=function(){setTimeout(function(){i.addContent(r);i.showImage();i.setName("image")},50);setTimeout(function(){executeFunction(n)},500)};u.src=t})}var u=$(n),r,i,t=$.extend({linkSelector:".lightbox-link",popupThemeClass:"component-popup-clean",popupCloseButtonHTML:'<a class="action-close icon icon-cross-wit" href="#"><\/a>',popupIsImgLightbox:!0},t);return{init:f}}function ValidateCardNumber(n,t){function f(){u=r.find(t.cardNumberInputSelector);i=$(t.emailField);r.on("click",t.buttonSelector,function(n){n.preventDefault();e()})}function e(){console.log("$email.val() : "+i.val());var n={cardNumber:u.val(),emailaddress:i.val()};getJSON(getApiUrl("validateCard"),n,function(n){o(n)})}function o(n){var i,r=$(t.feedbackSelector);n.valid?(i=t.succesMessage,r.removeClass("invalid")):(i=t.failMessage,r.addClass("invalid"));r.text(i)}var r=$(n),u=null,i="",t=$.extend({cardNumberInputSelector:'[type="text"]',buttonSelector:'[type="submit"]',feedbackSelector:".discount",succesMessage:"Te ontvangen korting: 10%",failMessage:"Dit is geen geldig kaartnummer.",emailField:".mijn-gegevens #Emailadres"},t);return{init:f}}function ShadowFormFields(n,t){function r(){$shadowFormFieldComponents=$(n);$shadowFormFieldComponents.each(function(){var n=new ShadowFormField($(this),t);n.init();i.push(n)})}var i=[];return{init:r}}function ShadowFormField(n){function r(){var n=t.attr("data-shadow");i=$('[name="'+n+'"]');i.on("blur",function(){if(t.is(":disabled")){var i=$(this).val();t.val(i);t.attr("data-old-value",i);console.log(n)}})}var t=n,i;return{init:r}}function DisabledFieldToggles(n,t){function r(){$disabledFieldsToggleComponents=$(n);$disabledFieldsToggleComponents.each(function(){var n=new DisabledFieldsToggle($(this),t);n.init();i.push(n)})}var i=[];return{init:r}}function DisabledFieldsToggle(n,t){function e(){typeof Queue=="function"&&(u=new Queue);i=$(t.checkboxSelector);r=f.find(t.fieldsToDisableSelector).not(i);i.on("click",function(){o($(this),r)})}function o(n,i){u.add(function(r){var u=n.is(":checked");u==t.disableOnCheck?(i.attr("disabled","disabled"),t.repopulateOnDisable&&i.each(function(){var n=$(this);n.val(n.attr("data-old-value"))})):(i.removeAttr("disabled"),t.clearOnEnable&&i.each(function(){$(this).val("")}));setTimeout(function(){executeFunction(r)},200)})}var f=n,i,r,u,t=$.extend({checkboxSelector:".disabled-fields-toggle-checkbox",fieldsToDisableSelector:"select, input, button",disableOnCheck:!0,clearOnEnable:!1,repopulateOnDisable:!0},t);return{init:e}}function BBBind(){function t(){typeof Handlebars=="object"&&(n=Handlebars)}function i(t,i){if(n!==null){var r=Handlebars.compile($("#"+t).html());return r(i)}return!1}var n=null;return{init:t,getHTML:i}}function Taalkeuzemenu(){function f(){t=$($("[data-toggle=taalkeuzemenu]")[0]);t.on("click",function(n){n.preventDefault();n.stopPropagation();u()});var i=$(".taalkeuzemenu-wrapper");n=$($(".component-taalkeuzemenu")[0]);i.on("click mouseenter",function(n){n.stopPropagation()});layover.bind("click",function(){r()})}function u(){i?r():e()}function e(){var f,u;layover.show(6500);f=1;n.css("right",f+"px");u=$(n.find(".linkOverlay")[0]);u.css("width",t.width()+29+"px");u.on("click",function(){r()});n.fadeIn();i=!0}function r(){n.removeClass("active");n.fadeOut(function(){layover.hide()});i=!1}var t=null,n=null,i=!1;return{init:f,toggle:u}}function Hoofdmenu(){function tt(){typeof Queue=="function"&&(f=new Queue);c=$(".page-zoeken.page-type").length>0;v=$(".page-type-home").length>0;a=$($(".tablet-landscape-header-content .component-hoofdmenu")[0]);u=$("#submenu-slider");ut();n=$($(".tablet-landscape-header-content .kruimelpad")[0]);n.length>0&&!v?(n.active=n.is(":visible"),k()):n=!1;t=$($(".tablet-landscape-header-content .submenu")[0]);t.active=t.is(":visible");t.click(function(n){n.stopPropagation()});r=$($("#submenu-slider .component-zoekbalk")[0]);r.active=r.is(":visible");zoekveldSwitch=$("#search-toggle");zoekveldSwitch.on("click",function(n){n.stopPropagation();r.active?h():p()});$("#search > .icon-svg-zoeken").on("click",function(){r.submit()});o=$($(r.find(".zoekveld"))[0]);o.click(function(n){n.stopPropagation()});setTimeout(function(){b();o.fadeIn()},0);u.addClass("initialized");menuItems=a.find(" > li");menuItems.each(function(){if($(this).find("> ul").length>0){var i=$($(this).find("> ul")[0]);i.parent=$(this);i.addClass("component-submenu");$(this).on("click",function(u){if($(this).hasClass("hover")&&t.active)$(this).hasClass("hover")&&t.active&&h();else{var f=$(this);y();f.addClass("hover");n&&n.active?g():r.active&&(layover.hide(),d());rt(i,f)}u.preventDefault();u.stopPropagation()})}});w=$($(".page-type")[0]);w.on("click",function(){h()});layover.bind("click",function(){h()});$(window).on("resize",function(){b()})}function b(){if(!(responsive_handler.breakpointActive("xs")||responsive_handler.breakpointActive("sm"))){var n=a.width()-65;o.css("width",n+"px")}}function h(){y();e=!0;t.active?nt():r.active&&!c&&(layover.hide(),d());c?p():!n||n.active||v?it():k();i.hide()}function it(){f.add(function(t){var i=u.initialHeight;n.active||e||(i="7px");u.css("height",i);executeFunction(t)})}function y(){menuItems.removeClass("hover")}function k(){f.add(function(t){n&&l(n,t)})}function p(){zoekveldSwitch.hide();n&&n.active?g():t.active&&(nt(),y());zoekveldSwitch.parent().addClass("active");f.add(function(n){c||(layover.show(5500),responsive_handler.breakpointActive("xs")||responsive_handler.breakpointActive("sm")||setTimeout(function(){o.focus()},300));l(r,n);i.hide()})}function d(){zoekveldSwitch.show();f.add(function(t){zoekveldSwitch.parent().removeClass("active");r.stop().fadeOut(s.exit,function(){var i=u.initialHeight;n.active||e||(i="7px");u.css("height",i);executeFunction(t);r.active=!1;e&&(e=!1)});suggest.hide();i.show()})}function g(){f.add(function(t){n.stop().fadeOut(s.exit,function(){n.active=!1;executeFunction(t)})})}function l(n,t){sliderHeight=75;n.height()>50&&(sliderHeight=n.height()+25);u.css("height",sliderHeight+"px");setTimeout(function(){n.fadeIn(s.enter).css("display","inline-block");n.active=!0;executeFunction(t)},250);i.show()}function rt(n,i){f.add(function(r){n.css("margin-left",i.position().left+8+"px");t.active?t.stop().fadeOut(s.exit,function(){t.html(n);l(t,r)}):(t.html(n),l(t,r))})}function nt(){f.add(function(n){t.stop().fadeOut(s.exit,function(){t.active=!1;e&&(e=!1);executeFunction(n);i.hide()})})}function ut(){i=$('<div id="exit-bottom"><\/div>');i.css("position","absolute");i.css("bottom","-210px");i.css("width","100%").css("height","150px");i.on("click mouseenter",function(){setTimeout(function(){h()},200)});i.hide();u.append(i)}var t=null,u=null,n=null,r=null,o=null,a=null,w=null,f=null,c=null,v=null,i=null,e=!1,s={enter:80,exit:50};return{init:tt,toonZoekveld:p}}function MobileMenu(){function y(){i=$($(".mobile-menu .hoofdmenu")[0]);n=$($(".mobile-menu .menu-search")[0]);s=i.find(".component-hoofdmenu > li > a");s.on("click",function(n){if($menuItem=$(this),$menuItem.parent().hasClass("borderless"))return!0;n.stopPropagation();n.preventDefault();$menuItem.parent().hasClass("active")?b($menuItem.parent()):w($menuItem.parent())});r=$("#toggle-menu");r.on("click",function(n){n.preventDefault();n.stopPropagation();f?o():p()});u=$("#toggle-search");u.on("click",function(n){n.preventDefault();n.stopPropagation();e?v():a()});t=n.find(".component-zoekbalk").first();t.active=t.is(":visible");h=t.find(".zoekveld").first();h.click(function(n){n.stopPropagation()});c=n.find(".search").first();c.on("click",function(){t.submit()});l=$($(".page-type")[0]);l.on("click",function(){o()});pageZoeken=$($(".page-zoeken"));pageZoeken.length>0&&a()}function p(){$("body").addClass("no-scroll");r.addClass("active");v();i.addClass("visible");f=!0}function o(){$("body").removeClass("no-scroll");r.removeClass("active");i.removeClass("visible");f=!1}function a(){o();n.addClass("visible");u.addClass("active");e=!0}function v(){n.removeClass("visible");u.removeClass("active");e=!1}function w(n){$(".component-hoofdmenu > li > .visible").removeClass("visible");$(".component-hoofdmenu > .active").removeClass("active");n.addClass("active");var t=$(n.find("ul")[0]);t.addClass("visible")}function b(n){n.removeClass("active");var t=$(n.find("ul")[0]);t.removeClass("visible")}var i=null,n=null,s=null,r=null,u=null,f=!1,e=!1,t=null,h=null,c=null,l=null;return{init:y}}function Suggest(){function y(){u=$($(".tablet-landscape-header-content .component-zoekbalk:not(.page-zoeken .component-zoekbalk)")[0]);u.click(function(n){n.stopPropagation()});t=$($(u.find(".zoekveld"))[0]);t.keyup(function(){if(i=this.value,this.value!==""){h!==null&&clearTimeout(h);var n;n=i.length<=2?v:a;h=setTimeout(function(){l(i)},n)}});n=$($(".component-suggestie-container")[0]);n.click(function(n){n.stopPropagation()});n.on("mouseleave",function(){});f=$($(n.find(".categorie.webpaginas .suggesties")[0]));meerResultatenWebpaginas=$($(n.find(".categorie.webpaginas .component-suggestie-meer-resultaten.meer-website")[0]));resultatenSectieArtiesten=$($(n.find(".categorie.collectie .suggesties.tekst")[0]));e=$($(n.find(".categorie.collectie .suggesties.afbeelding")[0]));meerResultatenCollectie=$($(n.find(".categorie.collectie .component-suggestie-meer-resultaten.meer-collectie")[0]));o=$($(n.find(".categorie.shop .suggesties")[0]));meerResultatenWebshop=$($(n.find(".categorie.shop .component-suggestie-meer-resultaten.meer-webshop")[0]));layover.bind("click",function(){c()})}function l(n){s==null&&(s=$.ajax({type:"GET",dataType:"json",url:"/"+MauritshuisApi.suggestBaseUrl,data:{query:n},success:function(t){s=null;t.query!=i&&l(i);p(n,t)}}))}function r(n,t){var r=$(t),u=n.split(" "),f,i;for(f in u)i=u[f],typeof i!="function"&&r.highlight(i,{className:"shade"});return r[0]}function p(n,t){var s,h,v,p,b,l,y,a,i,u;if(isDefined(t)){if(f.html(""),resultatenSectieArtiesten.html(""),e.html(""),o.html(""),isDefined(t.webpaginas)){if(s=t.webpaginas,s.length){for(a in s)i=$("<li><\/li>"),u=r(n,SuggestieTekst(s[a])),i.append(u),f.append(i);show=!0}meerResultatenWebpaginas.attr("href",t.moreWebpaginasUrl+encodeURIComponent(t.query))}if(isDefined(t.collectie)){if(isDefined(t.collectie.kunstenaars)&&(v=t.collectie.kunstenaars,v.length)){for(p in v)i=$("<li><\/li>"),u=r(n,SuggestieTekst(v[p])),i.append(u),resultatenSectieArtiesten.append(i);show=!0}if(isDefined(t.collectie.kunstwerken)&&(h=t.collectie.kunstwerken,h.length)){for(b in h)l=h[b],l.artiesten=(l.authors==null||typeof l.authors=="undefined")?"":l.authors.join(", "),i=$("<li><\/li>"),u=r(n,SuggestieAfbeelding(l)),i.append(u),e.append(i);show=!0}meerResultatenCollectie.attr("href",t.moreCollectionUrl+encodeURIComponent(t.query))}if(isDefined(t.webshop)){if(y=t.webshop,y.length)for(a in y)i=$("<li><\/li>"),u=r(n,SuggestieShop(y[a])),i.append(u),o.append(i);console.log(t.moreWebshopUrl+encodeURIComponent(t.query));meerResultatenWebshop.attr("href",t.moreWebshopUrl+encodeURIComponent(t.query))}isDefined(s)&&s.length||isDefined(h)&&h.length?w():c()}}function w(){n.css("left",t.offset().left);n.css("top",t.offset().top+t.outerHeight()-1+"px");n.css("width",t.outerWidth());n.show()}function c(){n.hide()}var u=null,t=null,n=null,f=null,e=null,o=null,i="",a=100,v=350,s=null,h=null;return{hide:c,init:y}}function SuggestieTekst(n){n.author&&(n.titel=n.author);var t=Handlebars.compile($("#template-suggestie-tekst").html());return t(n)}function SuggestieAfbeelding(n){var t=Handlebars.compile($("#template-suggestie-afbeelding").html());return t(n)}function SuggestieShop(n){var t=Handlebars.compile($("#template-suggestie-shop").html());return t(n)}function Layover(){function i(){t=$(".page-header");n=$('<div class="layover"><\/div>');$("body").prepend(n)}function r(i){n.css("height",$(document).height());t.css("z-index","auto");n.css("z-index",i);document.body.scrollTop=document.documentElement.scrollTop=0;t.css("position","absolute");setTimeout(function(){n.addClass("visible")},200)}function u(){n.removeClass("visible");setTimeout(function(){n.css("z-index","0");t.css("position","fixed");t.css("z-index","6000")},500)}function f(t,i){n.bind(t,function(n){n.stopPropagation();i()})}var n=null,t=null;return{init:i,show:r,hide:u,bind:f}}function Tabs(){function i(){n=$(".component-tabs");n.find(".tab").on("click",t);n.find(".tab").on("trigger",t)}function t(n){n.preventDefault();r($(this))}function r(n){u(n);f(n)}function u(n){n.closest(".component-tabs").find(".active").removeClass("active");n.addClass("active")}function f(n){var i=n.closest(".component-tabs").find(".tab"),t;i.each(function(){var n=$(this).data("toggle");$("div[data-content="+n+"]").hide()});t=n.data("toggle");$("div[data-content="+t+"]").show()}var n=null;return{init:i}}function customCheckboxes(){function u(){i();var t=n.find("a");t.click(function(n){n.stopPropagation()})}function i(){n=$(".component-formfield-checkbox-custom, .checkbox.custom");n.find('input[type="checkbox"]').on("click",function(){r($(this))});n.each(function(){var n=$(this),r=n.find("input"),i;r.attr("checked")&&(n.addClass("active"),i=n.data("toggle-item"),i&&t(i,!0))})}function f(){n.find('input[type="checkbox"]').off("click");i()}function t(n,t){t==!0?$(n).hide():$(n).show()}function r(n){var i=$(n).parent(".formfield"),r;i.length==0?i=$(n).closest("label"):i.length==0&&(i=$(n));console.log(i);r=i.data("toggle-item");i.hasClass("active")?(i.removeClass("active"),r&&t(r,!1)):(i.addClass("active"),r&&t(r,!0))}var n=null;return{init:u,reinit:f,toggleCheckbox:r}}function customRadio(){function u(){t();var i=n.find("a");i.click(function(n){n.stopPropagation()})}function t(){n=$(".component-formfield-radio-custom, .radio.custom");n.find('input[type="radio"]').on("click",function(){r($(this).parent("label"));$("[name="+$(this).attr("name")+"]").each(function(){var n=$(this),t;n.prop("checked")||(n.parent("label").removeClass("active"),t=n.parent("label").data("toggle-item"),t&&i(t,!1))})});n.each(function(){var n=$(this),t=n.find("input");t.attr("checked")&&n.find("label").addClass("active")})}function f(){n.find('input[type="radio"]').off("click");t()}function i(n,t){t==!0?$(n).show():$(n).hide()}function r(n){var t=n.data("toggle-item");n.hasClass("active")||(n.addClass("active"),t&&i(t,!0))}var n=null;return{init:u,reinit:f,checkRadio:r}}function scrollStop(){lazyLoadContent()}function lazyLoadContent(){var n=$(".lazy-load:in-viewport").not(".lazy-load.visible");n.each(function(){var n=$(this),i=0,t=n.find("img");n.get(0).tagName=="IMG"&&(t=$([$(this)]));t.length&&(i=300);t.each(function(){var t=$(this),f=t.parent().height(),u=n.parent().width(),i,r;t.data("src")&&(i=getBaseUrl(t.data("src")),r=i+"?mw="+u,t.attr("src",r))});setTimeout(function(){n.css("visibility","visible");n.addClass("visible")},i)})}function loadPageImage(n){var t=$(".component-page-image").not(".component-page-image.no-image");t.each(function(){var i=$(this),t=getBaseUrl(i.data("src"));t!==""&&$(this).css("background-image","url("+t+"?w="+n+"&h=250&useCustomFunctions=1&centerCrop=1)")})}var responsive_handler,responsive_images,bbbind,bug,layover,hoofdmenu,mobileMenu,taalkeuzemenu,scrollTop,suggest,tabs,custom_checkboxes,custom_radio,settings,favoritsOverview,search,support,tickets,pageBecomeFriends,_lightboxLinks,_infiniteCarousels1,_infiniteCarousels4,_shoppingCart,_disabledFieldToggles,_shadowFormFields,_validateCardNumber,_productOverview,activities,blogOverview,sliders,artDetail,paragraphs,first,button,component,content,formFooterActinos,nextStep,$attendees,carouselSettings,carousel,productDetail,scrollTimer;typeof mod_responsive_handler=="function"&&(responsive_handler=new mod_responsive_handler,responsive_handler.init(),typeof respond=="function"&&respond(),typeof module_responsive_images=="function"&&(responsive_images=module_responsive_images(),responsive_images.init(),responsive_handler.subscribe_to_all(responsive_images.update)));typeof BBBind=="function"&&(bbbind=new BBBind,bbbind.init());typeof BBDebugger=="function"&&(bug=new BBDebugger);typeof Layover=="function"&&(layover=new Layover,layover.init());typeof Hoofdmenu=="function"&&(hoofdmenu=new Hoofdmenu,hoofdmenu.init());typeof MobileMenu=="function"&&(mobileMenu=new MobileMenu,mobileMenu.init());typeof Taalkeuzemenu=="function"&&(taalkeuzemenu=new Taalkeuzemenu,taalkeuzemenu.init());typeof FastClick=="function";typeof ScrollTop=="function"&&(scrollTop=new ScrollTop,scrollTop.init());typeof Suggest=="function"&&(suggest=new Suggest,suggest.init());typeof Tabs!="function"||$(".page-tickets, .page-support, .page-become-friends, .page-webshopgegevens").length||(tabs=new Tabs,tabs.init());$("html").hasClass("highresdisplay")&&$(".icon").removeClass("icon").addClass("icon-x2");typeof customCheckboxes=="function"&&(custom_checkboxes=new customCheckboxes,custom_checkboxes.init());typeof customRadio=="function"&&(custom_radio=new customRadio,custom_radio.init());typeof Content=="function"&&(content=new Content,$(".elements").length&&(settings={into:".elements"},content.generateElements(settings)),$(".components").length&&(settings={into:".components"},content.generateComponents(settings)));$(".page-overview-favorits").length&&typeof FavoritsOverview=="function"&&(favoritsOverview=new FavoritsOverview,favoritsOverview.init());$(".page-error #search").on("click",function(n){n.stopPropagation();hoofdmenu.toonZoekveld()});search=new Search;search.init();$(".page-support").length&&typeof Tickets=="function"&&(support=new Support,support.init());$(".page-tickets").length&&typeof Tickets=="function"&&(tickets=new Tickets,tickets.init());$(".page-become-friends").length&&typeof PageBecomeFriends=="function"&&(pageBecomeFriends=new PageBecomeFriends,pageBecomeFriends.init());$(".component-navigatieblok-compact, .component-navigatieblok-nieuwsberichten").on("click",function(n){n.preventDefault();var i=$(this).attr("target")||$(this).find("a").attr("target"),t=$(this).attr("href")||$(this).find("a").attr("href");i=="_blank"?window.open(t,"_blank"):location.href=t});if($(".page-webshopproductdetail").length&&(typeof LightboxLinks=="function"&&(_lightboxLinks=new LightboxLinks(".lightbox-links",{}),_lightboxLinks.init()),typeof InfiniteCarousels=="function"&&(_infiniteCarousels1=new InfiniteCarousels(".product-images-carousel",{elementsPerPanel:1,nextInnerHTML:'<img src="/Images/Mauritshuis/navigation-right.png">',previousInnerHTML:'<img src="/Images/Mauritshuis/navigation-left.png">'}),_infiniteCarousels1.init(),_infiniteCarousels4=new InfiniteCarousels(".related-products-carousel",{elementsPerPanel:4,displayPrevious:!1,nextInnerHTML:'<i class="icon icon-pijl-wit"><\/i>',animationDuration:1500}),_infiniteCarousels4.init())),$(".page-webshopwinkelwagen").length&&typeof ShoppingCart=="function"&&(_shoppingCart=new ShoppingCart(".shopping-cart-form",{}),_shoppingCart.init()),$(".page-webshopgegevens").length&&(typeof DisabledFieldToggles=="function"&&(_disabledFieldToggles=new DisabledFieldToggles(".disabled-fields-toggle",{}),_disabledFieldToggles.init()),typeof ShadowFormFields=="function"&&(_shadowFormFields=new ShadowFormFields("[data-shadow]"),_shadowFormFields.init()),typeof ValidateCardNumber=="function"&&(_validateCardNumber=new ValidateCardNumber(".vriendenpas"),_validateCardNumber.init())),($(".page-webshophoofdcategorie").length||$(".page-webshopsubcategorie").length)&&typeof ProductOverview=="function"&&(_productOverview=new ProductOverview({}),_productOverview.init()),$("#menu-toggler").length&&typeof toggleContent=="function")$("#menu-toggler").on("click",function(n){n.preventDefault();n.stopPropagation();toggleContent($(this).data("connect"))});if($(".page-activiteitenagenda").length&&typeof Activities=="function"&&(activities=new Activities,activities.init()),$(".page-blogoverzicht").length&&typeof BlogOverview=="function"&&(blogOverview=new BlogOverview,blogOverview.init()),$(".page-kunstwerk").length&&typeof ArtDetail=="function"&&(typeof Sliders=="function"&&(sliders=new Sliders,sliders.init()),artDetail=new ArtDetail,artDetail.init(),paragraphs=$(".component-collectiestuk-detail .omschrijving > p"),paragraphs.length>1)){first=!0;paragraphs.each(function(){first||$(this).addClass("initially-hidden");first=!1});button=$('<a class="button-goud">Meer<\/a>');button.on("click",function(){paragraphs.each(function(){var n=$(this);n.hasClass("visible")?n.removeClass("visible"):n.addClass("visible")})});component=$(".component-collectiestuk-detail");content=component.find(".content").first();content.append(button)}if($(".form-footer-actions").length&&(formFooterActinos=$(".form-footer-actions").first(),nextStep=formFooterActinos.find(".next-step").first(),nextStep.length))nextStep.on("click",function(){var n=$(this);if(n.addClass("disabled"),!n.hasClass("no-action")){n.css("cursor","progress");n.unbind("click");n.on("click",function(n){return n.stopPropagation(),n.preventDefault(),!1})}});if($(".formulier-aanmeld-portal").length>0){$attendees=$("#attendees");$attendees.hide();$('input[name="ResponseCode"]').on("change",handleChoice);function handleChoice(n){if($(n.target).is(":checked"))var t=$(n.target).val();t=="Present"?$attendees.show():$attendees.hide()}}$(document).on("click",".component-activity-block",function(){var n=$(".activity",this).attr("href");window.location.href=n});$(".component-navigatieblok-download > .link").on("click",function(n){n.preventDefault();n.stopPropagation();var t=$(this).parent(".component-navigatieblok-download").find(".titel").text();t=t.replace(/ /g,"_");dataLayer.push({virtualPagePath:window.location.pathname+t,virtualPageTitle:t,event:"virtualPageview"});$("#downloadid").val($(this).parent(".component-navigatieblok-download").data("downloadid"));popupWrapper=$($(".popup-wrapper")[0]);popupWrapper.off("click").on("click",function(n){n.stopPropagation();downloadPopup.removeClass("visible");setTimeout(function(){layover.hide()},400);dataLayer.push({virtualPagePath:window.location.pathname,virtualPageTitle:"Exhibitions",event:"virtualPageview"})});downloadPopup=$($(".download-popup")[0]);downloadPopup.on("click",function(n){n.stopPropagation()});$("body").prepend(popupWrapper);popupWrapper.show();setTimeout(function(){downloadPopup.addClass("visible")},500);layover.show(9e3);$(layover).off("click").on("click",downloadPopup.closePopup);downloadPopup.closePopup=function(){downloadPopup.removeClass("visible");layover.hide();downloadPopup.find("form")[0].reset();dataLayer.push({virtualPagePath:window.location.pathname,virtualPageTitle:"Exhibitions",event:"virtualPageview"})};downloadPopup.downloadFile=function(n){var i=$(this).find("#SoortMedium").val();dataLayer.push({eventCategory:"Exhibitions Download",eventAction:t,eventLabel:i,eventNonInteraction:!1,event:"eventPush"});typeof n!="undefined"&&typeof n.downloadUrl!="undefined"&&n.downloadUrl!==""&&(window.location.href=n.downloadUrl);downloadPopup.closePopup()}});if($(".page-homepagina").length&&typeof Carousel=="function"&&(carouselSettings={automaticRotation:!0,enableTransition:!0,animationDuration:1500,enableThumbs:!1},carousel=new Carousel,carousel.init(carouselSettings)),$(".page-webshopbeginpagina, .page-webshopproductdetail, .page-webshophoofdcategorie, .page-webshopsubcategorie").length&&typeof ProductDetail=="function"&&(productDetail=new ProductDetail,productDetail.init()),$(".component-iecontainer").length)$(".ie-accept").on("click",function(){$(".component-iecontainer").hide()});$(window).on("scroll",function(){lazyLoadContent();clearTimeout(scrollTimer);scrollTimer=setTimeout(function(){scrollStop()},250)});$(".art-info").on("scroll",function(){lazyLoadContent();clearTimeout(scrollTimer);scrollTimer=setTimeout(function(){scrollStop()},250)});$(".art-info .component-sluiten").on("click",function(){dataLayer.push({event:"event",eventLabel:"Klik dicht",eventCategory:"Klik"})});$(".component-tool-set .toolbar .info").on("click",function(){dataLayer.push({event:"event",eventLabel:"Klik open",eventCategory:"Klik"})});window.addEventListener("load",function(){CheckConsentCookie(document.getElementById("cookie-consent-banner"))});lazyLoadContent();responsive_handler.subscribe("md",function(){loadPageImage(1200)});responsive_handler.subscribe("lg",function(){loadPageImage(1680)});responsive_handler.subscribe("xl",function(){loadPageImage(2560)});responsive_handler.republish()