document.getElementById("showImage").onclick = function() { document.getElementById("advertising_2").style.visibility = "visible"; } img.src = 'https://www.lesflicks.com/wp-content/uploads/2019/03/300x250-advert.jpg'; document.addEventListener('advertising_2', function () { var el = document.getElementById("an-img"); const advertising_4 = (element) => { element.insertAdjacentHTML('beforeend', '<'+'div class="adv" id="placement_463456_'+plc463456+'">'); AdButler.ads.push({handler: function(opt){ AdButler.register(175092, 463456, [300,250], 'placement_463456_'+opt.place, opt); }, opt: { place: plc463456++, keywords: abkw, domain: 'ads.brandadvance.co.uk', click:'CLICK_MACRO_PLACEHOLDER' }}); let detectProgramPage = () => { if (location.href.includes('/programs')) { let header = document.querySelector('.cbt-header') if (header) { if (!header.classList.value.includes('touched')) { advertising_1(header) header.classList.add('touched') } } let programRightColumn = document.querySelector('.cbt-tabs--content .col-lg-4') if (programRightColumn) { if (!programRightColumn.classList.value.includes('touched')) { advertising_2(programRightColumn) advertising_3(programRightColumn) advertising_4(programRightColumn) programRightColumn.classList.add('touched') } } } setTimeout(() => detectProgramPage(), 500) } detectProgramPage()