// Contact page functionality function makePhoneCall() { const phoneNumber = "5617197374"; // Try multiple approaches try { // Method 1: Direct window.location window.location.href = `tel:${phoneNumber}`; } catch (e) { try { // Method 2: With country code window.location.href = `tel:+1${phoneNumber}`; } catch (e2) { try { // Method 3: With dashes window.location.href = `tel:561-719-7374`; } catch (e3) { // Fallback: Copy to clipboard and alert user navigator.clipboard.writeText("561-719-7374").then(() => { alert("Phone number copied to clipboard: 561-719-7374"); }).catch(() => { alert("Please call: 561-719-7374"); }); } } } } function sendEmail() { const email = "Brian@lwcservices.org"; const subject = "Lake and Wetland Consulting Inquiry"; try { // Method 1: Direct mailto window.location.href = `mailto:${email}?subject=${encodeURIComponent(subject)}`; } catch (e) { try { // Method 2: Simple mailto window.location.href = `mailto:${email}`; } catch (e2) { // Fallback: Copy to clipboard and alert user navigator.clipboard.writeText(email).then(() => { alert("Email address copied to clipboard: " + email); }).catch(() => { alert("Please email: " + email); }); } } } // Export functions for the module system export function init() { // Add event listeners when page loads console.log("Contact page JavaScript initialized"); } export function teardown() { // Clean up when page unloads console.log("Contact page JavaScript cleaned up"); } // Make functions globally available window.makePhoneCall = makePhoneCall; window.sendEmail = sendEmail;