"use strict";
(function() {
    var waitForJQuery = setInterval(function() {
        if ((typeof jQuery !== 'undefined') && (typeof window.jQuery !== 'undefined')) {
            clearInterval(waitForJQuery);

            $(function() {
                let pathname = window.location.pathname;
				const arr = pathname.split("/");
				let context = arr[1];
				if (context == "bank") {
					$('#footerSelect').val("footer-contact-us-bank");
					$('#footerSelect').val("footer-contact-us-bank").change();
				} else if (context == "medical-aid") {
					$('#footerSelect').val("footer-contact-us-medical-aid");
					$('#footerSelect').val("footer-contact-us-medical-aid").change();
				} else if (context == "gap") {
					$('#footerSelect').val("footer-contact-us-gap-cover");
					$('#footerSelect').val("footer-contact-us-gap-cover").change();
				} else if (context == "life-insurance") {
					$('#footerSelect').val("footer-contact-us-life-insurance");
					$('#footerSelect').val("footer-contact-us-life-insurance").change();
				} else if (context == "investments") {
					$('#footerSelect').val("footer-contact-us-investments");
					$('#footerSelect').val("footer-contact-us-investments").change();
				} else if (context == "car-and-home-insurance") {
					$('#footerSelect').val("footer-contact-us-car-and-home-insurance");
					$('#footerSelect').val("footer-contact-us-car-and-home-insurance").change();
				} else if (context == "vitality") {
					$('#footerSelect').val("footer-contact-us-vitality");
					$('#footerSelect').val("footer-contact-us-vitality").change();
				}
            });
        }
    }, 500);
})();
