opens if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', () => { document.body.prepend(script); }); } else { document.body.prepend(script); } } else if (adsAllowed && existingScript) { // If script already exists, just ensure it's loaded existingScript.src = '//tag.brandcdn.com/autoscript/cocreate_vgxssmqwouvrwgm9/Cocreate.js'; } else { // If consent is denied, ensure the script is removed if (existingScript) { existingScript.remove(); } } } // Called by OneTrust after the banner and groups load: function OptanonWrapper() { applyAnalyticsConsent(); applyAdsConsent(); } // Re-run whenever the user updates their choices document.addEventListener('OneTrustActiveGroupsUpdated', () => { applyAnalyticsConsent(); applyAdsConsent(); });