(function(n,t,i){var r=window.matchMedia;typeof module!="undefined"&&module.exports?module.exports=i(r):typeof define=="function"&&define.amd?define(function(){return t[n]=i(r)}):t[n]=i(r)})("enquire",this,function(n){"use strict";function t(n,t){var i=0,u=n.length,r;for(i;i<u;i++)if(r=t(n[i],i),r===!1)break}function f(n){return Object.prototype.toString.apply(n)==="[object Array]"}function e(n){return typeof n=="function"}function i(n){this.options=n;n.deferSetup||this.setup()}function r(t,i){this.query=t;this.isUnconditional=i;this.handlers=[];this.mql=n(t);var r=this;this.listener=function(n){r.mql=n;r.assess()};this.mql.addListener(this.listener)}function u(){if(!n)throw new Error("matchMedia not present, legacy browsers require a polyfill");this.queries={};this.browserIsIncapable=!n("only all").matches}return i.prototype={setup:function(){this.options.setup&&this.options.setup();this.initialised=!0},on:function(){this.initialised||this.setup();this.options.match&&this.options.match()},off:function(){this.options.unmatch&&this.options.unmatch()},destroy:function(){this.options.destroy?this.options.destroy():this.off()},equals:function(n){return this.options===n||this.options.match===n}},r.prototype={addHandler:function(n){var t=new i(n);this.handlers.push(t);this.matches()&&t.on()},removeHandler:function(n){var i=this.handlers;t(i,function(t,r){if(t.equals(n))return t.destroy(),!i.splice(r,1)})},matches:function(){return this.mql.matches||this.isUnconditional},clear:function(){t(this.handlers,function(n){n.destroy()});this.mql.removeListener(this.listener);this.handlers.length=0},assess:function(){var n=this.matches()?"on":"off";t(this.handlers,function(t){t[n]()})}},u.prototype={register:function(n,i,u){var o=this.queries,s=u&&this.browserIsIncapable;return o[n]||(o[n]=new r(n,s)),e(i)&&(i={match:i}),f(i)||(i=[i]),t(i,function(t){o[n].addHandler(t)}),this},unregister:function(n,t){var i=this.queries[n];return i&&(t?i.removeHandler(t):(i.clear(),delete this.queries[n])),this}},new u});$(function(){cityWay.consts.responsive=cityWay.tools.getLessVars("Responsive");enquire.register("screen and (max-width: "+cityWay.consts.responsive.screenSmMax+"px)",{match:function(){var n,t;$("#mainnav").toggleClass("navbar-fixed-top",!0);n=$("#login-popup-container").detach();$("#navbar-login").append(n);t=$("#SearchFormGlobal").detach();$("#navbar-search").append(t)},unmatch:function(){var n,t;$("#mainnav").toggleClass("navbar-fixed-top",!1);n=$("#navbar-login > #login-popup-container").detach();$("#login-popup-container-parent").append(n);t=$("#SearchFormGlobal").detach();$("#search-container").append(t)}})});cityWay.modules.mapResponsive={};cityWay.modules.mapResponsive.bindPopup=function(n){var t=function(t){$("#popup-"+n.mapId).empty().html(t.popup.getContent());$("p.title","#popup-"+n.mapId).find(".leaflet-popup-close-button").remove();var i=$('<button class="btn-link leaflet-popup-close-button" href="#close" aria-label="'+cityWay.texts.common.Button_Close+'">×<\/button>');$("p.title","#popup-"+n.mapId).append(i);i.on("click",function(){return n.mapControl.closePopup(),!0});t.popup.on("contentupdate",function(){$("#popup-"+n.mapId).empty().html(t.popup.getContent());$("p.title","#popup-"+n.mapId).find(".leaflet-popup-close-button").remove();var i=$('<button class="btn-link leaflet-popup-close-button" href="#close" aria-label="'+cityWay.texts.common.Button_Close+'">×<\/button>');$("p.title","#popup-"+n.mapId).append(i);i.on("click",function(){return n.mapControl.closePopup(),!0});return cityWay.eventManager.publish(cityWay.events.map.responsivePopupContentUpdate,t.popup,$("#popup-"+n.mapId)),!1});return cityWay.eventManager.publish(cityWay.events.map.responsivePopupOpen,t.popup,$("#popup-"+n.mapId)),!1},i=function(t){return $("#popup-"+n.mapId).empty(),cityWay.eventManager.publish(cityWay.events.map.responsivePopupClose,t.popup,$("#popup-"+n.mapId)),!1};enquire.register("screen and (max-width: "+cityWay.tools.getLessVars("Responsive").screenSmMax+"px)",{match:function(){n.mapControl.on("popupopen",t);n.mapControl.on("popupclose",i);var r=$("<div/>").attr("id","popup-"+n.mapId);r.insertAfter("#"+n.mapId)},unmatch:function(){n.mapControl.off("popupopen",t);n.mapControl.off("popupclose",i)}})}