function OptanonWrapper() { if (window.location.pathname.includes('customer-service')) { var newItem = document.createElement("div"); newItem.id = 'svgButtons'; // Up svg const iconSvgUp = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); const iconPathUp = document.createElementNS( 'http://www.w3.org/2000/svg', 'path' ); iconSvgUp.setAttribute('fill', '#222222'); iconSvgUp.setAttribute('viewBox', '4 2 8 8'); iconSvgUp.setAttribute('width', 16); iconSvgUp.setAttribute('height', 16); iconSvgUp.setAttribute('title', 'Expand Cookie banner'); iconPathUp.setAttribute( 'd', 'M4,14.3368542 L4,6.33685425 L5,6.33685425 L5,13.3368542 L12,13.3368542 L12,14.3368542 L4,14.3368542 Z' ); iconPathUp.setAttribute( 'transform', 'translate(8.000000, 10.336854) scale(1, -1) rotate(-45.000000) translate(-8.000000, -10.336854)'); iconSvgUp.appendChild(iconPathUp); iconSvgUp.addEventListener('click', () => handleClick('Up')); newItem.appendChild(iconSvgUp); iconSvgUp.style.float = 'right'; // Down svg const iconSvgDown = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); const iconPathDown = document.createElementNS( 'http://www.w3.org/2000/svg', 'path' ); iconSvgDown.setAttribute('fill', '#222222'); iconSvgDown.setAttribute('viewBox', '4 2 8 8'); iconSvgDown.setAttribute('width', 16); iconSvgDown.setAttribute('height', 16); iconSvgDown.setAttribute('title', 'Collapse Cookie banner'); iconPathDown.setAttribute( 'd', 'M4,9.65685425 L4,1.65685425 L5,1.65685425 L5,8.65685425 L12,8.65685425 L12,9.65685425 L4,9.65685425 Z' ); iconPathDown.setAttribute( 'transform', 'translate(8.000000, 5.656854) rotate(-45.000000) translate(-8.000000, -5.656854)'); iconSvgDown.appendChild(iconPathDown); iconSvgDown.addEventListener('click', () => handleClick('Down')); newItem.appendChild(iconSvgDown); iconSvgDown.style.display = 'none' iconSvgDown.style.float = 'right'; iconSvgDown.style.marginBottom = '16px'; //Adding svg's to the top of title in banner var list = document.getElementById("onetrust-banner-sdk").childNodes[0]; list.insertBefore(newItem, list.childNodes[0]); list.style.padding = '20px 40px 40px 40px'; document.getElementById('onetrust-group-container').style.display = 'none'; document.getElementById('onetrust-button-group-parent').style.display = 'none'; function handleClick(text) { let buttons = document.getElementById('svgButtons'); if (text === 'Up') { document.getElementById('onetrust-group-container').style.display = 'block'; document.getElementById('onetrust-button-group-parent').style.display = 'block'; buttons.firstChild.style.display = 'none'; buttons.lastChild.style.display = 'block'; } else { document.getElementById('onetrust-group-container').style.display = 'none'; document.getElementById('onetrust-button-group-parent').style.display = 'none'; buttons.firstChild.style.display = 'block'; buttons.lastChild.style.display = 'none'; } } } }