// -->
// let o=document.createElement('script');o.async=1;o.crossOrigin='anonymous';o.src='https://www.googletagmanager.com/gtag/js?id=AW-824264721';
// let y=document.getElementsByTagName('script')[0];y.parentNode.insertBefore(o,y);
// window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'AW-824264721',{'restricted_data_processing':true});
// gtag('event','page_view',{'send_to':'AW-824264721','value':'1'});
// Load Tawk.to
// var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date();(function(){var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0];s1.async=true;s1.src='https://embed.tawk.to/670c89a34304e3196ad125c0/1ia4fjaff';s1.charset='UTF-8';s1.setAttribute('crossorigin','*');s0.parentNode.insertBefore(s1,s0);})();
// load Flickity when a gll
if (document.querySelector('.gallery'))// does a caroursel exist? don't attempt to load flickity if not required
{
// CSS
let fileref=document.createElement("link");fileref.setAttribute("rel","stylesheet");fileref.setAttribute("type","text/css");fileref.setAttribute("href","/media/website_designs/flickity/flickity.min.css");
document.getElementsByTagName("head")[0].appendChild(fileref);
// JS
let o=document.createElement('script');o.async=1;o.crossOrigin='anonymous';o.src='/media/website_designs/flickity/flickity.pkgd.min.js';
let y=document.getElementsByTagName('script')[0];y.parentNode.insertBefore(o,y);
// o.onload = instantiateFlickity();
o.onload = function(){instantiateFlickity()};
}
});
// load flickity once flickity is ready for use
function instantiateFlickity()
{
let allGalleries = document.querySelectorAll('.gallery');
allGalleries.forEach((carousel, key) =>
{
let options = {};
if (carousel.classList.contains('testimonial'))
{
options.cellAlign = "left";options.contain = true;options.wrapAround = true;options.arrowShape = {x0:15,x1:65,y1:50,x2:70,y2:45,x3:25};
}
else if (carousel.classList.contains('homepage-banner'))
{
options.wrapAround = true;options.arrowShape = {x0:15,x1:65,y1:50,x2:70,y2:45,x3:25};options.cellSelector = ".banner";options.prevNextButtons = true;options.autoPlay = 6000;options.pauseAutoPlayOnHover = true;
}
else
{
options.cellSelector = ".image";options.adaptiveHeight = true;options.imagesLoaded = true;options.prevNextButtons = false;options.pageDots = false;
}
if (!carousel.classList.contains('hasDots')){options.pageDots = false;}
if (!carousel.classList.contains('hasButtons')){options.prevNextButtons = false;}
if (carousel.classList.contains('autoPlay')){options.contain = true;options.autoPlay = 2500;options.pauseAutoPlayOnHover = true}
if (carousel.classList.contains('contain')){options.contain = true;options.wrapAround = false;}
if (carousel.classList.contains('enableAdaptiveHeight')){options.contain = true;options.adaptiveHeight = true;}
let flkty = new Flickity(carousel, options);
});
let allGalleryNavs = document.querySelectorAll('.gallery-nav');
allGalleryNavs.forEach((carousel, key) =>
{
let options = {};options.asNavFor = '.gallery';options.imagesLoaded = true;options.contain = true;options.prevNextButtons = false;options.pageDots = false;
let flkty_navs = new Flickity(carousel, options);
});
}
// Hamburger menu functionality
document.addEventListener('DOMContentLoaded', () => {
const hamburgerMenu = document.querySelector('.hamburger-menu');
const navMenu = document.querySelector('.primary ul');
// Add click event listener to toggle menu
hamburgerMenu.addEventListener('click', () => {
navMenu.classList.toggle('open');
});
// Close menu when clicking outside
document.addEventListener('click', (event) => {
if (!hamburgerMenu.contains(event.target) && !navMenu.contains(event.target)) {
navMenu.classList.remove('open');
}
});
});