window.ac = window.ac || { cmd: [] } ac.ads = ac.ads || {} ac.ads.breakpoints = { 200: [[180, 500]], 400: [[320, 400], [300, 600], [320, 250]], 650: [[580, 400]], 980: [[980, 240], [980, 300], [980, 600]] } try { (function (ac, doc, win) { function executeCmd() { var executeQueue = function () { try { var queItem; while (queItem = ac.cmd.shift()) { if (typeof queItem == 'function') queItem(); } } catch (e) { ac.log('error', e, 'queue handler'); }; }; win.setTimeout(executeQueue, 25); ac.cmd.push = function () { Array.prototype.push.apply(this, arguments); win.setTimeout(executeQueue, 1); return this.length; }; executeQueue(); } function addScript(src, targetId, fn, options) { var script = doc.createElement("script"); script.type = "text/javascript"; script.src = src; if (options && options.async) script.async = true; if (options && options.defer) script.defer = true; if (options && options.type) script.type = options.type; if (options && options.nomodule) script.noModule = true; if (script.readyState) { // only required for IE <9 script.onreadystatechange = function () { if (script.readyState === "loaded" || script.readyState === "complete") { script.onreadystatechange = null; fn(); }; }; } else { //Others script.onload = function () { if (fn) fn(); }; }; if (targetId) doc.getElementById(targetId).appendChild(script); else doc.getElementsByTagName("head")[0].appendChild(script); } addScript("https://cdn.adnuntius.com/adn.js", false, false, { async: true }); (function () { executeCmd() })(); })(ac, document, window); } catch (e) { console.log('error', e); } ac.cmd.push(function () { var adNodes = document.querySelectorAll("div[id^='adn-']") adNodes.forEach(function (node) { node.classList.add("adn-nif-ad"); }) const auids = [] const checkAdnFn = () => { var adNodes = document.querySelectorAll("div[class*='adn-nif-ad']") adNodes.forEach(function (node) { if (!auids.includes(node.id)) { ac.ads.display(node.id) auids.push(node.id) } }) } checkAdnFn() const checkAdn = setInterval(checkAdnFn, 5) window.addEventListener('load', function () { clearInterval(checkAdn) }); const setHeight = () => { var adNodes = document.querySelectorAll("div[class*='adn-nif-ad']") adNodes.forEach(function (node) { node.style.height = 'auto' node.style.flexGrow = 1 }) } setTimeout(setHeight, 200) setTimeout(setHeight, 400) setTimeout(setHeight, 600) setTimeout(setHeight, 1000) });