1/* 2-------------------------------- 3 4Preloader 5 6-------------------------------- 7*/ 8 9 10jQuery(window).on("load", function () { 11 jQuery("body").addClass("loaded"); 12}); 13 14jQuery(document).ready(function ($) { 15 16 17 18/* 19----------------------------- 20 21Calculates notification height and applies padding to site-main 22 23----------------------------- 24*/ 25var notificationsHeight = $('.notifications').outerHeight(); 26 $('#page').css('padding-top', notificationsHeight); 27 28 29/* 30----------------------------- 31 32Hero Form Flip 33 34----------------------------- 35*/ 36$('.sign-in-other a').on('click', function(e) { 37 e.preventDefault(); // Prevent the default link behavior 38 39 // Add the required classes to the elements 40 $('.other-accounts').toggleClass('flip-front'); 41 $('.login-form').toggleClass('flip-back'); 42 }); 43 44 45 46 47/* 48----------------------------- 49 50"How can we help?" toggle dropdown 51 52----------------------------- 53*/ 54function showSelected() { 55 var selected = $("#prod-toggle-select").val(); 56 $(".toggle-items").hide(); 57 $("#" + (selected || "prod-1")).show(); 58} 59 60$(document).ready(function() { 61 showSelected(); 62 63 $("#prod-toggle-select").change(function() { 64 $(".toggle-items").fadeOut(200); 65 $("#" + $(this).val()).delay(200).fadeIn(200); 66 }); 67}); 68 69// Handle browser back/forward cache restores 70$(window).on("pageshow", function() { 71 showSelected(); 72}); 73 74 75 76 77/* 78----------------------------- 79 80Product Tabs 81 82----------------------------- 83*/ 84 85$('#product-tabs').responsiveTabs({ 86 startCollapsed: 'accordion', 87 scrollToAccordion: true 88}); 89 90 91 92 93 94 95/* 96----------------------------- 97 98Video Modal 99 100----------------------------- 101*/ 102 103$(".js-modal-btn").modalVideo(); 104 105 106 107/* 108----------------------------- 109 110Modal 111 112----------------------------- 113*/ 114 115 $('a.modal-link').click(function (event) { 116 $(this).modal({ 117 fadeDuration: 200 118 }); 119 return false; 120 }); 121 122 123/* 124----------------------------- 125 126Trasnlations and translate notice modal 127 128----------------------------- 129*/ 130 function proceedToSpanish() { 131 $.modal.close(); 132 setTimeout(() => setLanguage('es'), 100); 133 } 134 135 function closeModal() { 136 $.modal.close(); 137 } 138 139 function setLanguage(lang, retries = 10) { 140 const combo = document.querySelector('.goog-te-combo'); 141 142 if (!combo) { 143 console.warn('Translate dropdown not loaded yet'); 144 if (retries > 0) { 145 setTimeout(() => setLanguage(lang, retries - 1), 300); 146 } 147 return; 148 } 149 150 combo.value = lang; 151 combo.dispatchEvent(new Event('change')); 152 153 document.querySelectorAll('.to-es').forEach(el => { 154 el.style.display = (lang === 'en') ? 'inline' : 'none'; 155 }); 156 157 document.querySelectorAll('.to-en').forEach(el => { 158 el.style.display = (lang === 'en') ? 'none' : 'inline'; 159 }); 160 } 161 162 const checkCombo = setInterval(() => { 163 const combo = document.querySelector('.goog-te-combo'); 164 if (combo) { 165 clearInterval(checkCombo); 166 167 const match = document.cookie.match(/googtrans=\/[a-z]{2}\/([a-z]{2})/); 168 const currentLang = match ? match[1] : 'en'; 169 170 document.querySelectorAll('.to-es').forEach(el => { 171 el.style.display = (currentLang === 'en') ? 'inline' : 'none'; 172 }); 173 174 document.querySelectorAll('.to-en').forEach(el => { 175 el.style.display = (currentLang === 'en') ? 'none' : 'inline'; 176 }); 177 178 document.querySelectorAll('.to-en').forEach(el => { 179 el.addEventListener('click', e => { 180 e.preventDefault(); 181 setLanguage('en'); 182 }); 183 }); 184 185 const continueBtn = document.getElementById('continue-to-spanish'); 186 if (continueBtn) { 187 continueBtn.addEventListener('click', proceedToSpanish); 188 } 189 } 190 // TEMP: Automatically open the Spanish translation notice when 191// ?utm_lang=es is present (used for marketing campaigns). 192if (new URLSearchParams(window.location.search).get('utm_lang') === 'es') { 193 $('.to-es').first().trigger('click'); 194} 195 }, 100); 196 197 198/* 199----------------------------- 200 201Search Modal 202 203----------------------------- 204*/ 205 // Open the modal when the button is clicked 206 $('.open-search-modal').on('click', function() { 207 $('#search-modal').addClass('visible'); 208 $('body').addClass('no-scroll'); // Prevent scrolling on the body 209 $('#s').focus(); // Focus on the search input field 210 }); 211 212 // Close the modal when the close button is clicked 213 $('#close-modal').on('click', function() { 214 $('#search-modal').removeClass('visible'); 215 $('body').removeClass('no-scroll'); // Restore scrolling on the body 216 }); 217 218 // Close the modal when clicking on the overlay 219 $('.overlay').on('click', function() { 220 $('#search-modal').removeClass('visible'); 221 $('body').removeClass('no-scroll'); // Restore scrolling on the body 222 }); 223 224 // Handle the search action when Enter is pressed 225 $('#s').on('keydown', function(event) { 226 if (event.key === 'Enter') { 227 const query = $(this).val(); 228 if (query) { 229 console.log("Search query:", query); // replace this with search action 230 $('#search-modal').removeClass('visible'); // Close modal after search 231 $('body').removeClass('no-scroll'); // Restore scrolling on the body 232 // Optionally, you could submit the form if using a form element 233 $('#searchform').submit(); // Uncomment this if you want to submit the form 234 } else { 235 alert("Please enter a search term."); 236 } 237 } 238 }); 239 240 // Open with `/` key 241 $(document).on('keydown', function(event) { 242 if (event.key === '/') { 243 event.preventDefault(); 244 $('#search-modal').addClass('visible'); 245 $('body').addClass('no-scroll'); // Prevent scrolling on the body 246 $('#s').focus(); // Focus on the search input field 247 } 248 }); 249 250 // Close with `ESC` key 251 $(document).on('keydown', function(event) { 252 if (event.key === 'Escape') { 253 $('#search-modal').removeClass('visible'); 254 $('body').removeClass('no-scroll'); // Restore scrolling on the body 255 } 256 }); 257 258 259 260 261 262/* 263----------------------------- 264 265External link alert 266 267----------------------------- 268*/ 269 270$(function() { 271 var exceptions = [ 272 'forms.fivision.com', 273 'www.embassybank-online.com', 274 'onlinebanking.embassybank.com' 275 ]; 276 277 // Disable inline onclicks so they donât trigger early 278 $('.social-share-btn').each(function() { 279 this.onclick = null; 280 }); 281 282 // Tag external links 283 $('a').each(function () { 284 var $link = $(this); 285 var linkHost = this.hostname; 286 var href = $link.attr('href') || ''; 287 288 if (!linkHost || href.startsWith('javascript:')) return; 289 290 // Skip email share buttons entirely 291 if ($link.hasClass('email')) return; 292 293 if ( 294 linkHost !== window.location.hostname && 295 !exceptions.includes(linkHost) 296 ) { 297 $link.addClass('external-link'); 298 } 299 }); 300 301 // Handle external link clicks 302 $(document).on('click', '.external-link', function (e) { 303 e.preventDefault(); 304 var $link = $(this); 305 var targetUrl = $link.attr('href'); 306 var isSocial = $link.hasClass('social-share-btn'); 307 var sharePlatform = ''; 308 309 if (isSocial) { 310 if ($link.hasClass('fb')) sharePlatform = 'facebook'; 311 else if ($link.hasClass('tw')) sharePlatform = 'twitter'; 312 else if ($link.hasClass('linkedin')) sharePlatform = 'linkedin'; 313 } 314 315 // Build modal 316 var modalHtml = ` 317 <div id="external-link-modal" class="modal x-small-modal"> 318 <div class="text-center"> 319 <h3>You Are About to Leave Embassy Bank</h3> 320 <p>You are leaving Embassy Bank for the Lehigh Valley's website. Embassy Bank does not control this site, and does not guarantee the accuracy, completeness, efficacy or timeliness of information contained therein.</p> 321 <p>To proceed to this website, click "Continue." To remain on the Embassy Bank website, click "Cancel."</p> 322 <div class="modal-actions flex horz-center">
323 <a id="continue-link" class="cta no-arrow" href="#" target="_blank" rel="noopener noreferrer">Continue</a> 324 <a href="#" rel="modal:close" class="cta cancel no-arrow">Cancel</a> 325 </div> 326 </div> 327 </div> 328 `; 329 330 $('#external-link-modal').remove(); 331 $('body').append(modalHtml); 332 333 // On continue click 334 $('#continue-link').on('click', function (event) { 335 event.preventDefault(); 336 337 if (isSocial) { 338 var pageUrl = encodeURIComponent(document.URL); 339 var pageTitle = encodeURIComponent(document.title); 340 var popupUrl = ''; 341 342 switch (sharePlatform) { 343 case 'facebook': 344 popupUrl = `https://www.facebook.com/sharer/sharer.php?u=${pageUrl}&t=${pageTitle}`; 345 break; 346 case 'twitter': 347 popupUrl = `https://twitter.com/intent/tweet?text=${pageTitle}%20${pageUrl}`; 348 break; 349 case 'linkedin': 350 popupUrl = `https://www.linkedin.com/shareArticle?mini=true&url=${pageUrl}&title=${pageTitle}`; 351 break; 352 } 353 354 var sharePopup = window.open( 355 popupUrl, 356 '_blank', 357 'width=600,height=400' 358 ); 359 if (sharePopup) sharePopup.focus(); 360 } else { 361 // Normal external link 362 window.open(targetUrl, '_blank', 'noopener,noreferrer'); 363 } 364 365 $.modal.close(); 366 }); 367 368 $('#external-link-modal').modal({ fadeDuration: 200 }); 369 }); 370}); 371 372// Dynamically populate mailto links for email share buttons 373$('.social-share-btn.email').each(function() { 374 var pageUrl = encodeURIComponent(document.URL); 375 var pageTitle = encodeURIComponent(document.title); 376 $(this).attr('href', `mailto:?subject=${pageTitle}&body=${pageUrl}`); 377}); 378 379 380 381 382 383/* 384----------------------------- 385 386Panel animations 387 388----------------------------- 389*/ 390 391$(".animate").waypoint( 392 function () { 393 $(this.element).addClass("fade-up"); 394 }, 395 { 396 offset: "95%", 397 triggerOnce: true 398 } 399); 400 401 402 /* 403 ----------------------------- 404 405 Mobile Nav 406 407 ----------------------------- 408 */ 409 410 411$('.main-navigation .menu-item-has-children > a').after('<button class="sub-dropdown-toggle" aria-expanded="false"><span class="expand">expand child menu</span></button>'); 412 413var $button = $('#mobile-menu'); 414var isMenuOpen = false; 415 416// Select only the top-level sub-dropdown-toggle buttons 417var $topLevelSubToggles = $('.main-navigation > .menu-item-has-children > .sub-dropdown-toggle'); 418 419$button.on('click', function () { 420 isMenuOpen = !isMenuOpen; 421 $button.toggleClass("toggled-on").attr('aria-expanded', isMenuOpen); 422 $('#menu-main-navigation').toggleClass("open-menu"); 423}); 424 425// Handle click for top-level sub-dropdown-toggle (first level only) 426$topLevelSubToggles.on('click', function (e) { 427 e.stopPropagation(); // Prevent click from bubbling up 428 429 var $parentMenuItem = $(this).closest('.menu-item-has-children'); 430 431 // Toggle the visibility of the immediate submenu (first-level only) 432 var $subMenu = $parentMenuItem.children('.sub-menu'); 433 434 // Only toggle the immediate submenu and avoid affecting nested submenus 435 if ($subMenu.length) { 436 $subMenu.toggleClass('open-sub-menu'); 437 } 438 439 // Update the aria-expanded attribute for the toggle button 440 var isExpanded = $subMenu.hasClass('open-sub-menu'); 441 $(this).attr('aria-expanded', isExpanded).toggleClass('toggled-on'); 442}); 443 444// Ensure that clicking on nested toggle buttons doesn't trigger the top-level toggle 445$('.sub-dropdown-toggle').on('click', function (e) { 446 // Stop the event from bubbling up to prevent triggering the parent menu's behavior 447 e.stopPropagation(); 448 449 var $parentMenuItem = $(this).closest('.menu-item-has-children'); 450 451 // Toggle the nested submenu visibility 452 var $subMenu = $parentMenuItem.children('.sub-menu'); 453 if ($subMenu.length) { 454 $subMenu.toggleClass('open-sub-menu'); 455 } 456 457 // Update the aria-expanded for the nested toggle button 458 var isExpanded = $subMenu.hasClass('open-sub-menu'); 459 $(this).attr('aria-expanded', isExpanded).toggleClass('toggled-on'); 460}); 461 462 463 464 465 466 467 /* 468----------------------------- 469 470Calculates height of nav bars and sets mobile flyout height 471 472----------------------------- 473*/ 474 function setHeight() { 475 if (window.innerWidth <= 1100) { 476 var referenceHeight = $("#masthead").outerHeight(); 477 $(".menu-main-navigation-container").css("height", "calc(100dvh - " + referenceHeight + "px)"); 478 } else { 479 $(".menu-main-navigation-container").css("height", ""); // Reset height for larger screens 480 } 481 } 482 setHeight(); // Set height on page load 483 $(window).resize(function () { 484 setHeight(); // Update height on window resize 485 }); 486 487 488/* 489----------------------------- 490 491Wrap all tables with a div for RWD 492 493----------------------------- 494*/ 495 496 $("table.table-scroll").each(function() { 497 if (!$(this).parent().hasClass("table-wrap")) { 498 $(this).wrap("<div class='table-wrap'><div class='table-wrap-shadow'></div></div>"); 499 } 500 }); 501 502 503 504 505 506}); 507 508 509 510 511/* 512----------------------------- 513 514Remove no-scroll class from body when RWD menu is engaged and modal is triggered 515 516----------------------------- 517*/ 518 519jQuery(document).on("click", ".close-modal, .cancel, #continue-link, #continue-to-spanish, .cancel-es", function(event) { 520 if (jQuery("body").hasClass("no-scroll")) { 521 console.log("Removing 'no-scroll' class from body"); // Debugging log 522 jQuery("body").removeClass("no-scroll"); 523 } 524}); 525 526 527 528/* 529----------------------------- 530 531Swiper Sliders 532 533----------------------------- 534*/ 535 536
537 var swiper = new Swiper(".customer-reviews-slider", { 538 pagination: { 539 el: ".swiper-pagination", 540 clickable: true, 541 }, 542 }); 543 544 var swiper = new Swiper(".customer-reviews-card-slider", { 545 loop: true, 546 //autoHeight: true, 547 slidesPerView: 1, 548 slidesPerGroup: 1, 549 spaceBetween: 30, 550 pagination: { 551 el: ".swiper-pagination", 552 clickable: true, 553 }, 554 navigation: { 555 nextEl: ".swiper-button-next", 556 prevEl: ".swiper-button-prev", 557 }, 558 breakpoints: { 559 560 // when window width is >= 500px 561 600: { 562 loop: true, 563 //autoHeight: true, 564 slidesPerView: 2, 565 slidesPerGroup: 2, 566 spaceBetween: 30, 567 }, 568 569 // when window width is >= 1050px 570 1050: { 571 loop: true, 572 //autoHeight: true, 573 slidesPerView: 3, 574 slidesPerGroup: 3, 575 spaceBetween: 30, 576 } 577 } 578 }); 579 580 581/* 582----------------------------- 583 584Meet the team slider 585 586----------------------------- 587*/ 588 589 var swiper = new Swiper(".team-slider", { 590 slidesPerView: 1, 591 slidesPerGroup: 1, 592 spaceBetween: 30, 593 navigation: { 594 nextEl: ".swiper-button-next", 595 prevEl: ".swiper-button-prev", 596 }, 597 pagination: { 598 el: ".swiper-pagination", 599 clickable: true, 600 }, 601 breakpoints: { 602 // when window width is >= 500px 603 600: { 604 loop: true, 605 //autoHeight: true, 606 slidesPerView: 2, 607 slidesPerGroup: 2, 608 spaceBetween: 30, 609 }, 610 // when window width is >= 1050px 611 1050: { 612 slidesPerView: 3, 613 slidesPerGroup: 3, 614 spaceBetween: 30, 615 } 616 } 617 }); 618 619 620 621/* 622----------------------------- 623 624Quote slider 625 626----------------------------- 627*/ 628 629 var swiper = new Swiper(".quote-slider", { 630 loop: true, 631 navigation: { 632 nextEl: ".swiper-button-next", 633 prevEl: ".swiper-button-prev", 634 }, 635 }); 636 637 638 639 640 641 642/* 643----------------------------- 644 645Headroom 646 647----------------------------- 648*/ 649 650var Header = document.querySelector("header"); 651var headroom = new Headroom(Header, { 652 offset: 40, 653 tolerance: 0 654}); 655headroom.init(); 656 657 658 659 660/* 661----------------------------- 662 663Accordion 664 665----------------------------- 666*/ 667 668document.addEventListener("DOMContentLoaded", function () { 669 // Initialize each accordion container individually 670 document.querySelectorAll('.accordion-container').forEach(container => { 671 new Accordion(container, { 672 duration: 200, 673 showMultiple: false, 674 }); 675 }); 676 677 // Hash handling 678 function openAccordionByHash() { 679 const hash = window.location.hash.replace('#', ''); 680 if (!hash) return; 681 682 const section = document.getElementById(hash); 683 if (!section || !section.classList.contains('ac')) return; 684 685 // Open parent items 686 let current = section; 687 while (current) { 688 if (current.classList.contains('ac') && !current.classList.contains('is-active')) { 689 const trigger = current.querySelector('.ac-trigger'); 690 if (trigger) trigger.click(); 691 } 692 current = current.parentElement.closest('.ac'); 693 } 694 695 // Scroll into view 696 setTimeout(() => { 697 section.scrollIntoView({ behavior: 'smooth' }); 698 }, 300); 699 } 700 701 setTimeout(openAccordionByHash, 300); 702 703 // Update hash on open 704 document.querySelectorAll('.ac').forEach((item) => { 705 const trigger = item.querySelector('.ac-trigger'); 706 const id = item.getAttribute('id'); 707 if (!id || !trigger) return; 708 709 trigger.addEventListener('click', () => { 710 setTimeout(() => { 711 if (item.classList.contains('is-active')) { 712 history.replaceState(null, '', `#${id}`); 713 } 714 }, 100); 715 }); 716 }); 717 }); 718 719 720/* 721----------------------------- 722 723Track Spanish translation link in GA 724 725----------------------------- 726*/ 727 document.addEventListener('DOMContentLoaded', function() { 728 var btn = document.getElementById('continue-to-spanish'); 729 if (btn) { 730 btn.addEventListener('click', function() { 731 gtag('event', 'continue_to_spanish_click', { 732 event_category: 'engagement', 733 event_label: 'Continue to Spanish', 734 button_id: 'continue-to-spanish' 735 }); 736 }); 737 } 738 }); 739 740 741 742 743/* 744----------------------------- 745 746HFG Hero animation 747 748----------------------------- 749*/ 750 751 752document.addEventListener('DOMContentLoaded', () => { 753 const wordLists = document.querySelectorAll('.rotating-words .word-list'); 754
755 wordLists.forEach(list => { 756 const words = Array.from(list.children); 757 const visibleCount = 3; // show 3 words 758 let currentIndex = 0; 759 760 // Clone first 'visibleCount' words to make seamless loop 761 words.slice(0, visibleCount).forEach(word => { 762 const clone = word.cloneNode(true); 763 list.appendChild(clone); 764 }); 765 766 const totalWords = list.children.length; 767 const wordHeight = words[0].offsetHeight; 768 769 function rotate() { 770 currentIndex++; 771 list.style.transition = 'transform 0.4s cubic-bezier(0.680, -0.550, 0.265, 1.550)'; 772 list.style.transform = `translateY(-${wordHeight * currentIndex}px)`; 773 774 // normal case: update active class 775 if (currentIndex < totalWords - visibleCount) { 776 list.querySelectorAll('span').forEach(span => span.classList.remove('active')); 777 const middleIndex = currentIndex + 1; 778 list.children[middleIndex].classList.add('active'); 779 } 780 781 // seamless reset 782 if (currentIndex >= totalWords - visibleCount) { 783 setTimeout(() => { 784 list.style.transition = 'none'; 785 list.style.transform = 'translateY(0)'; 786 currentIndex = 0; 787 788 // re-add active class after reset 789 list.querySelectorAll('span').forEach(span => span.classList.remove('active')); 790 list.children[1].classList.add('active'); 791 792 // force reflow so next transition works smoothly 793 list.offsetHeight; 794 list.style.transition = 'transform 0.4s cubic-bezier(0.515, 0.020, 0.000, 1.020))'; 795 }, 300); // match transition duration 796 } 797 } 798 799 // initialize active class 800 list.children[1].classList.add('active'); 801 802 setInterval(rotate, 2000); 803 }); 804}); 805 806 807 808 809 810/* 811----------------------------- 812 813HFG event tracking 814 815----------------------------- 816*/ 817 818 819(function () { 820 var isTestimonialPage = document.body.classList.contains("page-template-here-for-good-testimonials"); 821 var isMainHfgPage = document.body.classList.contains("page-id-743"); 822 823 if (!isTestimonialPage && !isMainHfgPage) return; 824 825 function storyFromUrl(url) { 826 var path = ""; 827 try { 828 path = new URL(url || window.location.href, window.location.origin).pathname.toLowerCase(); 829 } catch (e) { 830 path = (window.location.pathname || "").toLowerCase(); 831 } 832 833 if (path.includes("boys-and-girls-club-allentown")) return "katarah"; 834 if (path.includes("mr-bills-poultry")) return "bill"; 835 if (path.includes("la-mega")) return "victor"; 836 if (path.includes("/here-for-good/")) return "dave"; 837 return "unknown"; 838 } 839 840 var pageStory = isMainHfgPage ? "dave" : storyFromUrl(window.location.href); 841 842 var CONTACT_URL = "https://embassybank.com/contact-us/"; 843 var OPEN_ACCOUNT_URL = "https://forms.fivision.com/embassybank/oa"; 844 845 function isTestimonialCta(linkEl) { 846 // Only the main page has these âRead ___âs Storyâ CTAs 847 if (!isMainHfgPage) return false; 848 return !!linkEl.closest("a.more"); 849 } 850 851 document.addEventListener("click", function (e) { 852 var link = e.target.closest("a"); 853 if (!link) return; 854 855 // Fail silently if GA4 isn't available (ad blockers, tag not loaded, etc.) 856 if (typeof window.gtag !== "function") return; 857 858 var href = link.href || ""; 859 var text = (link.textContent || "").trim(); 860 861 // Testimonial page: product cross-promo pill links 862 var isPillLink = isTestimonialPage && !!link.closest(".tags-list"); 863 864 // Nav CTAs (track on both main + testimonial pages) 865 var isContact = href.indexOf(CONTACT_URL) === 0; 866 var isOpenAccount = href.indexOf(OPEN_ACCOUNT_URL) === 0; 867 868 // Main page: âRead ___âs Storyâ CTA links 869 var isStoryCta = isTestimonialCta(link); 870 871 if (!isPillLink && !isContact && !isOpenAccount && !isStoryCta) return; 872 873 var linkType = "other"; 874 if (isPillLink) linkType = "product_pill"; 875 else if (isStoryCta) linkType = "testimonial_cta"; 876 else if (isContact) linkType = "nav_contact"; 877 else if (isOpenAccount) linkType = "nav_open_account"; 878 879 window.gtag("event", "hfg_engagement_click", { 880 page_type: isTestimonialPage ? "testimonial" : "main", 881 story: pageStory, 882 link_type: linkType, 883 link_text: text, 884 link_url: href, 885 destination_story: isStoryCta ? storyFromUrl(href) : undefined 886 }); 887 }); 888})(); 889 890 891 892/* 893----------------------------- 894 895TEMP: Dynamically change page colors based on Vericast UTM code params 896 897----------------------------- 898*/ 899 900const params = new URLSearchParams(window.location.search); 901 902const color = params.get('utm_color'); 903const campaign = params.get('utm_campaign'); 904 905if (color) { 906 const safeColor = color.toLowerCase().replace(/[^a-z0-9_-]/g, ''); 907 document.body.classList.add(`utm-${safeColor}`); 908} 909 910if (campaign) { 911 const safeCampaign = campaign.toLowerCase().replace(/[^a-z0-9_-]/g, ''); 912 document.body.classList.add(`campaign-${safeCampaign}`); 913} 914 915const hero = document.querySelector('.page-template-landing-pages .hero img'); 916 917if (hero) { 918 hero.removeAttribute('srcset'); 919 hero.removeAttribute('sizes'); 920 921 switch (color) { 922 case 'pk': 923 hero.src = '/wp-content/uploads/2026/07/ucm2-header.jpg'; 924 hero.alt = 'Uncommon Mortgage Rate'; 925 break; 926 927 case 'pr': 928 hero.src = '/wp-content/uploads/2026/07/ucm3-header.jpg'; 929 hero.alt = 'Uncommon Mortgage Rate'; 930 break; 931 } 932} 933 934 935 936 937/* 938----------------------------- 939 940Cookie Disclosure Notice 941 942----------------------------- 943*/ 944 945document.addEventListener('DOMContentLoaded', function () { 946 const disclosure = document.getElementById('cookie-disclosure'); 947 948 if (!disclosure) { 949 return; 950 } 951 952 const closeButton = disclosure.querySelector('.cookie-disclosure-close'); 953 const version = disclosure.dataset.version || '1'; 954 const storageKey = 'emb_cookie_disclosure_version'; 955 956 if (localStorage.getItem(storageKey) === version) { 957 return; 958 } 959 960 disclosure.hidden = false;
961 962 closeButton.addEventListener('click', function () { 963 localStorage.setItem(storageKey, version); 964 disclosure.classList.add('is-dismissed'); 965 disclosure.addEventListener('transitionend', function () { 966 disclosure.hidden = true; 967 }, { once: true }); 968}); 969}); 970
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.