function handleToggleClicks(event){event.preventDefault();const toggleLink=event.currentTarget;const toggleTarget=document.getElementById(toggleLink.getAttribute('aria-controls'));const isExpanded=toggleLink.getAttribute('aria-expanded')==='true';const newExpandedState=!isExpanded;toggleTarget.classList.toggle('is-visible',newExpandedState);toggleLink.setAttribute('aria-expanded',newExpandedState.toString());if(newExpandedState){toggleTarget.focus();}} function debounce(func,delay){let timeout;return function debouncedFunction(...args){const context=this;clearTimeout(timeout);timeout=setTimeout(()=>func.apply(context,args),delay);};} function menuToggle(){const menuToggle=document.querySelector('.js-menu-toggle');if(!menuToggle)return;function closeSearch(){const searchToggle=document.querySelector('.js-search-toggle');const searchTarget=document.getElementById(searchToggle.getAttribute('aria-controls'));searchToggle.setAttribute('aria-expanded','false');searchTarget.classList.remove('is-visible');} menuToggle.addEventListener('click',(event)=>{closeSearch();handleToggleClicks(event);});} function menuDropdownToggles(){const dropdownButtons=document.querySelectorAll('.js-dropdown-toggle');if(!dropdownButtons)return;const eventListeners=new Map();function closeDropdowns(){document.removeEventListener('keydown',detectFocusPosition);dropdownButtons.forEach((button)=>{const panel=document.getElementById(button.getAttribute('aria-controls'));if(button.getAttribute('aria-expanded')==='true'){button.setAttribute('aria-expanded','false');button.classList.remove('is-active');if(panel){panel.classList.remove('is-visible');}} const listener=eventListeners.get(panel);if(listener){document.removeEventListener('click',listener);eventListeners.delete(panel);}});} function toggleDropdown(event){event.preventDefault();event.stopPropagation();const toggleBtn=event.currentTarget;const panel=document.getElementById(toggleBtn.getAttribute('aria-controls'));const isExpanded=toggleBtn.getAttribute('aria-expanded')==='true';if(isExpanded){closeDropdowns();}else{closeDropdowns();toggleBtn.setAttribute('aria-expanded','true');toggleBtn.classList.add('is-active');if(panel){panel.classList.add('is-visible');} document.addEventListener('keydown',(event)=>detectFocusPosition(event,toggleBtn,panel));const outsideClickHandler=(event)=>handleOutsideClick(event,panel);document.addEventListener('click',outsideClickHandler);eventListeners.set(panel,outsideClickHandler);}} function handleOutsideClick(event,panel){const dropdownContent=panel.querySelector('.dropdown-panel');if(!dropdownContent)return if(!dropdownContent.contains(event.target)){closeDropdowns();}} function detectFocusPosition(event,toggleBtn,panel){const focusableElements='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';if(!focusableElements)return;const focusableContent=panel.querySelectorAll(focusableElements);const firstFocusableElement=focusableContent[0];const lastFocusableElement=focusableContent[focusableContent.length-1];let isTabPressed=event.key==='Tab';if(!isTabPressed)return;if((event.shiftKey&&document.activeElement===firstFocusableElement)||document.activeElement===lastFocusableElement){toggleBtn.setAttribute('aria-expanded','false');toggleBtn.classList.remove('is-active');panel.classList.remove('is-visible');}} dropdownButtons.forEach((button)=>{button.addEventListener('click',toggleDropdown);});} function searchToggle(){const searchToggle=document.querySelector('.js-search-toggle');if(!searchToggle)return;function closeAllMenus(){const menuTrigger=document.getElementById('navigation-toggle');const menuTarget=document.getElementById(menuTrigger.getAttribute('aria-controls'));const allDropdownTriggers=document.querySelectorAll('.js-dropdown-toggle');const allDropdownPanels=document.querySelectorAll('.mega-content');menuTrigger.setAttribute('aria-expanded','false');menuTarget.classList.remove('is-visible');allDropdownTriggers.forEach((link)=>{link.setAttribute('aria-expanded','false');link.classList.remove('is-active');}) allDropdownPanels.forEach((panel)=>{panel.classList.remove('is-visible');})} searchToggle.addEventListener('click',(event)=>{closeAllMenus();handleToggleClicks(event);});} function imageTypeCheck(){const allImages=document.querySelectorAll('img');if(!allImages)return;allImages.forEach((img)=>{try{const url=new URL(img.src);const pathname=url.pathname.toLowerCase();if(pathname.endsWith('.svg')){img.parentElement.classList.add('is-svg');img.classList.add('is-svg');}else{img.classList.add('is-raster');}}catch(error){console.warn('Invalid image URL',img.src);}});} function myÂé¶¹¾«Ñ¡LikeCheck(){const cookieName='hl_default';const currentCookieValue=getCookie(cookieName);if(!currentCookieValue)return const likesExist=currentCookieValue&&decodeURIComponent(currentCookieValue).split('|').filter(Boolean).length>0;const likesButton=document.getElementById('myhie-likes');const likesInactiveIcon=likesButton.querySelector('.btn--myhie__inactive') const likesActiveIcon=likesButton.querySelector('.btn--myhie__active') if(likesExist){likesButton.classList.add('hasLikes') likesInactiveIcon.classList.add('hidden') likesActiveIcon.classList.remove('hidden')}else{likesButton.classList.remove('hasLikes') likesInactiveIcon.classList.remove('hidden') likesActiveIcon.classList.add('hidden')} function getCookie(name){const nameEQ=name+"=";const ca=document.cookie.split(';');for(let i=0;i{panel.setAttribute('aria-hidden','true');panel.classList.remove('is-visible');});currentPanel=null;} function showPanel(panel){panel.setAttribute('aria-hidden','false');panel.classList.add('is-visible');currentPanel=panel;} function handleCloseClick(event){const panel=event.currentTarget.closest('.regional-map__popover');if(panel){panel.setAttribute('aria-hidden','true');panel.classList.remove('is-visible');}} function handleBtnClicks(event){event.preventDefault();const clickedBtn=event.currentTarget;const targetId=clickedBtn.getAttribute('aria-controls');const targetPanel=document.getElementById(targetId);if(!targetPanel)return;if(currentPanel===targetPanel){hideAllPanels();}else{hideAllPanels();showPanel(targetPanel);}} regionalMapBtns.forEach((btn)=>{btn.addEventListener('click',handleBtnClicks,false)}) closeBtns.forEach((btn)=>{btn.addEventListener('click',handleCloseClick,false);});} menuToggle();menuDropdownToggles();searchToggle();imageTypeCheck();myÂé¶¹¾«Ñ¡LikeCheck();regionalMap();;; const focusableSelectors=` a[href]:not([tabindex="-1"]), button:not([disabled]):not([tabindex="-1"]), textarea:not([disabled]):not([tabindex="-1"]), input:not([type="hidden"]):not([disabled]):not([tabindex="-1"]), select:not([disabled]):not([tabindex="-1"]), [tabindex]:not([tabindex="-1"]) `;function handleDialogClosures(){const dialogs=document.querySelectorAll(".dialog.is-visible");document.body.classList.remove("dialog--is-open");document.removeEventListener("keydown",handleEscapeKey);dialogs.forEach((panel)=>{panel.classList.remove("is-visible");panel.removeAttribute('tabindex');});} const handleEscapeKey=(e)=>{if(e.key==="Escape"){handleDialogClosures();}};function trapDialogFocus(event,element){const focusableContent=element.querySelectorAll(focusableSelectors);if(focusableContent.length===0)return;const firstFocusableElement=focusableContent[0];const lastFocusableElement=focusableContent[focusableContent.length-1];const isTabPressed=event.key==="Tab";if(!isTabPressed)return;if(event.shiftKey){if(document.activeElement===firstFocusableElement){lastFocusableElement.focus();event.preventDefault();}}else{if(document.activeElement===lastFocusableElement){firstFocusableElement.focus();event.preventDefault();}}} function openNewsletterDialog(dialogElement){if(!dialogElement)return;dialogElement.classList.add('is-visible');document.body.classList.add('dialog--is-open');try{dialogElement.getElementsByTagName('fieldset')[0].style.display='none';} catch(err){console.log(err);} dialogElement.setAttribute('tabindex','-1');dialogElement.focus({preventScroll:true});dialogElement.addEventListener('keydown',(event)=>trapDialogFocus(event,dialogElement));document.addEventListener('keydown',handleEscapeKey);const closeButton=dialogElement.querySelector('.closeDialogButton');if(closeButton){closeButton.removeEventListener('click',handleDialogClosures);closeButton.addEventListener('click',handleDialogClosures);}} function initNewsletterDialogs(dialogs){if(!dialogs||!dialogs.forEach)return;dialogs.forEach((dialog)=>{if(dialog.classList.contains('is-visible')){openNewsletterDialog(dialog);}});} document.addEventListener("DOMContentLoaded",()=>{const step1Form=document.getElementById('step1-newsletter-form');if(step1Form){initStep1Form(step1Form);} const dialogs=document.querySelectorAll('[data-module="dialog"]');if(dialogs.length>0&&typeof initNewsletterDialogs==='function'){initNewsletterDialogs(dialogs);}});function initStep1Form(formElement){const submitButton=formElement.querySelector('button[type="submit"]');const emailInput=formElement.querySelector('input[type="email"]');const errorMessageDiv=document.getElementById('step1-error-message');const siteKey=formElement.dataset.recaptchaSiteKey;if(!submitButton||!emailInput){console.error("Step 1 form is missing a submit button or email input.");return;} submitButton.addEventListener('click',async(event)=>{event.preventDefault();if(!formElement.checkValidity()){errorMessageDiv.textContent='Please enter a valid email address.';errorMessageDiv.style.display='block';return;} submitButton.setAttribute('disabled','disabled');submitButton.style.opacity='0.7';errorMessageDiv.style.display='none';grecaptcha.ready(function(){grecaptcha.execute(siteKey,{action:'submit'}).then(async function(token){try{const response=await fetch('/umbraco/api/newsletterapi/subscribe',{method:'POST',headers:{'Content-Type':'application/json',},body:JSON.stringify({email:emailInput.value,recaptchaToken:token}),});const responseData=await response.json();if(!response.ok){throw new Error(responseData.message||`HTTP error! status: ${response.status}`);} const dialog=document.getElementById(event.target.dataset.target);const prefsButton=dialog.getElementsByClassName('prefsButton')[0];if(prefsButton){openNewsletterDialog(dialog);document.getElementById('confirmedEmail').innerHTML=responseData.email;document.getElementById('confirmedEmail2').innerHTML=responseData.email;prefsButton.href=prefsButton.href+"?email="+encodeURIComponent(responseData.email)+"&signupId="+encodeURIComponent(responseData.signupId);document.getElementById('stage2Text').style.display='block';formElement.style.display='none';}else{console.error("Could not find the '.signupid' or '.email' fields in the Step 2 form. Check your field aliases.");errorMessageDiv.textContent='An unexpected error occurred. Please refresh and try again.';errorMessageDiv.style.display='block';}}catch(error){console.error('Form submission failed:',error);errorMessageDiv.textContent=error.message||'An unexpected error occurred. Please try again later.';errorMessageDiv.style.display='block';}finally{submitButton.removeAttribute('disabled');submitButton.style.opacity='1';}});});});};; +function($){'use strict';var Tab=function(element){this.element=$(element)} Tab.VERSION='3.3.1' Tab.TRANSITION_DURATION=150 Tab.prototype.show=function(){var $this=this.element var $ul=$this.closest('ul:not(.dropdown-menu)') var selector=$this.data('target') if(!selector){selector=$this.attr('href') selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,'')} if($this.parent('li').hasClass('active'))return var $previous=$ul.find('.active:last a') var hideEvent=$.Event('hide.bs.tab',{relatedTarget:$this[0]}) var showEvent=$.Event('show.bs.tab',{relatedTarget:$previous[0]}) $previous.trigger(hideEvent) $this.trigger(showEvent) if(showEvent.isDefaultPrevented()||hideEvent.isDefaultPrevented())return var $target=$(selector) this.activate($this.closest('li'),$ul) this.activate($target,$target.parent(),function(){$previous.trigger({type:'hidden.bs.tab',relatedTarget:$this[0]}) $this.trigger({type:'shown.bs.tab',relatedTarget:$previous[0]})})} Tab.prototype.activate=function(element,container,callback){var $active=container.find('> .active') var transition=callback&&$.support.transition&&(($active.length&&$active.hasClass('fade'))||!!container.find('> .fade').length) function next(){$active.removeClass('active').find('> .dropdown-menu > .active').removeClass('active').end().find('[data-toggle="tab"]').attr('aria-selected',false) element.addClass('active').find('[data-toggle="tab"]').attr('aria-selected',true) if(transition){element[0].offsetWidth element.addClass('in')}else{element.removeClass('fade')} if(element.parent('.dropdown-menu')){element.closest('li.dropdown').addClass('active').end().find('[data-toggle="tab"]').attr('aria-selected',true)} callback&&callback()} $active.length&&transition?$active.one('bsTransitionEnd',next).emulateTransitionEnd(Tab.TRANSITION_DURATION):next() $active.removeClass('in')} function Plugin(option){return this.each(function(){var $this=$(this) var data=$this.data('bs.tab') if(!data)$this.data('bs.tab',(data=new Tab(this))) if(typeof option=='string')data[option]()})} var old=$.fn.tab $.fn.tab=Plugin $.fn.tab.Constructor=Tab $.fn.tab.noConflict=function(){$.fn.tab=old return this} var clickHandler=function(e){e.preventDefault() Plugin.call($(this),'show')} $(document).on('click.bs.tab.data-api','[data-toggle="tab"]',clickHandler).on('click.bs.tab.data-api','[data-toggle="pill"]',clickHandler)}(jQuery);;; (function($,window,document){function init(){$('.dropdown .top').on('click',function(){if($(this).hasClass('open')){$(this).siblings('ul').slideUp();$(this).removeClass('open');}else{$('.dropdown .top').removeClass('open') $('.dropdown ul').slideUp();$(this).siblings('ul').slideDown();$(this).addClass('open');} var clickedItem=$(this);var inputChildren=clickedItem.siblings('ul').children() if(inputChildren.children().children('input:checkbox:checked').length>0){clickedItem.parent().addClass('active');$('.dropdown-mobile .top-toggle').addClass('active')}else{clickedItem.parent().removeClass('active');$('.dropdown-mobile .top-toggle').removeClass('active')} $('.m-filters .active-filters .clear').on('click',function(){$('.dropdown').removeClass('active');$('.dropdown-mobile .top-toggle').removeClass('active')})});$('.dropdown').each(function(){if($(this).children('ul').children().children().children('input:checkbox:checked').length>0){$(this).addClass('active');}});$('.dropdown-mobile .top-toggle').on('click',function(){$(this).toggleClass('open');$(this).parent().toggleClass('open');$(this).siblings('.filters').show();$('.m-maptop').addClass('filter-active');$('body').addClass('filter-open');$('.dropdown-mobile .e-close').on('click',function(){$('.dropdown-mobile, .dropdown-mobile .top').removeClass('open');$('.m-maptop').removeClass('filter-active');$('.dropdown-mobile .filters').hide();$('body').removeClass('filter-open');});$('.dropdown-mobile .close-filters-panel').on('click',function(){$('.dropdown-mobile, .dropdown-mobile .top').removeClass('open');$('.m-maptop').removeClass('filter-active');$('.dropdown-mobile .filters').hide();$('body').removeClass('filter-open');});$('.dropdown-mobile .fa-search').on('click',function(){$('.dropdown-mobile, .dropdown-mobile .top').removeClass('open');$('.m-maptop').removeClass('filter-active');$('.dropdown-mobile .filters').hide();$('body').removeClass('filter-open');});$('.keyword input').on('keyup',function(e){if(e.keyCode===13){$('.dropdown-mobile, .dropdown-mobile .top').removeClass('open');$('.m-maptop').removeClass('filter-active');$('.dropdown-mobile .filters').hide();$('body').removeClass('filter-open');}});});} $(function(){setTimeout(function(){init();},500);});})(window.jQuery,window,document);;; (function($,window,document){function closeProfilePopup(){$(document).on('click','.popup.save-notice .btn-outline',function(e){e.preventDefault();$('.popup.save-notice').remove();});} function profileFilters(){$('.e-profilefilters li a').on('click',function(e){e.preventDefault();var selectedSection=$(this).attr('data-section');$(this).toggleClass('active');$(selectedSection).toggle('fade');});} function myÂé¶¹¾«Ñ¡Dropdown(){var $allDropdowns=$(".e-dropdown .e-top");$(document).on('click',".e-dropdown .e-top",function(){$allDropdowns.not(this).removeClass('open');$allDropdowns.not(this).siblings('.e-more').hide();$(this).toggleClass('open');$(this).siblings('.e-more').slideToggle();});$(document).on('click',".e-dropdown .e-more .btn.btn-outline.green",function(e){e.preventDefault();$(this).parent().hide();});} function generalFormDropdown(){$(document).on('click',".form-row.inline .dropdown-checkbox",function(){var clickedCheck=$(this);var clickedCheckParent=clickedCheck.parent();var clickedCheckText=$(this).text();var clickedCheckId=$(this).attr('data-id');var checkbox=$('#'+clickedCheckId);var clickedItemTop=clickedCheckParent.siblings('.e-top');$(this).toggleClass('checked');checkbox.prop('checked',!checkbox.prop('checked'));if(clickedCheck.hasClass('checked')){$('.e-dropdown .e-top').removeClass('open');clickedItemTop.removeClass('open').children().children('.e-placeholder').hide();$(''+clickedCheckText+'').appendTo(clickedItemTop.children('.inner'));}else if(!clickedCheck.hasClass('checked')){clickedItemTop.children('.inner').children('span[data-selected="'+clickedCheckId+'"]').remove();} if(!clickedItemTop.children('.inner').children('span').length>0){clickedItemTop.children('.inner').children('.e-placeholder').show();}});} $(function(){profileFilters();myÂé¶¹¾«Ñ¡Dropdown();generalFormDropdown();closeProfilePopup();});})(window.jQuery,window,document);;; (function($,window,document){$(function(){const notificationBanner=document.getElementById('notificationBanner');if(!notificationBanner)return const closeNotificationBtn=notificationBanner.querySelector('.h-notificationbanner__btn');let bannerActive=getCookie('bannerState');if(bannerActive==='disabled'){document.body.classList.remove('notification');}else{notificationBanner.classList.remove('h-notificationbanner--hidden');} closeNotificationBtn.addEventListener('click',(event)=>{event.preventDefault();setCookie('bannerState','disabled',1);notificationBanner.classList.add('h-notificationbanner--hidden');document.body.classList.remove('notification');var headerHeight=$('header').outerHeight();var browserHeight=$(window).outerHeight();enquire.register('screen and (max-width:1280px)',{unmatch:function(){$('.n-main').css({'top':'auto','height':' auto'});$('.n-main .e-sub').css({'top':'auto','height':' auto'});},match:function(){$('.n-main').css({'top':headerHeight+'px','height':browserHeight-headerHeight+'px'});$('.n-main .e-sub').css({'top':headerHeight+'px','height':browserHeight-headerHeight+'px'});}});}) function setCookie(name,value,days){var expires="";if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));expires="; expires="+date.toUTCString();} document.cookie=name+"="+(value||"")+expires+"; path=/";} function getCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;imaxUploadSizePerInput){alertDiv.innerHTML=failedUploadText;alertDiv.className="";alertDiv.classList.add('alert','alert-danger');fu.value=null;fu.files=null;} else{alertDiv.className="";alertDiv.classList.add('alert','alert-success');alertDiv.innerHTML=tickImage+" Your file meets the size requirements";}}})} function umbracoFormSubmitLoader(){if(document.querySelector('input[data-form-submit-loader]')!==null){var form=$('input[data-form-submit-loader]').closest('form');$(form).on('submit',function(e){window.onbeforeunload=function(){document.body.style.overflow='hidden';document.getElementById('animated-loading').style.display='flex';}});}} function getÂé¶¹¾«Ñ¡Options(supportSelections){orgTypeSelections=[];$('input[name="OrganisationTypeSelections"]:checked').each(function(){orgTypeSelections.push($(this).val());});$.ajax({url:'/umbraco/api/Âé¶¹¾«Ñ¡FinderApi/GetÂé¶¹¾«Ñ¡Options',type:'GET',data:{currentPageId:currentPageId,orgTypeSelections:orgTypeSelections.join(","),supportSelections:supportSelections},success:function(response){$(".supportOptions_ddl").empty();$(".supportOptions_cbx").empty();var len=response.length;for(var i=0;i"+text+"");$(".e-checkboxes.supportOptions_cbx").append("
"+""+""+"
");} $('Close').appendTo('.e-more.supportOptions_ddl');},error:function(response){console.log(response);}});} function formatBytes(a,b){if(b===undefined){b=2} if(0===a)return"0 Bytes";const c=0>b?0:b,d=Math.floor(Math.log(a)/Math.log(1024));return parseFloat((a/Math.pow(1024,d)).toFixed(c))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][d]} myHieProfileForm();umbracoFormLoadCushion();umbracoFormSubmitLoader();setTimeout(function(){formValidation();},500);});(function($){$.validator.unobtrusive.adapters.addBool("checkboxrequired","required");}(jQuery));$.validator.addMethod('strongpassword',function(value,element){const rules=[/[A-Z]{1}/g,/[a-z]{1}/g,/[0-9]{1}/g,/[^a-zA-Z\d]{1}/g,/.{8,}/g];let isValid=true;for(let i=0;i{const state=link.getAttribute('aria-expanded');if(state==='false'){link.setAttribute('aria-expanded',true);content.classList.add('js-expanded');content.addEventListener("focusout",(event)=>handleFocusOut(event,link,content));}else{link.setAttribute('aria-expanded',false);content.classList.remove('js-expanded');content.removeEventListener("focusout",(event)=>handleFocusOut(event,link,content))}} toggleLinks.forEach((link)=>{const toggleLink=link;const toggleTarget=document.getElementById(toggleLink.getAttribute('aria-controls'));toggleLink.addEventListener('click',(event)=>{event.preventDefault();handleToggleClick(toggleLink,toggleTarget);});})} function handleFocusOut(event,link,content){if(event.relatedTarget!=null&&!content.contains(event.relatedTarget)){link.setAttribute('aria-expanded',false);content.classList.remove('js-expanded');}} function handleOutsideClick(el){document.addEventListener('click',(e)=>{if(!el.contains(e.target.parentElement)&&!el.contains(e.target)){console.log('close everything down')}})} toggleLink();;; function accordionSelector(){const accordions=document.querySelectorAll('[data-module-accordion]');if(accordions.length===0)return;accordions.forEach((accordionGroup)=>{const accordionItems=accordionGroup.querySelectorAll(`.accordion-item`);init(accordionItems);});function init(accordionItems){accordionItems.forEach((item)=>{const toggleButton=item.querySelector('.accordion-item__toggle');const content=item.querySelector('.accordion-item__content');toggleButton.addEventListener('click',(event)=>{event.preventDefault();const isOpen=toggleButton.getAttribute('aria-expanded')==='true';closeAllItems(accordionItems);if(!isOpen){toggleButton.setAttribute('aria-expanded','true');content.classList.add('accordion-item__content--is-open');}else{toggleButton.setAttribute('aria-expanded','false');content.classList.remove('accordion-item__content--is-open');}});});} function closeAllItems(accordionItems){accordionItems.forEach(item=>{const button=item.querySelector('.accordion-item__toggle');const content=item.querySelector('.accordion-item__content');if(button&&content){button.setAttribute('aria-expanded','false');content.classList.remove('accordion-item__content--is-open');}});}} document.addEventListener('DOMContentLoaded',accordionSelector);;; (function($,window,document){function init(){$('.m-casestudypanel--carousel .inner').slick({dots:true,arrows:true,prevArrow:'',nextArrow:'',responsive:[{breakpoint:991,settings:{arrows:false}}]});} $(function(){setTimeout(function(){init();},500);});})(window.jQuery,window,document);;; const feedbackForm={init:function(){this.formElement=document.getElementById('feedbackForm') this.errorSummary=document.getElementById('feedbackErrorSummary') this.recaptchaSiteKey=document.getElementById('recaptchaSiteKey')?.value;this.fields={yes:{comments:document.querySelector('#comments-yes')},no:{reason:document.querySelector('#reason-no'),comments:document.querySelector('#comments-no')},yesbut:{reason:document.querySelector('#reason-yesbut'),comments:document.querySelector('#comments-yesbut')}} if(this.formElement){this.attachEventHandlers()}},addTracking:function(){const radios=[].slice.call(this.formElement.querySelectorAll('.radio__input')) radios.forEach(radio=>{radio.addEventListener('change',()=>{const type=document.querySelector('[name=feedbacktype]:checked').value this.updateDataLayer(type,'feedbackRadio')})}) const selects=[].slice.call(this.formElement.querySelectorAll('.select')) selects.forEach(select=>{select.addEventListener('change',()=>{const type=document.querySelector('[name=feedbacktype]:checked').value this.updateDataLayer(type,'feedbackSelect')})})},attachEventHandlers:function(){document.addEventListener('click',(event)=>{const submitButton=event.target.closest('.feedback-submit-btn') if(!submitButton){return} event.preventDefault(submitButton) if(document.querySelector('[name=feedbacktype]:checked')){this.submitFeedback(submitButton)}})},submitFeedback:function(submitButton){if(!document.querySelector('[name=feedbacktype]:checked')){return} this.removeErrorMessages() const container=submitButton.closest('.reveal-content') const type=document.querySelector('[name=feedbacktype]:checked').value const nodeId=document.querySelector('[name=feedbackFormNodeId]').value const reasonSelect=container.querySelector('select') const commentsTextarea=container.querySelector('textarea') const feedback={nodeId:nodeId,slug:document.location.pathname,type:type,reason:reasonSelect?reasonSelect.value:'',comments:commentsTextarea?commentsTextarea.value:'',errors:[]} const errorSummaryEl=document.getElementById('feedbackErrorSummary') const errorSummaryContentEl=errorSummaryEl.querySelector('.error-summary__content') errorSummaryContentEl.innerHTML='' if(!this.recaptchaSiteKey){console.error('reCAPTCHA site key not found.');that.errorSummary.querySelector('.error-summary__content').innerHTML='

Sorry, a configuration error occurred. Please try again later.

';that.errorSummary.classList.remove('hidden');that.errorSummary.scrollIntoView();return;} if(!this.validateFeedback(feedback)){const errorSummaryContentList=document.createElement('ul') errorSummaryContentList.classList.add('error-summary__list') errorSummaryContentEl.appendChild(errorSummaryContentList) feedback.errors.forEach(function(error){const fieldElement=error.field.nodeName==='SELECT'?error.field.parentNode:error.field fieldElement.classList.add('input--error') const questionElement=error.field.closest('.question') questionElement.classList.add('question--error') let messageElement=questionElement.querySelector('.question__error-message') if(!messageElement){messageElement=document.createElement('p') messageElement.classList.add('question__error-message')} messageElement.innerHTML=error.message fieldElement.insertAdjacentElement('beforebegin',messageElement) const summaryItem=document.createElement('li') errorSummaryContentList.appendChild(summaryItem) summaryItem.innerText=`${error.message}`}) errorSummaryEl.classList.remove('hidden') errorSummaryEl.focus() errorSummaryEl.scrollIntoView()}else{errorSummaryEl.classList.add('hidden') const that=this grecaptcha.ready(function(){grecaptcha.execute(that.recaptchaSiteKey,{action:'submit_feedback'}).then(function(token){feedback.recaptchaToken=token;that.updateDataLayer(feedback.type,'feedbackSubmit') var xhr=new XMLHttpRequest() xhr.open('POST','/api/feedback/Receiver',true) xhr.setRequestHeader('Content-Type','application/json charset=utf-8') xhr.onreadystatechange=function(){if(this.readyState===XMLHttpRequest.DONE&&this.status===201){document.getElementById('feedbackThanks').classList.remove('hidden');document.getElementById('feedbackForm').classList.add('hidden');const title=document.querySelector('.user-feedback-form__title');if(title){title.classList.add('hidden');}}else if(this.status>=400){if(this.status===429){that.errorSummary.querySelector('.error-summary__content').innerHTML='

Too many requests have been submitted, please try again later.

';}else{that.errorSummary.querySelector('.error-summary__content').innerHTML='

Sorry, we have a problem at our side. Please try again later.

';} that.errorSummary.classList.remove('hidden');that.errorSummary.scrollIntoView();}};xhr.send(JSON.stringify(feedback));document.querySelector('#feedbackForm button.btn.feedback-submit-btn').setAttribute("disabled","disabled");setTimeout(function(){document.querySelector('#feedbackForm button.btn.feedback-submit-btn').removeAttribute("disabled","disabled");},15000);})})}},updateDataLayer:function(type,event){window.dataLayer=window.dataLayer||[] window.dataLayer.push({'type':type,'reason':this.getFeedbackReason(type),'event':event})},getFeedbackReason:function(type){let reason='' if(type==='no'){reason=this.fields.no.reason.value}else if(type==='yesbut'){reason=this.fields.yesbut.reason.value} return reason},getFeedbackFreeText:function(type){let freeText='' if(type==='no'){freeText=this.fields.no.comments.value}else if(type==='yesbut'){freeText=this.fields.yesbut.comments.value}else{freeText=this.fields.yes.comments.value||''} return freeText.substring(0,250)},removeErrorMessages:function(){this.errorSummary.classList.add('hidden') Array.from(this.formElement.querySelectorAll('.input--error')).forEach(function(inputElement){inputElement.classList.remove('input--error')}) Array.from(this.formElement.querySelectorAll('.question--error')).forEach(function(inputElement){inputElement.classList.remove('question--error')}) Array.from(this.formElement.querySelectorAll('.question__error-message')).forEach(function(message){message.parentNode.removeChild(message)})},validateFeedback:function(feedback){switch(feedback.type){case'no':if(feedback.comments===''){feedback.errors.push({field:this.fields.no.comments,message:'Please enter a comment'})} if(feedback.reason===''){feedback.errors.push({field:this.fields.no.reason,message:'Please select a reason'})} break case'yesbut':if(feedback.reason===''){feedback.errors.push({field:this.fields.yesbut.reason,message:'Please select a reason'})} if(feedback.comments===''){feedback.errors.push({field:this.fields.yesbut.comments,message:'Please enter a comment'})} break default:break} return feedback.errors.length===0}} feedbackForm.init();; (function($,window,document){function initCaseStudiesCarousel(){var $caseStudyCarousel=$('.m-factsheet-group--carousel');if(!$caseStudyCarousel)return;$caseStudyCarousel.each(function(){var $slickElement=$(this);$slickElement.slick({dots:true,arrows:false,infinite:false,speed:300,slidesToShow:2,slidesToScroll:2,adaptiveHeight:true,responsive:[{breakpoint:767,settings:{slidesToShow:1,slidesToScroll:1}}]});})} $(function(){setTimeout(function(){initCaseStudiesCarousel();},1000);});})(window.jQuery,window,document);;; (function($,window,document){$(function(){$('.m-companydetailsquote .e-mobtitle').each(function(){$(this).on('click',function(){$(this).siblings('.e-inner').slideToggle();$(this).toggleClass('open');});});});})(window.jQuery,window,document);;; (function($,window,document){function init(){var originalHeight=$('.m-contactprofiles .e-more').outerHeight();var originalText=$('.m-contactprofiles .e-toggle span').text();if($('.m-contactprofiles .e-more').children().length>0){$('.m-contactprofiles .e-more').css({'height':'100px'});$('.m-contactprofiles .e-toggle span').on('click',function(){if(!$('.m-contactprofiles .e-more').hasClass('open')){$('.m-contactprofiles .e-more').animate({'height':originalHeight+'px'},300).addClass('open');$(this).text('Show less -');}else{$(this).text(originalText);$('.m-contactprofiles .e-more').animate({'height':'100px'},500).removeClass('open');}});}else{$('.m-contactprofiles .e-more, .m-contactprofiles .e-toggle').remove('.m-contactprofiles .e-more, .m-contactprofiles .e-toggle');}} $(function(){setTimeout(function(){init();},500);});})(window.jQuery,window,document);;; (function($,window,document){$(window).on('load',function(){$('.m-campusmap .popup-slider').slick({dots:false,arrows:false,fade:true,rows:0,slide:'.e-item',draggable:false,});$('.m-campusmap .popup-slider').on('init',function(){$('.m-campusmap .popup').hide();$('.m-campusmap .e-iteminfo').hide();}) setTimeout(function(){$('.m-campusmap .popup-slider .item-slider').each(function(){$(this).slick({dots:true,arrows:false,rows:0,slide:'span'});});$('.m-campusmap .e-iteminfo .slider').slick({dots:false,prevArrow:'',nextArrow:'',asNavFor:'.m-campusmap .popup-slider'});},10);$('.m-campusmap .e-pin').on('click',function(){console.log('clicked pin');var slideno=$(this).data('location');$('.m-campusmap .e-iteminfo, .m-campusmap .popup').show();$('.e-pin').hide();$('.m-campusmap .e-iteminfo .slider').slick('slickGoTo',slideno-1);$('.m-campusmap .popup-slider').slick('slickGoTo',slideno-1);$('.m-campusmap .e-iteminfo .slider').slick('resize');$('.m-campusmap .popup-slider').slick('resize');$('.m-campusmap .popup-slider .item-slider').slick('resize');});$('.m-campusmap .popup .e-close').on('click',function(){$('.m-campusmap .popup').fadeOut();$('.m-campusmap .e-iteminfo').fadeOut("fast",function(){$('.e-pin').show();});});});$(window).resize(function(){$('.m-campusmap .e-iteminfo .slider').slick('resize');$('.m-campusmap .popup-slider').slick('resize');$('.m-campusmap .popup-slider .item-slider').slick('resize');});})(window.jQuery,window,document);;; function imageTextReveal(){const readMoreBtns=document.querySelectorAll('[data-module="readmore"]');if(!readMoreBtns)return;function handleToggleReveal(event){event.preventDefault();const target=event.currentTarget;const toggleParent=target.closest('.truncated');const toggleTarget=toggleParent.querySelector('.truncated__inner');if(toggleTarget.classList.contains('is-expanded')){toggleTarget.classList.remove('is-expanded');target.textContent='Read more +';}else{toggleTarget.classList.add('is-expanded');target.textContent='Read less -';}} readMoreBtns.forEach((btn)=>{btn.addEventListener('click',handleToggleReveal);})} imageTextReveal();;; (function($,window,document){$(function(){var $ppc=$('.progress-pie-chart'),percent=parseInt($ppc.data('percent')),deg=360*percent/100;if(percent>50){$ppc.addClass('gt-50');}else if(percent===0){$ppc.addClass('gt-0');} $('.ppc-progress-fill').css('transform','rotate('+deg+'deg)');var $smallppc=$('.small-progress-pie-chart'),smallpercent=parseInt($smallppc.data('percent')),smalldeg=360*smallpercent/100;if(smallpercent>50){$smallppc.addClass('gt-50');}else if(smallpercent===0){$smallppc.addClass('gt-0');} $('.small-ppc-progress-fill').css('transform','rotate('+smalldeg+'deg)');});})(window.jQuery,window,document);;; (function($,window,document){function init(){$('.m-imagetextoverlay__slides').slick({arrows:true,dots:false,arrows:true,adaptiveHeight:false,infinite:false,prevArrow:'',nextArrow:''});} $(function(){setTimeout(function(){init();},800);});})(window.jQuery,window,document);;; (function($,window,document){$(function(){const targetWidth=window.matchMedia("(max-width: 768px)");;const zoomElements=document.querySelectorAll('.m-infographic');function initZoom(){if(targetWidth){zoomElements.forEach((zoom)=>{zoom=$('.zoom').magnify({touchBottomOffset:90});});}else{zoom.destroy();}} function checkViewport(){if(targetWidth){initZoom();}else{zoom.destroy();}} window.addEventListener('resize',checkViewport);initZoom();});})(window.jQuery,window,document);;; (function($,window,document){$(function(){$('.m-latesttweets .e-carousel').each(function(){$(this).slick({dots:true,rows:0,slide:'.e-item',slidesToShow:4,slidesToScroll:4,arrows:false,autoplay:false,responsive:[{breakpoint:991,settings:{slidesToShow:3,slidesToScroll:3,infinite:true,dots:true,arrows:false}},{breakpoint:767,settings:{slidesToShow:2,slidesToScroll:2,infinite:true,dots:true,arrows:false}},{breakpoint:480,settings:{slidesToShow:1,slidesToScroll:1,arrows:false}}]});});});})(window.jQuery,window,document);;; (function($,window,document){$(function(){if($('body').hasClass('osw')){$('.m-iconcarousel .e-carousel').each(function(){$(this).slick({dots:true,rows:0,slide:'.e-item',slidesToShow:4,slidesToScroll:4,arrows:true,autoplay:false,prevArrow:'',nextArrow:'',responsive:[{breakpoint:767,settings:{slidesToShow:3,slidesToScroll:3,infinite:true,dots:true,arrows:false}},{breakpoint:480,settings:{slidesToShow:1,slidesToScroll:1,arrows:false}}]});});}else{$('.m-iconcarousel .e-carousel').each(function(){$(this).slick({dots:true,rows:0,slide:'.e-item',slidesToShow:5,slidesToScroll:5,arrows:true,autoplay:false,prevArrow:'',nextArrow:'',responsive:[{breakpoint:1500,settings:{slidesToShow:4,slidesToScroll:4,infinite:true,dots:true,arrows:false}},{breakpoint:767,settings:{slidesToShow:3,slidesToScroll:3,infinite:true,dots:true,arrows:false}},{breakpoint:480,settings:{slidesToShow:1,slidesToScroll:1,arrows:false}}]});});}});})(window.jQuery,window,document);;; (function($,window,document){$(function(){function authors(){$('.authors .e-carousel').each(function(){$(this).slick({dots:true,rows:0,slide:'.slide',slidesToShow:1,slidesToScroll:1,arrows:false,autoplay:false});});} function highlightsIcons(){$('.js-highlightsicons-carousel').each(function(){var $carousel=$(this);if(!$carousel.hasClass('slick-initialized')){var slideCount=$carousel.children('.slide').length;var slidesToShow=4;var showDots=slidesToShow',nextArrow:'',responsive:[{breakpoint:1024,settings:{slidesToShow:3,slidesToScroll:3,dots:true,}},{breakpoint:768,settings:{slidesToShow:2,slidesToScroll:2,dots:true,}},{breakpoint:600,settings:{slidesToShow:1,slidesToScroll:1,adaptiveHeight:true,dots:true,}}]});}});} authors();highlightsIcons();});})(window.jQuery,window,document);;; (function($){$(function(){$(".m-newslettersignup").each(function(){const $root=$(this);const btn=$root.find("button[type=submit]");$(btn).on("click",function(e){e.preventDefault();$root.find("[js-emailaddress-error]").hide();$root.find("[js-newsletter-error]").hide();$root.find("[js-subscribed]").hide();let acceptPrivacyPolicy=$root.find("[js-accept-privacy-policy]").prop("checked");if(!acceptPrivacyPolicy){$root.find("[js-checkbox-error]").show();return;}else{$root.find("[js-checkbox-error]").hide();} let emailAddress=$root.find("[js-email-address]").val();if(emailAddress===""){$root.find("[js-emailaddress-error]").show();return;} if(emailAddress!==""&&acceptPrivacyPolicy){let listId=$root.data("list-id");$.post("/umbraco/api/NewsletterApi/Add",{emailAddress:emailAddress,acceptPrivacyPolicy:acceptPrivacyPolicy,currentPageId:currentPageId,listId:listId},function(){$root.find("[js-subscribed]").show();$root.find("form").hide();}).fail(function(){$root.find("[js-newsletter-error]").show();});}});});});})(window.jQuery);;; (function($,window,document){function init(){const statsPanelSlick=document.querySelectorAll('.m-statspanel');var timeOutFunction;function resizeCompleteCheck(){let widthOutput=window.innerWidth;const slickWrappers=document.querySelectorAll('.m-statspanel .slick-initialized');if(widthOutput<=1279&&slickWrappers.length===0){statsPanelSlick.forEach((el)=>initSlick(el));} if(widthOutput>=1280&&slickWrappers.length){$('.m-statspanel__items').slick('unslick');}} window.addEventListener("resize",()=>{clearTimeout(timeOutFunction);timeOutFunction=setTimeout(resizeCompleteCheck,500);});function initSlick(el){const slider=el.querySelector('.m-statspanel__items');var $sliderVar=$(slider);$sliderVar.slick({arrows:false,slidesToShow:3,slidesToScroll:3,infinite:true,dots:true,responsive:[{breakpoint:1024,settings:{slidesToShow:2,slidesToScroll:2}},{breakpoint:600,settings:{slidesToShow:1,slidesToScroll:1}}]});} if(window.matchMedia("(max-width: 1279px)").matches){statsPanelSlick.forEach((el)=>initSlick(el));}} $(function(){setTimeout(function(){init();},500);});})(window.jQuery,window,document);;; (function($,window,document){$(function(){setTimeout(function(){if($('.m-propertydetails-bottom .e-text .inner').height()<150){$('.m-propertydetails-bottom .e-text .inner').contents().unwrap();$('.m-propertydetails-bottom .e-text .more').remove();}},600);$('.m-propertydetails-top .more, .m-propertydetails-bottom .more').on('click',function(){if(!$(this).siblings().hasClass('open')){$(this).siblings('.inner').addClass('open');var totalHeight;totalHeight=0 $(this).siblings('.inner').children('p').each(function(){totalHeight+=$(this).outerHeight()+20;});$(this).siblings('.inner').css({"height":$(this).siblings('.inner'),"max-height":9999}).animate({"height":totalHeight});$(this).html('Read less -');return false;}else{$(this).html('Read more +');$(this).siblings('.inner').removeClass('open').css({"height":'auto',"max-height":140}).animate({"height":140});}});$('.m-propertydetails-top .e-gallery .main-carousel').on('init reInit afterChange',function(event,slick,currentSlide,nextSlide){var i=(currentSlide?currentSlide:0)+1;$('.m-propertydetails-top .e-gallery .total-carousel').text(i+' of '+slick.slideCount);});$('.m-propertydetails-top .e-gallery .main-carousel').slick({slidesToShow:1,slidesToScroll:1,arrows:true,fade:true,dots:false,adaptiveHeight:true,asNavFor:'.m-propertydetails-top .e-gallery .nav-carousel',prevArrow:'',nextArrow:''});var centerModeChildren;if($('.m-propertydetails-top .e-gallery .nav-carousel img').length>3){centerModeChildren=true;}else{centerModeChildren=false;} $('.m-propertydetails-top .e-gallery .nav-carousel').slick({slidesToShow:3,slidesToScroll:1,asNavFor:'.m-propertydetails-top .e-gallery .main-carousel',dots:false,centerMode:centerModeChildren,focusOnSelect:true,arrows:false});$('.m-propertydetails-top .e-close').on('click',function(){$('.m-propertydetails-top .e-text .m-tabs .nav-tabs li, .m-propertydetails-top .e-text .m-tabs .nav-tabs li a').removeClass('active');$('.m-propertydetails-top .e-text .m-tabs .tab-pane').removeClass('active');$(this).hide();});$('.m-propertydetails-top .e-text .m-tabs .nav-tabs li').on('click',function(){$('.m-propertydetails-top .e-close').show();});});})(window.jQuery,window,document);;; (function($,window,document){function init(){$('.m-homepagebanner .e-cta').slick({arrows:false,slidesToShow:4,slidesToScroll:4,rows:0,slide:'a',responsive:[{breakpoint:767,settings:{slidesToShow:2,slidesToScroll:2,infinite:true,dots:true}}]});var firstVideo=$('#videoItem-1 iframe').attr('src');var secondVideo=$('#videoItem-2 iframe').attr('src');var thirdVideo=$('#videoItem-3 iframe').attr('src');var fourthVideo=$('#videoItem-4 iframe').attr('src');$('.m-homepagebanner .e-play').on('click',function(e){e.preventDefault();var activeVideo=$('.m-homepagebanner .e-videooverlay .tab-pane.active iframe').attr('src');$('.m-homepagebanner .e-videooverlay .tab-pane.active iframe').attr('src',activeVideo+'?autoplay=1');$('body').addClass('fixed');$('.m-homepagebanner .e-videooverlay').slideDown(function(){$('.m-homepagebanner .e-videooverlay .wrapper').fadeIn();});});$('.m-homepagebanner .e-close').on('click',function(){$('.m-homepagebanner .e-videooverlay .wrapper').fadeOut(function(){$('.m-homepagebanner .e-videooverlay').slideUp(function(){$('body').removeClass('fixed');});$('#videoItem-1 iframe').attr('src',firstVideo);$('#videoItem-2 iframe').attr('src',secondVideo);$('#videoItem-3 iframe').attr('src',thirdVideo);$('#videoItem-4 iframe').attr('src',fourthVideo);});});$('.m-homepagebanner .e-videooverlay .wrapper .inner .nav-tabs li a').on('click',function(){$('#videoItem-1 iframe').attr('src',firstVideo);$('#videoItem-2 iframe').attr('src',secondVideo);$('#videoItem-3 iframe').attr('src',thirdVideo);$('#videoItem-4 iframe').attr('src',fourthVideo);setTimeout(function(){var activeVideo=$('.m-homepagebanner .e-videooverlay .tab-pane.active iframe').attr('src');$('.m-homepagebanner .e-videooverlay .tab-pane.active iframe').attr('src',activeVideo+'?autoplay=1');},500);});} $(function(){setTimeout(function(){init();},1000);});})(window.jQuery,window,document);;; (function($,window,document){function init(){$('.text-media-carousel .text-media-carousel__description').slick({arrows:false,dots:false,draggable:false,asNavFor:'.text-media-carousel .text-media-carousel__slides'});$('.text-media-carousel .text-media-carousel__slides').on('init reInit afterChange',function(event,slick,currentSlide,nextSlide){var i=(currentSlide?currentSlide:0)+1;$('.text-media-carousel .text-media-carousel__count').text(i+' / '+slick.slideCount);});$('.text-media-carousel .text-media-carousel__slides').slick({arrows:true,dots:false,asNavFor:'.text-media-carousel .text-media-carousel__description',prevArrow:'',nextArrow:'',});} $(function(){setTimeout(function(){init();},500);});})(window.jQuery,window,document);;; (function($,window,document){function init(){const sliderEl=document.querySelectorAll('[data-module="threecardcarousel"]');if(!sliderEl)return;$(sliderEl).slick({arrows:true,dots:true,slidesToShow:3,slidesToScroll:3,infinite:false,prevArrow:'',nextArrow:'',responsive:[{breakpoint:991,settings:{slidesToShow:2,slidesToScroll:2,arrows:false}},{breakpoint:500,settings:{slidesToShow:1,slidesToScroll:1,arrows:false}}]});} $(function(){setTimeout(function(){init();},500);});})(window.jQuery,window,document);;; (function($,window,document){$(function(){$('.m-venue .e-gallery .main-carousel').on('init reInit afterChange',function(event,slick,currentSlide,nextSlide){var i=(currentSlide?currentSlide:0)+1;$('.m-venue .e-gallery .total-carousel').text(i+' of '+slick.slideCount);});$('.m-venue .e-gallery .main-carousel').slick({slidesToShow:1,slidesToScroll:1,arrows:true,fade:true,dots:false,adaptiveHeight:true,asNavFor:'.m-venue .e-gallery .nav-carousel',prevArrow:'',nextArrow:''});var centerModeChildren;if($('.m-venue.e-gallery .nav-carousel img').length>3){centerModeChildren=true;}else{centerModeChildren=false;} $('.m-venue .e-gallery .nav-carousel').slick({slidesToShow:3,slidesToScroll:1,asNavFor:'.m-venue .e-gallery .main-carousel',dots:false,centerMode:centerModeChildren,focusOnSelect:true,arrows:false});});})(window.jQuery,window,document);;; (function($,window,document){const documentBody=document.body;const navTriggerBtn=document.getElementById('nav-toggle-btn');function fixRTEButtonClasses(){const getAllNestedSpanLinks=document.querySelectorAll('a > span.btn');const getAllParentSpanLinks=document.querySelectorAll('p > span.btn');if(getAllNestedSpanLinks.length>=1){getAllNestedSpanLinks.forEach(y=>{y.parentNode.classList.add('btn');y.classList.remove('btn');})} if(getAllParentSpanLinks.length>=1){getAllParentSpanLinks.forEach(els=>{if(els.firstChild.tagName==='A'){els.firstChild.classList.add('btn');els.classList.remove('btn');}})}} function lazyLoadImage(){const observer=lozad('.lozad',{loaded:function(el){fitVidsTarget();}});observer.observe();} function umbracoFormsCheckboxing(){const checkboxContainers=document.querySelectorAll('.checkboxlist');checkboxContainers.forEach(container=>{const selectAllBox=container.querySelector('input[data-select-all]');const itemCheckboxes=container.querySelectorAll('input[type="checkbox"]:not([data-select-all])');if(!selectAllBox||itemCheckboxes.length===0){return;} selectAllBox.addEventListener('change',()=>{itemCheckboxes.forEach(item=>{item.checked=selectAllBox.checked;});});itemCheckboxes.forEach(item=>{item.addEventListener('change',()=>{const allAreChecked=Array.from(itemCheckboxes).every(cb=>cb.checked);selectAllBox.checked=allAreChecked;});});const allAreCheckedInitially=Array.from(itemCheckboxes).every(cb=>cb.checked);selectAllBox.checked=allAreCheckedInitially;});var checkboxes=document.querySelectorAll('.umbraco-forms-container input[type="checkbox"][id]:not(span.checkboxlist input[type="checkbox"][id])');checkboxes.forEach((checkbox)=>{var checked=checkbox.checked;var checkedValue=checked;var checkboxesWithSameName=document.querySelectorAll(`.umbraco-forms-container *[name="${checkbox.name}"]`);checkboxesWithSameName.forEach((cb)=>{cb.checked=checked;cb.value=checkedValue;});});checkboxes.forEach((checkbox)=>{checkbox.addEventListener('input',(event)=>{var checked=checkbox.checked;var checkedValue=checked;var checkboxesWithSameName=document.querySelectorAll(`.umbraco-forms-container *[name="${checkbox.name}"]`);checkboxesWithSameName.forEach((cb)=>{cb.checked=checked;cb.value=checkedValue;});});});} function toggleNavReset(){Array.from(document.querySelectorAll('.nav-primary__link--btn')).forEach(function(el){const elTarget=document.getElementById(el.getAttribute('aria-controls')) el.setAttribute("aria-expanded","false");elTarget.classList.remove('js-expanded');});} function ariaExpandedToggle(link,target){let state=link.getAttribute("aria-expanded");if(state==='false'){link.setAttribute("aria-expanded","true");target.classList.add('js-expanded');target.addEventListener('focusout',(event)=>handleFocusOut(event,link,target));}else{link.setAttribute("aria-expanded","false");target.classList.remove('js-expanded');target.removeEventListener('focusout',(event)=>handleFocusOut(event,link,target));}} function handleFocusOut(event,link,content){if(!content.contains(event.relatedTarget)){console.log('close everything') link.setAttribute('aria-expanded',false);content.classList.remove('js-expanded');}} function globalNavToggles(link,content){const state=link.getAttribute('aria-expanded');if(state==='false'){toggleNavReset();link.setAttribute('aria-expanded',true);content.classList.add('js-expanded');content.addEventListener('focusout',(event)=>handleFocusOut(event,link,content));documentBody.classList.add('takeover');}else{link.setAttribute('aria-expanded',false);content.classList.remove('js-expanded');content.removeEventListener('focusout',(event)=>handleFocusOut(event,link,content));documentBody.classList.remove('takeover');}} function navToggle(){if(!navTriggerBtn)return;const navWrapper=document.getElementById(navTriggerBtn.getAttribute('aria-controls'));navTriggerBtn.addEventListener('click',(event)=>{event.preventDefault();ariaExpandedToggle(navTriggerBtn,navWrapper);toggleNavReset();searchCheck();}) documentBody.classList.remove('takeover');} function navToggleLinks(){const toggleLinks=document.querySelectorAll('.nav-primary__link--btn');if(!toggleLinks)return;toggleLinks.forEach((link)=>{const toggleLink=link;const toggleTarget=document.getElementById(toggleLink.getAttribute('aria-controls'));toggleLink.addEventListener('click',(event)=>{event.preventDefault();globalNavToggles(toggleLink,toggleTarget);searchCheck();});})} function searchToggle(){const searchTriggerBtn=document.getElementById('search-toggle-btn');if(!searchTriggerBtn)return;searchTriggerBtn.addEventListener('click',()=>{navTriggerBtn.setAttribute("aria-expanded","false");navWrapper.classList.remove('js-expanded');documentBody.classList.remove('takeover');toggleNavReset();});} function searchCheck(){const searchTriggerBtn=document.getElementById('search-toggle-btn');if(!searchTriggerBtn)return const searchWrapper=document.getElementById(searchTriggerBtn.getAttribute('aria-controls'));let searchState=searchTriggerBtn.getAttribute("aria-expanded");if(searchState==='true'){searchTriggerBtn.setAttribute("aria-expanded","false");searchWrapper.classList.remove('js-expanded');}} function headerToggles(){$('.e-myhielink.dropdownlink').on('click',function(e){e.preventDefault();$('.h-myhiedropdown').slideToggle();$(document).keyup(function(e){if(e.key==="Escape"){$('.h-myhiedropdown').slideUp();}});});} function headerScroll(){if(!document.body.classList.contains('hie')){$(window).on('load, scroll',function(){if($(window).scrollTop()>$('header').outerHeight()){$('header').addClass('slim');}else{$('header').removeClass('slim');}});}} function fitVidsTarget(){if($('iframe[src*="youtube"]').length>0){$('iframe[src*="youtube"]').parent().fitVids();} if($('iframe[src*="vimeo"]').length>0){$('iframe[src*="vimeo"]').parent().fitVids();}} function cardListLoad(){$('.m-cardlist .row').each(function(){var cardItems=$(this).children();cardItems.each(function(index){var delayNumber=index*100;$(this).attr('data-aos-delay',delayNumber);});});} function videoPopup(){$('a.play').magnificPopup({disableOn:0,type:'iframe',mainClass:'mfp-fade',removalDelay:160,preloader:false,fixedContentPos:false});$('span.play').magnificPopup({delegate:'a',disableOn:0,type:'iframe',mainClass:'mfp-fade',removalDelay:160,preloader:false,fixedContentPos:false});} function copyToClipboard(){const copyToClipboardBtn=document.querySelectorAll('.share-link__btn');if(!copyToClipboardBtn)return;copyToClipboardBtn.forEach((btn)=>{btn.addEventListener('click',async(event)=>{const clickedItem=event.currentTarget;const clickedNote=clickedItem.nextElementSibling;try{await navigator.clipboard.writeText(window.location.href);clickedNote.classList.add('active');setTimeout(()=>{clickedNote.classList.remove('active');},2000);}catch(err){console.error('Failed to copy text to clipboard: ',err);}});})} function oswButtons(){$('.osw span.btn').each(function(){$(this).parent().addClass('no-style');});} function anchorTags(){$("a").on('click',function(event){if(this.hash!==""&&!this.parent().hasClass('.nav-item')||!this.classList.contains('play')){event.preventDefault();var hash=this.hash;$('html, body').animate({scrollTop:$(hash).offset().top+230},800,function(){window.location.hash=hash;});}});} function mapInfoClose(){$('.m-mapview .e-iteminfo .close').on('click',function(){$(this).closest('.e-iteminfo').attr('data-status','closed');});} function propertyListing(){var cardItem=$('.l-propertylisting #locationsTab .row .m-cardcomponent a');cardItem.on('click',function(){$('.m-tabs ul.nav-tabs li').removeClass('active');$('#list-tab').parent().addClass('active');$('html, body').animate({scrollTop:$('#list-tab').offset().top-150},1000);});} function propertyAlerts(){$('.property-alerts').on('click',function(e){e.preventDefault();$('body').addClass('fixed');$('.m-propertyalerts').slideDown({start:function(){$(this).css({display:'flex'})},done:function(){$('.m-propertyalerts .popup').fadeIn();}});});$('.m-propertyalerts .e-close').on('click',function(){$('.m-propertyalerts .popup').fadeOut(function(){$('.m-propertyalerts').slideUp(function(){$('body').removeClass('fixed');});});});} function toggleDropdownLinks(){const allToggles=document.querySelectorAll('.toggle-link');if(!allToggles)return allToggles.forEach((toggleLink)=>{const toggleTarget=document.getElementById(toggleLink.getAttribute('aria-controls'));let expanded=toggleLink.hasAttribute('aria-expanded')?(toggleLink.getAttribute('aria-expanded')==='true'):false;toggleLink.addEventListener('click',(event)=>{event.preventDefault();if(expanded){toggleTarget.classList.remove('toggle-link__target--visible');expanded=!expanded;toggleLink.setAttribute('aria-expanded',expanded);}else{toggleTarget.classList.add('toggle-link__target--visible');expanded=!expanded;toggleLink.setAttribute('aria-expanded',expanded);}});})} $(function(){lazyLoadImage();umbracoFormsCheckboxing();navToggle();navToggleLinks();searchToggle();toggleDropdownLinks();headerToggles();headerScroll();fitVidsTarget();videoPopup();oswButtons();copyToClipboard();fixRTEButtonClasses();mapInfoClose();propertyListing();propertyAlerts();});$.extend(true,$.magnificPopup.defaults,{iframe:{patterns:{youtube:{index:'youtube.com',id:function(src){var mt=src.match(/v=([^&]+)(&(.*))?/);if(mt) return mt[1]+'?'+mt[3];mt=src.match(/embed\/([^\?\/]+)(\?(.*))?/);if(mt) return mt[1]+'?'+mt[3];},src:'//www.youtube.com/embed/%id%&autoplay=1&rel=0'}}},callbacks:{beforeOpen:function(){if($(window).width()<700) this.st.focus=false;}}});})(window.jQuery,window,document);;; (function(){'use strict';const OVERLAY_ID='ufp-overlay';const HTML_ACTIVE_CLASS='ufp-uploading-active';const FORM_SELECTOR='div.umbraco-forms-form form';const FILE_INPUT_SELECTOR='input[type="file"]:not([disabled])';const SUBMIT_SELECTOR='button[type="submit"], input[type="submit"]';const css=` /* Root toggle that subtly blurs/greys the page behind the overlay */ html.${HTML_ACTIVE_CLASS} body > *:not(#ufp-overlay) { filter: blur(2px) grayscale(20%); transition: filter 200ms ease-in; } /* Full-screen overlay */ #${OVERLAY_ID} { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.33); display: none; z-index: 2147482999; /* very high to sit above CMS UI */ } html.${HTML_ACTIVE_CLASS} #${OVERLAY_ID} { display: grid; place-items: center; } /* Center panel */ #${OVERLAY_ID} .ufp-panel { background: #ffffff; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); padding: 28px 32px; width: min(92vw, 460px); text-align: center; border: 1px solid rgba(0,0,0,0.06); z-index: 2147483000; /* very high to sit above CMS UI */ } #${OVERLAY_ID} .ufp-spinner { display: block; margin: 0 auto 0 auto; width: 100px; height: 100px; } #${OVERLAY_ID} .ufp-spinner { animation: ufp-spin 0.9s linear infinite; transform-origin: 50px 50px; } @keyframes ufp-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } #${OVERLAY_ID} .ufp-text { font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji"; color: #23408f; font-size: 16px; line-height: 1.4; margin: 1.2em 0 0 0; font-weight: 700; } `;function injectStyle(){if(document.getElementById('ufp-style'))return;const style=document.createElement('style');style.id='ufp-style';style.textContent=css;document.head.appendChild(style);} function createOverlay(){if(document.getElementById(OVERLAY_ID))return;const overlay=document.createElement('div');overlay.id=OVERLAY_ID;overlay.setAttribute('aria-hidden','true');const spinnerSVG=` `;overlay.innerHTML=`
${spinnerSVG}

Uploading your files, please wait...

`;document.body.appendChild(overlay);} function showOverlay(){console.log("Showing Form Spinner overlay");const overlay=document.getElementById(OVERLAY_ID);if(!overlay)return;document.documentElement.classList.add(HTML_ACTIVE_CLASS);overlay.dataset.show='true';overlay.removeAttribute('aria-hidden');} function hideOverlay(){console.log("Hiding Form Spinner overlay");const overlay=document.getElementById(OVERLAY_ID);if(!overlay)return;overlay.dataset.show='false';overlay.setAttribute('aria-hidden','true');document.documentElement.classList.remove(HTML_ACTIVE_CLASS);} function hasFileInputs(root){return!!root.querySelector(FILE_INPUT_SELECTOR);} function bindToForm(form){console.log("Binding to Umbraco Form.");if(form.dataset.ufpBound==='1')return;form.dataset.ufpBound='1';if(!hasFileInputs(form))return;console.log("Adding Submit Event Listener.") form.querySelectorAll(SUBMIT_SELECTOR)[0].addEventListener('click',function submitOnClick(e){console.log("Umbraco Form - Submit Event started");showOverlay();});} function init(){console.log("Initialising Umbraco Form submitter");injectStyle();createOverlay();document.querySelectorAll(FORM_SELECTOR).forEach(bindToForm);} if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',init,{once:true});}else{init();}})();;;