document.querySelectorAll('.phone-cta a').forEach(function(phoneLink) {
phoneLink.addEventListener('click', function(event) {
// Get the phone number from the href attribute
const phoneNumber = phoneLink.getAttribute('href').replace('tel:', '');
// Check if the user is on a desktop (screen width >= 768px)
const isDesktop = window.matchMedia("screen and (min-width: 768px)").matches;
// If it's a desktop, open a VoIP app (e.g., Skype)
if (isDesktop) {
event.preventDefault(); // Prevent the default behavior (link following)
// Create the Skype link using the phone number
const skypeLink = `skype:${phoneNumber}?call`; // Skype example
// Redirect to the Skype app (or any other VoIP app that supports the "tel:" link)
window.location.href = skypeLink;
}
});
});