Skip to main content
Home
About ICA
Management
Our Partners
Our Board Of Directors
Insurance
Personal Insurance
Corporate Insurance
Claims
More
Customer Service
FAQs
Media
Contact
Get a Quote
Contact Us
Last Name
*
First Name
*
Phone
*
Email
Policy Type
Select
Auto Claims
Travel
Fire
Subject
Message
document.addEventListener("DOMContentLoaded", function () { /* ========================================================= ICA WEBSITE - MOBILE MENU ========================================================= */ const menuToggle = document.querySelector(".ica-menu-toggle"); const nav = document.querySelector(".ica-nav"); if (menuToggle && nav) { menuToggle.addEventListener("click", function () { const isOpen = nav.classList.toggle("is-open"); menuToggle.setAttribute( "aria-expanded", isOpen ? "true" : "false" ); document.body.classList.toggle("ica-menu-open", isOpen); }); } /* ========================================================= ICA WEBSITE - MOBILE DROPDOWNS ========================================================= */ const dropdownButtons = document.querySelectorAll( ".ica-nav .dropdown-toggle" ); dropdownButtons.forEach(function (button) { button.addEventListener("click", function (event) { /* * On mobile/tablet, clicking a dropdown title * opens and closes the submenu. */ if (window.innerWidth <= 920) { event.preventDefault(); const parent=button.closest(".has-dropdown"); if (!parent) { return; } parent.classList.toggle("dropdown-open"); } }); }); /*========================================================= ICA WEBSITE - CLOSE MENU AFTER CLICKING A LINK========================================================= */ const navLinks=document.querySelectorAll( ".ica-nav a" ); navLinks.forEach(function (link) { link.addEventListener("click", function () { if (window.innerWidth<= 920 && nav) { nav.classList.remove("is-open"); document.body.classList.remove( "ica-menu-open" ); if (menuToggle) { menuToggle.setAttribute( "aria-expanded", "false" ); } } }); }); /*========================================================= ICA WEBSITE - CLOSE DROPDOWNS WHEN CLICKING OUTSIDE========================================================= */ document.addEventListener("click", function (event) { if (!event.target.closest(".ica-nav")) { document .querySelectorAll(".ica-nav .has-dropdown") .forEach(function (dropdown) { dropdown.classList.remove( "dropdown-open" ); }); } }); /*========================================================= ICA WEBSITE - SMOOTH ANCHOR SCROLLING========================================================= */ document .querySelectorAll('a[href^="#" ]') .forEach(function (anchor) { anchor.addEventListener("click", function (event) { const targetId=anchor.getAttribute("href"); if (!targetId || targetId=== "#") { return; } const target=document.querySelector(targetId); if (!target) { return; } event.preventDefault(); target.scrollIntoView({ behavior: "smooth", block: "start" }); }); }); /*========================================================= ICA WEBSITE - REVEAL ANIMATION========================================================= */ const revealElements=document.querySelectorAll(".ica-reveal"); if ("IntersectionObserver" in window) { const observer=new IntersectionObserver( function (entries, observerInstance) { entries.forEach(function (entry) { if (entry.isIntersecting) { entry.target.classList.add( "is-visible" ); observerInstance.unobserve( entry.target ); } }); }, { threshold: 0.12 } ); revealElements.forEach(function (element) { observer.observe(element); }); } else { revealElements.forEach(function (element) { element.classList.add("is-visible"); }); } /*========================================================= ICA WEBSITE - HEADER SCROLL EFFECT========================================================= */ const header=document.querySelector(".ica-header"); function updateHeader() { if (!header) { return; } if (window.scrollY> 30) { header.classList.add( "ica-header-scrolled" ); } else { header.classList.remove( "ica-header-scrolled" ); } } window.addEventListener( "scroll", updateHeader, { passive: true } ); updateHeader(); /* ========================================================= ICA WEBSITE - RESET MOBILE MENU ON RESIZE ========================================================= */ window.addEventListener("resize", function () { if (window.innerWidth > 920) { if (nav) { nav.classList.remove("is-open"); } if (menuToggle) { menuToggle.setAttribute( "aria-expanded", "false" ); } document.body.classList.remove( "ica-menu-open" ); document .querySelectorAll(".ica-nav .has-dropdown") .forEach(function (dropdown) { dropdown.classList.remove( "dropdown-open" ); }); } }); });