/* Sales-Talent.net cookie consent banner (GDPR / ePrivacy). Analytics only after "Accept". */ (function () { var GA_ID = 'G-WGD0T497P5'; var KEY = 'st_cookie_consent'; var NAVY = '#274479', ORANGE = '#CB8744'; function getChoice() { try { return localStorage.getItem(KEY); } catch (e) { return null; } } function setChoice(v) { try { localStorage.setItem(KEY, v); } catch (e) {} } function deleteGaCookies() { var host = location.hostname.split('.'); var domains = ['', location.hostname]; for (var i = 0; i < host.length - 1; i++) domains.push('.' + host.slice(i).join('.')); document.cookie.split(';').forEach(function (c) { var name = c.split('=')[0].trim(); if (/^(_ga|_gid|_gat)/.test(name)) { domains.forEach(function (d) { document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/' + (d ? '; domain=' + d : ''); }); } }); } function enableAnalytics() { window['ga-disable-' + GA_ID] = false; window.dataLayer = window.dataLayer || []; window.gtag = window.gtag || function () { dataLayer.push(arguments); }; gtag('consent', 'update', { analytics_storage: 'granted' }); // Load GA only if the platform's built-in integration isn't already loading it if (!document.querySelector('script[src*="googletagmanager.com/gtag/js?id=' + GA_ID + '"]')) { var s = document.createElement('script'); s.async = true; s.src = 'https://www.googletagmanager.com/gtag/js?id=' + GA_ID; document.head.appendChild(s); gtag('js', new Date()); gtag('config', GA_ID, { anonymize_ip: true }); } } function disableAnalytics() { window['ga-disable-' + GA_ID] = true; if (window.gtag) gtag('consent', 'update', { analytics_storage: 'denied' }); deleteGaCookies(); } function addStyles() { if (document.getElementById('st-cc-style')) return; var css = '' + '#st-cc{position:fixed;left:16px;right:16px;bottom:16px;z-index:99999;max-width:720px;margin:0 auto;background:#fff;color:#2b2f3a;' + 'border-radius:12px;box-shadow:0 8px 32px rgba(0,0,0,.18);border-top:4px solid ' + ORANGE + ';padding:20px 22px;font-size:15px;line-height:1.55}' + '#st-cc strong{color:' + NAVY + ';font-size:16px;display:block;margin-bottom:4px}' + '#st-cc a{color:' + ORANGE + ';text-decoration:underline}' + '#st-cc .st-cc-btns{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px;justify-content:flex-end}' + '#st-cc button{cursor:pointer;border-radius:999px;padding:10px 22px;font-size:15px;font-weight:600;border:2px solid ' + NAVY + ';font-family:inherit}' + '#st-cc .st-cc-refuse{background:#fff;color:' + NAVY + '}' + '#st-cc .st-cc-accept{background:' + NAVY + ';color:#fff}' + '#st-cc button:hover{opacity:.88}' + '@media(max-width:540px){#st-cc .st-cc-btns button{flex:1}}'; var st = document.createElement('style'); st.id = 'st-cc-style'; st.appendChild(document.createTextNode(css)); document.head.appendChild(st); } function showBanner() { if (document.getElementById('st-cc')) return; addStyles(); var b = document.createElement('div'); b.id = 'st-cc'; b.setAttribute('role', 'dialog'); b.setAttribute('aria-label', 'Cookie preferences'); b.innerHTML = 'We value your privacy' + 'We use essential cookies to make this site work. With your consent, we also use analytics cookies (Google Analytics) ' + 'to understand how the site is used and improve it. No advertising cookies. ' + 'Privacy Policy' + '
' + '' + '' + '
'; document.body.appendChild(b); b.querySelector('.st-cc-accept').onclick = function () { setChoice('granted'); enableAnalytics(); b.remove(); }; b.querySelector('.st-cc-refuse').onclick = function () { setChoice('denied'); disableAnalytics(); b.remove(); }; } function addFooterLink() { var privacy = Array.prototype.find.call(document.querySelectorAll('footer a, a'), function (a) { return /privacy-policy/.test(a.getAttribute('href') || ''); }); if (!privacy || document.getElementById('st-cc-settings')) return; var link = document.createElement('a'); link.id = 'st-cc-settings'; link.href = '#'; link.textContent = 'Cookie settings'; link.className = privacy.className; link.onclick = function (e) { e.preventDefault(); showBanner(); }; privacy.parentNode.insertBefore(link, privacy.nextSibling); privacy.parentNode.insertBefore(document.createTextNode(' '), link); } function init() { addFooterLink(); var choice = getChoice(); if (choice === 'granted') enableAnalytics(); else { disableAnalytics(); if (choice !== 'denied') showBanner(); } } if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', init); else init(); })();