$(document).ready(function () { $("a.scrollto").on("click", function (o) { var t = this.hash; o.preventDefault(), $("body").scrollTo(t, 800, { offset: 0, axis: "y" }) }) $('#map').addClass('scrolloff'); // set the mouse events to none when doc is ready $('#overlay').on("mouseup",function(){ // lock it when mouse up $('#map').addClass('scrolloff'); //somehow the mouseup event doesn't get call... }); $('#overlay').on("mousedown",function(){ // when mouse down, set the mouse events free $('#map').removeClass('scrolloff'); }); $("#map").mouseleave(function () { // becuase the mouse up doesn't work... $('#map').addClass('scrolloff'); // set the pointer events to none when mouse leaves the map area // or you can do it on some other event }); $('.faq-item .faq-question').on('click', function () { // Check if the target faq content is visible var isOpen = $(this).next('.collapse').hasClass('show'); var $toggleIcon = $(this).find('.toggle-icon'); // Toggle the icon class for the clicked faq var $toggleIcon = $(this).find('.toggle-icon'); // Close all accordions and reset icons $('.faq-item .collapse').collapse('hide'); $('.faq-item .toggle-icon').removeClass('fa-angle-up').addClass('fa-angle-down'); if (isOpen) { $toggleIcon.removeClass('fa-angle-up').addClass('fa-angle-down'); } else { $toggleIcon.removeClass('fa-angle-down').addClass('fa-angle-up'); } // Show/hide the content of the clicked faq based on its previous state var target = $(this).data('target'); if (!isOpen) { $(target).collapse('show'); } }); // Add 'active' class to the first '.carousel-item' $('.carousel-item').eq(0).addClass('active'); // Attach the submit handler to the form $('#contact_us').on('submit', submitFormViaAjax); }); $(document).ready(function () { $('.sub-menu ul').hide(); $('.sub-sub-menu ul').hide(); $(".sub-menu a").click(function () { $(this) .parent(".sub-menu") .children("ul") .slideToggle("100"); $(this) .find(".right") .toggleClass("fa-chevron-up fa-chevron-down"); }); $(".sub-sub-menu .icon").click(function () { $(this) .parent() .parent(".sub-sub-menu") .children("ul") .slideToggle("100"); $(this) .find(".right") .toggleClass("fa-chevron-up fa-chevron-down"); }); }); $(document).ready(function() { // Get the hostname of the current site var currentHost = window.location.hostname; // Select all anchor tags $('a').each(function() { var link = $(this); var href = link.attr('href'); // Check if the href is absolute and points to an external domain if (href && href.includes("//") && !href.includes(currentHost)) { // Set target to _blank to open in new tab and add rel for security link.attr('target', '_blank'); link.attr('rel', 'noopener noreferrer'); // Add an external link icon to the link text } }); }); function submitFormViaAjax(e) { e.preventDefault(); // Prevent the default form submission // Serialize form data var formData = $('#contact_us').serialize(); $('#contact_us').css('opacity', '0.5'); var submitButton = $('#contact_us').find('input[type="submit"]'); // Add the 'shadow-submitted' class to the submit button submitButton.addClass('shadow-submitted'); // Send AJAX request $.ajax({ url: '/', type: 'POST', data: formData, success: function(response) { $('#contact_us_confirm_message').show(); $('#contact_us').find('.submit-error-message').hide(); $('#contact_us').hide(); }, error: function(xhr, status, error) { submitButton.removeClass('shadow-submitted'); $('#contact_us').css('opacity', '1'); // Parse the response JSON var errorResponse = JSON.parse(xhr.responseText); // Extract the error message var errorMessage = errorResponse.errors.message[0]; $('#contact_us').find('.submit-error-message').text(errorMessage).show(); grecaptcha.reset(); } }); } $(document).ready(function () { console.log('ready'); $('.media oembed').each(function () { // Get the URL from the tag const embedUrl = $(this).attr('url'); console.log('embedUrl: ',embedUrl); if (embedUrl) { // Create a new `; // Replace the
element with the new