AUI.add("com-placecube-cookieconsent",function(A){var PPID="com_placecube_cookieconsent_web_portlet_CookieConsentPortlet";var CookieConsent={initCookieConsentForm:function(){$(document).on("click",".btn-cookie-consent",function(e){var consentResponse=$(e.target).attr("data-cookie-consent");var selected=$('input[type\x3d"radio"][name\x3d"measure-website-use"]:checked');if(selected.length>0)consentResponse=selected.val();A.CookieConsent.updateConsent(consentResponse)})},configureDoNotTrack:function(cookiesAccepted){var doNotTrack=
cookiesAccepted=="false";window["ac_client_disable_tracking"]=doNotTrack},updateConsent:function(consentResponse){var url=Liferay.PortletURL.createResourceURL();url.setPortletId(PPID);url.setResourceId("/cookie-consent/update-consent");url.setParameter("consentGiven",consentResponse);A.io.request(url.toString(),{on:{success:function(){A.CookieConsent.configureDoNotTrack(consentResponse);if($(".cookie-consent-updated-banner").length>0){$(".cookie-consent-updated-banner").show();$(window).scrollTop(0)}else location.reload()}}})}};
A.CookieConsent=CookieConsent},"",{requires:["aui-io","liferay-portlet-url"]});
$(document).ready(function(){document.body.className=document.body.className?document.body.className+" js-enabled":"js-enabled";window.GOVUKFrontend.initAll()});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define("GOVUKFrontend",["exports"],e):e(t.GOVUKFrontend={})}(this,function(t){"use strict";function r(t,e){if(window.NodeList.prototype.forEach)return t.forEach(e);for(var n=0;n<t.length;n++)e.call(window,t[n],n,t)}function n(t){this.$module=t,this.moduleId=t.getAttribute("id"),this.$sections=t.querySelectorAll(".govuk-accordion__section"),this.$openAllButton="",this.browserSupportsSessionStorage=e.checkForSessionStorage(),this.controlsClass="govuk-accordion__controls",this.openAllClass="govuk-accordion__open-all",this.iconClass="govuk-accordion__icon",this.sectionHeaderClass="govuk-accordion__section-header",this.sectionHeaderFocusedClass="govuk-accordion__section-header--focused",this.sectionHeadingClass="govuk-accordion__section-heading",this.sectionSummaryClass="govuk-accordion__section-summary",this.sectionButtonClass="govuk-accordion__section-button",this.sectionExpandedClass="govuk-accordion__section--expanded"}(function(t){var a,c,l,u;"defineProperty"in Object&&function(){try{return Object.defineProperty({},"test",{value:42}),!0}catch(t){return!1}}()||(a=Object.defineProperty,c=Object.prototype.hasOwnProperty("__defineGetter__"),l="Getters & setters cannot be defined on this javascript engine",u="A property cannot both have accessors and be writable or have a value",Object.defineProperty=function(t,e,n){if(a&&(t===window||t===document||t===Element.prototype||t instanceof Element))return a(t,e,n);if(null===t||!(t instanceof Object||"object"==typeof t))throw new TypeError("Object.defineProperty called on non-object");if(!(n instanceof Object))throw new TypeError("Property description must be an object");var o=String(e),i="value"in n||"writable"in n,r="get"in n&&typeof n.get,s="set"in n&&typeof n.set;if(r){if("function"!==r)throw new TypeError("Getter must be a function");if(!c)throw new TypeError(l);if(i)throw new TypeError(u);Object.__defineGetter__.call(t,o,n.get)}else t[o]=n.value;if(s){if("function"!==s)throw new TypeError("Setter must be a function");if(!c)throw new TypeError(l);if(i)throw new TypeError(u);Object.__defineSetter__.call(t,o,n.set)}return"value"in n&&(t[o]=n.value),t})}).call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"bind"in Function.prototype||Object.defineProperty(Function.prototype,"bind",{value:function(e){var n,t=Array,o=Object,i=o.prototype,r=t.prototype,s=function s(){},a=i.toString,c="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,l=Function.prototype.toString,u=function u(t){try{return l.call(t),!0}catch(e){return!1}};n=function n(t){if("function"!=typeof t)return!1;if(c)return u(t);var e=a.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e};var d=r.slice,h=r.concat,p=r.push,f=Math.max,b=this;if(!n(b))throw new TypeError("Function.prototype.bind called on incompatible "+b);for(var m,y=d.call(arguments,1),v=f(0,b.length-y.length),g=[],w=0;w<v;w++)p.call(g,"$"+w);return m=Function("binder","return function ("+g.join(",")+"){ return binder.apply(this, arguments); }")(function(){if(this instanceof m){var t=b.apply(this,h.call(y,d.call(arguments)));return o(t)===t?t:this}return b.apply(e,h.call(y,d.call(arguments)))}),b.prototype&&(s.prototype=b.prototype,m.prototype=new s,s.prototype=null),m}})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(o){var t,e,n;"DOMTokenList"in this&&(!("classList"in(t=document.createElement("x")))||!t.classList.toggle("x",!1)&&!t.className)||("DOMTokenList"in(e=this)&&e.DOMTokenList&&(!document.createElementNS||!document.createElementNS("http://www.w3.org/2000/svg","svg")||document.createElementNS("http://www.w3.org/2000/svg","svg").classList instanceof DOMTokenList)||(e.DOMTokenList=function(){var i=!0,n=function(t,e,n,o){Object.defineProperty?Object.defineProperty(t,e,{configurable:!1===i||!!o,get:n}):t.__defineGetter__(e,n)};try{n({},"support")}catch(t){i=!1}return function(i,r){var s=this,a=[],c={},l=0,t=0,e=function(t){n(s,t,function(){return d(),a[t]},!1)},u=function(){if(t<=l)for(;t<l;++t)e(t)},d=function(){var t,e,n=arguments,o=/\s+/;if(n.length)for(e=0;e<n.length;++e)if(o.test(n[e]))throw(t=new SyntaxError('String "'+n[e]+'" contains an invalid character')).code=5,t.name="InvalidCharacterError",t;for(""===(a="object"==typeof i[r]?(""+i[r].baseVal).replace(/^\s+|\s+$/g,"").split(o):(""+i[r]).replace(/^\s+|\s+$/g,"").split(o))[0]&&(a=[]),c={},e=0;e<a.length;++e)c[a[e]]=!0;l=a.length,u()};return d(),n(s,"length",function(){return d(),l}),s.toLocaleString=s.toString=function(){return d(),a.join(" ")},s.item=function(t){return d(),a[t]},s.contains=function(t){return d(),!!c[t]},s.add=function(){d.apply(s,t=arguments);for(var t,e,n=0,o=t.length;n<o;++n)c[e=t[n]]||(a.push(e),c[e]=!0);l!==a.length&&(l=a.length>>>0,"object"==typeof i[r]?i[r].baseVal=a.join(" "):i[r]=a.join(" "),u())},s.remove=function(){d.apply(s,t=arguments);for(var t,e={},n=0,o=[];n<t.length;++n)e[t[n]]=!0,delete c[t[n]];for(n=0;n<a.length;++n)e[a[n]]||o.push(a[n]);l=(a=o).length>>>0,"object"==typeof i[r]?i[r].baseVal=a.join(" "):i[r]=a.join(" "),u()},s.toggle=function(t,e){return d.apply(s,[t]),o!==e?e?(s.add(t),!0):(s.remove(t),!1):c[t]?(s.remove(t),!1):(s.add(t),!0)},s}}()),"classList"in(n=document.createElement("span"))&&(n.classList.toggle("x",!1),n.classList.contains("x")&&(n.classList.constructor.prototype.toggle=function(t){var e=arguments[1];if(e!==o)return this[(e=!!e)?"add":"remove"](t),e;var n=!this.contains(t);return this[n?"add":"remove"](t),n})),function(){var t=document.createElement("span");if("classList"in t&&(t.classList.add("a","b"),!t.classList.contains("b"))){var o=t.classList.constructor.prototype.add;t.classList.constructor.prototype.add=function(){for(var t=arguments,e=arguments.length,n=0;n<e;n++)o.call(this,t[n])}}}(),function(){var t=document.createElement("span");if("classList"in t&&(t.classList.add("a"),t.classList.add("b"),t.classList.remove("a","b"),t.classList.contains("b"))){var o=t.classList.constructor.prototype.remove;t.classList.constructor.prototype.remove=function(){for(var t=arguments,e=arguments.length,n=0;n<e;n++)o.call(this,t[n])}}}())}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"Document"in this||"undefined"==typeof WorkerGlobalScope&&"function"!=typeof importScripts&&(this.HTMLDocument?this.Document=this.HTMLDocument:(this.Document=this.HTMLDocument=document.constructor=new Function("return function Document() {}")(),this.Document.prototype=document))}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"Element"in this&&"HTMLElement"in this||function(){if(!window.Element||window.HTMLElement){window.Element=window.HTMLElement=new Function("return function Element() {}")();var t,e=document.appendChild(document.createElement("body")),n=e.appendChild(document.createElement("iframe")).contentWindow.document,a=Element.prototype=n.appendChild(n.createElement("*")),c={},l=function(t,e){var n,o,i,r=t.childNodes||[],s=-1;if(1===t.nodeType&&t.constructor!==Element)for(n in t.constructor=Element,c)o=c[n],t[n]=o;for(;i=e&&r[++s];)l(i,e);return t},u=document.getElementsByTagName("*"),o=document.createElement,i=100;a.attachEvent("onpropertychange",function(t){for(var e,n=t.propertyName,o=!c.hasOwnProperty(n),i=a[n],r=c[n],s=-1;e=u[++s];)1===e.nodeType&&(!o&&e[n]!==r||(e[n]=i));c[n]=i}),a.constructor=Element,a.hasAttribute||(a.hasAttribute=function(t){return null!==this.getAttribute(t)}),r()||(document.onreadystatechange=r,t=setInterval(r,25)),document.createElement=function(t){var e=o(String(t).toLowerCase());return l(e)},document.removeChild(e)}else window.HTMLElement=window.Element;function r(){return i--||clearTimeout(t),!(!document.body||document.body.prototype||!/(complete|interactive)/.test(document.readyState))&&(l(document,!0),t&&document.body.prototype&&clearTimeout(t),!!document.body.prototype)}}()}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){var e;"document"in this&&"classList"in document.documentElement&&"Element"in this&&"classList"in Element.prototype&&((e=document.createElement("span")).classList.add("a","b"),e.classList.contains("b"))||function(t){var u=!0,d=function(t,e,n,o){Object.defineProperty?Object.defineProperty(t,e,{configurable:!1===u||!!o,get:n}):t.__defineGetter__(e,n)};try{d({},"support")}catch(e){u=!1}var h=function(t,c,l){d(t.prototype,c,function(){var t,e=this,n="__defineGetter__DEFINE_PROPERTY"+c;if(e[n])return t;if(!(e[n]=!0)===u){for(var o,i=h.mirror||document.createElement("div"),r=i.childNodes,s=r.length,a=0;a<s;++a)if(r[a]._R===e){o=r[a];break}o=o||i.appendChild(document.createElement("div")),t=DOMTokenList.call(o,e,l)}else t=new DOMTokenList(e,l);return d(e,c,function(){return t}),delete e[n],t},!0)};h(t.Element,"classList","className"),h(t.HTMLElement,"classList","className"),h(t.HTMLLinkElement,"relList","rel"),h(t.HTMLAnchorElement,"relList","rel"),h(t.HTMLAreaElement,"relList","rel")}(this)}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),n.prototype.init=function(){if(this.$module){this.initControls(),this.initSectionHeaders();var t=this.checkIfAllSectionsOpen();this.updateOpenAllButton(t)}},n.prototype.initControls=function(){this.$openAllButton=document.createElement("button"),this.$openAllButton.setAttribute("type","button"),this.$openAllButton.innerHTML='Open all <span class="govuk-visually-hidden">sections</span>',this.$openAllButton.setAttribute("class",this.openAllClass),this.$openAllButton.setAttribute("aria-expanded","false"),this.$openAllButton.setAttribute("type","button");var t=document.createElement("div");t.setAttribute("class",this.controlsClass),t.appendChild(this.$openAllButton),this.$module.insertBefore(t,this.$module.firstChild),this.$openAllButton.addEventListener("click",this.onOpenOrCloseAllToggle.bind(this))},n.prototype.initSectionHeaders=function(){r(this.$sections,function(t,e){var n=t.querySelector("."+this.sectionHeaderClass);this.initHeaderAttributes(n,e),this.setExpanded(this.isExpanded(t),t),n.addEventListener("click",this.onSectionToggle.bind(this,t)),this.setInitialState(t)}.bind(this))},n.prototype.initHeaderAttributes=function(e,t){var n=this,o=e.querySelector("."+this.sectionButtonClass),i=e.querySelector("."+this.sectionHeadingClass),r=e.querySelector("."+this.sectionSummaryClass),s=document.createElement("button");s.setAttribute("type","button"),s.setAttribute("id",this.moduleId+"-heading-"+(t+1)),s.setAttribute("aria-controls",this.moduleId+"-content-"+(t+1));for(var a=0;a<o.attributes.length;a++){var c=o.attributes.item(a);s.setAttribute(c.nodeName,c.nodeValue)}s.addEventListener("focusin",function(t){e.classList.contains(n.sectionHeaderFocusedClass)||(e.className+=" "+n.sectionHeaderFocusedClass)}),s.addEventListener("blur",function(t){e.classList.remove(n.sectionHeaderFocusedClass)}),null!=r&&s.setAttribute("aria-describedby",this.moduleId+"-summary-"+(t+1)),s.innerHTML=o.innerHTML,i.removeChild(o),i.appendChild(s);var l=document.createElement("span");l.className=this.iconClass,l.setAttribute("aria-hidden","true"),s.appendChild(l)},n.prototype.onSectionToggle=function(t){var e=this.isExpanded(t);this.setExpanded(!e,t),this.storeState(t)},n.prototype.onOpenOrCloseAllToggle=function(){var e=this,t=this.$sections,n=!this.checkIfAllSectionsOpen();r(t,function(t){e.setExpanded(n,t),e.storeState(t)}),e.updateOpenAllButton(n)},n.prototype.setExpanded=function(t,e){e.querySelector("."+this.sectionButtonClass).setAttribute("aria-expanded",t),t?e.classList.add(this.sectionExpandedClass):e.classList.remove(this.sectionExpandedClass);var n=this.checkIfAllSectionsOpen();this.updateOpenAllButton(n)},n.prototype.isExpanded=function(t){return t.classList.contains(this.sectionExpandedClass)},n.prototype.checkIfAllSectionsOpen=function(){return this.$sections.length===this.$module.querySelectorAll("."+this.sectionExpandedClass).length},n.prototype.updateOpenAllButton=function(t){var e=t?"Close all":"Open all";e+='<span class="govuk-visually-hidden"> sections</span>',this.$openAllButton.setAttribute("aria-expanded",t),this.$openAllButton.innerHTML=e};var e={checkForSessionStorage:function(){var t,e="this is the test string";try{return window.sessionStorage.setItem(e,e),t=window.sessionStorage.getItem(e)===e.toString(),window.sessionStorage.removeItem(e),t}catch(n){"undefined"!=typeof console&&"undefined"!=typeof console.log||console.log("Notice: sessionStorage not available.")}}};n.prototype.storeState=function(t){if(this.browserSupportsSessionStorage){var e=t.querySelector("."+this.sectionButtonClass);if(e){var n=e.getAttribute("aria-controls"),o=e.getAttribute("aria-expanded");void 0!==n||"undefined"!=typeof console&&"undefined"!=typeof console.log||console.error(new Error("No aria controls present in accordion section heading.")),void 0!==o||"undefined"!=typeof console&&"undefined"!=typeof console.log||console.error(new Error("No aria expanded present in accordion section heading.")),n&&o&&window.sessionStorage.setItem(n,o)}}},n.prototype.setInitialState=function(t){if(this.browserSupportsSessionStorage){var e=t.querySelector("."+this.sectionButtonClass);if(e){var n=e.getAttribute("aria-controls"),o=n?window.sessionStorage.getItem(n):null;null!==o&&this.setExpanded("true"===o,t)}}},function(t){"Window"in this||"undefined"==typeof WorkerGlobalScope&&"function"!=typeof importScripts&&function(t){t.constructor?t.Window=t.constructor:(t.Window=t.constructor=new Function("return function Window() {}")()).prototype=this}(this)}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(r){!function(t){if(!("Event"in t))return!1;if("function"==typeof t.Event)return!0;try{return new Event("click"),!0}catch(e){return!1}}(this)&&function(){var n={click:1,dblclick:1,keyup:1,keypress:1,keydown:1,mousedown:1,mouseup:1,mousemove:1,mouseover:1,mouseenter:1,mouseleave:1,mouseout:1,storage:1,storagecommit:1,textinput:1};if("undefined"!=typeof document&&"undefined"!=typeof window){var t=window.Event&&window.Event.prototype||null;window.Event=Window.prototype.Event=function(t,e){if(!t)throw new Error("Not enough arguments");var n;if("createEvent"in document){n=document.createEvent("Event");var o=!(!e||e.bubbles===r)&&e.bubbles,i=!(!e||e.cancelable===r)&&e.cancelable;return n.initEvent(t,o,i),n}return(n=document.createEventObject()).type=t,n.bubbles=!(!e||e.bubbles===r)&&e.bubbles,n.cancelable=!(!e||e.cancelable===r)&&e.cancelable,n},t&&Object.defineProperty(window.Event,"prototype",{configurable:!1,enumerable:!1,writable:!0,value:t}),"createEvent"in document||(window.addEventListener=Window.prototype.addEventListener=Document.prototype.addEventListener=Element.prototype.addEventListener=function(){var s=this,t=arguments[0],e=arguments[1];if(s===window&&t in n)throw new Error("In IE8 the event: "+t+" is not available on the window object. Please see https://github.com/Financial-Times/polyfill-service/issues/317 for more information.");s._events||(s._events={}),s._events[t]||(s._events[t]=function(t){var e,n=s._events[t.type].list,o=n.slice(),i=-1,r=o.length;for(t.preventDefault=function(){!1!==t.cancelable&&(t.returnValue=!1)},t.stopPropagation=function(){t.cancelBubble=!0},t.stopImmediatePropagation=function(){t.cancelBubble=!0,t.cancelImmediate=!0},t.currentTarget=s,t.relatedTarget=t.fromElement||null,t.target=t.target||t.srcElement||s,t.timeStamp=(new Date).getTime(),t.clientX&&(t.pageX=t.clientX+document.documentElement.scrollLeft,t.pageY=t.clientY+document.documentElement.scrollTop);++i<r&&!t.cancelImmediate;)i in o&&-1!==a(n,e=o[i])&&"function"==typeof e&&e.call(s,t)},s._events[t].list=[],s.attachEvent&&s.attachEvent("on"+t,s._events[t])),s._events[t].list.push(e)},window.removeEventListener=Window.prototype.removeEventListener=Document.prototype.removeEventListener=Element.prototype.removeEventListener=function(){var t,e=this,n=arguments[0],o=arguments[1];e._events&&e._events[n]&&e._events[n].list&&-1!==(t=a(e._events[n].list,o))&&(e._events[n].list.splice(t,1),e._events[n].list.length||(e.detachEvent&&e.detachEvent("on"+n,e._events[n]),delete e._events[n]))},window.dispatchEvent=Window.prototype.dispatchEvent=Document.prototype.dispatchEvent=Element.prototype.dispatchEvent=function(t){if(!arguments.length)throw new Error("Not enough arguments");if(!t||"string"!=typeof t.type)throw new Error("DOM Events Exception 0");var e=this,n=t.type;try{if(!t.bubbles){t.cancelBubble=!0;var o=function(t){t.cancelBubble=!0,(e||window).detachEvent("on"+n,o)};this.attachEvent("on"+n,o)}this.fireEvent("on"+n,t)}catch(i){for(t.target=e;"_events"in(t.currentTarget=e)&&"function"==typeof e._events[n]&&e._events[n].call(e,t),"function"==typeof e["on"+n]&&e["on"+n].call(e,t),(e=9===e.nodeType?e.parentWindow:e.parentNode)&&!t.cancelBubble;);}return!0},document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&document.dispatchEvent(new Event("DOMContentLoaded",{bubbles:!0}))}))}function a(t,e){for(var n=-1,o=t.length;++n<o;)if(n in t&&t[n]===e)return n;return-1}}()}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{});function o(t){this.$module=t,this.debounceFormSubmitTimer=null}o.prototype.handleKeyDown=function(t){var e=t.target;"button"===e.getAttribute("role")&&32===t.keyCode&&(t.preventDefault(),e.click())},o.prototype.debounce=function(t){if("true"===t.target.getAttribute("data-prevent-double-click"))return this.debounceFormSubmitTimer?(t.preventDefault(),!1):void(this.debounceFormSubmitTimer=setTimeout(function(){this.debounceFormSubmitTimer=null}.bind(this),1e3))},o.prototype.init=function(){this.$module.addEventListener("keydown",this.handleKeyDown),this.$module.addEventListener("click",this.debounce)};function i(t){this.$module=t}function s(t){this.$module=t,this.$textarea=t.querySelector(".govuk-js-character-count"),this.$textarea&&(this.$countMessage=t.querySelector('[id="'+this.$textarea.id+'-info"]'))}function a(t){this.$module=t,this.$inputs=t.querySelectorAll('input[type="checkbox"]')}function c(t){this.$module=t}function l(t){this.$module=t}function u(t){this.$module=t,this.$menuButton=t&&t.querySelector(".govuk-js-header-toggle"),this.$menu=this.$menuButton&&t.querySelector("#"+this.$menuButton.getAttribute("aria-controls"))}function d(t){this.$module=t,this.$inputs=t.querySelectorAll('input[type="radio"]')}function h(t){this.$module=t,this.$tabs=t.querySelectorAll(".govuk-tabs__tab"),this.keys={left:37,right:39,up:38,down:40},this.jsHiddenClass="govuk-tabs__panel--hidden"}i.prototype.init=function(){this.$module&&("boolean"==typeof this.$module.open||this.polyfillDetails())},i.prototype.polyfillDetails=function(){var t=this.$module,e=this.$summary=t.getElementsByTagName("summary").item(0),n=this.$content=t.getElementsByTagName("div").item(0);e&&n&&(n.id||(n.id="details-content-"+function o(){var n=(new Date).getTime();return"undefined"!=typeof window.performance&&"function"==typeof window.performance.now&&(n+=window.performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=(n+16*Math.random())%16|0;return n=Math.floor(n/16),("x"===t?e:3&e|8).toString(16)})}()),t.setAttribute("role","group"),e.setAttribute("role","button"),e.setAttribute("aria-controls",n.id),!(e.tabIndex=0)==(null!==t.getAttribute("open"))?(e.setAttribute("aria-expanded","true"),n.setAttribute("aria-hidden","false")):(e.setAttribute("aria-expanded","false"),n.setAttribute("aria-hidden","true"),n.style.display="none"),this.polyfillHandleInputs(e,this.polyfillSetAttributes.bind(this)))},i.prototype.polyfillSetAttributes=function(){var t=this.$module,e=this.$summary,n=this.$content,o="true"===e.getAttribute("aria-expanded"),i="true"===n.getAttribute("aria-hidden");return e.setAttribute("aria-expanded",o?"false":"true"),n.setAttribute("aria-hidden",i?"false":"true"),n.style.display=o?"none":"",null!==t.getAttribute("open")?t.removeAttribute("open"):t.setAttribute("open","open"),!0},i.prototype.polyfillHandleInputs=function(t,n){t.addEventListener("keypress",function(t){var e=t.target;13!==t.keyCode&&32!==t.keyCode||"summary"===e.nodeName.toLowerCase()&&(t.preventDefault(),e.click?e.click():n(t))}),t.addEventListener("keyup",function(t){var e=t.target;32===t.keyCode&&"summary"===e.nodeName.toLowerCase()&&t.preventDefault()}),t.addEventListener("click",n)},s.prototype.defaults={characterCountAttribute:"data-maxlength",wordCountAttribute:"data-maxwords"},s.prototype.init=function(){var t=this.$module,e=this.$textarea,n=this.$countMessage;if(e&&n){e.insertAdjacentElement("afterend",n),this.options=this.getDataset(t);var o=this.defaults.characterCountAttribute;this.options.maxwords&&(o=this.defaults.wordCountAttribute),this.maxLength=t.getAttribute(o),this.maxLength&&(t.removeAttribute("maxlength"),"onpageshow"in window?window.addEventListener("pageshow",this.sync.bind(this)):window.addEventListener("DOMContentLoaded",this.sync.bind(this)),this.sync())}},s.prototype.sync=function(){this.bindChangeEvents(),this.updateCountMessage()},s.prototype.getDataset=function(t){var e={},n=t.attributes;if(n)for(var o=0;o<n.length;o++){var i=n[o],r=i.name.match(/^data-(.+)/);r&&(e[r[1]]=i.value)}return e},s.prototype.count=function(t){var e;this.options.maxwords?e=(t.match(/\S+/g)||[]).length:e=t.length;return e},s.prototype.bindChangeEvents=function(){var t=this.$textarea;t.addEventListener("keyup",this.checkIfValueChanged.bind(this)),t.addEventListener("focus",this.handleFocus.bind(this)),t.addEventListener("blur",this.handleBlur.bind(this))},s.prototype.checkIfValueChanged=function(){this.$textarea.oldValue||(this.$textarea.oldValue=""),this.$textarea.value!==this.$textarea.oldValue&&(this.$textarea.oldValue=this.$textarea.value,this.updateCountMessage())},s.prototype.updateCountMessage=function(){var t=this.$textarea,e=this.options,n=this.$countMessage,o=this.count(t.value),i=this.maxLength,r=i-o;o<i*(e.threshold?e.threshold:0)/100?(n.classList.add("govuk-character-count__message--disabled"),n.setAttribute("aria-hidden",!0)):(n.classList.remove("govuk-character-count__message--disabled"),n.removeAttribute("aria-hidden")),r<0?(t.classList.add("govuk-textarea--error"),n.classList.remove("govuk-hint"),n.classList.add("govuk-error-message")):(t.classList.remove("govuk-textarea--error"),n.classList.remove("govuk-error-message"),n.classList.add("govuk-hint"));var s,a,c="character";e.maxwords&&(c="word"),c+=-1==r||1==r?"":"s",s=r<0?"too many":"remaining",a=Math.abs(r),n.innerHTML="You have "+a+" "+c+" "+s},s.prototype.handleFocus=function(){this.valueChecker=setInterval(this.checkIfValueChanged.bind(this),1e3)},s.prototype.handleBlur=function(){clearInterval(this.valueChecker)},a.prototype.init=function(){var n=this.$module;r(this.$inputs,function(t){var e=t.getAttribute("data-aria-controls");e&&n.querySelector("#"+e)&&(t.setAttribute("aria-controls",e),t.removeAttribute("data-aria-controls"))}),"onpageshow"in window?window.addEventListener("pageshow",this.syncAllConditionalReveals.bind(this)):window.addEventListener("DOMContentLoaded",this.syncAllConditionalReveals.bind(this)),this.syncAllConditionalReveals(),n.addEventListener("click",this.handleClick.bind(this))},a.prototype.syncAllConditionalReveals=function(){r(this.$inputs,this.syncConditionalRevealWithInputState.bind(this))},a.prototype.syncConditionalRevealWithInputState=function(t){var e=this.$module.querySelector("#"+t.getAttribute("aria-controls"));if(e&&e.classList.contains("govuk-checkboxes__conditional")){var n=t.checked;t.setAttribute("aria-expanded",n),e.classList.toggle("govuk-checkboxes__conditional--hidden",!n)}},a.prototype.unCheckAllInputsExcept=function(e){r(document.querySelectorAll('input[type="checkbox"][name="'+e.name+'"]'),function(t){e.form===t.form&&t!==e&&(t.checked=!1)}),this.syncAllConditionalReveals()},a.prototype.unCheckExclusiveInputs=function(e){r(document.querySelectorAll('input[data-behaviour="exclusive"][type="checkbox"][name="'+e.name+'"]'),function(t){e.form===t.form&&(t.checked=!1)}),this.syncAllConditionalReveals()},a.prototype.handleClick=function(t){var e=t.target;"checkbox"===e.type&&(e.getAttribute("aria-controls")&&this.syncConditionalRevealWithInputState(e),e.checked&&("exclusive"===e.getAttribute("data-behaviour")?this.unCheckAllInputsExcept(e):this.unCheckExclusiveInputs(e)))},function(t){"document"in this&&"matches"in document.documentElement||(Element.prototype.matches=Element.prototype.webkitMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.mozMatchesSelector||function(t){for(var e=(this.document||this.ownerDocument).querySelectorAll(t),n=0;e[n]&&e[n]!==this;)++n;return!!e[n]})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"document"in this&&"closest"in document.documentElement||(Element.prototype.closest=function(t){for(var e=this;e;){if(e.matches(t))return e;e="SVGElement"in window&&e instanceof SVGElement?e.parentNode:e.parentElement}return null})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),c.prototype.init=function(){var t=this.$module;t&&(t.focus(),t.addEventListener("click",this.handleClick.bind(this)))},c.prototype.handleClick=function(t){var e=t.target;this.focusTarget(e)&&t.preventDefault()},c.prototype.focusTarget=function(t){if("A"!==t.tagName||!1===t.href)return!1;var e=this.getFragmentFromUrl(t.href),n=document.getElementById(e);if(!n)return!1;var o=this.getAssociatedLegendOrLabel(n);return!!o&&(o.scrollIntoView(),n.focus({preventScroll:!0}),!0)},c.prototype.getFragmentFromUrl=function(t){return-1!==t.indexOf("#")&&t.split("#").pop()},c.prototype.getAssociatedLegendOrLabel=function(t){var e=t.closest("fieldset");if(e){var n=e.getElementsByTagName("legend");if(n.length){var o=n[0];if("checkbox"===t.type||"radio"===t.type)return o;var i=o.getBoundingClientRect().top,r=t.getBoundingClientRect();if(r.height&&window.innerHeight)if(r.top+r.height-i<window.innerHeight/2)return o}}return document.querySelector("label[for='"+t.getAttribute("id")+"']")||t.closest("label")},l.prototype.init=function(){this.$module&&this.setFocus()},l.prototype.setFocus=function(){var t=this.$module;"true"!==t.getAttribute("data-disable-auto-focus")&&"alert"===t.getAttribute("role")&&(t.getAttribute("tabindex")||(t.setAttribute("tabindex","-1"),t.addEventListener("blur",function(){t.removeAttribute("tabindex")})),t.focus())},u.prototype.init=function(){this.$module&&this.$menuButton&&this.$menu&&(this.syncState(this.$menu.classList.contains("govuk-header__navigation--open")),this.$menuButton.addEventListener("click",this.handleMenuButtonClick.bind(this)))},u.prototype.syncState=function(t){this.$menuButton.classList.toggle("govuk-header__menu-button--open",t),this.$menuButton.setAttribute("aria-expanded",t)},u.prototype.handleMenuButtonClick=function(){var t=this.$menu.classList.toggle("govuk-header__navigation--open");this.syncState(t)},d.prototype.init=function(){var n=this.$module;r(this.$inputs,function(t){var e=t.getAttribute("data-aria-controls");e&&n.querySelector("#"+e)&&(t.setAttribute("aria-controls",e),t.removeAttribute("data-aria-controls"))}),"onpageshow"in window?window.addEventListener("pageshow",this.syncAllConditionalReveals.bind(this)):window.addEventListener("DOMContentLoaded",this.syncAllConditionalReveals.bind(this)),this.syncAllConditionalReveals(),n.addEventListener("click",this.handleClick.bind(this))},d.prototype.syncAllConditionalReveals=function(){r(this.$inputs,this.syncConditionalRevealWithInputState.bind(this))},d.prototype.syncConditionalRevealWithInputState=function(t){var e=document.querySelector("#"+t.getAttribute("aria-controls"));if(e&&e.classList.contains("govuk-radios__conditional")){var n=t.checked;t.setAttribute("aria-expanded",n),e.classList.toggle("govuk-radios__conditional--hidden",!n)}},d.prototype.handleClick=function(t){var n=t.target;"radio"===n.type&&r(document.querySelectorAll('input[type="radio"][aria-controls]'),function(t){var e=t.form===n.form;t.name===n.name&&e&&this.syncConditionalRevealWithInputState(t)}.bind(this))},function(t){"document"in this&&"nextElementSibling"in document.documentElement||Object.defineProperty(Element.prototype,"nextElementSibling",{get:function(){for(var t=this.nextSibling;t&&1!==t.nodeType;)t=t.nextSibling;return t}})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"document"in this&&"previousElementSibling"in document.documentElement||Object.defineProperty(Element.prototype,"previousElementSibling",{get:function(){for(var t=this.previousSibling;t&&1!==t.nodeType;)t=t.previousSibling;return t}})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),h.prototype.init=function(){"function"==typeof window.matchMedia?this.setupResponsiveChecks():this.setup()},h.prototype.setupResponsiveChecks=function(){this.mql=window.matchMedia("(min-width: 40.0625em)"),this.mql.addListener(this.checkMode.bind(this)),this.checkMode()},h.prototype.checkMode=function(){this.mql.matches?this.setup():this.teardown()},h.prototype.setup=function(){var t=this.$module,e=this.$tabs,n=t.querySelector(".govuk-tabs__list"),o=t.querySelectorAll(".govuk-tabs__list-item");if(e&&n&&o){n.setAttribute("role","tablist"),r(o,function(t){t.setAttribute("role","presentation")}),r(e,function(t){this.setAttributes(t),t.boundTabClick=this.onTabClick.bind(this),t.boundTabKeydown=this.onTabKeydown.bind(this),t.addEventListener("click",t.boundTabClick,!0),t.addEventListener("keydown",t.boundTabKeydown,!0),this.hideTab(t)}.bind(this));var i=this.getTab(window.location.hash)||this.$tabs[0];this.showTab(i),t.boundOnHashChange=this.onHashChange.bind(this),window.addEventListener("hashchange",t.boundOnHashChange,!0)}},h.prototype.teardown=function(){var t=this.$module,e=this.$tabs,n=t.querySelector(".govuk-tabs__list"),o=t.querySelectorAll(".govuk-tabs__list-item");e&&n&&o&&(n.removeAttribute("role"),r(o,function(t){t.removeAttribute("role","presentation")}),r(e,function(t){t.removeEventListener("click",t.boundTabClick,!0),t.removeEventListener("keydown",t.boundTabKeydown,!0),this.unsetAttributes(t)}.bind(this)),window.removeEventListener("hashchange",t.boundOnHashChange,!0))},h.prototype.onHashChange=function(t){var e=window.location.hash,n=this.getTab(e);if(n)if(this.changingHash)this.changingHash=!1;else{var o=this.getCurrentTab();this.hideTab(o),this.showTab(n),n.focus()}},h.prototype.hideTab=function(t){this.unhighlightTab(t),this.hidePanel(t)},h.prototype.showTab=function(t){this.highlightTab(t),this.showPanel(t)},h.prototype.getTab=function(t){return this.$module.querySelector('.govuk-tabs__tab[href="'+t+'"]')},h.prototype.setAttributes=function(t){var e=this.getHref(t).slice(1);t.setAttribute("id","tab_"+e),t.setAttribute("role","tab"),t.setAttribute("aria-controls",e),t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");var n=this.getPanel(t);n.setAttribute("role","tabpanel"),n.setAttribute("aria-labelledby",t.id),n.classList.add(this.jsHiddenClass)},h.prototype.unsetAttributes=function(t){t.removeAttribute("id"),t.removeAttribute("role"),t.removeAttribute("aria-controls"),t.removeAttribute("aria-selected"),t.removeAttribute("tabindex");var e=this.getPanel(t);e.removeAttribute("role"),e.removeAttribute("aria-labelledby"),e.classList.remove(this.jsHiddenClass)},h.prototype.onTabClick=function(t){if(!t.target.classList.contains("govuk-tabs__tab"))return!1;t.preventDefault();var e=t.target,n=this.getCurrentTab();this.hideTab(n),this.showTab(e),this.createHistoryEntry(e)},h.prototype.createHistoryEntry=function(t){var e=this.getPanel(t),n=e.id;e.id="",this.changingHash=!0,window.location.hash=this.getHref(t).slice(1),e.id=n},h.prototype.onTabKeydown=function(t){switch(t.keyCode){case this.keys.left:case this.keys.up:this.activatePreviousTab(),t.preventDefault();break;case this.keys.right:case this.keys.down:this.activateNextTab(),t.preventDefault()}},h.prototype.activateNextTab=function(){var t=this.getCurrentTab(),e=t.parentNode.nextElementSibling;if(e)var n=e.querySelector(".govuk-tabs__tab");n&&(this.hideTab(t),this.showTab(n),n.focus(),this.createHistoryEntry(n))},h.prototype.activatePreviousTab=function(){var t=this.getCurrentTab(),e=t.parentNode.previousElementSibling;if(e)var n=e.querySelector(".govuk-tabs__tab");n&&(this.hideTab(t),this.showTab(n),n.focus(),this.createHistoryEntry(n))},h.prototype.getPanel=function(t){return this.$module.querySelector(this.getHref(t))},h.prototype.showPanel=function(t){this.getPanel(t).classList.remove(this.jsHiddenClass)},h.prototype.hidePanel=function(t){this.getPanel(t).classList.add(this.jsHiddenClass)},h.prototype.unhighlightTab=function(t){t.setAttribute("aria-selected","false"),t.parentNode.classList.remove("govuk-tabs__list-item--selected"),t.setAttribute("tabindex","-1")},h.prototype.highlightTab=function(t){t.setAttribute("aria-selected","true"),t.parentNode.classList.add("govuk-tabs__list-item--selected"),t.setAttribute("tabindex","0")},h.prototype.getCurrentTab=function(){return this.$module.querySelector(".govuk-tabs__list-item--selected .govuk-tabs__tab")},h.prototype.getHref=function(t){var e=t.getAttribute("href");return e.slice(e.indexOf("#"),e.length)},t.initAll=function p(t){var e="undefined"!=typeof(t=void 0!==t?t:{}).scope?t.scope:document;r(e.querySelectorAll('[data-module="govuk-button"]'),function(t){new o(t).init()}),r(e.querySelectorAll('[data-module="govuk-accordion"]'),function(t){new n(t).init()}),r(e.querySelectorAll('[data-module="govuk-details"]'),function(t){new i(t).init()}),r(e.querySelectorAll('[data-module="govuk-character-count"]'),function(t){new s(t).init()}),r(e.querySelectorAll('[data-module="govuk-checkboxes"]'),function(t){new a(t).init()}),new c(e.querySelector('[data-module="govuk-error-summary"]')).init(),new u(e.querySelector('[data-module="govuk-header"]')).init(),r(e.querySelectorAll('[data-module="govuk-notification-banner"]'),function(t){new l(t).init()}),r(e.querySelectorAll('[data-module="govuk-radios"]'),function(t){new d(t).init()}),r(e.querySelectorAll('[data-module="govuk-tabs"]'),function(t){new h(t).init()})},t.Accordion=n,t.Button=o,t.Details=i,t.CharacterCount=s,t.Checkboxes=a,t.ErrorSummary=c,t.Header=u,t.Radios=d,t.Tabs=h});
(function(factory){if(typeof define==="function"&&define.amd)define(["jquery"],factory);else if(typeof module!=="undefined"&&module.exports)module.exports=factory(require("jquery"));else factory(jQuery)})(function($){var _previousResizeWidth=-1,_updateTimeout=-1;var _parse=function(value){return parseFloat(value)||0};var _rows=function(elements){var tolerance=1,$elements=$(elements),lastTop=null,rows=[];$elements.each(function(){var $that=$(this),top=$that.offset().top-_parse($that.css("margin-top")),
lastRow=rows.length>0?rows[rows.length-1]:null;if(lastRow===null)rows.push($that);else if(Math.floor(Math.abs(lastTop-top))<=tolerance)rows[rows.length-1]=lastRow.add($that);else rows.push($that);lastTop=top});return rows};var _parseOptions=function(options){var opts={byRow:true,property:"height",target:null,remove:false};if(typeof options==="object")return $.extend(opts,options);if(typeof options==="boolean")opts.byRow=options;else if(options==="remove")opts.remove=true;return opts};var matchHeight=
$.fn.matchHeight=function(options){var opts=_parseOptions(options);if(opts.remove){var that=this;this.css(opts.property,"");$.each(matchHeight._groups,function(key,group){group.elements=group.elements.not(that)});return this}if(this.length<=1&&!opts.target)return this;matchHeight._groups.push({elements:this,options:opts});matchHeight._apply(this,opts);return this};matchHeight.version="master";matchHeight._groups=[];matchHeight._throttle=80;matchHeight._maintainScroll=false;matchHeight._beforeUpdate=
null;matchHeight._afterUpdate=null;matchHeight._rows=_rows;matchHeight._parse=_parse;matchHeight._parseOptions=_parseOptions;matchHeight._apply=function(elements,options){var opts=_parseOptions(options),$elements=$(elements),rows=[$elements];var scrollTop=$(window).scrollTop(),htmlHeight=$("html").outerHeight(true);var $hiddenParents=$elements.parents().filter(":hidden");$hiddenParents.each(function(){var $that=$(this);$that.data("style-cache",$that.attr("style"))});$hiddenParents.css("display","block");
if(opts.byRow&&!opts.target){$elements.each(function(){var $that=$(this),display=$that.css("display");if(display!=="inline-block"&&display!=="flex"&&display!=="inline-flex")display="block";$that.data("style-cache",$that.attr("style"));$that.css({"display":display,"padding-top":"0","padding-bottom":"0","margin-top":"0","margin-bottom":"0","border-top-width":"0","border-bottom-width":"0","height":"100px","overflow":"hidden"})});rows=_rows($elements);$elements.each(function(){var $that=$(this);$that.attr("style",
$that.data("style-cache")||"")})}$.each(rows,function(key,row){var $row=$(row),targetHeight=0;if(!opts.target){if(opts.byRow&&$row.length<=1){$row.css(opts.property,"");return}$row.each(function(){var $that=$(this),style=$that.attr("style"),display=$that.css("display");if(display!=="inline-block"&&display!=="flex"&&display!=="inline-flex")display="block";var css={"display":display};css[opts.property]="";$that.css(css);if($that.outerHeight(false)>targetHeight)targetHeight=$that.outerHeight(false);
if(style)$that.attr("style",style);else $that.css("display","")})}else targetHeight=opts.target.outerHeight(false);$row.each(function(){var $that=$(this),verticalPadding=0;if(opts.target&&$that.is(opts.target))return;if($that.css("box-sizing")!=="border-box"){verticalPadding+=_parse($that.css("border-top-width"))+_parse($that.css("border-bottom-width"));verticalPadding+=_parse($that.css("padding-top"))+_parse($that.css("padding-bottom"))}$that.css(opts.property,targetHeight-verticalPadding+"px")})});
$hiddenParents.each(function(){var $that=$(this);$that.attr("style",$that.data("style-cache")||null)});if(matchHeight._maintainScroll)$(window).scrollTop(scrollTop/htmlHeight*$("html").outerHeight(true));return this};matchHeight._applyDataApi=function(){var groups={};$("[data-match-height], [data-mh]").each(function(){var $this=$(this),groupId=$this.attr("data-mh")||$this.attr("data-match-height");if(groupId in groups)groups[groupId]=groups[groupId].add($this);else groups[groupId]=$this});$.each(groups,
function(){this.matchHeight(true)})};var _update=function(event){if(matchHeight._beforeUpdate)matchHeight._beforeUpdate(event,matchHeight._groups);$.each(matchHeight._groups,function(){matchHeight._apply(this.elements,this.options)});if(matchHeight._afterUpdate)matchHeight._afterUpdate(event,matchHeight._groups)};matchHeight._update=function(throttle,event){if(event&&event.type==="resize"){var windowWidth=$(window).width();if(windowWidth===_previousResizeWidth)return;_previousResizeWidth=windowWidth}if(!throttle)_update(event);
else if(_updateTimeout===-1)_updateTimeout=setTimeout(function(){_update(event);_updateTimeout=-1},matchHeight._throttle)};$(matchHeight._applyDataApi);var on=$.fn.on?"on":"bind";$(window)[on]("load",function(event){matchHeight._update(false,event)});$(window)[on]("resize orientationchange",function(event){matchHeight._update(true,event)})});
AUI().ready(function(){setInterval(function(){$("input[name*\x3d'_com_liferay_journal_web_portlet_JournalPortlet_ContentType']:checked").each(function(){var includeContent=$(this).parents('div[data-fieldname\x3d"IncludeContent"]');if($(this).val()=="html"){includeContent.find('.lfr-ddm-field-group[data-fieldname*\x3d"HTML"]').show();includeContent.find('.lfr-ddm-field-group[data-fieldname*\x3d"WebContent"]').hide();includeContent.find('.lfr-ddm-field-group[data-fieldname*\x3d"Geolocation"]').hide();
includeContent.find('.lfr-ddm-field-group[data-fieldname*\x3d"CTATitle"]').hide();includeContent.find('.lfr-ddm-field-group[data-fieldname*\x3d"DistrictCTA"]').hide()}else if($(this).val()=="webcontent"){includeContent.find('.lfr-ddm-field-group[data-fieldname*\x3d"HTML"]').hide();includeContent.find('.lfr-ddm-field-group[data-fieldname*\x3d"WebContent"]').show();includeContent.find('.lfr-ddm-field-group[data-fieldname*\x3d"Geolocation"]').hide();includeContent.find('.lfr-ddm-field-group[data-fieldname*\x3d"CTATitle"]').hide();
includeContent.find('.lfr-ddm-field-group[data-fieldname*\x3d"DistrictCTA"]').hide()}else if($(this).val()=="map"){includeContent.find('.lfr-ddm-field-group[data-fieldname*\x3d"HTML"]').hide();includeContent.find('.lfr-ddm-field-group[data-fieldname*\x3d"WebContent"]').hide();includeContent.find('.lfr-ddm-field-group[data-fieldname*\x3d"Geolocation"]').show();includeContent.find('.lfr-ddm-field-group[data-fieldname*\x3d"CTATitle"]').hide();includeContent.find('.lfr-ddm-field-group[data-fieldname*\x3d"DistrictCTA"]').hide()}else if($(this).val()==
"cta"){includeContent.find('.lfr-ddm-field-group[data-fieldname*\x3d"HTML"]').hide();includeContent.find('.lfr-ddm-field-group[data-fieldname*\x3d"WebContent"]').hide();includeContent.find('.lfr-ddm-field-group[data-fieldname*\x3d"Geolocation"]').hide();includeContent.find('.lfr-ddm-field-group[data-fieldname*\x3d"CTATitle"]').show();includeContent.find('.lfr-ddm-field-group[data-fieldname*\x3d"DistrictCTA"]').hide()}else if($(this).val()=="districtcta"){includeContent.find('.lfr-ddm-field-group[data-fieldname*\x3d"HTML"]').hide();
includeContent.find('.lfr-ddm-field-group[data-fieldname*\x3d"WebContent"]').hide();includeContent.find('.lfr-ddm-field-group[data-fieldname*\x3d"Geolocation"]').hide();includeContent.find('.lfr-ddm-field-group[data-fieldname*\x3d"CTATitle"]').hide();includeContent.find('.lfr-ddm-field-group[data-fieldname*\x3d"DistrictCTA"]').show()}});var journalForm=$(".portlet-journal form.edit-article-form");if(journalForm.length==1)if(typeof journalForm.attr("data-senna-off")=="undefined")journalForm.attr("data-senna-off",
"true")},500);$(".gallery__link").each(function(){var src=$(this).find("img").attr("src");$(this).attr("href",src)});$(".gallery__items").magnificPopup({delegate:"a",type:"image",gallery:{enabled:true}})});
/*
 Magnific Popup - v0.9.9 - 2013-11-15
 http://dimsemenov.com/plugins/magnific-popup/
 Copyright (c) 2013 Dmitry Semenov; */
(function($){var CLOSE_EVENT="Close",BEFORE_CLOSE_EVENT="BeforeClose",AFTER_CLOSE_EVENT="AfterClose",BEFORE_APPEND_EVENT="BeforeAppend",MARKUP_PARSE_EVENT="MarkupParse",OPEN_EVENT="Open",CHANGE_EVENT="Change",NS="mfp",EVENT_NS="."+NS,READY_CLASS="mfp-ready",REMOVING_CLASS="mfp-removing",PREVENT_CLOSE_CLASS="mfp-prevent-close";var mfp,MagnificPopup=function(){},_isJQ=!!window.jQuery,_prevStatus,_window=$(window),_body,_document,_prevContentType,_wrapClasses,_currPopupType;var _mfpOn=function(name,
f){mfp.ev.on(NS+name+EVENT_NS,f)},_getEl=function(className,appendTo,html,raw){var el=document.createElement("div");el.className="mfp-"+className;if(html)el.innerHTML=html;if(!raw){el=$(el);if(appendTo)el.appendTo(appendTo)}else if(appendTo)appendTo.appendChild(el);return el},_mfpTrigger=function(e,data){mfp.ev.triggerHandler(NS+e,data);if(mfp.st.callbacks){e=e.charAt(0).toLowerCase()+e.slice(1);if(mfp.st.callbacks[e])mfp.st.callbacks[e].apply(mfp,$.isArray(data)?data:[data])}},_getCloseBtn=function(type){if(type!==
_currPopupType||!mfp.currTemplate.closeBtn){mfp.currTemplate.closeBtn=$(mfp.st.closeMarkup.replace("%title%",mfp.st.tClose));_currPopupType=type}return mfp.currTemplate.closeBtn},_checkInstance=function(){if(!$.magnificPopup.instance){mfp=new MagnificPopup;mfp.init();$.magnificPopup.instance=mfp}},supportsTransitions=function(){var s=document.createElement("p").style,v=["ms","O","Moz","Webkit"];if(s["transition"]!==undefined)return true;while(v.length)if(v.pop()+"Transition"in s)return true;return false};
MagnificPopup.prototype={constructor:MagnificPopup,init:function(){var appVersion=navigator.appVersion;mfp.isIE7=appVersion.indexOf("MSIE 7.")!==-1;mfp.isIE8=appVersion.indexOf("MSIE 8.")!==-1;mfp.isLowIE=mfp.isIE7||mfp.isIE8;mfp.isAndroid=/android/gi.test(appVersion);mfp.isIOS=/iphone|ipad|ipod/gi.test(appVersion);mfp.supportsTransition=supportsTransitions();mfp.probablyMobile=mfp.isAndroid||mfp.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent);
_body=$(document.body);_document=$(document);mfp.popupsCache={}},open:function(data){var i;if(data.isObj===false){mfp.items=data.items.toArray();mfp.index=0;var items=data.items,item;for(i=0;i<items.length;i++){item=items[i];if(item.parsed)item=item.el[0];if(item===data.el[0]){mfp.index=i;break}}}else{mfp.items=$.isArray(data.items)?data.items:[data.items];mfp.index=data.index||0}if(mfp.isOpen){mfp.updateItemHTML();return}mfp.types=[];_wrapClasses="";if(data.mainEl&&data.mainEl.length)mfp.ev=data.mainEl.eq(0);
else mfp.ev=_document;if(data.key){if(!mfp.popupsCache[data.key])mfp.popupsCache[data.key]={};mfp.currTemplate=mfp.popupsCache[data.key]}else mfp.currTemplate={};mfp.st=$.extend(true,{},$.magnificPopup.defaults,data);mfp.fixedContentPos=mfp.st.fixedContentPos==="auto"?!mfp.probablyMobile:mfp.st.fixedContentPos;if(mfp.st.modal){mfp.st.closeOnContentClick=false;mfp.st.closeOnBgClick=false;mfp.st.showCloseBtn=false;mfp.st.enableEscapeKey=false}if(!mfp.bgOverlay){mfp.bgOverlay=_getEl("bg").on("click"+
EVENT_NS,function(){mfp.close()});mfp.wrap=_getEl("wrap").attr("tabindex",-1).on("click"+EVENT_NS,function(e){if(mfp._checkIfClose(e.target))mfp.close()});mfp.container=_getEl("container",mfp.wrap)}mfp.contentContainer=_getEl("content");if(mfp.st.preloader)mfp.preloader=_getEl("preloader",mfp.container,mfp.st.tLoading);var modules=$.magnificPopup.modules;for(i=0;i<modules.length;i++){var n=modules[i];n=n.charAt(0).toUpperCase()+n.slice(1);mfp["init"+n].call(mfp)}_mfpTrigger("BeforeOpen");if(mfp.st.showCloseBtn)if(!mfp.st.closeBtnInside)mfp.wrap.append(_getCloseBtn());
else{_mfpOn(MARKUP_PARSE_EVENT,function(e,template,values,item){values.close_replaceWith=_getCloseBtn(item.type)});_wrapClasses+=" mfp-close-btn-in"}if(mfp.st.alignTop)_wrapClasses+=" mfp-align-top";if(mfp.fixedContentPos)mfp.wrap.css({overflow:mfp.st.overflowY,overflowX:"hidden",overflowY:mfp.st.overflowY});else mfp.wrap.css({top:_window.scrollTop(),position:"absolute"});if(mfp.st.fixedBgPos===false||mfp.st.fixedBgPos==="auto"&&!mfp.fixedContentPos)mfp.bgOverlay.css({height:_document.height(),position:"absolute"});
if(mfp.st.enableEscapeKey)_document.on("keyup"+EVENT_NS,function(e){if(e.keyCode===27)mfp.close()});_window.on("resize"+EVENT_NS,function(){mfp.updateSize()});if(!mfp.st.closeOnContentClick)_wrapClasses+=" mfp-auto-cursor";if(_wrapClasses)mfp.wrap.addClass(_wrapClasses);var windowHeight=mfp.wH=_window.height();var windowStyles={};if(mfp.fixedContentPos)if(mfp._hasScrollBar(windowHeight)){var s=mfp._getScrollbarSize();if(s)windowStyles.marginRight=s}if(mfp.fixedContentPos)if(!mfp.isIE7)windowStyles.overflow=
"hidden";else $("body, html").css("overflow","hidden");var classesToadd=mfp.st.mainClass;if(mfp.isIE7)classesToadd+=" mfp-ie7";if(classesToadd)mfp._addClassToMFP(classesToadd);mfp.updateItemHTML();_mfpTrigger("BuildControls");$("html").css(windowStyles);mfp.bgOverlay.add(mfp.wrap).prependTo(document.body);mfp._lastFocusedEl=document.activeElement;setTimeout(function(){if(mfp.content){mfp._addClassToMFP(READY_CLASS);mfp._setFocus()}else mfp.bgOverlay.addClass(READY_CLASS);_document.on("focusin"+EVENT_NS,
mfp._onFocusIn)},16);mfp.isOpen=true;mfp.updateSize(windowHeight);_mfpTrigger(OPEN_EVENT);return data},close:function(){if(!mfp.isOpen)return;_mfpTrigger(BEFORE_CLOSE_EVENT);mfp.isOpen=false;if(mfp.st.removalDelay&&!mfp.isLowIE&&mfp.supportsTransition){mfp._addClassToMFP(REMOVING_CLASS);setTimeout(function(){mfp._close()},mfp.st.removalDelay)}else mfp._close()},_close:function(){_mfpTrigger(CLOSE_EVENT);var classesToRemove=REMOVING_CLASS+" "+READY_CLASS+" ";mfp.bgOverlay.detach();mfp.wrap.detach();
mfp.container.empty();if(mfp.st.mainClass)classesToRemove+=mfp.st.mainClass+" ";mfp._removeClassFromMFP(classesToRemove);if(mfp.fixedContentPos){var windowStyles={marginRight:""};if(mfp.isIE7)$("body, html").css("overflow","");else windowStyles.overflow="";$("html").css(windowStyles)}_document.off("keyup"+EVENT_NS+" focusin"+EVENT_NS);mfp.ev.off(EVENT_NS);mfp.wrap.attr("class","mfp-wrap").removeAttr("style");mfp.bgOverlay.attr("class","mfp-bg");mfp.container.attr("class","mfp-container");if(mfp.st.showCloseBtn&&
(!mfp.st.closeBtnInside||mfp.currTemplate[mfp.currItem.type]===true))if(mfp.currTemplate.closeBtn)mfp.currTemplate.closeBtn.detach();if(mfp._lastFocusedEl)$(mfp._lastFocusedEl).focus();mfp.currItem=null;mfp.content=null;mfp.currTemplate=null;mfp.prevHeight=0;_mfpTrigger(AFTER_CLOSE_EVENT)},updateSize:function(winHeight){if(mfp.isIOS){var zoomLevel=document.documentElement.clientWidth/window.innerWidth;var height=window.innerHeight*zoomLevel;mfp.wrap.css("height",height);mfp.wH=height}else mfp.wH=
winHeight||_window.height();if(!mfp.fixedContentPos)mfp.wrap.css("height",mfp.wH);_mfpTrigger("Resize")},updateItemHTML:function(){var item=mfp.items[mfp.index];mfp.contentContainer.detach();if(mfp.content)mfp.content.detach();if(!item.parsed)item=mfp.parseEl(mfp.index);var type=item.type;_mfpTrigger("BeforeChange",[mfp.currItem?mfp.currItem.type:"",type]);mfp.currItem=item;if(!mfp.currTemplate[type]){var markup=mfp.st[type]?mfp.st[type].markup:false;_mfpTrigger("FirstMarkupParse",markup);if(markup)mfp.currTemplate[type]=
$(markup);else mfp.currTemplate[type]=true}if(_prevContentType&&_prevContentType!==item.type)mfp.container.removeClass("mfp-"+_prevContentType+"-holder");var newContent=mfp["get"+type.charAt(0).toUpperCase()+type.slice(1)](item,mfp.currTemplate[type]);mfp.appendContent(newContent,type);item.preloaded=true;_mfpTrigger(CHANGE_EVENT,item);_prevContentType=item.type;mfp.container.prepend(mfp.contentContainer);_mfpTrigger("AfterChange")},appendContent:function(newContent,type){mfp.content=newContent;if(newContent)if(mfp.st.showCloseBtn&&
mfp.st.closeBtnInside&&mfp.currTemplate[type]===true){if(!mfp.content.find(".mfp-close").length)mfp.content.append(_getCloseBtn())}else mfp.content=newContent;else mfp.content="";_mfpTrigger(BEFORE_APPEND_EVENT);mfp.container.addClass("mfp-"+type+"-holder");mfp.contentContainer.append(mfp.content)},parseEl:function(index){var item=mfp.items[index],type=item.type;if(item.tagName)item={el:$(item)};else item={data:item,src:item.src};if(item.el){var types=mfp.types;for(var i=0;i<types.length;i++)if(item.el.hasClass("mfp-"+
types[i])){type=types[i];break}item.src=item.el.attr("data-mfp-src");if(!item.src)item.src=item.el.attr("href")}item.type=type||mfp.st.type||"inline";item.index=index;item.parsed=true;mfp.items[index]=item;_mfpTrigger("ElementParse",item);return mfp.items[index]},addGroup:function(el,options){var eHandler=function(e){e.mfpEl=this;mfp._openClick(e,el,options)};if(!options)options={};var eName="click.magnificPopup";options.mainEl=el;if(options.items){options.isObj=true;el.off(eName).on(eName,eHandler)}else{options.isObj=
false;if(options.delegate)el.off(eName).on(eName,options.delegate,eHandler);else{options.items=el;el.off(eName).on(eName,eHandler)}}},_openClick:function(e,el,options){var midClick=options.midClick!==undefined?options.midClick:$.magnificPopup.defaults.midClick;if(!midClick&&(e.which===2||e.ctrlKey||e.metaKey))return;var disableOn=options.disableOn!==undefined?options.disableOn:$.magnificPopup.defaults.disableOn;if(disableOn)if($.isFunction(disableOn)){if(!disableOn.call(mfp))return true}else if(_window.width()<
disableOn)return true;if(e.type){e.preventDefault();if(mfp.isOpen)e.stopPropagation()}options.el=$(e.mfpEl);if(options.delegate)options.items=el.find(options.delegate);mfp.open(options)},updateStatus:function(status,text){if(mfp.preloader){if(_prevStatus!==status)mfp.container.removeClass("mfp-s-"+_prevStatus);if(!text&&status==="loading")text=mfp.st.tLoading;var data={status:status,text:text};_mfpTrigger("UpdateStatus",data);status=data.status;text=data.text;mfp.preloader.html(text);mfp.preloader.find("a").on("click",
function(e){e.stopImmediatePropagation()});mfp.container.addClass("mfp-s-"+status);_prevStatus=status}},_checkIfClose:function(target){if($(target).hasClass(PREVENT_CLOSE_CLASS))return;var closeOnContent=mfp.st.closeOnContentClick;var closeOnBg=mfp.st.closeOnBgClick;if(closeOnContent&&closeOnBg)return true;else{if(!mfp.content||$(target).hasClass("mfp-close")||mfp.preloader&&target===mfp.preloader[0])return true;if(target!==mfp.content[0]&&!$.contains(mfp.content[0],target)){if(closeOnBg)if($.contains(document,
target))return true}else if(closeOnContent)return true}return false},_addClassToMFP:function(cName){mfp.bgOverlay.addClass(cName);mfp.wrap.addClass(cName)},_removeClassFromMFP:function(cName){this.bgOverlay.removeClass(cName);mfp.wrap.removeClass(cName)},_hasScrollBar:function(winHeight){return(mfp.isIE7?_document.height():document.body.scrollHeight)>(winHeight||_window.height())},_setFocus:function(){(mfp.st.focus?mfp.content.find(mfp.st.focus).eq(0):mfp.wrap).focus()},_onFocusIn:function(e){if(e.target!==
mfp.wrap[0]&&!$.contains(mfp.wrap[0],e.target)){mfp._setFocus();return false}},_parseMarkup:function(template,values,item){var arr;if(item.data)values=$.extend(item.data,values);_mfpTrigger(MARKUP_PARSE_EVENT,[template,values,item]);$.each(values,function(key,value){if(value===undefined||value===false)return true;arr=key.split("_");if(arr.length>1){var el=template.find(EVENT_NS+"-"+arr[0]);if(el.length>0){var attr=arr[1];if(attr==="replaceWith"){if(el[0]!==value[0])el.replaceWith(value)}else if(attr===
"img")if(el.is("img"))el.attr("src",value);else el.replaceWith('\x3cimg src\x3d"'+value+'" class\x3d"'+el.attr("class")+'" /\x3e');else el.attr(arr[1],value)}}else template.find(EVENT_NS+"-"+key).html(value)})},_getScrollbarSize:function(){if(mfp.scrollbarSize===undefined){var scrollDiv=document.createElement("div");scrollDiv.id="mfp-sbm";scrollDiv.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;";document.body.appendChild(scrollDiv);mfp.scrollbarSize=
scrollDiv.offsetWidth-scrollDiv.clientWidth;document.body.removeChild(scrollDiv)}return mfp.scrollbarSize}};$.magnificPopup={instance:null,proto:MagnificPopup.prototype,modules:[],open:function(options,index){_checkInstance();if(!options)options={};else options=$.extend(true,{},options);options.isObj=true;options.index=index||0;return this.instance.open(options)},close:function(){return $.magnificPopup.instance&&$.magnificPopup.instance.close()},registerModule:function(name,module){if(module.options)$.magnificPopup.defaults[name]=
module.options;$.extend(this.proto,module.proto);this.modules.push(name)},defaults:{disableOn:0,key:null,midClick:false,mainClass:"",preloader:true,focus:"",closeOnContentClick:false,closeOnBgClick:true,closeBtnInside:true,showCloseBtn:true,enableEscapeKey:true,modal:false,alignTop:false,removalDelay:0,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'\x3cbutton title\x3d"%title%" type\x3d"button" class\x3d"mfp-close"\x3e\x26times;\x3c/button\x3e',tClose:"Close (Esc)",tLoading:"Loading..."}};
$.fn.magnificPopup=function(options){_checkInstance();var jqEl=$(this);if(typeof options==="string")if(options==="open"){var items,itemOpts=_isJQ?jqEl.data("magnificPopup"):jqEl[0].magnificPopup,index=parseInt(arguments[1],10)||0;if(itemOpts.items)items=itemOpts.items[index];else{items=jqEl;if(itemOpts.delegate)items=items.find(itemOpts.delegate);items=items.eq(index)}mfp._openClick({mfpEl:items},jqEl,itemOpts)}else{if(mfp.isOpen)mfp[options].apply(mfp,Array.prototype.slice.call(arguments,1))}else{options=
$.extend(true,{},options);if(_isJQ)jqEl.data("magnificPopup",options);else jqEl[0].magnificPopup=options;mfp.addGroup(jqEl,options)}return jqEl};var INLINE_NS="inline",_hiddenClass,_inlinePlaceholder,_lastInlineElement,_putInlineElementsBack=function(){if(_lastInlineElement){_inlinePlaceholder.after(_lastInlineElement.addClass(_hiddenClass)).detach();_lastInlineElement=null}};$.magnificPopup.registerModule(INLINE_NS,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){mfp.types.push(INLINE_NS);
_mfpOn(CLOSE_EVENT+"."+INLINE_NS,function(){_putInlineElementsBack()})},getInline:function(item,template){_putInlineElementsBack();if(item.src){var inlineSt=mfp.st.inline,el=$(item.src);if(el.length){var parent=el[0].parentNode;if(parent&&parent.tagName){if(!_inlinePlaceholder){_hiddenClass=inlineSt.hiddenClass;_inlinePlaceholder=_getEl(_hiddenClass);_hiddenClass="mfp-"+_hiddenClass}_lastInlineElement=el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass)}mfp.updateStatus("ready")}else{mfp.updateStatus("error",
inlineSt.tNotFound);el=$("\x3cdiv\x3e")}item.inlineElement=el;return el}mfp.updateStatus("ready");mfp._parseMarkup(template,{},item);return template}}});var AJAX_NS="ajax",_ajaxCur,_removeAjaxCursor=function(){if(_ajaxCur)_body.removeClass(_ajaxCur)},_destroyAjaxRequest=function(){_removeAjaxCursor();if(mfp.req)mfp.req.abort()};$.magnificPopup.registerModule(AJAX_NS,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'\x3ca href\x3d"%url%"\x3eThe content\x3c/a\x3e could not be loaded.'},proto:{initAjax:function(){mfp.types.push(AJAX_NS);
_ajaxCur=mfp.st.ajax.cursor;_mfpOn(CLOSE_EVENT+"."+AJAX_NS,_destroyAjaxRequest);_mfpOn("BeforeChange."+AJAX_NS,_destroyAjaxRequest)},getAjax:function(item){if(_ajaxCur)_body.addClass(_ajaxCur);mfp.updateStatus("loading");var opts=$.extend({url:item.src,success:function(data,textStatus,jqXHR){var temp={data:data,xhr:jqXHR};_mfpTrigger("ParseAjax",temp);mfp.appendContent($(temp.data),AJAX_NS);item.finished=true;_removeAjaxCursor();mfp._setFocus();setTimeout(function(){mfp.wrap.addClass(READY_CLASS)},
16);mfp.updateStatus("ready");_mfpTrigger("AjaxContentAdded")},error:function(){_removeAjaxCursor();item.finished=item.loadError=true;mfp.updateStatus("error",mfp.st.ajax.tError.replace("%url%",item.src))}},mfp.st.ajax.settings);mfp.req=$.ajax(opts);return""}}});var _imgInterval,_getTitle=function(item){if(item.data&&item.data.title!==undefined)return item.data.title;var src=mfp.st.image.titleSrc;if(src)if($.isFunction(src))return src.call(mfp,item);else if(item.el)return item.el.attr(src)||"";return""};
$.magnificPopup.registerModule("image",{options:{markup:'\x3cdiv class\x3d"mfp-figure"\x3e'+'\x3cdiv class\x3d"mfp-close"\x3e\x3c/div\x3e'+"\x3cfigure\x3e"+'\x3cdiv class\x3d"mfp-img"\x3e\x3c/div\x3e'+"\x3cfigcaption\x3e"+'\x3cdiv class\x3d"mfp-bottom-bar"\x3e'+'\x3cdiv class\x3d"mfp-title"\x3e\x3c/div\x3e'+'\x3cdiv class\x3d"mfp-counter"\x3e\x3c/div\x3e'+"\x3c/div\x3e"+"\x3c/figcaption\x3e"+"\x3c/figure\x3e"+"\x3c/div\x3e",cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:true,tError:'\x3ca href\x3d"%url%"\x3eThe image\x3c/a\x3e could not be loaded.'},
proto:{initImage:function(){var imgSt=mfp.st.image,ns=".image";mfp.types.push("image");_mfpOn(OPEN_EVENT+ns,function(){if(mfp.currItem.type==="image"&&imgSt.cursor)_body.addClass(imgSt.cursor)});_mfpOn(CLOSE_EVENT+ns,function(){if(imgSt.cursor)_body.removeClass(imgSt.cursor);_window.off("resize"+EVENT_NS)});_mfpOn("Resize"+ns,mfp.resizeImage);if(mfp.isLowIE)_mfpOn("AfterChange",mfp.resizeImage)},resizeImage:function(){var item=mfp.currItem;if(!item||!item.img)return;if(mfp.st.image.verticalFit){var decr=
0;if(mfp.isLowIE)decr=parseInt(item.img.css("padding-top"),10)+parseInt(item.img.css("padding-bottom"),10);item.img.css("max-height",mfp.wH-decr)}},_onImageHasSize:function(item){if(item.img){item.hasSize=true;if(_imgInterval)clearInterval(_imgInterval);item.isCheckingImgSize=false;_mfpTrigger("ImageHasSize",item);if(item.imgHidden){if(mfp.content)mfp.content.removeClass("mfp-loading");item.imgHidden=false}}},findImageSize:function(item){var counter=0,img=item.img[0],mfpSetInterval=function(delay){if(_imgInterval)clearInterval(_imgInterval);
_imgInterval=setInterval(function(){if(img.naturalWidth>0){mfp._onImageHasSize(item);return}if(counter>200)clearInterval(_imgInterval);counter++;if(counter===3)mfpSetInterval(10);else if(counter===40)mfpSetInterval(50);else if(counter===100)mfpSetInterval(500)},delay)};mfpSetInterval(1)},getImage:function(item,template){var guard=0,onLoadComplete=function(){if(item)if(item.img[0].complete){item.img.off(".mfploader");if(item===mfp.currItem){mfp._onImageHasSize(item);mfp.updateStatus("ready")}item.hasSize=
true;item.loaded=true;_mfpTrigger("ImageLoadComplete")}else{guard++;if(guard<200)setTimeout(onLoadComplete,100);else onLoadError()}},onLoadError=function(){if(item){item.img.off(".mfploader");if(item===mfp.currItem){mfp._onImageHasSize(item);mfp.updateStatus("error",imgSt.tError.replace("%url%",item.src))}item.hasSize=true;item.loaded=true;item.loadError=true}},imgSt=mfp.st.image;var el=template.find(".mfp-img");if(el.length){var img=document.createElement("img");img.className="mfp-img";item.img=
$(img).on("load.mfploader",onLoadComplete).on("error.mfploader",onLoadError);img.src=item.src;if(el.is("img"))item.img=item.img.clone();if(item.img[0].naturalWidth>0)item.hasSize=true}mfp._parseMarkup(template,{title:_getTitle(item),img_replaceWith:item.img},item);mfp.resizeImage();if(item.hasSize){if(_imgInterval)clearInterval(_imgInterval);if(item.loadError){template.addClass("mfp-loading");mfp.updateStatus("error",imgSt.tError.replace("%url%",item.src))}else{template.removeClass("mfp-loading");
mfp.updateStatus("ready")}return template}mfp.updateStatus("loading");item.loading=true;if(!item.hasSize){item.imgHidden=true;template.addClass("mfp-loading");mfp.findImageSize(item)}return template}}});var hasMozTransform,getHasMozTransform=function(){if(hasMozTransform===undefined)hasMozTransform=document.createElement("p").style.MozTransform!==undefined;return hasMozTransform};$.magnificPopup.registerModule("zoom",{options:{enabled:false,easing:"ease-in-out",duration:300,opener:function(element){return element.is("img")?
element:element.find("img")}},proto:{initZoom:function(){var zoomSt=mfp.st.zoom,ns=".zoom",image;if(!zoomSt.enabled||!mfp.supportsTransition)return;var duration=zoomSt.duration,getElToAnimate=function(image){var newImg=image.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),transition="all "+zoomSt.duration/1E3+"s "+zoomSt.easing,cssObj={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},t="transition";cssObj["-webkit-"+t]=cssObj["-moz-"+
t]=cssObj["-o-"+t]=cssObj[t]=transition;newImg.css(cssObj);return newImg},showMainContent=function(){mfp.content.css("visibility","visible")},openTimeout,animatedImg;_mfpOn("BuildControls"+ns,function(){if(mfp._allowZoom()){clearTimeout(openTimeout);mfp.content.css("visibility","hidden");image=mfp._getItemToZoom();if(!image){showMainContent();return}animatedImg=getElToAnimate(image);animatedImg.css(mfp._getOffset());mfp.wrap.append(animatedImg);openTimeout=setTimeout(function(){animatedImg.css(mfp._getOffset(true));
openTimeout=setTimeout(function(){showMainContent();setTimeout(function(){animatedImg.remove();image=animatedImg=null;_mfpTrigger("ZoomAnimationEnded")},16)},duration)},16)}});_mfpOn(BEFORE_CLOSE_EVENT+ns,function(){if(mfp._allowZoom()){clearTimeout(openTimeout);mfp.st.removalDelay=duration;if(!image){image=mfp._getItemToZoom();if(!image)return;animatedImg=getElToAnimate(image)}animatedImg.css(mfp._getOffset(true));mfp.wrap.append(animatedImg);mfp.content.css("visibility","hidden");setTimeout(function(){animatedImg.css(mfp._getOffset())},
16)}});_mfpOn(CLOSE_EVENT+ns,function(){if(mfp._allowZoom()){showMainContent();if(animatedImg)animatedImg.remove();image=null}})},_allowZoom:function(){return mfp.currItem.type==="image"},_getItemToZoom:function(){if(mfp.currItem.hasSize)return mfp.currItem.img;else return false},_getOffset:function(isLarge){var el;if(isLarge)el=mfp.currItem.img;else el=mfp.st.zoom.opener(mfp.currItem.el||mfp.currItem);var offset=el.offset();var paddingTop=parseInt(el.css("padding-top"),10);var paddingBottom=parseInt(el.css("padding-bottom"),
10);offset.top-=$(window).scrollTop()-paddingTop;var obj={width:el.width(),height:(_isJQ?el.innerHeight():el[0].offsetHeight)-paddingBottom-paddingTop};if(getHasMozTransform())obj["-moz-transform"]=obj["transform"]="translate("+offset.left+"px,"+offset.top+"px)";else{obj.left=offset.left;obj.top=offset.top}return obj}}});var IFRAME_NS="iframe",_emptyPage="//about:blank",_fixIframeBugs=function(isShowing){if(mfp.currTemplate[IFRAME_NS]){var el=mfp.currTemplate[IFRAME_NS].find("iframe");if(el.length){if(!isShowing)el[0].src=
_emptyPage;if(mfp.isIE8)el.css("display",isShowing?"block":"none")}}};$.magnificPopup.registerModule(IFRAME_NS,{options:{markup:'\x3cdiv class\x3d"mfp-iframe-scaler"\x3e'+'\x3cdiv class\x3d"mfp-close"\x3e\x3c/div\x3e'+'\x3ciframe class\x3d"mfp-iframe" src\x3d"//about:blank" frameborder\x3d"0" allowfullscreen\x3e\x3c/iframe\x3e'+"\x3c/div\x3e",srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v\x3d",src:"//www.youtube.com/embed/%id%?autoplay\x3d1"},vimeo:{index:"vimeo.com/",id:"/",
src:"//player.vimeo.com/video/%id%?autoplay\x3d1"},gmaps:{index:"//maps.google.",src:"%id%\x26output\x3dembed"}}},proto:{initIframe:function(){mfp.types.push(IFRAME_NS);_mfpOn("BeforeChange",function(e,prevType,newType){if(prevType!==newType)if(prevType===IFRAME_NS)_fixIframeBugs();else if(newType===IFRAME_NS)_fixIframeBugs(true)});_mfpOn(CLOSE_EVENT+"."+IFRAME_NS,function(){_fixIframeBugs()})},getIframe:function(item,template){var embedSrc=item.src;var iframeSt=mfp.st.iframe;$.each(iframeSt.patterns,
function(){if(embedSrc.indexOf(this.index)>-1){if(this.id)if(typeof this.id==="string")embedSrc=embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length,embedSrc.length);else embedSrc=this.id.call(this,embedSrc);embedSrc=this.src.replace("%id%",embedSrc);return false}});var dataObj={};if(iframeSt.srcAction)dataObj[iframeSt.srcAction]=embedSrc;mfp._parseMarkup(template,dataObj,item);mfp.updateStatus("ready");return template}}});var _getLoopedId=function(index){var numSlides=mfp.items.length;if(index>
numSlides-1)return index-numSlides;else if(index<0)return numSlides+index;return index},_replaceCurrTotal=function(text,curr,total){return text.replace(/%curr%/gi,curr+1).replace(/%total%/gi,total)};$.magnificPopup.registerModule("gallery",{options:{enabled:false,arrowMarkup:'\x3cbutton title\x3d"%title%" type\x3d"button" class\x3d"mfp-arrow mfp-arrow-%dir%"\x3e\x3c/button\x3e',preload:[0,2],navigateByImgClick:true,arrows:true,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},
proto:{initGallery:function(){var gSt=mfp.st.gallery,ns=".mfp-gallery",supportsFastClick=Boolean($.fn.mfpFastClick);mfp.direction=true;if(!gSt||!gSt.enabled)return false;_wrapClasses+=" mfp-gallery";_mfpOn(OPEN_EVENT+ns,function(){if(gSt.navigateByImgClick)mfp.wrap.on("click"+ns,".mfp-img",function(){if(mfp.items.length>1){mfp.next();return false}});_document.on("keydown"+ns,function(e){if(e.keyCode===37)mfp.prev();else if(e.keyCode===39)mfp.next()})});_mfpOn("UpdateStatus"+ns,function(e,data){if(data.text)data.text=
_replaceCurrTotal(data.text,mfp.currItem.index,mfp.items.length)});_mfpOn(MARKUP_PARSE_EVENT+ns,function(e,element,values,item){var l=mfp.items.length;values.counter=l>1?_replaceCurrTotal(gSt.tCounter,item.index,l):""});_mfpOn("BuildControls"+ns,function(){if(mfp.items.length>1&&gSt.arrows&&!mfp.arrowLeft){var markup=gSt.arrowMarkup,arrowLeft=mfp.arrowLeft=$(markup.replace(/%title%/gi,gSt.tPrev).replace(/%dir%/gi,"left")).addClass(PREVENT_CLOSE_CLASS),arrowRight=mfp.arrowRight=$(markup.replace(/%title%/gi,
gSt.tNext).replace(/%dir%/gi,"right")).addClass(PREVENT_CLOSE_CLASS);var eName=supportsFastClick?"mfpFastClick":"click";arrowLeft[eName](function(){mfp.prev()});arrowRight[eName](function(){mfp.next()});if(mfp.isIE7){_getEl("b",arrowLeft[0],false,true);_getEl("a",arrowLeft[0],false,true);_getEl("b",arrowRight[0],false,true);_getEl("a",arrowRight[0],false,true)}mfp.container.append(arrowLeft.add(arrowRight))}});_mfpOn(CHANGE_EVENT+ns,function(){if(mfp._preloadTimeout)clearTimeout(mfp._preloadTimeout);
mfp._preloadTimeout=setTimeout(function(){mfp.preloadNearbyImages();mfp._preloadTimeout=null},16)});_mfpOn(CLOSE_EVENT+ns,function(){_document.off(ns);mfp.wrap.off("click"+ns);if(mfp.arrowLeft&&supportsFastClick)mfp.arrowLeft.add(mfp.arrowRight).destroyMfpFastClick();mfp.arrowRight=mfp.arrowLeft=null})},next:function(){mfp.direction=true;mfp.index=_getLoopedId(mfp.index+1);mfp.updateItemHTML()},prev:function(){mfp.direction=false;mfp.index=_getLoopedId(mfp.index-1);mfp.updateItemHTML()},goTo:function(newIndex){mfp.direction=
newIndex>=mfp.index;mfp.index=newIndex;mfp.updateItemHTML()},preloadNearbyImages:function(){var p=mfp.st.gallery.preload,preloadBefore=Math.min(p[0],mfp.items.length),preloadAfter=Math.min(p[1],mfp.items.length),i;for(i=1;i<=(mfp.direction?preloadAfter:preloadBefore);i++)mfp._preloadItem(mfp.index+i);for(i=1;i<=(mfp.direction?preloadBefore:preloadAfter);i++)mfp._preloadItem(mfp.index-i)},_preloadItem:function(index){index=_getLoopedId(index);if(mfp.items[index].preloaded)return;var item=mfp.items[index];
if(!item.parsed)item=mfp.parseEl(index);_mfpTrigger("LazyLoad",item);if(item.type==="image")item.img=$('\x3cimg class\x3d"mfp-img" /\x3e').on("load.mfploader",function(){item.hasSize=true}).on("error.mfploader",function(){item.hasSize=true;item.loadError=true;_mfpTrigger("LazyLoadError",item)}).attr("src",item.src);item.preloaded=true}}});var RETINA_NS="retina";$.magnificPopup.registerModule(RETINA_NS,{options:{replaceSrc:function(item){return item.src.replace(/\.\w+$/,function(m){return"@2x"+m})},
ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var st=mfp.st.retina,ratio=st.ratio;ratio=!isNaN(ratio)?ratio:ratio();if(ratio>1){_mfpOn("ImageHasSize"+"."+RETINA_NS,function(e,item){item.img.css({"max-width":item.img[0].naturalWidth/ratio,"width":"100%"})});_mfpOn("ElementParse"+"."+RETINA_NS,function(e,item){item.src=st.replaceSrc(item,ratio)})}}}}});(function(){var ghostClickDelay=1E3,supportsTouch="ontouchstart"in window,unbindTouchMove=function(){_window.off("touchmove"+ns+
" touchend"+ns)},eName="mfpFastClick",ns="."+eName;$.fn.mfpFastClick=function(callback){return $(this).each(function(){var elem=$(this),lock;if(supportsTouch){var timeout,startX,startY,pointerMoved,point,numPointers;elem.on("touchstart"+ns,function(e){pointerMoved=false;numPointers=1;point=e.originalEvent?e.originalEvent.touches[0]:e.touches[0];startX=point.clientX;startY=point.clientY;_window.on("touchmove"+ns,function(e){point=e.originalEvent?e.originalEvent.touches:e.touches;numPointers=point.length;
point=point[0];if(Math.abs(point.clientX-startX)>10||Math.abs(point.clientY-startY)>10){pointerMoved=true;unbindTouchMove()}}).on("touchend"+ns,function(e){unbindTouchMove();if(pointerMoved||numPointers>1)return;lock=true;e.preventDefault();clearTimeout(timeout);timeout=setTimeout(function(){lock=false},ghostClickDelay);callback()})})}elem.on("click"+ns,function(){if(!lock)callback()})})};$.fn.destroyMfpFastClick=function(){$(this).off("touchstart"+ns+" click"+ns);if(supportsTouch)_window.off("touchmove"+
ns+" touchend"+ns)}})();_checkInstance()})(window.jQuery||window.Zepto);
AUI.add("com-placecube-digitalplace-address-postcodelookup",function(A){var NS="ns";var ENTRY_EMPTY_OPTION='\x3coption value\x3d""\x3e{numberOfAddresses} addresses found for {postcode}\x3c/option\x3e';var ENTRY_OPTION_TEMPLATE='\x3coption {selectedAddress} value\x3d"{addressId}"\x3e{addressValue}\x3c/option\x3e';var SELECTED_CALLBACK="selectedCallback";var UNSELECTED_CALLBACK="unselectedCallback";var ADDRESS_FORM_CONTAINER_ID="addressFormContainerId";var ADDRESS_LOOKUP_RESET_ID="addressLookupResetId";
var BUTTON_ADDRESS_LOOKUP_ID="btnAddressLookupId";var FULL_ADDRESS_ID="fullAddressId";var POST_CODE_FIELD_CONTAINER_ID="postcodeFieldContainerId";var POSTCODE_ID="postcodeId";var POST_CODE_LABEL_ID="postcodeLabelId";var UPRN_ID="uprnId";A.PostcodeLookup=A.Component.create({NAME:"com-placecube-digitalplace-address-postcodelookup",EXTENDS:A.Component,ATTRS:{ns:{},selectedCallback:{},unselectedCallback:{},fallbackToNationalLookup:{},addressFormContainerId:{},addressLookupResetId:{},btnAddressLookupId:{},
fullAddressId:{},postcodeFieldContainerId:{},postcodeId:{},postcodeLabelId:{},uprnId:{}},prototype:{render:function(){var instance=this;instance._init()},_init:function(){var instance=this;instance.set(ADDRESS_FORM_CONTAINER_ID,"#"+instance.get(NS)+"addressFormContainer");instance.set(ADDRESS_LOOKUP_RESET_ID,"#"+instance.get(NS)+"addressLookupReset");instance.set(BUTTON_ADDRESS_LOOKUP_ID,"#"+instance.get(NS)+"btnAddressLookup");instance.set(FULL_ADDRESS_ID,"#"+instance.get(NS)+"fullAddress");instance.set(POST_CODE_FIELD_CONTAINER_ID,
"#"+instance.get(NS)+"postcodeFieldContainer");instance.set(POSTCODE_ID,"#"+instance.get(NS)+"postcode");instance.set(POST_CODE_LABEL_ID,"#"+instance.get(NS)+"postcodeLabel");instance.set(UPRN_ID,"#"+instance.get(NS)+"uprn");$(instance.get(BUTTON_ADDRESS_LOOKUP_ID)).on("click",function(e){var postcodeValue=$(instance.get(POSTCODE_ID)).val();instance.lookupAddress(postcodeValue)});$(instance.get(ADDRESS_LOOKUP_RESET_ID)).on("click",function(e){e.preventDefault();instance._resetAddressLookup();instance._callback(UNSELECTED_CALLBACK)});
$(instance.get(UPRN_ID)).on("change",function(e){instance._displaySelectedAddress($(this).find("option:selected").text());if($(this).prop("selectedIndex")>0)instance._callback(SELECTED_CALLBACK);else instance._callback(UNSELECTED_CALLBACK)})},lookupAddress:function(postcodeValue){var instance=this;var uprnId=instance.get(UPRN_ID);var postcodeId=instance.get(POSTCODE_ID);var postcodeLabelId=instance.get(POST_CODE_LABEL_ID);var btnAddressLookupId=instance.get(BUTTON_ADDRESS_LOOKUP_ID);var addressFormContainerId=
instance.get(ADDRESS_FORM_CONTAINER_ID);var addressLookupResetId=instance.get(ADDRESS_LOOKUP_RESET_ID);var isValidPostcode=postcodeValue.match(/[A-Z]{1,2}[0-9][0-9A-Z]?\s?[0-9][A-Z]{2}/gi);if(isValidPostcode!=null)Liferay.Service("/placecube_digitalplace.addresscontext/search-address-by-postcode",{companyId:Liferay.ThemeDisplay.getCompanyId(),postcode:postcodeValue,fallbackToNationalLookup:instance.get("fallbackToNationalLookup")},function(data){var addressesFound=data;instance._displaySelectedAddress("");
$(uprnId).html("");instance._clearErrorMessage();if(addressesFound.length===0){$(addressFormContainerId).addClass("hide");instance._configurePostcodeErrorMessage("We did not find any address with that postcode. Please check you've entered it correctly.")}else{$(postcodeId).addClass("hide");$(postcodeLabelId).html(postcodeValue);$(postcodeLabelId).removeClass("hide");$(btnAddressLookupId).addClass("hide");$(addressFormContainerId).removeClass("hide");$(addressLookupResetId).removeClass("hide");var emptyOption=
A.Lang.sub(ENTRY_EMPTY_OPTION,{numberOfAddresses:addressesFound.length,postcode:postcodeValue});$(uprnId).append(emptyOption);$.each(addressesFound,function(key,value){var entryValue=A.Lang.sub(ENTRY_OPTION_TEMPLATE,{addressId:value.UPRN,addressValue:value.fullAddress,selectedAddress:""});$(uprnId).append(entryValue)})}});else{instance._displaySelectedAddress("");$(uprnId).html("");instance._clearErrorMessage();$(addressFormContainerId).addClass("hide");instance._configurePostcodeErrorMessage("Please enter a valid postcode")}},
_callback:function(callback){var instance=this;if(instance.get(callback))eval(instance.get(callback))},_clearErrorMessage:function(){var instance=this;var postcodeFieldContainerId=instance.get(POST_CODE_FIELD_CONTAINER_ID);$(postcodeFieldContainerId+" .form-group.input-text-wrapper").removeClass("has-success has-error");$(postcodeFieldContainerId+" .field.form-control").removeClass("error-field");$(postcodeFieldContainerId+" .form-group.input-text-wrapper .form-validator-stack").remove()},_configurePostcodeErrorMessage:function(errorMessage){var instance=
this;var postcodeFieldContainerId=instance.get(POST_CODE_FIELD_CONTAINER_ID);$(postcodeFieldContainerId+" .form-group.input-text-wrapper").addClass("has-error");$(postcodeFieldContainerId+" .field.form-control").addClass("error-field");$(postcodeFieldContainerId+" .form-group.input-text-wrapper").append('\x3cdiv class\x3d"form-validator-stack help-block"\x3e\x3cdiv role\x3d"alert" class\x3d"required"\x3e'+errorMessage+"\x3c/div\x3e\x3c/div\x3e")},_displaySelectedAddress:function(fullAddressSelected){var instance=
this;var fullAddressDetailsId="#"+instance.get(NS)+"fullAddressDetails";var addressDisplayContainerId="#"+instance.get(NS)+"addressDisplayContainer";if(fullAddressSelected!==undefined&&fullAddressSelected.length>0)$(instance.get(FULL_ADDRESS_ID)).val(fullAddressSelected);if($(addressDisplayContainerId).length)if(fullAddressSelected!==undefined&&fullAddressSelected.length>0){$(fullAddressDetailsId).html(fullAddressSelected);$(addressDisplayContainerId).removeClass("hide")}else{$(fullAddressDetailsId).html("");
$(addressDisplayContainerId).addClass("hide")}},_resetAddressLookup:function(){var instance=this;$(instance.get(ADDRESS_FORM_CONTAINER_ID)).addClass("hide");$(instance.get(ADDRESS_LOOKUP_RESET_ID)).addClass("hide");$(instance.get(FULL_ADDRESS_ID)).val("");$(instance.get(UPRN_ID)).html("");$(instance.get(POST_CODE_FIELD_CONTAINER_ID)+" .field.form-control").val("");$(instance.get(POST_CODE_LABEL_ID)).addClass("hide");$(instance.get(POSTCODE_ID)).removeClass("hide");$(instance.get(BUTTON_ADDRESS_LOOKUP_ID)).removeClass("hide")}}})},
"",{requires:["aui-base","liferay-util-window"]});
AUI.add("com-placecube-digitalplace-casemanagement-frontend-caselisting",function(A){var CaseListing={init:function(){$(document).on("click",".case-listing-entry",function(e){A.CaseListing.openCaseEntryDetailPopUp(e)})},getRenderUrl:function(ppid,mvcRenderCommandName,windowState,parameters){var renderURL=Liferay.PortletURL.createRenderURL();renderURL.setPortletId(ppid);renderURL.setParameter("mvcRenderCommandName",mvcRenderCommandName);renderURL.setWindowState(windowState);renderURL.setParameters(parameters);
return renderURL},openCaseEntryDetailPopUp:function(e){var caseListing=$(e.currentTarget).closest(".case-management .case-listing");var ppid=$(caseListing).attr("data-ppid");var mvcRenderCommandName=$(caseListing).attr("data-mvc-render-command-name");var entryId=$(e.currentTarget).attr("data-entry-id");var parameters={entryId:entryId};var renderURL=this.getRenderUrl(ppid,mvcRenderCommandName,"pop_up",parameters);Liferay.Util.openWindow({dialog:{destroyOnHide:true,plugins:[Liferay.WidgetZIndex]},id:ppid+
"_Dialog",title:"",uri:renderURL.toString()})}};A.CaseListing=CaseListing},"",{requires:["liferay-portlet-url","liferay-util-window"]});
AUI.add("com-placecube-digitalplace-casemanagement-datastructureupdate",function(A){var ENTRY_OPTION_TEMPLATE='\x3coption value\x3d"{optionValue}"\x3e{optionValue}\x3c/option\x3e';var DataStructureUpdate={init:function(){var instance=this;$(".data-structure-update").on("change",function(e){var selectedDataStructurekey=$(this).attr("data-dataStructureKey");var dropdownSelectToUpdate=$('.data-structure-update[data-parentDataStructureKey\x3d"'+selectedDataStructurekey+'"]')[0];if(dropdownSelectToUpdate!==
undefined){var optionSelectedParam=document.getElementById(this.id).value;instance._retrieveValuesForSelectedParentDataStructure(selectedDataStructurekey,optionSelectedParam,dropdownSelectToUpdate)}})},_retrieveValuesForSelectedParentDataStructure:function(parentDataStructureKeyParam,optionSelectedParam,dropdownSelectToUpdate){var datastructurekeyParam=$(dropdownSelectToUpdate).attr("data-dataStructureKey");Liferay.Service("/casemanagement_datastructure.datastructureentry/get-linked-data-structure-entries",
{parentStructureKey:parentDataStructureKeyParam,parentStructureName:optionSelectedParam,dataStructureKey:datastructurekeyParam},function(data){var dataStructureEntiresFound=data;$(dropdownSelectToUpdate).html("");$.each(dataStructureEntiresFound,function(key,value){var entryValue=A.Lang.sub(ENTRY_OPTION_TEMPLATE,{optionValue:value.name});$(dropdownSelectToUpdate).append(entryValue)})})}};A.DataStructureUpdate=DataStructureUpdate},"",{requires:["liferay-portlet-url"]});
