jQuery(document).ready(function(){
jQuery('a[href^="http"]').not('a[href*="firstcountybank.com"]').attr('target','_blank');
jQuery('a[href$=".pdf"]').attr('target','_blank');
});
//**************************************CF7 FIX
jQuery( ".wpcf7-inline-wrapper > p:not(.wpcf7-inline-field)" ).remove();
jQuery( ".wpcf7 br" ).remove();
//*****************************************TABS
jQuery(window).on('load',function(){
jQuery(".nav-tabs").on(
'shown.bs.tab', function() {
window.dispatchEvent(new CustomEvent('boxResized'));
}
);
});
//*****************************************MOBILE SEARCH
jQuery('.mobileSearchIcon').click(function() {
jQuery('.mobileSearch').toggleClass('show');
});
jQuery('.accountMobile').click(function() {
jQuery('.accountDrop').toggleClass('show');
});
//*****MOBILE MENU
document.addEventListener(
'click',
function (e) {
// If you only want this on mobile, uncomment:
// if (window.innerWidth > 959) return;
// Click on the parent link inside .blockAdd
var link = e.target.closest('.blockAdd > a');
if (!link) return;
//e.preventDefault();
//e.stopImmediatePropagation();
var li = link.closest('.blockAdd');
if (!li) return;
// Level 1: the mega-menu-inner UL directly under .blockAdd
var panel = li.querySelector(':scope > ul');
if (!panel) return;
// Level 2: its first drop-menu
var drop = panel.querySelector(':scope > li:first-child > ul.drop-menu');
if (!drop) return;
var isOpen = panel.dataset.fcbOpen === 'true';
if (!isOpen) {
// OPEN: mark, add class, and force display inline
panel.dataset.fcbOpen = 'true';
panel.classList.add('block');
drop.classList.add('block');
panel.style.setProperty('display', 'block', 'important');
drop.style.setProperty('display', 'block', 'important');
drop.style.setProperty('visibility', 'visible', 'important');
drop.style.setProperty('pointer-events', 'auto', 'important');
} else {
// CLOSE: clear markers, remove inline display
panel.dataset.fcbOpen = 'false';
panel.classList.remove('block');
drop.classList.remove('block');
panel.style.removeProperty('display');
drop.style.removeProperty('display');
drop.style.removeProperty('visibility');
drop.style.removeProperty('pointer-events');
}
},
true
);
//******************************************EXIT INTENT
// Open external links in a popup modal notice
jQuery(window).on('load', function() {
jQuery('.menu-item a').removeAttr('data-toggle');
jQuery.expr[":"].external = function(a) {
var linkhn = a.hostname.split('.').reverse();
var linkHref = linkhn[1] + "." + linkhn[0];
var domainhn = window.location.hostname.split('.').reverse();
var domainHref = domainhn[1] + "." + domainhn[0];
return !a.href.match(/^mailto\:/) && !a.href.match(/^tel\:/) && linkHref !== domainHref;
};
jQuery('a:external').addClass("ext_link");
jQuery('.safe a').removeClass("ext_link");
jQuery('.njt-nofi-notification-bar a').removeClass("ext_link");
jQuery(function() {
jQuery('a.ext_link').click(function(event) {
event.preventDefault(); // Prevent the default link behavior
var url = jQuery(this).attr('href');
// Open the modal
jQuery('#speedbump').addClass('show');
// Event handler for the continue button
jQuery('.btn-modal.btn-continue').off('click').on('click', function() {
window.open(url);
jQuery('#speedbump').removeClass('show');
});
// Event handler for the close button
jQuery('.btn-modal.btn-close').off('click').on('click', function() {
jQuery('#speedbump').removeClass('show');
});
});
});
});
// END MODAL
//******************************************ADVISORS NAV
jQuery(document).ready(function(){
jQuery("body[class*='id-12511'] a.navbar-brand").attr("href", "https://www.firstcountybank.com/advisors/");
jQuery("body[class*='id-12511'] #main-logo").addClass("safe");
jQuery("body.first-county-advisors a.navbar-brand").attr("href", "https://www.firstcountybank.com/advisors/");
jQuery("body.first-county-advisors #main-logo").addClass("safe");
jQuery("body.tax-portfolio_category a.navbar-brand").attr("href", "https://www.firstcountybank.com/advisors/");
jQuery("body.tax-portfolio_category #main-logo").addClass("safe");
jQuery("body.single-portfolio a.navbar-brand").attr("href", "https://www.firstcountybank.com/advisors/");
jQuery("body.sungle-portfolio #main-logo").addClass("safe");
jQuery(".advisors #menu-item-12576").addClass("safe")
jQuery(".advisors a.navbar-brand").attr("href", "https://www.firstcountybank.com/advisors/");
jQuery(".advisors #main-logo").addClass("safe");
jQuery(".advisors #menu-item-12576").addClass("safe")
});
//*****FIX MENU when Notibar is there
// Use jQuery noConflict mode to avoid conflicts with other libraries
jQuery.noConflict();
// Wait for the DOM to be fully loaded
jQuery(document).ready(function($) {
// Function to check if #masthead has the class .is_stuck and add .stuckUp to .igmenu if it does
function checkSticky() {
if ($('#masthead').hasClass('is_stuck')) {
$('.igmenu').addClass('stuckUp');
} else {
$('.igmenu').removeClass('stuckUp');
}
}
// Call checkSticky on page load
checkSticky();
// Call checkSticky on every scroll event
$(window).scroll(function() {
checkSticky();
});
});
You are accessing a resource that includes multiple links to data not hosted on our web site.
This service has been provided for your education and convenience only. It does not imply that the First County Bank endorses or sponsors the included companies or organizations. We also cannot guarantee the accuracy of the information offered or the privacy of any information you may disclose while on these sites.
The products and services offered on 3rd party sites, including investment and insurance products, are not products of First County Bank and may not be insured by the FDIC.