// Email obfuscation data const emailData = { contact: { user: String.fromCharCode(99, 111, 110, 116, 97, 99, 116), domain: String.fromCharCode(118, 105, 116, 114, 97, 102, 111, 120, 105, 110), tld: String.fromCharCode(99, 111, 109) }, support: { user: String.fromCharCode(115, 117, 112, 112, 111, 114, 116), domain: String.fromCharCode(118, 105, 116, 114, 97, 102, 111, 120, 105, 110), tld: String.fromCharCode(99, 111, 109) } }; // Replace email addresses when page loads document.addEventListener('DOMContentLoaded', function() { // Find all elements with class 'email-protection' const emailElements = document.querySelectorAll('.email-protection'); emailElements.forEach(element => { const type = element.dataset.type; // 'contact' or 'support' const emailAddress = `${emailData[type].user}@${emailData[type].domain}.${emailData[type].tld}`; if (element.tagName === 'A') { element.href = `mailto:${emailAddress}`; } element.textContent = emailAddress; }); }); // Update terms and privacy links depending on where hosted const domain = window.location.hostname; const termsLink = document.getElementById('termsLink'); const privacyLink = document.getElementById('privacyLink'); const contactLink = document.getElementById('contactLink'); if (domain === 'advancedbiohealth.com') { termsLink.href = '../../vsl/Vitrafoxin/terms.html'; privacyLink.href = '../../vsl/Vitrafoxin/privacy.html'; contactLink.href = '../../vsl/Vitrafoxin/contact.html'; } else { termsLink.href = 'terms.html'; privacyLink.href = 'privacy.html'; contactLink.href = 'contact.html'; }