(function () { function initTrustArc() { // Avoid duplicate injection if (document.getElementById('trustarc-script')) return; // Hide OneTrust and Termly links (optional, already handled in HTML) const termlyLinks = document.querySelectorAll( '#termlyConsentLink, a.termly-display-preferences' ); termlyLinks.forEach(link => { link.outerHTML = '
'; }); // Add TrustArc CSS if (!document.getElementById('trustarc-css')) { const css = document.createElement('link'); css.id = 'trustarc-css'; css.rel = 'stylesheet'; css.href = "https://members.propertychecker.com/tspecV2/shared/css/trustArcCustom.css"; document.head.appendChild(css); } // Ensure banner container exists if (!document.getElementById('consent-banner')) { const div = document.createElement('div'); div.id = 'consent-banner'; document.body.appendChild(div); } // Add fixed positioning CSS if (!document.getElementById('trustarc-inline-style')) { const style = document.createElement('style'); style.id = 'trustarc-inline-style'; style.textContent = ` #consent-banner { position: fixed !important; right: 0 !important; bottom: 0 !important; z-index: 2147483647 !important; } `; document.head.appendChild(style); } // Add TrustArc script const script = document.createElement('script'); script.id = 'trustarc-script'; script.src = "https://consent.trustarc.com/v2/notice/d8wizd?pcookie"; script.async = true; script.type = 'text/javascript'; script.onload = function () { const teconsent = document.getElementById('teconsent'); if (teconsent) { teconsent.style.display = 'block'; } }; script.onerror = function () { console.error('TrustArc script failed to load'); }; document.head.appendChild(script); } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', initTrustArc); } else { initTrustArc(); } })(); //window.addEventListener('DOMContentLoaded', () => { // // // Hide OneTrust and Termly links (optional, already handled in HTML) // const oneTrustLink = document.getElementById('oneTrustConsentLink'); // const termlyLink = document.getElementById('termlyConsentLink'); // //if (oneTrustLink) oneTrustLink.style.display = 'none'; // //if (termlyLink) termlyLink.style.display = 'none'; // //if (termlyLink) termlyLink.outerHTML = ''; // // const termlyLinks = document.querySelectorAll( // '#termlyConsentLink, a.termly-display-preferences' // ); // // termlyLinks.forEach(link => { // link.outerHTML = ''; // }); // // // Add TrustArc CSS // const css = document.createElement('link'); // css.rel = 'stylesheet'; // css.href = "//"; // document.head.appendChild(css); // // const div = document.createElement("div"); // div.id = "consent-banner"; // document.body.appendChild(div); // // const script = document.createElement('script'); // script.src = "//"; // script.async = true; // script.type = "text/javascript"; // // // Show teconsent only after TrustArc loads successfully // script.onload = () => { // teconsent.style.display = 'block'; // }; // // //document.head.appendChild(script); // document.head.insertBefore(script, document.head.firstChild); // // const style = document.createElement('style'); // style.textContent = ` // /* Example: force floating */ // #consent-banner { // position: fixed !important; // //left: 0 !important; // right: 0 !important; // bottom: 0 !important; // z-index: 2147483647 !important; // } // `; // // document.head.appendChild(style); //});