1// scroll page to top when loaded 2jQuery(function ($) { 3 $(document).ready(function(){ 4 $(this).scrollTop(0); 5 }); 6}); 7 8 9 10 11// get the sticky element and hide logos based on which nav it's in 12jQuery(function ($) { 13 const stickyElm = document.querySelector('.main-navigation-menu') 14 15const observer = new IntersectionObserver( 16 ([e]) => e.target.classList.toggle('isSticky', e.intersectionRatio < 1), 17 {threshold: [1]} 18 ); 19 20if (stickyElm) observer.observe(stickyElm) 21}); 22 23 24 25// More Nav Functionality 26 27 28var mainNav = document.querySelector('.main-nav'); 29if (!mainNav) { 30 // Pages without the desktop navigation do not need the overflow menu. 31} else { 32mainNav.firstElementChild.style.flexWrap = 'nowrap'; 33 34var moreMenuItem = document.querySelector('.nav__more-item'); 35 36if (!moreMenuItem) { 37 // The overflow control is not present when every item fits. 38} else { 39moreMenuItem.style.display = 'block'; 40 41var moreMenuLink = moreMenuItem.querySelector('a'); 42var secondaryNav = document.querySelector('.secondary-nav'); 43 44moreMenuLink.addEventListener('click', function (e) { 45 e.preventDefault(); 46 47 var expanded = moreMenuLink.getAttribute('aria-expanded') === 'true' || false; 48 moreMenuLink.setAttribute('aria-expanded', !expanded); 49 50 var open = secondaryNav.classList.contains('is-open'); 51 secondaryNav.classList.toggle('is-open', !open); 52 secondaryNav.style.display = open ? 'none' : 'block'; 53 54 if (!open) { 55 var firstVisibleItem = secondaryNav.querySelector('li[style*="display: block"] a'); 56 if (firstVisibleItem) firstVisibleItem.focus(); 57 } 58}); 59 60 61 62// moreMenuLink.addEventListener('mouseout', function (e) { 63// e.preventDefault(); 64// 65// var expanded = moreMenuLink.getAttribute('aria-expanded') === 'false' || false; 66// moreMenuLink.setAttribute('aria-expanded', !expanded); 67// 68// var open = secondaryNav.style.display === 'flex' || false; 69// secondaryNav.style.display = open ? 'none' : 'flex'; 70// 71// if (!open) { 72// var firstVisibleItem = secondaryNav.querySelector('li[style="display: none;"] a'); 73// firstVisibleItem.focus(); 74// } 75// }); 76 77 78moreMenuLink.addEventListener('keydown', function (e) { 79 if (e.keyCode === 32) { 80 e.preventDefault(); 81 moreMenuLink.click(); 82 } 83}); 84 85secondaryNav.addEventListener('keydown', function (e) { 86 if (e.keyCode === 27) { 87 e.preventDefault(); 88 moreMenuLink.setAttribute('aria-expanded', false); 89 secondaryNav.classList.remove('is-open'); 90 secondaryNav.style.display = 'none'; 91 moreMenuLink.focus(); 92 } 93}); 94 95if ('IntersectionObserver' in window) { 96 97 var observerSettings = { 98 root: mainNav, 99 threshold: 0.98 100 } 101 102 103 // Match only top-level items. Dropdown children must not affect overflow counts. 104 var mainNavItems = Array.prototype.filter.call(mainNav.firstElementChild.children, function (item) { 105 return item.tagName === 'LI'; 106 }); 107 var secondaryNavItems = Array.prototype.filter.call(secondaryNav.querySelector('.secondary-nav__list').children, function (item) { 108 return item.tagName === 'LI'; 109 }); 110 var overflowItems = []; 111 112 mainNavItems.forEach(function (item, index) { 113 item.dataset.index = index; 114 if (secondaryNavItems[index]) { 115 secondaryNavItems[index].dataset.index = index; 116 secondaryNavItems[index].style.display = 'none'; 117 } 118 overflowItems[index] = false; 119 }); 120 121 var callback = function (items) { 122 items.forEach(function (item) { 123 var index = Number(item.target.dataset.index); 124 var isOverflowing = item.intersectionRatio < 0.98; 125 item.target.style.visibility = isOverflowing ? 'hidden' : 'visible'; 126 overflowItems[index] = isOverflowing; 127 if (secondaryNavItems[index]) { 128 secondaryNavItems[index].style.display = isOverflowing ? 'block' : 'none'; 129 } 130 }); 131 // Observer callbacks contain only changed items; retain the other items' state. 132 var hasOverflow = overflowItems.some(function (value) { return value; }); 133 // Reserve its width so showing More cannot repeatedly change what fits. 134 moreMenuItem.style.visibility = hasOverflow ? 'visible' : 'hidden'; 135 if (!hasOverflow) { 136 moreMenuLink.setAttribute('aria-expanded', 'false'); 137 secondaryNav.classList.remove('is-open'); 138 secondaryNav.style.display = 'none'; 139 } 140 }; 141 142 var observer = new IntersectionObserver(callback, observerSettings);
143 mainNavItems.forEach(function (item) { 144 observer.observe(item); 145 }); 146 147 148 149} 150} 151 152} 153 154// End 155 156 157// Mobile Nav drilldown functionality 158(function($) { 159 var methods; 160 methods = { 161 init: function(element, options) { 162 element.addClass('stack-menu'); 163 element.find('ul').addClass('stack-menu__list'); 164 element.find('ul:first').addClass('stack-menu__list--root').addClass('stack-menu__list--active'); 165 element.find('li').addClass('stack-menu__item'); 166 element.find('a').addClass('stack-menu__link'); 167 $('.stack-menu__item').each(function(index) { 168 $(this).attr('data-id', index); 169 if ($(this).find('.stack-menu__list').length > 0) { 170 $(this).children('.stack-menu__link').addClass('stack-menu__link--parent'); 171 } 172 }); 173 $('.stack-menu__list').each(function() { 174 var allItemElement, allLinkElement, backItemElement, backLinkElement, url; 175 if (!$(this).hasClass('stack-menu__list--root')) { 176 if (options.all) { 177 url = $(this).closest('.stack-menu__item').find('.stack-menu__link').attr('href'); 178 allItemElement = $('<li>', { 179 "class": 'stack-menu__item' 180 }); 181 allLinkElement = $('<a>', { 182 "class": 'stack-menu__link', 183 href: url, 184 text: options.allTitle 185 }); 186 allItemElement.append(allLinkElement); 187 $(this).prepend(allItemElement); 188 } 189 backItemElement = $('<li>', { 190 "class": 'stack-menu__item back' 191 }); 192 backLinkElement = $('<a>', { 193 "class": 'stack-menu__link stack-menu__link--back', 194 href: '#', 195 html: ' BACK' 196 }); 197 backItemElement.append(backLinkElement); 198 $(this).prepend(backItemElement); 199 } 200 }); 201 element.find('.stack-menu__link').click(function(event) { 202 var item, link, list, parent, sub; 203 link = $(this); 204 item = link.closest('.stack-menu__item'); 205 list = item.closest('.stack-menu__list'); 206 parent = list.closest('.stack-menu__item'); 207 sub = item.children('.stack-menu__list'); 208 if (link.hasClass('stack-menu__link--back')) { 209 event.preventDefault(); 210 list.removeClass('stack-menu__list--active'); 211 list.removeClass('stack-menu__list--active'); 212 parent.removeClass('stack-menu__item--opened'); 213 parent.find('.stack-menu__link').removeClass('stack-menu__link--hidden'); 214 parent.closest('.stack-menu__list').children('.stack-menu__item').removeClass('stack-menu__item--hidden'); 215 } else { 216 if (item.children('.stack-menu__list').length === 0) { 217 return true; 218 } else { 219 event.preventDefault(); 220 parent.addClass('stack-menu__item--opened'); 221 link.addClass('stack-menu__link--hidden'); 222 sub.addClass('stack-menu__list--active'); 223 $(list.children('.stack-menu__item')).each(function() { 224 if ($(this).data('id') !== item.data('id')) { 225 $(this).addClass('stack-menu__item--hidden'); 226 } 227 }); 228 } 229 } 230 }); 231 } 232 }; 233 jQuery.fn.stackMenu = function(options) { 234 options = $.extend({ 235 all: false, 236 allTitle: 'All' 237 }, options); 238 methods.init(this, options); 239 return { 240 reset: function(element) { 241 $(element).find('.stack-menu').removeClass('stack-menu--active'); 242 $(element).find('.stack-menu__list').removeClass('stack-menu__list--active'); 243 $(element).find('.stack-menu__item').removeClass('stack-menu__item--hidden').removeClass('stack-menu__item--opened'); 244 $(element).find('.stack-menu__link').removeClass('stack-menu__link--hidden'); 245 $(element).find('.stack-menu__list--root').addClass('stack-menu__list--active'); 246 } 247 }; 248 }; 249})(jQuery); 250 251// Mobile Nav drilldown options 252jQuery(function ($) { 253 $(document).ready(function() { 254 $('#stack-menu').stackMenu({ 255 all: false, // add links to parents 256 allTitle: 'All' // parents links text 257 }); 258 }); 259}); 260
261// Add Active class to nav-toggle when clicked 262document.querySelector( "#nav-toggle" ) 263 .addEventListener( "click", function() { 264 this.classList.toggle( "active" ); 265 }); 266 267 268// Make Bootstrap Navbar Hoverable 269jQuery(function ($) { 270 const $dropdown = $(".dropdown"); 271 const $dropdownToggle = $(".dropdown-toggle"); 272 const $dropdownMenu = $(".dropdown-menu"); 273 const showClass = "show"; 274 275 $(window).on("load resize", function() { 276 if (this.matchMedia("(min-width: 768px)").matches) { 277 $dropdown.hover( 278 function() { 279 const $this = $(this); 280 $this.addClass(showClass); 281 $this.find($dropdownToggle).attr("aria-expanded", "true"); 282 $this.find('.dropdown-menu:first').addClass(showClass); 283 }, 284 function() { 285 const $this = $(this); 286 $this.removeClass(showClass); 287 $this.find($dropdownToggle).attr("aria-expanded", "false"); 288 $this.find($dropdownMenu).removeClass(showClass); 289 } 290 ); 291 } else { 292 $dropdown.off("mouseenter mouseleave"); 293 } 294 }); 295 296}); 297 298jQuery.noConflict(); 299jQuery(document).ready(function($){ 300 $('.splide__slide img').each(function(){ 301 $(this).removeAttr('width') 302 $(this).removeAttr('height'); 303 }); 304}); 305 306 307// Featured News Slider 308if(jQuery(".main-carousel" ).length){ 309 310 // new Splide( '.main-carousel', { 311 // perPage: 1, 312 // perMove: 1, 313 // rewind : true, 314 // type : 'loop', 315 // arrows : false, 316 // autoplay : true, 317 // interval : '10000', 318 // video: { 319 // autoplay: false, 320 // mute : false, 321 // loop: false, 322 // playerOptions: { 323 // youtube: { 324 // playlist: undefined, 325 // controls: 0, 326 // modestbranding: 1, 327 // } 328 // } 329 // }, 330 // } ).mount( window.splide.Extensions ); 331 332 333 // SplideJS Slider. See full docs at: 334 // https://splidejs.com/ 335 // SplideJS Slider. See full docs at: https://splidejs.com/ 336 document.addEventListener('DOMContentLoaded', function () { 337 document.querySelectorAll('.main-carousel').forEach(function (carousel) { 338 if (carousel.classList.contains('is-initialized')) return; 339 var splide = new Splide(carousel, { 340 perPage: 1, 341 perMove: 1, 342 rewind: true, 343 type: 'loop', 344 arrows: false, 345 autoplay: true, 346 interval: 10000, // number, not string 347 pauseOnHover: false, // must be false 348 pauseOnFocus: false, // must be false 349 video: { 350 autoplay: false, 351 mute: false, 352 loop: false, 353 playerOptions: { 354 youtube: { 355 playlist: undefined, 356 controls: 0, 357 modestbranding: 1, 358 host: 'https://www.youtube-nocookie.com', 359 } 360 } 361 } 362 }).mount(window.splide ? window.splide.Extensions : {}); 363 364 // --- Accessibility labeling for Splide-injected controls --- 365 function labelSplideA11y(root) { 366 // 1) Label the injected video play button 367 root.querySelectorAll('.splide__video__play').forEach(function (btn) { 368 btn.setAttribute('type', 'button'); 369 if (!btn.getAttribute('aria-label')) { 370 btn.setAttribute('aria-label', 'Play video'); 371 } 372 }); 373 374 // 2) Title for injected iframes (YouTube/Vimeo) 375 root.querySelectorAll('.splide__slide iframe').forEach(function (iframe) { 376 if (!iframe.hasAttribute('title')) { 377 var slide = iframe.closest('.splide__slide'); 378 var h2 = slide && slide.querySelector('h2'); 379 var title = h2 ? ('Video: ' + h2.textContent.trim()) : 'Embedded video'; 380 iframe.setAttribute('title', title); 381 } 382 }); 383 384 // 3) Ensure pagination buttons have labels 385 var pages = root.querySelectorAll('.splide__pagination__page'); 386 pages.forEach(function (btn, i) { 387 btn.setAttribute('type', 'button'); 388 if (!btn.getAttribute('aria-label')) { 389 btn.setAttribute('aria-label', 'Go to slide ' + (i + 1)); 390 } 391 }); 392 } 393 394 // Run once after mount 395 labelSplideA11y(splide.root); 396 397 // Run again whenever Splide mutates the DOM (clones, lazy mounts, videos, etc.) 398 var mo = new MutationObserver(function () { 399 labelSplideA11y(splide.root); 400 }); 401 mo.observe(splide.root, { childList: true, subtree: true }); 402 403 // --- Your existing video â autoplay logic --- 404 splide.on('video:play', function () { 405 var Autoplay = splide.Components.Autoplay; 406 Autoplay.pause(99); 407 }); 408
409 splide.on('video:ended', function () { 410 var Autoplay = splide.Components.Autoplay; 411 Autoplay.play(99); 412 }); 413 414 // --- Optional: if you have a custom play/pause button for autoplay --- 415 var button = carousel.querySelector('.splide__play-pause'); 416 if (button) { 417 var pausedClass = 'is-paused'; 418 button.setAttribute('type', 'button'); 419 420 function updateAutoplayButton() { 421 var Auto = splide.Components.Autoplay; 422 var running = !Auto.isPaused(); 423 if (running) { 424 button.classList.remove(pausedClass); 425 button.textContent = 'Pause'; 426 button.setAttribute('aria-label', 'Pause autoplay'); 427 } else { 428 button.classList.add(pausedClass); 429 button.textContent = 'Play'; 430 button.setAttribute('aria-label', 'Start autoplay'); 431 } 432 } 433 434 button.addEventListener('click', function () { 435 var Auto = splide.Components.Autoplay; 436 if (Auto.isPaused()) { 437 Auto.play(1); 438 } else { 439 Auto.pause(1); 440 } 441 updateAutoplayButton(); 442 }); 443 444 splide.on('autoplay:play', updateAutoplayButton); 445 splide.on('autoplay:pause', updateAutoplayButton); 446 updateAutoplayButton(); 447 } 448 }); 449 }); 450} 451 452// Leaderboard Slider 453if(jQuery(".leaderboard-advert" ).length){ 454 455 new Splide( '.leaderboard-advert', { 456 perPage: 1, 457 perMove: 1, 458 rewind : true, 459 type : 'loop', 460 arrows : false, 461 autoplay : true, 462 pagination : false, 463 interval : '6000' 464 } ).mount(); 465 466} 467 468 469// News Slider Slider 470if(jQuery(".news-slider" ).length){ 471 472 new Splide( '.news-slider', { 473 perPage: 4, 474 perMove: 1, 475 rewind : false, 476 gap: '1.5rem', 477 width: '100%', 478 pagination : false, 479 breakpoints: { 480 768: { 481 perPage: 2, 482 }, 483 576: { 484 perPage: 1, 485 }, 486 } 487 } ).mount(); 488 489} 490 491// MPU Slider 492if(jQuery(".mpu-advert" ).length){ 493 494 new Splide( '.mpu-advert', { 495 perPage: 1, 496 perMove: 1, 497 rewind : true, 498 type : 'loop', 499 arrows : false, 500 autoplay : true, 501 pagination : false, 502 interval : '6000' 503 } ).mount(); 504 505} 506 507 508 509 510// Core Content Slider 511if (jQuery(".hp_core_content").length) { 512 513 new Splide('.hp_core_content', { 514 perPage: 3, 515 perMove: 1, 516 rewind: false, 517 arrows: false, 518 infinite: false, 519 gap: '1.5rem', 520 trimSpace: true, 521 focus: 'left', 522 pagination: false, 523 524 breakpoints: { 525 768: { 526 perPage: 2, 527 fixedWidth: (100 / 2) * 0.8 + '%', 528 }, 529 530 576: { 531 perPage: 1, 532 fixedWidth: (100 / 1) * 0.7 + '%', 533 }, 534 } 535 }).mount(); 536} 537 538 539// Billboard Slider 540if(jQuery(".billboard-advert" ).length){ 541 542 new Splide( '.billboard-advert', { 543 perPage: 1, 544 perMove: 1, 545 rewind : true, 546 type : 'loop', 547 arrows : false, 548 autoplay : true, 549 pagination : false, 550 interval : '6000' 551 } ).mount(); 552 553} 554 555 556// CC Leaderboard Slider 557if(jQuery(".cc-leaderboard-advert" ).length){ 558 559 new Splide( '.cc-leaderboard-advert', { 560 perPage: 1, 561 perMove: 1, 562 rewind : true, 563 type : 'loop', 564 arrows : false, 565 autoplay : true, 566 pagination : false, 567 interval : '6000' 568 } ).mount(); 569 570} 571 572// Gallery Lightbox 573jQuery(function ($) { 574 $(document).on('click', '[data-toggle="lightbox"]', function(event) { 575 event.preventDefault(); 576 $(this).ekkoLightbox({ 577 showArrows: true, 578 }); 579 }); 580}); 581 582(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement) 583 584 585 586 587 588//Make Header nav expandible 589jQuery(function ($) { 590 $('.mobile_container').each(function(){ 591 var $div = $(this), 592 $ul = $div.find('ul.mobile-nav-dd.expandible'), 593 $lis = $div.find('ul.mobile-nav-dd.expandible>li:gt(8)'), 594 isExpanded = $ul.hasClass('expanded'); 595 $lis[isExpanded ? 'show' : 'hide'](); 596 597 598 599 if($lis.length > 0){ 600 $ul 601 .append($('<li class="expand nav-item"><a class="nav-link"><span class="more_less">More <i class="fa-solid fa-plus float-right mt-1"></i></span></a></li>') 602 .click(function(event){ 603 var isExpanded = $ul.hasClass('expanded'); 604 (isExpanded ? jQuery('html,body').animate({scrollTop:0},500) : '') 605 event.preventDefault(); 606 $(this).find('.more_less').html(isExpanded ? 'More <i class="fa-solid fa-plus float-right mt-1"></i>' : 'Less <i class="fa-solid fa-minus float-right mt-1"></i>'); 607 608 609 610 $ul.toggleClass('expanded'); 611 $lis.toggle(); 612 })); 613 } 614 }); 615}); 616 617//Make footer nav expandible 618jQuery(function ($) { 619 $('ul.footer_nav.expandible').each(function(){ 620 var $ul = $(this), 621 $lis = $ul.find('li:gt(9)'), 622 isExpanded = $ul.hasClass('expanded'); 623 $lis[isExpanded ? 'show' : 'hide'](); 624 625 if($lis.length > 0){ 626 $ul 627 .append($('<li class="expand btn btn-secondary btn-sm d-block py-0 mt-1"><span>' + (isExpanded ? 'Less' : 'More <i class="fa-solid fa-plus float-right mt-1"></i>') + '</span></li>') 628 .click(function(event){ 629 var isExpanded = $ul.hasClass('expanded'); 630 event.preventDefault(); 631 $(this).text(isExpanded ? 'More' : 'Less'); 632 $ul.toggleClass('expanded'); 633 $lis.toggle(); 634 })); 635 } 636 }); 637});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.