{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./js/src/index.js","webpack:///./js/src/libs/details-pollyfill.js","webpack:///./js/src/modules/_clear-umb-forms.js","webpack:///./js/src/modules/address-lookup.js","webpack:///./js/src/modules/updateURLParameter.js","webpack:///./js/src/modules/_burger-menu.js","webpack:///./js/src/modules/_mobile-nav-expander.js","webpack:///./js/src/modules/_mobile-search-expander.js","webpack:///./js/src/modules/_main-nav.js","webpack:///./js/src/modules/_functions.js","webpack:///./js/src/modules/_collapse-disable.js","webpack:///./js/src/modules/_variables.js","webpack:///./js/src/modules/_load-more.js","webpack:///./js/src/modules/_deferred_image_load.js","webpack:///./js/src/modules/_slide-animation-triggers.js","webpack:///./js/src/modules/_disabled-elements.js","webpack:///./js/src/modules/_browse-aloud-remote.js","webpack:///./js/src/modules/_news-filters.js","webpack:///./js/src/modules/_twitter-timeline.js","webpack:///./js/src/modules/_double-back-button.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","require","window","overrideBannerText","txt","el","document","querySelector","innerText","disableSubmitButtonOnClick","btn","addEventListener","frm","$","this","closest","validate","valid","disabled","submit","monitorFAQLinks","querySelectorAll","forEach","link","e","hashPart","getAttribute","split","newID","replace","parentElement","open","setAttribute","focus","console","log","summary","id","history","pushState","title","location","pathname","event","hash","item","readyState","getScript","url","success","script","createElement","src","head","getElementsByTagName","done","onload","onreadystatechange","Function","removeChild","appendChild","fontA","fontB","fontC","FontFaceObserver","documentElement","classList","contains","Promise","all","load","then","className","cookie","jQuery","validator","methods","date","element","optional","test","setTimeout","initTextareaCounterInForms","fn","characterCounter","remainText","tooManyText","global","GOVUK","details","NATIVE_DETAILS","KEY_ENTER","KEY_SPACE","started","addEvent","node","type","callback","target","attachEvent","srcElement","removeEvent","removeEventListener","detachEvent","charCode","which","keyCode","preventDefault","returnValue","addClickEvent","nodeName","toLowerCase","click","getAncestor","match","parentNode","addDetailsPolyfill","list","container","body","length","__summary","__content","tabIndex","openAttr","style","display","__details","twisty","createTextNode","__twisty","insertBefore","firstChild","statechange","expanded","removeAttribute","nodeValue","destroy","init","$container","ClearUmbFormFields","reset","setupAddressLookup","config","getElementById","hasSelectedAddress","enableContinue","disableContinue","btnCantFindAddress","btnChangePostcode","btnManualEntry","btnReset","noResultsText","pleaseEnterAddressText","freetextAddressElementID","selectAddressText","FreetextAddressElementID","addressLine1ElementID","AddressLine1ElementID","addressLine2ElementID","AddressLine2ElementID","addressLine3ElementID","AddressLine3ElementID","townOrCityElementID","TownOrCityElementID","countyElementID","CountyElementID","postcodeElementID","PostcodeElementID","countryElementID","CountryElementID","inputFreetextAddress","currentFocus","prevAddressVal","addressFieldChange","newValue","trim","findAddress","addFocus","addressItems","getElementsByClassName","currentAddressItem","remove","add","showError","message","error","innerHTML","SecondFind","postcode","Container","undefined","resultBox","childNodes","selectBox","xmlhttp","XMLHttpRequest","DONE","status","data","JSON","parse","responseText","Items","Error","response","Description","option","Text","Type","Id","retrieveAddress","send","indexOf","addr","Line1","Line2","Line3","City","PostalCode","CountryName","populateAddress","showAddressFields","addressFields","resetAll","showPostcodeFields","stopPropagation","initAddressLookup","addressConfig","warn","updateURLParameter","param","paramVal","TheAnchor","newAdditionalURL","tempArray","baseURL","additionalURL","temp","TheParams","tmpAnchor","_mobileNavExpander","SetUpBurgerNav","nav","burgerMenu","searchToggleIcon","searchForm","height","removeProperty","SetUpMobileNavExpanders","toggleButtons","parentSpan","ul","nextElementSibling","SetUpMobileSearchExpander","_functions","SetUpMainNav","navbar","menuItems","headerContainer","toggleMainNavigation","show","topLevelListItem","findAncestor","dropdownContainer","childLinks","childLink","moveHorizontally","right","parentListItem","allListItems","sibling","getNextSibling","getPreviousSibling","linkItems","targetLink","moveVertically","down","childListItems","listItem","nextListItem","previousListItem","j","blur","sticky","offsetTop","onscroll","pageYOffset","child","cls","isDescendant","parent","elem","selector","matches","previousElementSibling","_variables","disableCollapse","width","innerWidth","SetUpCollapsePanels","footerGroups","group","breakpointWidth","newsFilters","newsFilter","breakpointWidthMD","SetupLoadMore","isSearching","buttons","resultsPane","currentPageIndex","doLoadMore","moreResults","doLoadingAnimation","params","loadMoreOptions","searchTerm","isTagSearch","pageSize","searchPageUrl","controller","method","resultsCount","srSearchResultsCount","resultsCountLabel","totalResults","arr","eval","statusText","doNoMoreResults","onerror","resultsPanes","button","lastDiv","lastDivOffset","clientHeight","innerHeight","LoadDeferredImages","items","img","dataSrc","SetupSildeTriggers","isScrolledIntoView","rect","getBoundingClientRect","elemTop","top","elemBottom","bottom","slides","SetUpDisabledElements","disabledElements","SetupBrowseAloudRemote","_baFooter","elementId","attributeNames","interval","arguments","timeout","resolve","reject","startTime","Date","now","poll","setInterval","clearInterval","attributes","attr","pollForElement","toggleBar","catch","SetupNewsFilters","filterCheckboxes","updateBasedOnCheckboxes","filterString","checkbox","checked","newURL","href","check_twttr","timeline","twitterCheckCount","twttr","widgets","createTimeline","sourceType","screenName","SetUpTwitterTimeline","DestroyTwitterTimeline","doubleBackButton","formStepInput","contactBackLink","formsBackLink","currentFormStep"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI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C,QAAU,QAE/B2Q,EAAgB5Q,MAAMC,QAAU,SAIV,MAAnB2Q,GAA2BE,EAAkB,IAE3B,MAAjBD,IACHA,EAAc7Q,MAAMC,QAAU,SAE/B2Q,EAAgB5Q,MAAMC,QAAU,aAQV,MAAnB2Q,IACHA,EAAgB5Q,MAAMC,QAAU,SAIP,YAAxBxH,SAASwC,WACZyV,IAEAjY,SAASK,iBAAiB,oBAAoB,WAC7C4X","file":"leo.site.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","\r\nrequire('./libs/details-pollyfill.js');\r\nrequire('./modules/_clear-umb-forms.js');\r\nrequire('./modules/address-lookup.js');\r\nrequire('./modules/updateURLParameter.js');\r\nrequire('./modules/_burger-menu.js');\r\nrequire('./modules/_mobile-search-expander.js');\r\nrequire('./modules/_main-nav.js');\r\nrequire('./modules/_collapse-disable.js');\r\nrequire('./modules/_load-more.js');\r\nrequire('./modules/_deferred_image_load.js');\r\nrequire('./modules/_slide-animation-triggers.js');\r\nrequire('./modules/_disabled-elements.js');\r\nrequire('./modules/_browse-aloud-remote.js');\r\nrequire('./modules/_news-filters.js');\r\nrequire('./modules/_twitter-timeline.js');\r\nrequire('./modules/_double-back-button.js');\r\n\r\n\r\n\r\nvar rev = '009';\r\n\r\n\r\n\r\n\r\n// font face observer\r\nfunction SetUpFontFaceObserver() {\r\n\r\n var fontA = new FontFaceObserver('Futura Std Book');\r\n var fontB = new FontFaceObserver('Futura Std Bold');\r\n var fontC = new FontFaceObserver('Futura Std Medium');\r\n\r\n if (document.documentElement.classList.contains('fonts-loaded')) {\r\n // fonts should be in cache\r\n } else {\r\n\r\n Promise.all([fontA.load(), fontB.load(), fontC.load()]).then(function () {\r\n document.documentElement.className += \" fonts-loaded\";\r\n // drop a cookie indicating that fonts should now be available from cache\r\n document.cookie = \"fonts-loaded=true\";\r\n });\r\n }\r\n}\r\n\r\nwindow.overrideBannerText = function(txt) {\r\n\r\n var el = document.querySelector('h1.banner__heading');\r\n\r\n if (el != null) {\r\n el.innerText = txt;\r\n }\r\n}\r\n\r\nwindow.disableSubmitButtonOnClick = function() {\r\n var btn = document.querySelector('.umbraco-forms-form .btn');\r\n\r\n if (btn) {\r\n btn.addEventListener('click', function () {\r\n\r\n // if the form is valid, disable the button to prevent double submission\r\n\r\n // var errors = document.querySelectorAll('.umbraco-forms-form .field-validation-error');\r\n var frm = $(this).closest(\"form\");\r\n\r\n frm.validate();\r\n\r\n var isFormValid = frm.valid();\r\n\r\n if (isFormValid) {\r\n btn.disabled = true;\r\n frm.submit();\r\n }\r\n\r\n return true;\r\n })\r\n }\r\n}\r\n\r\n\r\n// detect clicks on FAQ anchors and set properties on the linked element...\r\n// this is to auto-expand faq details/summary elements\r\n// cannot rely on hashchange event as LeO picked up on someone clicking the same link multiple times, not changing the hash\r\nwindow.monitorFAQLinks = function () {\r\n const faqLinks = document.querySelectorAll('a[href*=\"#FAQAnchor\"]');\r\n\r\n faqLinks.forEach(function (link) {\r\n link.addEventListener('click', function (e) {\r\n\r\n const href = link.getAttribute('href');\r\n const hashPart = href.split('#')[1]\r\n\r\n if (hashPart != '') {\r\n var newID = hashPart.replace(\"FAQAnchor\", \"FAQLabel\");\r\n var el = document.querySelector('#' + newID);\r\n if (el) {\r\n\r\n //el.scrollIntoView();\r\n el.parentElement.open = true;\r\n el.setAttribute('aria-expanded', true);\r\n el.focus();\r\n // reset the hash so that this will fire again if the user clicks the same link again\r\n // window.location.hash = newID;\r\n } else {\r\n console.log('unable to locate an element with ID ' + newID);\r\n }\r\n }\r\n })\r\n });\r\n\r\n // update the URL has to reflect expanded faq items\r\n\r\n var summaryElements = document.querySelectorAll('summary');\r\n\r\n // find all of the summary elements on the page and update the url hash id of the element when it is expanded, or remove from the url when it is closed\r\n summaryElements.forEach(function (summary) {\r\n\r\n summary.addEventListener('click', function (e) {\r\n var id = summary.getAttribute('id');\r\n\r\n if (id != null && id != '') {\r\n if (summary.parentElement.open) {\r\n //window.location.hash = '';\r\n history.pushState(\"\", document.title, window.location.pathname);\r\n } else {\r\n //window.location.hash = id;\r\n history.pushState(\"\", document.title, window.location.pathname + '#' + id);\r\n }\r\n }\r\n });\r\n });\r\n\r\n window.addEventListener(\"popstate\", (event) => {\r\n \r\n // if there is a hash in the url, expand the relevant faq item, or close any that are open\r\n if (window.location.hash) {\r\n var hash = window.location.hash;\r\n var newID = hash.replace(\"FAQAnchor\", \"FAQLabel\");\r\n\r\n var el = document.querySelector(newID);\r\n\r\n if (el) {\r\n el.parentElement.open = true;\r\n el.setAttribute('aria-expanded', true);\r\n el.focus();\r\n }\r\n } else {\r\n // find and close any open faq items\r\n\r\n var openItems = document.querySelectorAll('details[open]');\r\n openItems.forEach(function (item) {\r\n item.open = false;\r\n });\r\n }\r\n });\r\n\r\n // if the page url contains a hash, expand the relevant faq item\r\n if (window.location.hash) {\r\n var hash = window.location.hash;\r\n var newID = hash.replace(\"FAQAnchor\", \"FAQLabel\");\r\n\r\n var el = document.querySelector(newID);\r\n\r\n if (el) {\r\n el.parentElement.open = true;\r\n el.setAttribute('aria-expanded', true);\r\n el.focus();\r\n }\r\n }\r\n}\r\n\r\n\r\nif (document.readyState !== 'loading') {\r\n window.disableSubmitButtonOnClick();\r\n window.monitorFAQLinks();\r\n} else {\r\n document.addEventListener('DOMContentLoaded', function () {\r\n window.disableSubmitButtonOnClick();\r\n window.monitorFAQLinks();\r\n });\r\n}\r\n\r\n\r\n/// defferred script load\r\n/// @url {string} - the url of the script to be loaded\r\n/// @obj {object} - and instance of an object which can be used to determine if the script has already been loaded\r\n/// @success {method} - callback on script load\r\n(function () {\r\n function getScript(url, success) {\r\n\r\n var script = document.createElement('script');\r\n script.src = url;\r\n var head = document.getElementsByTagName('head')[0],\r\n done = false;\r\n script.onload = script.onreadystatechange = function () {\r\n if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')) {\r\n done = true;\r\n if (success && success instanceof Function) {\r\n success();\r\n }\r\n script.onload = script.onreadystatechange = null;\r\n head.removeChild(script);\r\n }\r\n };\r\n head.appendChild(script);\r\n }\r\n\r\n // font face loader\r\n getScript('/js/fontfaceobserver.min.js?rev=' + rev, function () {\r\n SetUpFontFaceObserver();\r\n })\r\n\r\n // jquery\r\n getScript('https://code.jquery.com/jquery-3.5.1.min.js', function () {\r\n // execure any jquery code here\r\n\r\n // bootstrap js - dependency on jquery\r\n getScript('https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js')\r\n\r\n\r\n getScript('https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.28.0/moment.min.js', function () { });\r\n\r\n\r\n // jquery validate - dependency on jquery\r\n getScript('https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.15.0/jquery.validate.min.js', function () {\r\n\r\n // jquery validate unobtrusive - dependency on jquery validate\r\n getScript('https://cdnjs.cloudflare.com/ajax/libs/jquery-validation-unobtrusive/3.2.6/jquery.validate.unobtrusive.min.js', function () {\r\n\r\n // Umbraco Forms - dependency on jquery validate and validate unob\r\n //getScript('/App_Plugins/UmbracoForms/Assets/Themes/Default/umbracoforms.js?rev=' + rev);\r\n\r\n // replace the unob validate date method with something that supports en-GB date formats\r\n jQuery.validator.methods.date = function (value, element) {\r\n var dateRegex = /^(0?[1-9]\\/|[12]\\d\\/|3[01]\\/){2}(19|20)\\d\\d$/;\r\n return this.optional(element) || dateRegex.test(value);\r\n };\r\n\r\n // custom validation\r\n getScript('/js/leo.site.custom-validation.min.js?rev=' + rev, function () { });\r\n })\r\n\r\n })\r\n\r\n // jquery unobtrusive\r\n getScript('/Scripts/jquery.unobtrusive-ajax.min.js');\r\n\r\n // lazysizes - dependancy on jquery\r\n getScript('/js/lazysizes.min.js')\r\n })\r\n\r\n\r\n // twitter\r\n getScript('https://platform.twitter.com/widgets.js')\r\n\r\n // Modernizr Clippath tests\r\n getScript('/js/src/libs/modernizr.clippath.min.js?rev=' + rev)\r\n\r\n})();\r\n\r\nfunction initTextareaCounterInForms() {\r\n\r\n if (window.jQuery && window.jQuery.fn.characterCounter) {\r\n\r\n var form = $('.form-group');\r\n\r\n if (form) {\r\n\r\n $('[data-char-limit]').characterCounter({\r\n remainText: 'Characters remaining',\r\n tooManyText: 'Characters too many'\r\n });\r\n }\r\n }\r\n else {\r\n window.setTimeout(initTextareaCounterInForms, 500);\r\n }\r\n}\r\nwindow.setTimeout(initTextareaCounterInForms, 500);","//
polyfill\n// http://caniuse.com/#feat=details\n\n// FF Support for HTML5's
and \n// https://bugzilla.mozilla.org/show_bug.cgi?id=591737\n\n// http://www.sitepoint.com/fixing-the-details-element/\n\n; (function (global) {\n 'use strict'\n\n var GOVUK = global.GOVUK || {}\n\n GOVUK.details = {\n NATIVE_DETAILS: typeof document.createElement('details').open === 'boolean',\n KEY_ENTER: 13,\n KEY_SPACE: 32,\n\n // Create a started flag so we can prevent the initialisation\n // function firing from both DOMContentLoaded and window.onload\n started: false,\n\n // Add event construct for modern browsers or IE\n // which fires the callback with a pre-converted target reference\n addEvent: function (node, type, callback) {\n if (node.addEventListener) {\n node.addEventListener(type, function (e) {\n callback(e, e.target)\n }, false)\n } else if (node.attachEvent) {\n node.attachEvent('on' + type, function (e) {\n callback(e, e.srcElement)\n })\n }\n },\n\n removeEvent: function (node, type) {\n if (node.removeEventListener) {\n node.removeEventListener(type, function (e) {\n }, false)\n } else if (node.detachEvent) {\n node.detachEvent('on' + type, function (e) {\n })\n }\n },\n\n // Cross-browser character code / key pressed\n charCode: function (e) {\n return (typeof e.which === 'number') ? e.which : e.keyCode\n },\n\n // Cross-browser preventing default action\n preventDefault: function (e) {\n if (e.preventDefault) {\n e.preventDefault()\n } else {\n e.returnValue = false\n }\n },\n\n // Handle cross-modal click events\n addClickEvent: function (node, callback) {\n GOVUK.details.addEvent(node, 'keypress', function (e, target) {\n // When the key gets pressed - check if it is enter or space\n if (GOVUK.details.charCode(e) === GOVUK.details.KEY_ENTER || GOVUK.details.charCode(e) === GOVUK.details.KEY_SPACE) {\n if (target.nodeName.toLowerCase() === 'summary') {\n // Prevent space from scrolling the page\n // and enter from submitting a form\n GOVUK.details.preventDefault(e)\n // Click to let the click event do all the necessary action\n if (target.click) {\n target.click()\n } else {\n // except Safari 5.1 and under don't support .click() here\n callback(e, target)\n }\n }\n }\n })\n\n // Prevent keyup to prevent clicking twice in Firefox when using space key\n GOVUK.details.addEvent(node, 'keyup', function (e, target) {\n if (GOVUK.details.charCode(e) === GOVUK.details.KEY_SPACE) {\n if (target.nodeName === 'SUMMARY') {\n GOVUK.details.preventDefault(e)\n }\n }\n })\n\n GOVUK.details.addEvent(node, 'click', function (e, target) {\n callback(e, target)\n })\n },\n\n // Get the nearest ancestor element of a node that matches a given tag name\n getAncestor: function (node, match) {\n do {\n if (!node || node.nodeName.toLowerCase() === match) {\n break\n }\n node = node.parentNode\n } while (node)\n\n return node\n },\n\n // Initialisation function\n addDetailsPolyfill: function (list, container) {\n container = container || document.body\n // If this has already happened, just return\n // else set the flag so it doesn't happen again\n if (GOVUK.details.started) {\n return\n }\n GOVUK.details.started = true\n // Get the collection of details elements, but if that's empty\n // then we don't need to bother with the rest of the scripting\n if ((list = container.getElementsByTagName('details')).length === 0) {\n return\n }\n // else iterate through them to apply their initial state\n var n = list.length\n var i = 0\n for (i; i < n; i++) {\n var details = list[i]\n\n // Save shortcuts to the inner summary and content elements\n details.__summary = details.getElementsByTagName('summary').item(0)\n details.__content = details.getElementsByTagName('div').item(0)\n\n if (!details.__summary || !details.__content) {\n return\n }\n // If the content doesn't have an ID, assign it one now\n // which we'll need for the summary's aria-controls assignment\n if (!details.__content.id) {\n details.__content.id = 'details-content-' + i\n }\n\n // Add ARIA role=\"group\" to details\n details.setAttribute('role', 'group')\n\n // Add role=button to summary\n details.__summary.setAttribute('role', 'button')\n\n // Add aria-controls\n details.__summary.setAttribute('aria-controls', details.__content.id)\n\n // Set tabIndex so the summary is keyboard accessible for non-native elements\n // http://www.saliences.com/browserBugs/tabIndex.html\n if (!GOVUK.details.NATIVE_DETAILS) {\n details.__summary.tabIndex = 0\n }\n\n // Detect initial open state\n var openAttr = details.getAttribute('open') !== null\n if (openAttr === true) {\n details.__summary.setAttribute('aria-expanded', 'true')\n // details.__content.setAttribute('aria-hidden', 'false')\n } else {\n details.__summary.setAttribute('aria-expanded', 'false')\n // details.__content.setAttribute('aria-hidden', 'true')\n if (!GOVUK.details.NATIVE_DETAILS) {\n details.__content.style.display = 'none'\n }\n }\n\n // Create a circular reference from the summary back to its\n // parent details element, for convenience in the click handler\n details.__summary.__details = details\n\n // If this is not a native implementation, create an arrow\n // inside the summary\n if (!GOVUK.details.NATIVE_DETAILS) {\n var twisty = document.createElement('i')\n\n if (openAttr === true) {\n twisty.className = 'arrow arrow-open'\n twisty.appendChild(document.createTextNode('\\u25bc'))\n } else {\n twisty.className = 'arrow arrow-closed'\n twisty.appendChild(document.createTextNode('\\u25ba'))\n }\n\n details.__summary.__twisty = details.__summary.insertBefore(twisty, details.__summary.firstChild)\n // details.__summary.__twisty.setAttribute('aria-hidden', 'true')\n }\n }\n\n // Bind a click event to handle summary elements\n GOVUK.details.addClickEvent(container, function (e, summary) {\n if (!(summary = GOVUK.details.getAncestor(summary, 'summary'))) {\n return true\n }\n return GOVUK.details.statechange(summary)\n })\n },\n\n // Define a statechange function that updates aria-expanded and style.display\n // Also update the arrow position\n statechange: function (summary) {\n var expanded = summary.__details.__summary.getAttribute('aria-expanded') === 'true'\n // var hidden = summary.__details.__content.getAttribute('aria-hidden') === 'true'\n\n summary.__details.__summary.setAttribute('aria-expanded', (expanded ? 'false' : 'true'))\n // summary.__details.__content.setAttribute('aria-hidden', (hidden ? 'false' : 'true'))\n\n if (!GOVUK.details.NATIVE_DETAILS) {\n summary.__details.__content.style.display = (expanded ? 'none' : '')\n\n var hasOpenAttr = summary.__details.getAttribute('open') !== null\n if (!hasOpenAttr) {\n summary.__details.setAttribute('open', 'open')\n } else {\n summary.__details.removeAttribute('open')\n }\n }\n\n if (summary.__twisty) {\n summary.__twisty.firstChild.nodeValue = (expanded ? '\\u25ba' : '\\u25bc')\n summary.__twisty.setAttribute('class', (expanded ? 'arrow arrow-closed' : 'arrow arrow-open'))\n }\n\n return true\n },\n\n destroy: function (node) {\n GOVUK.details.removeEvent(node, 'click')\n },\n\n // Bind two load events for modern and older browsers\n // If the first one fires it will set a flag to block the second one\n // but if it's not supported then the second one will fire\n init: function ($container) {\n GOVUK.details.addEvent(document, 'DOMContentLoaded', GOVUK.details.addDetailsPolyfill)\n GOVUK.details.addEvent(window, 'load', GOVUK.details.addDetailsPolyfill)\n }\n }\n global.GOVUK = GOVUK\n\n GOVUK.details.init();\n\n})(window)","\n///\n/// Disabled Elements\n///\n/// Add a tabindex of -1 to all disabled elements\n/// so that focus cannot be passed to the element \n\nwindow.ClearUmbFormFields = function () {\r\n\r\n var umbForm = document.querySelector('.umbraco-forms-page');\r\n\r\n if (umbForm != null) {\r\n\r\n var frm = document.querySelector('.umbraco-forms-form form');\r\n\r\n if (frm != null) {\r\n \r\n frm.reset();\r\n }\r\n\r\n } else {\r\n //console.log('No form found');\r\n }\r\n}\n\nfunction disableUmbFormSubmitButton() {\n\r\n var btn = document.querySelector('.umbraco-forms-form form button[type=submit].btn--primary');\r\n\r\n // console.log(btn);\r\n\r\n if (btn != null) {\r\n btn.setAttribute('disabled', 'disabled');\r\n //console.log('submit button found');\r\n } else {\r\n //console.log('no submit button found');\r\n }\r\n}\n\nwindow.addEventListener('popstate', function (event) {\n // Clear form fields when the user navigates back\n window.ClearUmbFormFields();\n});\nwindow.addEventListener(\"pageshow\", () => {\r\n window.ClearUmbFormFields();\r\n});","//\n\n\nwindow.setupAddressLookup = function (config) {\n\n\t// we need to see if an address is to be entered or if it is being reviewed\n\tif (document.getElementById('BuildingAndStreetLine1').value.length > 0) {\n\t\twindow.hasSelectedAddress = true;\n\t\tenableContinue();\n\t} else {\n\t\twindow.hasSelectedAddress = false;\n\t\tdisableContinue();\n\t}\n\n\tvar maxAddressDisplayCount = 50;\n\n\tvar btnCantFindAddress = document.getElementById('BtnCantFindAddress');\n\tvar btnChangePostcode = document.getElementById('BtnChangePostcode');\n\tvar btnManualEntry = document.getElementById('BtnManualEntry');\n\tvar btnReset = document.getElementById('BtnAnotherPostcode');\n\n\t// strings...\n\tvar pleaseEnterAddressText = config.pleaseEnterAddressText;\n\tvar noResultsText = \"We could not find this address, please try entering it again or click the I can't find my address in the list link\";\n\tvar selectAddressText = config.selectAddressText;\n\tvar freetextAddressElementID = config.FreetextAddressElementID\n\tvar addressLine1ElementID = config.AddressLine1ElementID\n\tvar addressLine2ElementID = config.AddressLine2ElementID\n\tvar addressLine3ElementID = config.AddressLine3ElementID\n\tvar townOrCityElementID = config.TownOrCityElementID\n\tvar countyElementID = config.CountyElementID\n\tvar postcodeElementID = config.PostcodeElementID\n\tvar countryElementID = config.CountryElementID\n\n\tvar inputFreetextAddress = document.getElementById(freetextAddressElementID);\n\n\tvar currentFocus = 0;\n\tvar prevAddressVal = '';\n\n\t// \n\t// trying different events to catch autofilled addresses\n\tinputFreetextAddress.addEventListener('blur', addressFieldChange, false);\n\tinputFreetextAddress.addEventListener('change', addressFieldChange, false);\n\tinputFreetextAddress.addEventListener('input', addressFieldChange, false);\n\n\tinputFreetextAddress.addEventListener('keydown', function (e) {\n\t\tif (e.keyCode == 40) {\n\t\t\t// down\n\t\t\tcurrentFocus++;\n\t\t\taddFocus();\n\t\t} else if (e.keyCode == 38) {\n\t\t\t// up\n\t\t\tcurrentFocus--;\n\t\t\taddFocus();\n\t\t} else if (e.keyCode == 13) {\n\t\t\t// enter\n\t\t\tvar currentAddressItem = document.getElementsByClassName('address-option--selected');\n\t\t\tif (currentAddressItem.length > 0) {\n\t\t\t\tvar id = currentAddressItem[0].getAttribute('data-address-id');\n\t\t\t\tif (id != '') {\n\t\t\t\t\tretrieveAddress(id);\n\t\t\t\t}\n\t\t\t}\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\treturn false;\n\t\t} else if (e.keyCode != 32) {\n\t\t\t// not the spacebar\n\t\t\treturn false;\n\t\t} else {\n\t\t\t// lookup is now triggered on change event\n\t\t\t// console.log('looking up postcode...');\n\t\t\t// currentFocus = 0;\n\t\t\t// findAddress()\n\t\t}\n\t})\n\n\tinputFreetextAddress.addEventListener('focus', function (e) {\n\t\tcurrentFocus = 0;\n\t\tfindAddress()\n\t})\n\n\tbtnCantFindAddress.addEventListener('click', function () {\n\t\tresetAll();\n\t\twindow.hasSelectedAddress = true;\n\t\tenableContinue();\n\t\tshowAddressFields();\n\t})\n\n\tbtnChangePostcode.addEventListener('click', function () {\n\t\tresetAll();\n\t})\n\n\tbtnManualEntry.addEventListener('click', function () {\n\t\twindow.hasSelectedAddress = true;\n\t\tenableContinue();\n\t\tshowAddressFields();\n\t})\n\n\tbtnReset.addEventListener('click', function () {\n\t\tresetAll();\n\t})\n\n\tfunction addressFieldChange() {\n\t\tvar newValue = inputFreetextAddress.value;\n\n\t\t// the value to lookup has changed\n\t\tif (newValue.trim() != prevAddressVal) {\n\n\t\t\tprevAddressVal = newValue.trim();\n\n\t\t\tcurrentFocus = 0;\n\t\t\tfindAddress()\n\t\t}\n\t}\n\n\tfunction addFocus() {\n\n\t\tvar addressItems = document.getElementsByClassName('address-option');\n\t\tvar currentAddressItem = document.getElementsByClassName('address-option--selected')\n\n\t\tif (currentFocus < 0) {\n\t\t\tcurrentFocus = 0;\n\t\t}\n\n\t\tif (currentFocus > addressItems.length) {\n\t\t\tcurrentFocus = 0;\n\t\t}\n\n\t\tif (currentAddressItem.length) {\n\t\t\tcurrentAddressItem[0].classList.remove('address-option--selected');\n\t\t}\n\n\t\taddressItems[currentFocus - 1].classList.add('address-option--selected');\n\t}\n\n\tfunction showError(message) {\n\t\tvar error = document.getElementById(\"AddressLookupErrorMessage\");\n\t\terror.innerHTML = message;\n\t\terror.style.display = \"block\";\n\t\terror.classList.remove('field-validation-valid');\n\n\t\tsetTimeout(function () {\n\t\t\terror.style.display = \"none\";\n\t\t\terror.classList.add('field-validation-valid');\n\t\t}, 10000)\n\t}\n\n\tfunction findAddress(SecondFind) {\n\n\t\twindow.hasSelectedAddress = false;\n\n\t\tdisableContinue();\n\n\t\tvar postcode = inputFreetextAddress.value;\n\n\t\tif (postcode === '') {\n\t\t\t// showError(pleaseEnterAddressText);\n\t\t\treturn;\n\t\t}\n\n\t\tvar Container = \"\";\n\n\t\tif (SecondFind !== undefined) {\n\t\t\tContainer = SecondFind;\n\t\t}\n\n\n\t\tvar resultBox = document.getElementById(\"AddressLookupResult\");\n\n\t\t// remove any existing results\n\t\tif (resultBox.childNodes.length > 0) {\n\t\t\tvar selectBox = document.getElementById(\"mySelect\");\n\t\t\tselectBox.parentNode.removeChild(selectBox)\n\t\t}\n\n\t\tif (postcode != '') {\n\n\t\t\tvar xmlhttp = new XMLHttpRequest();\n\n\t\t\txmlhttp.onreadystatechange = function () {\n\t\t\t\tif (xmlhttp.readyState == XMLHttpRequest.DONE) { // XMLHttpRequest.DONE == 4\n\n\t\t\t\t\thideLoader();\n\n\t\t\t\t\tif (xmlhttp.status == 200) {\n\t\t\t\t\t\tvar data = JSON.parse(xmlhttp.responseText);\n\n\t\t\t\t\t\t// remove any existing results\n\t\t\t\t\t\tif (resultBox.childNodes.length > 0) {\n\t\t\t\t\t\t\tvar selectBox = document.getElementById(\"mySelect\");\n\t\t\t\t\t\t\tselectBox.parentNode.removeChild(selectBox)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (data.Items.length == 1 && typeof (data.Items[0].Error) != \"undefined\") {\n\t\t\t\t\t\t\tshowError(response.Items[0].Description);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (data.Items.length == 0) {\n\t\t\t\t\t\t\t\tshowError(noResultsText);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\n\t\t\t\t\t\t\t\tif ((Container == SecondFind) || (data.Items && data.Items.length < maxAddressDisplayCount)) {\n\n\t\t\t\t\t\t\t\t\tvar list = document.createElement(\"div\");\n\t\t\t\t\t\t\t\t\tlist.setAttribute(\"id\", \"mySelect\");\n\t\t\t\t\t\t\t\t\tresultBox.appendChild(list);\n\n\t\t\t\t\t\t\t\t\t// build selectable list of address results\n\t\t\t\t\t\t\t\t\tfor (var i = 0; i < data.Items.length; i++) {\n\t\t\t\t\t\t\t\t\t\tvar option = document.createElement(\"div\");\n\t\t\t\t\t\t\t\t\t\toption.innerText = data.Items[i].Text + \" \" + data.Items[i].Description;\n\t\t\t\t\t\t\t\t\t\toption.setAttribute(\"class\", 'address-option ' + data.Items[i].Type);\n\t\t\t\t\t\t\t\t\t\toption.setAttribute(\"data-address-id\", data.Items[i].Id);\n\n\t\t\t\t\t\t\t\t\t\t// click to select address\n\t\t\t\t\t\t\t\t\t\toption.addEventListener('click', function () {\n\t\t\t\t\t\t\t\t\t\t\tvar id = this.getAttribute('data-address-id');\n\t\t\t\t\t\t\t\t\t\t\tif (id != '') {\n\t\t\t\t\t\t\t\t\t\t\t\tretrieveAddress(id);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\t\t\t\tlist.appendChild(option);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// show the address options\n\t\t\t\t\t\t\t\t\tdocument.getElementById('AddressLookupResult').style.display = '';\n\n\t\t\t\t\t\t\t\t\t// show the manual entry button\n\t\t\t\t\t\t\t\t\tbtnCantFindAddress.style.display = '';\n\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// too many addresses to display\n\t\t\t\t\t\t\t\t\tconsole.log('More than ' + maxAddressDisplayCount + ' addresses returned.');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (xmlhttp.status == 400) {\n\t\t\t\t\t\t// doAddressesNoFound();\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// doAddressesNoFound();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tshowLoader();\n\t\t\txmlhttp.open(\"GET\", \"/Umbraco/Surface/AddressLookup/LookupAddresses?postcode=\" + postcode + \"&container=\" + Container, true);\n\t\t\txmlhttp.send();\n\t\t}\n\t};\n\n\tfunction retrieveAddress(id) {\n\t\t//\n\n\t\tif (id != '') {\n\n\t\t\tif (id.indexOf('-') > 0) {\n\n\t\t\t\tfindAddress(id);\n\n\t\t\t} else {\n\n\t\t\t\tvar xmlhttp = new XMLHttpRequest();\n\n\t\t\t\txmlhttp.onreadystatechange = function () {\n\t\t\t\t\tif (xmlhttp.readyState == XMLHttpRequest.DONE) { // XMLHttpRequest.DONE == 4\n\t\t\t\t\t\tif (xmlhttp.status == 200) {\n\n\t\t\t\t\t\t\tvar data = JSON.parse(xmlhttp.responseText);\n\n\t\t\t\t\t\t\tif (data == '' || data.Items.length == 0) {\n\t\t\t\t\t\t\t\tshowError(noResultsText);\n\t\t\t\t\t\t\t} else if (data.Items.length == 1 && typeof (data.Items[0].Error) != \"undefined\") {\n\t\t\t\t\t\t\t\tshowError(data.Items[0].Description);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tvar res = data.Items[0];\n\n\t\t\t\t\t\t\t\tpopulateAddress(res);\n\n\t\t\t\t\t\t\t\tshowAddressFields();\n\n\t\t\t\t\t\t\t\t// hide the address options\n\t\t\t\t\t\t\t\tdocument.getElementById('AddressLookupResult').style.display = 'none';\n\n\t\t\t\t\t\t\t\t// hide the manual entry button\n\t\t\t\t\t\t\t\tbtnCantFindAddress.style.display = 'none';\n\n\t\t\t\t\t\t\t\t// hide the manula entry button\n\t\t\t\t\t\t\t\tdocument.getElementById('BtnManualEntry').style.display = 'none';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (xmlhttp.status == 400) {\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\txmlhttp.open(\"GET\", \"/Umbraco/Surface/AddressLookup/ResolveAddress?id=\" + id, true);\n\t\t\t\txmlhttp.send();\n\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction showLoader() {\n\t\tvar loader = document.getElementById('Loader').style.display = '';\n\t}\n\n\tfunction hideLoader() {\n\t\tvar loader = document.getElementById('Loader').style.display = 'none';\n\t}\n\n\t//\n\t// Populate address fields based on a result\n\t//\n\tfunction populateAddress(addr) {\n\n\t\tif (document.getElementById(addressLine1ElementID) != null)\n\t\t\tdocument.getElementById(addressLine1ElementID).value = addr.Line1;\n\n\t\tif (document.getElementById(addressLine2ElementID) != null)\n\t\t\tdocument.getElementById(addressLine2ElementID).value = addr.Line2;\n\n\t\tif (document.getElementById(addressLine3ElementID) != null)\n\t\t\tdocument.getElementById(addressLine3ElementID).value = addr.Line3;\n\n\t\tif (document.getElementById(townOrCityElementID) != null)\n\t\t\tdocument.getElementById(townOrCityElementID).value = addr.City;\n\n\t\tif (document.getElementById(countyElementID) != null)\n\t\t\tdocument.getElementById(countyElementID).value = '';\n\n\t\tif (document.getElementById(postcodeElementID) != null)\n\t\t\tdocument.getElementById(postcodeElementID).value = addr.PostalCode;\n\n\t\tif (document.getElementById(countryElementID) != null)\n\t\t\tdocument.getElementById(countryElementID).value = addr.CountryName;\n\n\t\thasSelectedAddress = true;\n\n\t\tenableContinue();\n\t}\n\n\t//\n\t// Clear address fields\n\t//\n\tfunction clearAddress() {\n\n\t\tif (document.getElementById(addressLine1ElementID) != null)\n\t\t\tdocument.getElementById(addressLine1ElementID).value = '';\n\n\t\tif (document.getElementById(addressLine2ElementID) != null)\n\t\t\tdocument.getElementById(addressLine2ElementID).value = '';\n\n\t\tif (document.getElementById(addressLine3ElementID) != null)\n\t\t\tdocument.getElementById(addressLine3ElementID).value = '';\n\n\t\tif (document.getElementById(townOrCityElementID) != null)\n\t\t\tdocument.getElementById(townOrCityElementID).value = '';\n\n\t\tif (document.getElementById(countyElementID) != null)\n\t\t\tdocument.getElementById(countyElementID).value = '';\n\n\t\tif (document.getElementById(postcodeElementID) != null)\n\t\t\tdocument.getElementById(postcodeElementID).value = '';\n\n\t\tif (document.getElementById(countryElementID) != null)\n\t\t\tdocument.getElementById(countryElementID).value = '';\n\t}\n\n\t//\n\t// Show all of the address fields and hide the address lookup\n\t//\n\tfunction showAddressFields() {\n\t\tvar addressFields = document.getElementsByClassName('address-field');\n\n\t\t// show the address fields\n\t\tfor (var i = 0; i < addressFields.length; i++) {\n\t\t\taddressFields[i].style.display = 'block';\n\t\t}\n\n\t\t// hide the lookup fields\n\t\tdocument.getElementById('AddressLookupFields').style.display = 'none';\n\n\t\t// show the change button\n\t\tdocument.getElementById('BtnChangePostcode').style.display = '';\n\t}\n\n\t//\n\t// Hide all of the address fields and show the address lookup\n\t//\n\tfunction showPostcodeFields() {\n\t\tvar addressFields = document.getElementsByClassName('address-field');\n\n\t\t// hide the address fields\n\t\tfor (var i = 0; i < addressFields.length; i++) {\n\t\t\taddressFields[i].style.display = 'none';\n\t\t}\n\n\t\t// show the lookup fields\n\t\tdocument.getElementById('AddressLookupFields').style.display = '';\n\n\t\t// hide the change button\n\t\tdocument.getElementById('BtnChangePostcode').style.display = 'none';\n\t}\n\n\t//\n\t// Reset to allow another lookup\n\t//\n\tfunction resetAll() {\n\t\twindow.hasSelectedAddress = false;\n\t\tdisableContinue();\n\t\tcurrentFocus = 0;\n\t\tinputFreetextAddress.value = '';\n\t\tclearAddress();\n\t\tshowPostcodeFields();\n\t\t// show the Lookup and manual entry buttons\n\t\tbtnManualEntry.style.display = 'block';\n\t}\n\n\t//\n\t// Disable the Continue buton\n\t//\n\tfunction disableContinue() {\n\t\tvar btn = document.getElementById(\"NextButton\");\n\n\t\tif (btn) {\n\t\t\tbtn.disabled = true;\n\t\t}\n\t}\n\n\t//\n\t// Enable the Continue buton\n\t//\n\tfunction enableContinue() {\n\t\tvar btn = document.getElementById(\"NextButton\");\n\n\t\tif (btn) {\n\t\t\tbtn.disabled = false;\n\t\t}\n\t}\n}\n\nwindow.initAddressLookup = function () {\n\n\tthis.console.log('Initialising address lookup...');\n\n\n\tif (typeof (addressConfig) !== 'undefined') {\n\t\twindow.setupAddressLookup(addressConfig);\n\t} else {\n\t\tconsole.warn('Address Lookup configuration not found');\n\t}\n\n\t//setTimeout(function () {\n\t//\tif (typeof (addressConfig) !== 'undefined') {\n\t//\t\twindow.setupAddressLookup(addressConfig);\n\t//\t} else {\n\t//\t\tconsole.warn('Address Lookup configuration not found');\n\t//\t}\n\t//}, 50);\n}\n\nif (document.readyState !== 'loading') {\n\twindow.initAddressLookup();\n} else {\n\tdocument.addEventListener('DOMContentLoaded', function () {\n\t\twindow.initAddressLookup();\n\t});\n}","\n//\n\nwindow.updateURLParameter = function (url, param, paramVal) {\n\t\n\tvar TheAnchor = null;\n\tvar newAdditionalURL = \"\";\n\tvar tempArray = url.split(\"?\");\n\tvar baseURL = tempArray[0];\n\tvar additionalURL = tempArray[1];\n\tvar temp = \"\";\n\n\tif (additionalURL) {\n\t\tvar tmpAnchor = additionalURL.split(\"#\");\n\t\tvar TheParams = tmpAnchor[0];\n\t\tTheAnchor = tmpAnchor[1];\n\t\tif (TheAnchor)\n\t\t\tadditionalURL = TheParams;\n\n\t\ttempArray = additionalURL.split(\"&\");\n\n\t\tfor (var i = 0; i < tempArray.length; i++) {\n\t\t\tif (tempArray[i].split('=')[0] != param) {\n\t\t\t\tnewAdditionalURL += temp + tempArray[i];\n\t\t\t\ttemp = \"&\";\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\tvar tmpAnchor = baseURL.split(\"#\");\n\t\tvar TheParams = tmpAnchor[0];\n\t\tTheAnchor = tmpAnchor[1];\n\n\t\tif (TheParams)\n\t\t\tbaseURL = TheParams;\n\t}\n\n\tif (TheAnchor)\n\t\tparamVal += \"#\" + TheAnchor;\n\n\tvar rows_txt = temp + \"\" + param + \"=\" + paramVal;\n\treturn baseURL + \"?\" + newAdditionalURL + rows_txt;\n}","\n///\n/// Burger menu\n///\n \nimport { SetUpMobileNavExpanders } from './_mobile-nav-expander';\n\nwindow.SetUpBurgerNav = function() {\n\n\tvar nav = document.querySelector('#MobileNavigation');\n\tvar burgerMenu = document.querySelector('#BurgerMenu');\n\tvar menuItems = document.querySelectorAll('#MobileNavigationList .mobile-navigation__list-item--level-1 a');\t\n\tvar expandedClassName = 'expanded';\n\n\tvar searchToggleIcon = document.querySelector('.magnifying-glass');\n\tvar searchForm = document.querySelector('#SearchForm')\n\n\t////\n\t//// remove the display none from the mobile nav\n\t//// after a short delay\n\t//window.setTimeout(function () {\n\t//\tdocument.querySelector('.mobile-navigation__drop-area').style.display = 'block';\n\t//\tdocument.querySelector('.mobile-navigation__drop-area').style.removeProperty('height');\n\t//}, 300);\n\t\n\n\t//\n\t// Add a click event handler to the burger menu element to toggle the showing and hiding of the nav elemet\n\t//\n\tburgerMenu.addEventListener('click', function () {\n\t\tif (nav.classList.contains(expandedClassName)) {\n\t\t\t// menu is already expanded -> close it\n\t\t\tthis.setAttribute('aria-expanded', 'false');\n\t\t\tnav.classList.remove(expandedClassName);\n\t\t\tburgerMenu.classList.remove(expandedClassName);\n\t\t\tdocument.querySelector('.mobile-navigation__drop-area').style.display = 'none';\n\t\t\tdocument.querySelector('.mobile-navigation__drop-area').style.height = 0;\n\t// set tabindexes\n\t\t\t// toggleTabIndex(menuItemsScope, false);\n\t\t} else {\n\t\t\t// is the search box in view?\n\t\t\tif (searchForm.classList.contains(expandedClassName)) {\n\t\t\t\t// close it\n\t\t\t\tsearchForm.classList.remove(expandedClassName);\n\t\t\t\tsearchToggleIcon.setAttribute('aria-expanded', 'false');\n\t\t\t}\n\t\t\t// menu is not expanded -> open it\n\t\t\tnav.classList.add(expandedClassName);\n\t\t\tburgerMenu.classList.add(expandedClassName);\n\t\t\tthis.setAttribute('aria-expanded', 'true');\n\n\t\t\t\t\tdocument.querySelector('.mobile-navigation__drop-area').style.display = 'block';\n\t\tdocument.querySelector('.mobile-navigation__drop-area').style.removeProperty('height');\n\n// set tabindexes\n\t\t\t// toggleTabIndex(menuItemsScope, true);\n\t\t\t// set focus on the first menu item\n\t\t\t// todo : menuItems[0].focus();\n\t\t}\n\t});\n\n\tSetUpMobileNavExpanders();\n}\n\nif (document.readyState !== 'loading') {\n\twindow.SetUpBurgerNav();\n} else {\n\tdocument.addEventListener('DOMContentLoaded', function () {\n\t\twindow.SetUpBurgerNav();\n\t});\n}","\r\n///\r\n/// Mobile navigation - expand and collapse child navigation lists\r\n///\r\n\r\nexport function SetUpMobileNavExpanders() {\r\n\r\n\tvar toggleButtons = document.querySelectorAll('#MobileNavigationList .mobile-navigation__expander');\r\n\tvar expandedClassName = 'expanded';\r\n\r\n\t//\r\n\t// Add a click event handler to each expand/collapse button to act on the related child list\r\n\t//\r\n\tif (toggleButtons.length) {\r\n\t\tfor (var i = 0; i < toggleButtons.length; i++) {\r\n\r\n\t\t\tvar button = toggleButtons[i];\r\n\r\n\t\t\tbutton.addEventListener('click', function () {\r\n\r\n\t\t\t\tthis.classList.add('clicked');\r\n\r\n\r\n\t\t\t\tvar parentSpan = this.parentNode; // findAncestor(button, '.mobile-navigation__list-item-wrapper');\r\n\r\n\t\t\t\tif (parentSpan) {\r\n\r\n\t\t\t\t\tvar ul = parentSpan.nextElementSibling; // n.b. this requires a pollyfill\r\n\r\n\t\t\t\t\tif (ul) {\r\n\r\n\t\t\t\t\t\tif (this.classList.contains(expandedClassName)) {\r\n\t\t\t\t\t\t\t// child list is expanded -> close it\r\n\t\t\t\t\t\t\tthis.setAttribute('aria-expanded', 'false');\r\n\t\t\t\t\t\t\tthis.classList.remove(expandedClassName);\r\n\t\t\t\t\t\t\tul.setAttribute('aria-hidden', 'true');\r\n\t\t\t\t\t\t\tul.classList.remove(expandedClassName);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// child list is not expanded -> open it\r\n\t\t\t\t\t\t\tthis.setAttribute('aria-expanded', 'true');\r\n\t\t\t\t\t\t\tthis.classList.add(expandedClassName);\r\n\t\t\t\t\t\t\tul.setAttribute('aria-hidden', 'false');\r\n\t\t\t\t\t\t\tul.classList.add(expandedClassName);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t}\r\n\t}\r\n\r\n}","\n///\n/// Search Magnifying Glass Icon\n/// i.e. mobile search form expander\n///\n \n\nwindow.SetUpMobileSearchExpander = function() {\n\n\tvar searchToggleIcon = document.querySelector('.magnifying-glass');\n\tvar searchForm = document.querySelector('#SearchForm')\n\tvar expandedClassName = 'expanded';\n\n\tvar nav = document.querySelector('#MobileNavigation');\n\tvar burgerMenu = document.querySelector('#BurgerMenu');\n\t\n\t//\n\t// Add a click event handler to the search expander icon element to toggle the showing and hiding of the search bar\n\t//\n\tsearchToggleIcon.addEventListener('click', function () {\n\t\tif (searchForm.classList.contains(expandedClassName)) {\n\t\t\t// search is already expanded -> close it\n\t\t\tthis.setAttribute('aria-expanded', 'false');\n\t\t\tsearchForm.classList.remove(expandedClassName);\n\t\t} else {\n\t\t\t// is the dropdown navigation opened?\n\t\t\tif (nav.classList.contains(expandedClassName)) {\n\t\t\t\t// close it\n\t\t\t\tnav.classList.remove(expandedClassName);\n\t\t\t\tburgerMenu.classList.remove(expandedClassName);\n\t\t\t\tburgerMenu.setAttribute('aria-expanded', 'false');\n\t\t\t}\n\t\t\t// search is not expanded -> open it\n\t\t\tsearchForm.classList.add(expandedClassName);\n\t\t\tthis.setAttribute('aria-expanded', 'true');\n\t\t}\n\t});\n}\n\nif (document.readyState !== 'loading') {\n\twindow.SetUpMobileSearchExpander();\n} else {\n\tdocument.addEventListener('DOMContentLoaded', function () {\n\t\twindow.SetUpMobileSearchExpander();\n\t});\n}","\n///\n/// Main navigation \n///\n/// Toggle the TabIndex and Aria-Hidden attribute values of menu list items based on user actions\n///\n\n// todo :\n// - moveHorizontally could do with refactoring\n// moveHorizontally - would be nice if the 'right' parameter was a 'direction' enum; Left | Right\n\nimport { findAncestor, getNextSibling, getPreviousSibling } from './_functions';\n\n//const directions = {\n//\tUP: 'up',\n//\tDOWN: 'down',\n//\tLEFT: 'left',\n//\tRIGHT: 'right'\n//}\n\nwindow.SetUpMainNav = function () {\n\n\tvar navbar = document.getElementById(\"MainNavigation\"); // HeaderContainer\n\tvar menuItems = document.querySelectorAll('.main-navigation__list-item-link');\n\tvar headerContainer = document.querySelector('.header-container');\n\n\t// toggle Aria and TabIndex attribute values on DOM elements relating to the link\n\tfunction toggleMainNavigation(link, show) {\n\n\t\t// find the top-level list item\n\t\tvar topLevelListItem = findAncestor(link, 'main-navigation__list-item--level-1')\n\n\t\tif (topLevelListItem) {\n\n\t\t\t// find the nested dropdown container and toggle the aria-hidden\n\t\t\tvar dropdownContainer = topLevelListItem.querySelectorAll('.main-navigation__dropdown');\n\n\t\t\tif (dropdownContainer) {\n\t\t\t\tif (show) {\n\t\t\t\t\tdropdownContainer[0].setAttribute('aria-hidden', 'false');\n\t\t\t\t} else {\n\t\t\t\t\tdropdownContainer[0].setAttribute('aria-hidden', 'true');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// and find every link and toggle the tabindex\n\t\t\tvar childLinks = dropdownContainer[0].querySelectorAll('.main-navigation__list-item-link');\n\n\t\t\tfor (var l = 0; l < childLinks.length; l++) {\n\n\t\t\t\tvar childLink = childLinks[l];\n\n\t\t\t\tif (show) {\n\t\t\t\t\tchildLink.setAttribute('tabindex', '0');\n\t\t\t\t} else {\n\t\t\t\t\tchildLink.setAttribute('tabindex', '-1');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// move horizontally through either the top level navigaiton links or the child navigation group depending on where current focus is\n\tfunction moveHorizontally(link, right) {\n \n\t\t// is this a top level list item link\n\t\tif (link.classList.contains('main-navigation__list-item-link--level-1')) {\n\n\t\t\t// find the parent level-1 li\n\t\t\tvar parentListItem = findAncestor(link, 'main-navigation__list-item--level-1');\n\t\t\t// find the parent ul\n\t\t\tvar parentUnorderedList = findAncestor(parentListItem, 'main-navigation__list');\n\t\t\t// and all the list items in this unordered list\n\t\t\tvar allListItems = parentUnorderedList.querySelectorAll('.main-navigation__list-item--level-1');\n\n\t\t\tif (allListItems.length > 1) {\n\n\t\t\t\tvar sibling = null;\n\n\t\t\t\tif (right)\n\t\t\t\t\tsibling = getNextSibling(parentListItem, '.main-navigation__list-item--level-1');\n\t\t\t\telse\n\t\t\t\t\tsibling = getPreviousSibling(parentListItem, '.main-navigation__list-item--level-1');\n\n\t\t\t\tif (sibling) {\n\n\t\t\t\t\t// find all links in this list\n\t\t\t\t\tvar linkItems = sibling.querySelectorAll('.main-navigation__list-item-link--level-1');\n\n\t\t\t\t\tif (linkItems) {\n\t\t\t\t\t\t// find the first link in this list\n\t\t\t\t\t\tvar targetLink = linkItems[0];\n\t\t\t\t\t\t// and select it\n\t\t\t\t\t\tif (targetLink) {\n\t\t\t\t\t\t\ttargetLink.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\t// at the last group, move to the first item...\n\t\t\t\t\t// find the first list item group\n\t\t\t\t\tvar listItem = null;\n\n\t\t\t\t\tif (right)\n\t\t\t\t\t\tlistItem = allListItems[0];\n\t\t\t\t\telse\n\t\t\t\t\t\tlistItem = allListItems[(allListItems.length - 1)];\n\n\t\t\t\t\t// find all links in this list\n\t\t\t\t\tvar linkItems = listItem.querySelectorAll('.main-navigation__list-item-link--level-1');\n\n\t\t\t\t\tif (linkItems) {\n\t\t\t\t\t\t// find the first link in this list\n\t\t\t\t\t\tvar targetLink = linkItems[0];\n\t\t\t\t\t\t// and select it\n\t\t\t\t\t\tif (targetLink) {\n\t\t\t\t\t\t\ttargetLink.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// find the parent level-2 li\n\t\t\tvar parentListItem = findAncestor(link, 'main-navigation__list-item--level-2');\n\t\t\t// find the parent ul\n\t\t\tvar parentUnorderedList = findAncestor(parentListItem, 'main-navigation__child-list--level-2');\n\t\t\t// and all the list items in this unordered list\n\t\t\tvar allListItems = parentUnorderedList.querySelectorAll('.main-navigation__list-item--level-2');\n\t\t\t// are there more than 1 groups\n\t\t\tif (allListItems.length > 1) {\n\t\t\t\tif (parentListItem) {\n\n\t\t\t\t\tvar sibling = null;\n\n\t\t\t\t\tif (right)\n\t\t\t\t\t\tsibling = getNextSibling(parentListItem, '.main-navigation__list-item--level-2');\n\t\t\t\t\telse\n\t\t\t\t\t\tsibling = getPreviousSibling(parentListItem, '.main-navigation__list-item--level-2');\n\n\t\t\t\t\tif (sibling) {\n\n\t\t\t\t\t\t// find all links in this list\n\t\t\t\t\t\tvar linkItems = sibling.querySelectorAll('.main-navigation__list-item-link--level-2');\n\n\t\t\t\t\t\tif (linkItems) {\n\t\t\t\t\t\t\t// find the first link in this list\n\t\t\t\t\t\t\tvar targetLink = linkItems[0];\n\t\t\t\t\t\t\t// and select it\n\t\t\t\t\t\t\tif (targetLink) {\n\t\t\t\t\t\t\t\ttargetLink.focus();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// at the last group, move to the first item...\n\t\t\t\t\t\t// find the first list item group\n\t\t\t\t\t\tvar listItem = null;\n\n\t\t\t\t\t\tif (right)\n\t\t\t\t\t\t\tlistItem = allListItems[0];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tlistItem = allListItems[(allListItems.length - 1)];\n\n\t\t\t\t\t\t// find all links in this list\n\t\t\t\t\t\tvar linkItems = listItem.querySelectorAll('.main-navigation__list-item-link--level-2');\n\n\t\t\t\t\t\tif (linkItems) {\n\t\t\t\t\t\t\t// find the first link in this list\n\t\t\t\t\t\t\tvar targetLink = linkItems[0];\n\t\t\t\t\t\t\t// and select it\n\t\t\t\t\t\t\tif (targetLink) {\n\t\t\t\t\t\t\t\ttargetLink.focus();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction moveVertically(link, down) {\n\n\t\t// is this a top level list item link\n\t\tif (link.classList.contains('main-navigation__list-item-link--level-1')) {\n\t\t\t// up => do nothing\n\t\t\t// down -> move focus to the first link item in the first child list\n\n\t\t\tif (down) {\n\t\t\t\t// find the parent level-1 li\n\t\t\t\tvar parentListItem = findAncestor(link, 'main-navigation__list-item--level-1');\n\t\t\t\t// find all child level2 lists\n\t\t\t\tvar childListItems = parentListItem.querySelectorAll('.main-navigation__list-item--level-2');\n\t\t\t\tif (childListItems) {\n\t\t\t\t\t// find the first list item\n\t\t\t\t\tvar listItem = childListItems[0];\n\t\t\t\t\tif (listItem) {\n\t\t\t\t\t\tvar linkItems = listItem.querySelectorAll('.main-navigation__list-item-link--level-2');\n\t\t\t\t\t\tif (linkItems) {\n\t\t\t\t\t\t\t// find the first link in this list\n\t\t\t\t\t\t\tvar targetLink = linkItems[0];\n\t\t\t\t\t\t\t// and select it\n\t\t\t\t\t\t\tif (targetLink) {\n\t\t\t\t\t\t\t\ttargetLink.focus();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t// focus is on the non-top level links\n\t\t\tvar parentListItem = findAncestor(link, 'main-navigation__list-item');\n\t\t\tvar nextListItem = getNextSibling(parentListItem, '.main-navigation__list-item')\n\t\t\tvar previousListItem = getPreviousSibling(parentListItem, '.main-navigation__list-item')\n\t\t\tvar childListItems = parentListItem.querySelectorAll('.main-navigation__list-item');\n\n\t\t\tif (down) {\n\t\t\t\t// move down...\n\n\t\t\t\t// if there are child links to this list item...\n\t\t\t\tif (childListItems && childListItems.length > 0) {\n\n\t\t\t\t\t// find all of the links in the first child list item\n\t\t\t\t\tvar linkItems = childListItems[0].querySelectorAll('.main-navigation__list-item-link');\n\n\t\t\t\t\tif (linkItems) {\n\t\t\t\t\t\t// find the first link in this list\n\t\t\t\t\t\tvar targetLink = linkItems[0];\n\n\t\t\t\t\t\t// and select it\n\t\t\t\t\t\tif (targetLink) {\n\t\t\t\t\t\t\ttargetLink.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// there are no nested child link, is there a subling after this link?\n\n\t\t\t\t\tif (nextListItem) {\n\n\t\t\t\t\t\t// we have a sibling, a list item after the current within the group. move focus to this\n\n\t\t\t\t\t\t// find the link in the next list item\n\t\t\t\t\t\tvar linkItems = nextListItem.querySelectorAll('.main-navigation__list-item-link');\n\n\t\t\t\t\t\tif (linkItems) {\n\n\t\t\t\t\t\t\t// find the first link in this list\n\t\t\t\t\t\t\tvar targetLink = linkItems[0];\n\n\t\t\t\t\t\t\t// and select it\n\t\t\t\t\t\t\tif (targetLink) {\n\t\t\t\t\t\t\t\ttargetLink.focus();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// there are no child list items and no other siblings in this group, move to the next item in the parent group\n\t\t\t\t\t\t// see if there is an item after the parent list item, assuming the parent list is not the top level list\n\n\t\t\t\t\t\tvar isUpperLevel = link.classList.contains('main-navigation__list-item-link--level-2');\n\n\t\t\t\t\t\tif (!isUpperLevel) {\n\t\t\t\t\t\t\tnextListItem = getNextSibling(parentListItem, '.main-navigation__list-item');\n\n\t\t\t\t\t\t\tif (nextListItem) {\n\n\t\t\t\t\t\t\t\t// we have a sibling, a list item after the current parent and within the group. move focus to this\n\t\t\t\t\t\t\t\tvar linkItems = nextListItem.querySelectorAll('.main-navigation__list-item-link');\n\n\t\t\t\t\t\t\t\tif (linkItems) {\n\n\t\t\t\t\t\t\t\t\t// find the first link in this list\n\t\t\t\t\t\t\t\t\tvar targetLink = linkItems[0];\n\n\t\t\t\t\t\t\t\t\t// and select it\n\t\t\t\t\t\t\t\t\tif (targetLink) {\n\t\t\t\t\t\t\t\t\t\ttargetLink.focus();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// there is no item after the parent list item\n\t\t\t\t\t\t\t\t// go up another level, but not back up to the top-level\n\t\t\t\t\t\t\t\tparentListItem = findAncestor(parentListItem, 'main-navigation__list-item');\n\n\t\t\t\t\t\t\t\tif (parentListItem) {\n\t\t\t\t\t\t\t\t\tnextListItem = getNextSibling(parentListItem, '.main-navigation__list-item')\n\n\t\t\t\t\t\t\t\t\tif (nextListItem) {\n\n\t\t\t\t\t\t\t\t\t\t// we have a sibling, a list item after the current parent and within the group. move focus to this\n\t\t\t\t\t\t\t\t\t\tvar linkItems = nextListItem.querySelectorAll('.main-navigation__list-item-link');\n\n\t\t\t\t\t\t\t\t\t\tif (linkItems) {\n\n\t\t\t\t\t\t\t\t\t\t\t// find the first link in this list\n\t\t\t\t\t\t\t\t\t\t\tvar targetLink = linkItems[0];\n\n\t\t\t\t\t\t\t\t\t\t\t// and select it\n\t\t\t\t\t\t\t\t\t\t\tif (targetLink) {\n\t\t\t\t\t\t\t\t\t\t\t\ttargetLink.focus();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t// go back to the first list item in the parent list\n\t\t\t\t\t\t\t\t\t\tparentListItem = findAncestor(parentListItem, 'main-navigation__list-item');\n\n\t\t\t\t\t\t\t\t\t\tvar linkItems = parentListItem.querySelectorAll('.main-navigation__list-item-link');\n\n\t\t\t\t\t\t\t\t\t\tif (linkItems) {\n\n\t\t\t\t\t\t\t\t\t\t\t// find the first link in this list\n\t\t\t\t\t\t\t\t\t\t\tvar targetLink = linkItems[0];\n\n\t\t\t\t\t\t\t\t\t\t\t// and select it\n\t\t\t\t\t\t\t\t\t\t\tif (targetLink) {\n\t\t\t\t\t\t\t\t\t\t\t\ttargetLink.focus();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// the parent is the top level list\n\t\t\t\t\t\t\t// go back to the first list item at this level\n\n\t\t\t\t\t\t\tparentListItem = findAncestor(parentListItem, 'main-navigation__list-item');\n\n\t\t\t\t\t\t\tvar linkItems = parentListItem.querySelectorAll('.main-navigation__list-item-link');\n\n\t\t\t\t\t\t\tif (linkItems) {\n\n\t\t\t\t\t\t\t\t// find the first link in this list\n\t\t\t\t\t\t\t\tvar targetLink = linkItems[0];\n\n\t\t\t\t\t\t\t\t// and select it\n\t\t\t\t\t\t\t\tif (targetLink) {\n\t\t\t\t\t\t\t\t\ttargetLink.focus();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// move up...\n\n\t\t\t\tif (previousListItem) {\n\n\t\t\t\t\t// we have a sibling, a list item before the current and within the group\n\t\t\t\t\tvar linkItems = previousListItem.querySelectorAll('.main-navigation__list-item-link');\n\n\t\t\t\t\tif (linkItems) {\n\n\t\t\t\t\t\t// find the last link in this list\n\t\t\t\t\t\tvar targetLink = linkItems[(linkItems.length - 1)];\n\n\t\t\t\t\t\t// and select it\n\t\t\t\t\t\tif (targetLink) {\n\t\t\t\t\t\t\ttargetLink.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// no previous subling, move up a level and select the parent list item\n\n\t\t\t\t\tparentListItem = findAncestor(parentListItem, 'main-navigation__list-item');\n\n\t\t\t\t\tvar linkItems = parentListItem.querySelectorAll('.main-navigation__list-item-link');\n\n\t\t\t\t\tif (linkItems) {\n\n\t\t\t\t\t\t// the first item in this list is the parent\n\t\t\t\t\t\tvar targetLink = linkItems[0];\n\n\t\t\t\t\t\t// check to see if this has children, if so then the last item in this child list should get focus\n\n\t\t\t\t\t\t// and select it\n\t\t\t\t\t\tif (targetLink) {\n\t\t\t\t\t\t\ttargetLink.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// the goal is to keep aria\tand tabindex attribute values inline with the css set visibility of menu items\n\tif (menuItems.length) {\n\n\t\tfor (var j = 0; j < menuItems.length; j++) {\n\t\t\tvar link = menuItems[j];\n\t\t\tvar index = j;\n\n\n\t\t\t// when focus is given to any menu item...\n\t\t\tlink.addEventListener('focus', function () {\n\n\t\t\t\ttoggleMainNavigation(this, true);\n\n\t\t\t})\n\n\t\t\t// when mouse-over any menu item...\n\t\t\tlink.addEventListener('mouseover', function () {\n\n\t\t\t\ttoggleMainNavigation(this, true);\n\n\t\t\t})\n\n\t\t\t// when focus is taken from any menu item...\n\t\t\tlink.addEventListener('blur', function () {\n\n\t\t\t\ttoggleMainNavigation(this, false);\n\n\t\t\t})\n\n\t\t\t// when mouse-out any menu item...\n\t\t\tlink.addEventListener('mouseout', function () {\n\n\t\t\t\ttoggleMainNavigation(this, false);\n\n\t\t\t})\n\n\t\t\tlink.addEventListener(\"keyup\", function (e) {\n\t\t\t\tif (e.which == 27) {\n\t\t\t\t\t// escape key - close the menu\n\t\t\t\t\ttoggleMainNavigation(this, false);\n\n\t\t\t\t\tthis.blur();\n\n\t\t\t\t} else if (e.which == 39) {\n\t\t\t\t\t// right arrow \n\t\t\t\t\t// move to the next 'group' if there is one\n\t\t\t\t\t//\n\t\t\t\t\tmoveHorizontally(this, true);\n\n\t\t\t\t} else if (e.which == 37) {\n\t\t\t\t\t// left arrow \n\t\t\t\t\t// move to the previous 'group' if there is one\n\t\t\t\t\t//\n\t\t\t\t\tmoveHorizontally(this, false);\n\t\t\t\t} else if (e.which == 40) {\n\t\t\t\t\t// down arrow - move down the list of links, or back to the top - assuming there is more than 1 link in the group\n\t\t\t\t\t// if there is only 1 item in the group, move to the next group\n\t\t\t\t\t//\n\t\t\t\t\tmoveVertically(this, true);\n\t\t\t\t} else if (e.which == 38) {\n\t\t\t\t\t// up arrow - move up the list of links, or back to the bottom - assuming there is more than 1 link in the group\n\t\t\t\t\t// if there is only 1 item in the group, move to the previous group\n\t\t\t\t\t//\n\t\t\t\t\tmoveVertically(this, false);\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t}\n\n\tvar sticky = navbar.offsetTop;\n\n\t// Add the sticky class to the navbar when you reach its scroll position. Remove \"sticky\" when you leave the scroll position\n\tfunction stickyMainNav() {\n\t\tif (window.pageYOffset >= sticky) {\n\t\t\t// navbar.classList.add(\"sticky\")\n\t\t\tdocument.documentElement.classList.add(\"sticky\")\n\t\t\theaderContainer.classList.add(\"sticky\");\n\t\t} else {\n\t\t\t// navbar.classList.remove(\"sticky\");\n\t\t\tdocument.documentElement.classList.remove(\"sticky\")\n\t\t\theaderContainer.classList.remove(\"sticky\");\n\t\t}\n\t}\n\n\t// attach scroll event\n\twindow.onscroll = function () { stickyMainNav() };\n}\n\nif (document.readyState !== 'loading') {\n\twindow.SetUpMainNav();\n} else {\n\tdocument.addEventListener('DOMContentLoaded', function () {\n\t\twindow.SetUpMainNav();\n\t});\n}","\r\n// find a parent element with a specific css class\r\n// DO NOT PREFIX THE CLASS NAME WITH A PERIOD\r\n// todo : check for leading period in class name\r\nexport function findAncestor(child, cls) {\r\n\tvar node = child.parentNode;\r\n\twhile (node != null) {\r\n\t\tif (node.classList.contains(cls)) {\r\n\t\t\treturn node;\r\n\t\t}\r\n\t\tnode = node.parentNode;\r\n\t}\r\n\treturn null;\r\n}\r\n\r\n//\r\nexport function isDescendant(parent, child) {\r\n\tvar node = child.parentNode;\r\n\twhile (node != null) {\r\n\t\tif (node == parent) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tnode = node.parentNode;\r\n\t}\r\n\treturn false;\r\n}\r\n\r\n//\r\nexport function getNextSibling(elem, selector) {\r\n\r\n\t// Get the next sibling element\r\n\tvar sibling = elem.nextElementSibling;\r\n\r\n\t// If there's no selector, return the first sibling\r\n\tif (!selector) return sibling;\r\n\r\n\t// If the sibling matches our selector, use it\r\n\t// If not, jump to the next sibling and continue the loop\r\n\twhile (sibling) {\r\n\t\tif (sibling.matches(selector)) return sibling;\r\n\t\tsibling = sibling.nextElementSibling\r\n\t}\r\n};\r\n\r\n//\r\nexport function getPreviousSibling(elem, selector) {\r\n\r\n\t// Get the next sibling element\r\n\tvar sibling = elem.previousElementSibling;\r\n\r\n\t// If there's no selector, return the first sibling\r\n\tif (!selector) return sibling;\r\n\r\n\t// If the sibling matches our selector, use it\r\n\t// If not, jump to the next sibling and continue the loop\r\n\twhile (sibling) {\r\n\t\tif (sibling.matches(selector)) return sibling;\r\n\t\tsibling = sibling.previousElementSibling;\r\n\t}\r\n};","\nimport { breakpointWidth, breakpointWidthMD } from './_variables';\n\n//\n// Set up collapse panesl\n//\n\n// the footer makes use of Bootstrap collapse panels\n// we want these to only work on smaller viewports\n// elements can be hidden with css, but we need to disable the click event handler on the collapse/expand element\n\nwindow.disableCollapse = function(el, width) {\n\n\tel.addEventListener('click', function (e) {\n\n\t\tvar windowWidth = window.innerWidth;\n\t\t\n\t\tif (windowWidth >= width) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t}\n\t})\n}\n\nwindow.SetUpCollapsePanels = function() {\n\n\t// Footer Link Groups...\n\tvar footerGroups = document.getElementsByClassName('footer-link-group__group-heading-wrapper');\n\n\tfor (var i = 0; i < footerGroups.length; i++) {\n\n\t\tvar group = footerGroups[i];\n\t\t\n\t\tdisableCollapse(group, breakpointWidth);\n\t}\n\n\t// News Filters Panel...\n\tvar newsFilters = document.getElementsByClassName('news-filters__panel-toggle');\n\n\tfor (var i = 0; i < newsFilters.length; i++) {\n\n\t\tvar newsFilter = newsFilters[i];\n\n\t\tdisableCollapse(newsFilter, breakpointWidthMD);\n\t}\n}\n\nif (document.readyState !== 'loading') {\n\twindow.SetUpCollapsePanels();\n} else {\n\tdocument.addEventListener('DOMContentLoaded', function () {\n\t\twindow.SetUpCollapsePanels();\n\t});\n}","// please note, this is also defined in css (/scss/base/_breakpoints.scss) and should ideally be the same\n\nexport var breakpointWidthMD = 992; \nexport var breakpointWidth = 1024;","\n//\n// Load More\n//\n\nwindow.SetupLoadMore = function() {\n\n\tvar isSearching = false;\n\tvar buttons = null;\n\tvar resultsPane = null;\n\tvar currentPageIndex = 1; // zero indexed, but the first page will already be loaded\n\n\t///\n\t///\n\t///\n\tfunction doLoadMore() {\n\n\t\tif (!isSearching && window.moreResults) {\n\n\t\t\tisSearching = true;\n\n\t\t\t// show a loading animation\n\t\t\tdoLoadingAnimation();\n\n\t\t\t// determine the paramaters to be passed to server method...\n\t\t\tvar params = '';\n\n\t\t\tif (loadMoreOptions.searchTerm != '') {\n\t\t\t\tparams = 'searchTerm=' + loadMoreOptions.searchTerm\n\t\t\t}\n\n\t\t\tif (typeof (loadMoreOptions.isTagSearch) == 'undefined' || loadMoreOptions.isTagSearch == '') {\n\t\t\t\tloadMoreOptions.isTagSearch = false;\n\t\t\t}\n\n\t\t\tif (params.length > 0)\n\t\t\t\tparams += \"&\";\n\n\t\t\tparams += 'currentPageIndex=' + currentPageIndex + '&pageSize=' + loadMoreOptions.pageSize + '&url=' + loadMoreOptions.searchPageUrl + '&isTagSearch=' + loadMoreOptions.isTagSearch;\n\n\n\n\t\t\tvar xmlhttp = new XMLHttpRequest();\n\n\t\t\txmlhttp.open(\"GET\", '/umbraco/surface/' + loadMoreOptions.controller + '/' + loadMoreOptions.method + '?' + params, true);\n\n\t\t\txmlhttp.onload = function (e) {\n\t\t\t\tif (xmlhttp.readyState === 4) {\n\t\t\t\t\tif (xmlhttp.status === 200) {\n\n\t\t\t\t\t\tcurrentPageIndex++;\n\n\t\t\t\t\t\tif (xmlhttp.responseText == '' || xmlhttp.responseText == 'false') {\n\n\t\t\t\t\t\t\t// assume no more results\n\t\t\t\t\t\t\twindow.moreResults = false;\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tvar data = xmlhttp.responseText;\n\n\t\t\t\t\t\t\tif (data != '') {\n\t\t\t\t\t\t\t\t// append the results pane with the new data\n\t\t\t\t\t\t\t\tresultsPane.innerHTML += data;\n\n\t\t\t\t\t\t\t\t// count the number of articles we now have\n\t\t\t\t\t\t\t\tvar resultsCount = document.querySelectorAll('.' + loadMoreOptions.resultsPane + ' > div > article').length;\n\n\t\t\t\t\t\t\t\t// update the UI with the number of results now being shown\n\t\t\t\t\t\t\t\tvar srSearchResultsCount = document.getElementsByClassName(loadMoreOptions.resultsCountLabel);\n\n\t\t\t\t\t\t\t\tif (srSearchResultsCount.length) {\n\t\t\t\t\t\t\t\t\tfor (var i = 0; i < srSearchResultsCount.length; i++) {\n\t\t\t\t\t\t\t\t\t\tsrSearchResultsCount[i].innerHTML = \"Showing \" + resultsCount + \" of \" + loadMoreOptions.totalResults + \" results\";\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// the moreResults varaible is stored within the loaded html partial - find it and evaluate it\n\t\t\t\t\t\t\t\tvar arr = resultsPane.getElementsByTagName('script')\n\t\t\t\t\t\t\t\tif (arr.length) {\n\t\t\t\t\t\t\t\t\teval(arr[arr.length - 1].innerHTML);\n\t\t\t\t\t\t\t\t\t// now remove the element\n\t\t\t\t\t\t\t\t\tfor (var i = 0; i < arr.length; i++) {\n\t\t\t\t\t\t\t\t\t\tarr[i].parentNode.removeChild(arr[i]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// assume no more results\n\t\t\t\t\t\t\t\twindow.moreResults = false;\n\t\t\t\t\t\t\t} \n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.error(xmlhttp.statusText);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t// complete\n\t\t\t\tisSearching = false;\n\t\t\t\tdoLoadingAnimation();\n\t\t\t\tif (!window.moreResults) {\n\t\t\t\t\tdoNoMoreResults();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\txmlhttp.onerror = function (e) {\n\t\t\t\tconsole.warn(xmlhttp.statusText);\n\t\t\t\tisSearching = false;\n\t\t\t\tdoLoadingAnimation();\n\t\t\t};\n\n\t\t\txmlhttp.send(null);\n\n\t\t} else {\n\t\t\t// either already loading more results or there are no more results to load\n\t\t}\n\t}\n\n\t///\n\t///\n\t///\n\tfunction doLoadingAnimation() {\n\n\t\tif (isSearching) {\n\t\t\tresultsPane.setAttribute('aria-busy', 'true');\n\t\t\tif (buttons && buttons.length > 0) {\n\t\t\t\tfor (var i = 0; i < buttons.length; i++) {\n\t\t\t\t\tbuttons[i].setAttribute('disabled', 'disabled');\n\t\t\t\t\tbuttons[i].setAttribute('aria-disabled', 'true');\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tresultsPane.setAttribute('aria-busy', 'false');\n\t\t\tif (buttons && buttons.length > 0) {\n\t\t\t\tfor (var i = 0; i < buttons.length; i++) {\n\t\t\t\t\tbuttons[i].removeAttribute('disabled');\n\t\t\t\t\tbuttons[i].removeAttribute('aria-disabled');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t///\n\t///\n\t///\n\tfunction doNoMoreResults() {\n\t\tif (loadMoreOptions.mode == 'button') {\n\t\t\tif (buttons.length > 0) {\n\t\t\t\tfor (var i = 0; i < buttons.length; i++) {\n\t\t\t\t\tbuttons[i].setAttribute('disabled', 'disabled');\n\t\t\t\t\tbuttons[i].setAttribute('aria-disabled', 'true');\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\n\t\t}\n\t}\n\n\t///\n\t///\n\t///\n\tfunction init() {\n\n\t\tif (typeof (loadMoreOptions) != 'undefined') {\n\n\t\t\t// check the loadMoreOptions contain minimum settings\n\t\t\tif (loadMoreOptions.mode != null &&\n\t\t\t\tloadMoreOptions.mode != '' &&\n\t\t\t\tloadMoreOptions.resultsPane != null &&\n\t\t\t\tloadMoreOptions.resultsPane != '' &&\n\t\t\t\tloadMoreOptions.pageSize != null &&\n\t\t\t\tloadMoreOptions.pageSize != '' &&\n\t\t\t\tloadMoreOptions.totalResults != null &&\n\t\t\t\tloadMoreOptions.totalResults != '' &&\n\t\t\t\tloadMoreOptions.controller != null &&\n\t\t\t\tloadMoreOptions.controller != '' &&\n\t\t\t\tloadMoreOptions.isTagSearch != null &&\n\t\t\t\tloadMoreOptions.isTagSearch != '' &&\n\t\t\t\tloadMoreOptions.method != null &&\n\t\t\t\tloadMoreOptions.method != '') {\n\n\t\t\t\t// find the Results Pane\n\t\t\t\tvar resultsPanes = document.getElementsByClassName(loadMoreOptions.resultsPane);\n\n\t\t\t\tif (resultsPanes.length > 0) {\n\t\t\t\t\tresultsPane = resultsPanes[0];\n\n\t\t\t\t\tif (loadMoreOptions.mode == 'button') {\n\t\t\t\t\t\t// Button mode...\n\n\t\t\t\t\t\t// find the LoadMore button(s)\n\t\t\t\t\t\tbuttons = document.getElementsByClassName(loadMoreOptions.button)\n\n\t\t\t\t\t\tif (buttons.length > 0) {\n\t\t\t\t\t\t\t// attach events to any buttons found\n\t\t\t\t\t\t\tfor (var i = 0; i < buttons.length; i++) {\n\t\t\t\t\t\t\t\tvar button = buttons[i];\n\t\t\t\t\t\t\t\tbutton.addEventListener('click', function () {\n\t\t\t\t\t\t\t\t\tdoLoadMore();\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// console.warn('The LoadMore button could not be found.');\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t} else if (loadMoreOptions.mode = 'scroll') {\n\t\t\t\t\t\t// Scroll mode...\n\n\t\t\t\t\t\tdocument.addEventListener(\"scroll\", function (event) {\n\t\t\t\t\t\t\tvar lastDiv = document.querySelector('.' + loadMoreOptions.resultsPane + ' > div > article:last-child');\n\t\t\t\t\t\t\tvar lastDivOffset = lastDiv.offsetTop + lastDiv.clientHeight;\n\t\t\t\t\t\t\tvar pageOffset = window.pageYOffset + window.innerHeight;\n\n\t\t\t\t\t\t\tif (pageOffset > lastDivOffset - 20) {\n\t\t\t\t\t\t\t\tdoLoadMore();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.warn('The LoadMore Mode has not been set to either button or scroll.');\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tconsole.warn(\"The LoadMore resultsPane was not found.\")\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tconsole.warn('The LoadMore options are misconfigured.')\n\t\t\t}\n\n\t\t} else {\n\t\t\t// console.warn('loadMoreOptions not set for LoadMore functionality');\n\t\t}\n\t}\n\n\t//\n\t// Main Entry Point\n\t//\n\tinit();\n}\n\nif (document.readyState !== 'loading') {\n\twindow.SetupLoadMore();\n} else {\n\tdocument.addEventListener('DOMContentLoaded', function () {\n\t\twindow.SetupLoadMore();\n\t});\n}","//\n//\n\n// deferred image load...\nwindow.LoadDeferredImages = function() {\n\n\tvar items = document.getElementsByClassName('deferredload');\n\n\tif (items.length) {\n\t\tfor (var i = 0; i < items.length; i++) {\n\n\t\t\tvar img = items[i];\n\t\t\tvar index = i;\n\n\t\t\tif (img.getAttribute('data-src')) {\n\t\t\t\tvar dataSrc = img.getAttribute('data-src');\n\t\t\t\tif (dataSrc !== '') {\n\t\t\t\t\timg.setAttribute('src', dataSrc);\n\t\t\t\t\timg.classList.add('deferredloaded');\n\t\t\t\t\timg.classList.remove('deferredload');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nif (document.readyState !== 'loading') {\n\twindow.LoadDeferredImages();\n} else {\n\tdocument.addEventListener('DOMContentLoaded', function () {\n\t\twindow.LoadDeferredImages();\n\t});\n}","\nwindow.SetupSildeTriggers = function() {\n\n\t//console.log('Setting up Slide Annimation Triggers...');\n\n\tfunction isScrolledIntoView(el) {\n\t\tvar rect = el.getBoundingClientRect();\n\t\tvar elemTop = rect.top;\n\t\tvar elemBottom = rect.bottom;\n\n\t\t// Only completely visible elements return true:\n\t\tvar isVisible = (elemTop >= 0) && (elemBottom <= window.innerHeight);\n\t\t// Partially visible elements return true:\n\t\t//isVisible = elemTop < window.innerHeight && elemBottom >= 0;\n\t\treturn isVisible;\n\t}\n\n\tvar slides = document.querySelectorAll('.slide');\n\n\twindow.addEventListener('scroll', function (e) {\n\t\t\n\t\tfor (var i = 0; i < slides.length; i++) {\n\t\t\tvar el = slides[i];\n\t\t\tif (isScrolledIntoView(el)) {\n\t\t\t\tif (!el.classList.contains('go-in')) {\n\t\t\t\t\t//this.console.log('going in...');\n\t\t\t\t\tel.classList.add('go-in');\n\t\t\t\t\tel.classList.remove('go-out');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (el.classList.contains('go-in')) {\n\t\t\t\t\t//this.console.log('going out...')\n\t\t\t\t\tel.classList.remove('go-in');\n\t\t\t\t\tel.classList.add('go-out');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n}\n\nif (document.readyState !== 'loading') {\n\twindow.SetupSildeTriggers();\n} else {\n\tdocument.addEventListener('DOMContentLoaded', function () {\n\t\twindow.SetupSildeTriggers();\n\t});\n}","\n///\n/// Disabled Elements\n///\n/// Add a tabindex of -1 to all disabled elements\n/// so that focus cannot be passed to the element \n\nwindow.SetUpDisabledElements = function() {\n\n\tvar disabledElements = document.querySelectorAll('.disabled');\n\n\tfor (var i = 0; i < disabledElements.length; i++) {\n\n\t\tvar disabledElement = disabledElements[i];\n\n\t\tdisabledElement.setAttribute('tabindex', '-1');\n\t}\n}\n\nif (document.readyState !== 'loading') {\n\twindow.SetUpDisabledElements();\n} else {\n\tdocument.addEventListener('DOMContentLoaded', function () {\n\t\twindow.SetUpDisabledElements();\n\t});\n}","\nfunction pollForElement(elementId, attributeNames, interval = 1000, timeout = 10000) {\n return new Promise((resolve, reject) => {\n const startTime = Date.now();\n\n const poll = setInterval(() => {\n const element = document.getElementById(elementId);\n\n console.log('polling for element', elementId);\n \n // If element is found, clear the interval and copy attributes\n if (element) {\n clearInterval(poll);\n\n const attributes = {};\n attributeNames.forEach(attr => {\n attributes[attr] = element.getAttribute(attr);\n });\n\n resolve(attributes); // Return the attributes\n }\n\n // If the timeout is reached, stop polling\n if (Date.now() - startTime >= timeout) {\n clearInterval(poll);\n }\n }, interval);\n });\n}\n\n\nwindow.SetupBrowseAloudRemote = function () {\n \n var _baFooter = document.getElementById('browsealoud-button--launchpad_shadow');\n\n if (_baFooter) {\n\n // look for the BrowseAloud button elsewhere on the page\n // and copy the attributes to the 2nd button in the site footer\n pollForElement('browsealoud-button--launchpad', ['aria-label', 'title', 'class'], 500, 15000)\n .then(attributes => {\n\n var _baMasthead = document.getElementById('browsealoud-button--launchpad');\n \n if (_baMasthead) {\n _baFooter.addEventListener('click', function () {\n window.toggleBar();\n });\n\n _baFooter.setAttribute('aria-label', attributes['aria-label']);\n _baFooter.setAttribute('title', attributes['title']);\n _baFooter.setAttribute('class', attributes['class']);\n }\n })\n .catch(error => {\n console.error(error);\n });\n }\n\t\n}\n\nif (document.readyState !== 'loading') {\n\twindow.SetupBrowseAloudRemote();\n} else {\n\tdocument.addEventListener('DOMContentLoaded', function () {\n\t\twindow.SetupBrowseAloudRemote();\n\t});\n}","\n//\nwindow.SetupNewsFilters = function() {\n\n\tvar filterCheckboxes = document.getElementsByClassName('news-filter-item-checkbox')\n\n\tif (filterCheckboxes.length > 0) {\n\n\t\tfor (var i = 0; i < filterCheckboxes.length; i++) {\n\n\t\t\tvar checkbox = filterCheckboxes[i];\n\n\t\t\tcheckbox.addEventListener('change', function (e) {\n\t\t\t\tupdateBasedOnCheckboxes();\n\t\t\t})\n\t\t}\n\t}\n\n\tfunction updateBasedOnCheckboxes() {\n\n\t\tvar filterCheckboxes = document.getElementsByClassName('news-filter-item-checkbox')\n\t\tvar filterString = \"\";\n\n\t\tfor (var i = 0; i < filterCheckboxes.length; i++) {\n\t\t\tvar checkbox = filterCheckboxes[i];\n\n\t\t\tif (checkbox.checked)\n\t\t\t\tfilterString += checkbox.getAttribute('data-filter') + ',';\n\t\t}\n\n\t\tfilterString = filterString.replace(/,\\s*$/, \"\");\n\n\t\tvar newURL = window.updateURLParameter(window.location.href, 'page', '1');\n\t\tnewURL = window.updateURLParameter(newURL, 'tags', filterString);\t\t\n\n\t\twindow.location = newURL;\n\t}\n}\n\nif (document.readyState !== 'loading') {\n\twindow.SetupNewsFilters();\n} else {\n\tdocument.addEventListener('DOMContentLoaded', function () {\n\t\twindow.SetupNewsFilters();\n\t});\n}","\r\nwindow.twitterCheckCount = 0;\r\n\r\nwindow.SetUpTwitterTimeline = function () {\r\n\r\n check_twttr();\r\n}\r\n\r\nfunction check_twttr() {\r\n if (window.twitterCheckCount < 10) {\r\n if (typeof twttr !== 'undefined') {\r\n buildTimeline();\r\n } else {\r\n setTimeout(check_twttr, 500);\r\n }\r\n }\r\n}\r\n\r\nfunction buildTimeline() {\r\n var container = document.querySelector('.twitter-container');\r\n var timeline = document.querySelector('.twitter-timeline--hidden');\r\n\r\n if (container && timeline) {\r\n timeline.classList.remove('twitter-timeline--hidden');\r\n timeline.classList.add('twitter-timeline');\r\n timeline.setAttribute(\"href\", \"https://twitter.com/Legal_Ombudsman\");\r\n //twttr.widgets.load();\r\n twttr.widgets.createTimeline(\r\n {\r\n sourceType: \"profile\",\r\n screenName: \"Legal_Ombudsman\"\r\n },\r\n timeline\r\n );\r\n container.classList.remove('hide');\r\n }\r\n}\r\n\r\nwindow.DestroyTwitterTimeline = function () {\r\n var container = document.querySelector('.twitter-container');\r\n\r\n if (container) {\r\n container.remove();\r\n }\r\n}","\r\n\r\nfunction doubleBackButton() {\r\n\r\n\tvar formStepInput = document.querySelector('#formStep');\r\n\r\n\tvar contactBackLink = document.querySelector('.contact-wiz-back-link');\r\n\tvar formsBackLink = document.querySelector('.umbraco-forms-page .back-link');\r\n\r\n\tif (formStepInput != null) {\r\n\r\n\t\tvar currentFormStep = formStepInput.value;\r\n\t\t\r\n\t\t// hide any forms back links on the first page and show the wiz back link\r\n\t\tif (contactBackLink != null && currentFormStep == 0) {\r\n\r\n\t\t\tif (formsBackLink != null)\r\n\t\t\t\tformsBackLink.style.display = 'none';\r\n\r\n\t\t\tcontactBackLink.style.display = 'block';\r\n\t\t}\r\n\r\n\t\t// hide any wiz back link and show forms back link on subsequent pages\r\n\t\tif (contactBackLink != null && currentFormStep > 0) {\r\n\r\n\t\t\tif (formsBackLink != null)\r\n\t\t\t\tformsBackLink.style.display = 'block';\r\n\r\n\t\t\tcontactBackLink.style.display = 'none';\r\n\t\t}\r\n\r\n\t\t\r\n\r\n\t} else {\r\n\r\n\t\t// any wizard back links, show it\r\n\t\tif (contactBackLink != null)\r\n\t\t\tcontactBackLink.style.display = 'block';\r\n\t}\r\n}\r\n\r\nif (document.readyState !== 'loading') {\r\n\tdoubleBackButton();\r\n} else {\r\n\tdocument.addEventListener('DOMContentLoaded', function () {\r\n\t\tdoubleBackButton();\r\n\t});\r\n}"],"sourceRoot":""}