// ATM Build: Vx813i5md "use strict"; var adnMeta = adnMeta || {}; var adn = adn || {}; adn.calls = adn.calls || []; var pbjs = pbjs || {}; pbjs.que = pbjs.que || []; window.atm = window.atm || {}; atm.queue = atm.queue || []; atm.events = atm.events || {}; atm.data = atm.data || {}; atm.transitData; atm.browser = atm.browser || {}; atm.ads = atm.ads || {}; atm.ortb2 = atm.ortb2 || {}; atm.containers = atm.containers || {}; atm.containerFunctions = atm.containerFunctions || {}; atm.GLOBALS = atm.GLOBALS || {}; atm.haltedTags = atm.haltedTags || []; atm.adUnits = atm.adUnits || []; atm.adUnitAliases = atm.adUnitAliases || []; atm.prebid = atm.prebid || { units: [], mappedUnits: {}, aliases: [], map: {} }; atm.eventList = ['consent.change', 'consent.saved', 'event',]; try { (function (atm, adn, doc, win) { var CONTAINER_ID = 'oTY8m7ysm'; atm.containerFunctions[CONTAINER_ID] = atm.containerFunctions[CONTAINER_ID] || {} "use strict"; atm.cookie = (function () { var pairs = document.cookie.split(";"); var cookies = {}; for (var i = 0; i < pairs.length; i++) { var pair = pairs[i].split("="); cookies[(pair[0] + '').trim()] = unescape(pair.slice(1).join('=')); } return cookies; })(); atm.localStorage = (function () { var values = {}; var keys = Object.keys(localStorage); for (var i = 0; i < keys.length; i++) { try { values[keys[i]] = JSON.parse(localStorage[keys[i]]); } catch (e) { values[keys[i]] = localStorage[keys[i]]; } } return values; })(); atm.browser = window.location; atm.browser.consent = (localStorage.getItem('adn-consent') || localStorage.getItem('atm-consent')) ? JSON.parse(localStorage.getItem('adn-consent') || localStorage.getItem('atm-consent')) : { time: new Date().getTime(), tc: false, given: false, purposes: [], specialFeatures: [], vendors: [], legIntPurposes: [], adnuntiusPurposes: [], stack: false, }; atm.browser.consent.timeSinceConsent = new Date().getTime() - atm.browser.consent.time; atm.page = atm.page || {}; atm.page.meta = (function () { var metaObject = {}; var metaData = document.getElementsByTagName("meta"); var metaDataArray = [].slice.call(metaData); metaDataArray.forEach(meta => { var name = meta.name || meta.getAttribute('property') || meta.getAttribute('http-equiv'); if (name) metaObject[name] = meta.content; }); return metaObject; })(); atm.containers[CONTAINER_ID] = { "id": "oTY8m7ysm", "data": { "geo": false, "gdpr": true, "cssAdd": false, "privacy": { "back": "Tilbake", "save": "Lagre", "stack": "", "title": "Innsamling og bruk av dine personlige data", "accept": "Godkjenn", "legInt": "Legitim interesse", "details": "Detaljer", "message": "Vi bryr oss om ditt personvern, og ber om din godkjenning før vi samler inn brukerinformasjon. Vi og våre partnere samler informasjon for enkelte formål, slik som å målrette innhold og annonser basert på det vi vet om deg. Her kan du velge hvorvidt vi får lov til å samle data for ulike formål.", "language": "no", "partners": "Partnere", "purposes": [ 1, 2, 4, 7 ], "settings": "Innstillinger", "acceptAll": "Godkjenn alle", "rejectAll": "Avvis alle", "editButton": "Rediger", "specialFeatures": [] }, "position": "overlay", "cssOverride": true, "gdprTrigger": true, "gdprChoiceButton": true }, "prebid": { "loadPrebidJs": false, "units": { "Mr_gzQCQI": { "code": " Toppbanner forside", "bids": [ { "bidder": "adnuntius", "params": { "auId": "18d6b3" } }, { "bidder": "adform_solution", "params": { "mid": 1369755 } }, { "bidder": "xandr_solution", "params": { "placementId": 24462473 } }, { "bidder": "rubicon_solution", "params": { "siteId": "414366", "zoneId": "2330970", "accountId": "22738" } }, { "bidder": "pubmatic_solution", "params": { "adSlot": "4320124", "publisherId": "158979" } }, { "bidder": "Adform_Matterkind", "params": { "mid": 1412311 } }, { "bidder": "Xandr_mSupply", "params": { "placementId": 24469789 } }, { "bidder": "OMG_Adform", "params": { "mid": 1389258 } }, { "bidder": "improve_solution", "params": { "placementId": 22892503 } }, { "bidder": "kobler", "params": {} } ], "mediaTypes": { "banner": { "sizes": [ [ 970, 90 ], [ 970, 250 ], [ 980, 90 ], [ 980, 120 ], [ 980, 150 ], [ 980, 250 ], [ 980, 300 ] ] } } }, "xMEpMHX0N": { "code": " Skykraper høyre forside", "bids": [ { "bidder": "adnuntius", "params": { "auId": "18d6bb" } }, { "bidder": "adform_solution", "params": { "mid": 1369760 } }, { "bidder": "xandr_solution", "params": { "placementId": 24462389 } }, { "bidder": "pubmatic_solution", "params": { "adSlot": "4320125", "publisherId": "158979" } }, { "bidder": "rubicon_solution", "params": { "siteId": "414366", "zoneId": "2330974", "accountId": "22738" } }, { "bidder": "Xandr_mSupply", "params": { "placementId": 24469785 } }, { "bidder": "Adform_Matterkind", "params": { "mid": 1412256 } }, { "bidder": "OMG_Adform", "params": { "mid": 1389259 } }, { "bidder": "improve_solution", "params": { "placementId": 22892504 } }, { "bidder": "kobler", "params": {} } ], "mediaTypes": { "banner": { "sizes": [ [ 160, 600 ], [ 180, 500 ], [ 300, 250 ] ] } } }, "3yJNvzjNr": { "code": " Skyskraper venstre forside", "bids": [ { "bidder": "adnuntius", "params": { "auId": "18d6ba" } }, { "bidder": "adform", "params": { "mid": 1369761 } }, { "bidder": "xandr_solution", "params": { "placementId": 24462491 } }, { "bidder": "pubmatic_solution", "params": { "adSlot": "4320126", "publisherId": "158979" } }, { "bidder": "rubicon_solution", "params": { "siteId": "414366", "zoneId": "2330976", "accountId": "22738" } }, { "bidder": "Xandr_mSupply", "params": { "placementId": 24469786 } }, { "bidder": "OMG_Adform", "params": { "mid": 1389262 } }, { "bidder": "Adform_Matterkind", "params": { "mid": 1412260 } }, { "bidder": "improve_solution", "params": { "placementId": 22892505 } }, { "bidder": "kobler", "params": {} } ], "mediaTypes": { "banner": { "sizes": [ [ 160, 600 ], [ 180, 500 ], [ 300, 250 ] ] } } }, "KfOXgq7xt": { "code": " Netbanner 1 forside", "bids": [ { "bidder": "adnuntius", "params": { "auId": "18d6b6" } }, { "bidder": "adform_solution", "params": { "mid": 1369766 } }, { "bidder": "xandr_solution", "params": { "placementId": 24462502 } }, { "bidder": "pubmatic_solution", "params": { "adSlot": "4320127", "publisherId": "158979" } }, { "bidder": "rubicon_solution", "params": { "siteId": "414366", "zoneId": "2330978", "accountId": "22738" } }, { "bidder": "Xandr_mSupply", "params": { "placementId": 24469768 } }, { "bidder": "OMG_Adform", "params": { "mid": 1389266 } }, { "bidder": "Adform_Matterkind", "params": { "mid": 1412301 } }, { "bidder": "improve_solution", "params": { "placementId": 22892506 } }, { "bidder": "kobler", "params": {} } ], "mediaTypes": { "banner": { "sizes": [ [ 580, 400 ], [ 580, 500 ], [ 728, 90 ], [ 970, 90 ], [ 970, 250 ], [ 980, 90 ], [ 980, 120 ], [ 980, 150 ], [ 980, 250 ], [ 980, 300 ], [ 980, 600 ] ] } } }, "PMUievnG8": { "code": " Netbanner 2 forside", "bids": [ { "bidder": "adnuntius", "params": { "auId": "18d6b5" } }, { "bidder": "adform_solution", "params": { "mid": 1369771 } }, { "bidder": "xandr_solution", "params": { "placementId": 24462503 } }, { "bidder": "pubmatic_solution", "params": { "adSlot": "4320128", "publisherId": "158979" } }, { "bidder": "rubicon_solution", "params": { "siteId": "414366", "zoneId": "2330982", "accountId": "22738" } }, { "bidder": "Xandr_mSupply", "params": { "placementId": 24469774 } }, { "bidder": "OMG_Adform", "params": { "mid": 1389269 } }, { "bidder": "Adform_Matterkind", "params": { "mid": 1412297 } }, { "bidder": "improve_solution", "params": { "placementId": 22892527 } }, { "bidder": "kobler", "params": {} } ], "mediaTypes": { "banner": { "sizes": [ [ 580, 400 ], [ 580, 500 ], [ 728, 90 ], [ 970, 90 ], [ 970, 250 ], [ 980, 90 ], [ 980, 120 ], [ 980, 150 ], [ 980, 250 ], [ 980, 300 ] ] } } }, "wkSlH2wFq": { "code": " Netbanner 3 forside", "bids": [ { "bidder": "adnuntius", "params": { "auId": "18d6b6" } }, { "bidder": "adform_solution", "params": { "mid": 1369769 } }, { "bidder": "xandr_solution", "params": { "placementId": 24462504 } }, { "bidder": "pubmatic_solution", "params": { "adSlot": "4320129", "publisherId": "158979" } }, { "bidder": "rubicon_solution", "params": { "siteId": "414366", "zoneId": "2330990", "accountId": "22738" } }, { "bidder": "Xandr_mSupply", "params": { "placementId": 24469777 } }, { "bidder": "OMG_Adform", "params": { "mid": 1389268 } }, { "bidder": "Adform_Matterkind", "params": { "mid": 1412307 } }, { "bidder": "improve_solution", "params": { "placementId": 22892507 } }, { "bidder": "kobler", "params": {} } ], "mediaTypes": { "banner": { "sizes": [ [ 580, 400 ], [ 580, 500 ], [ 728, 90 ], [ 970, 90 ], [ 970, 250 ], [ 980, 90 ], [ 980, 120 ], [ 980, 150 ], [ 980, 250 ], [ 980, 300 ], [ 980, 600 ] ] } } }, "R6bEP4V-K": { "code": " Netboard 1 forside", "bids": [ { "bidder": "adnuntius", "params": { "auId": "18d6b9" } }, { "bidder": "adform_solution", "params": { "mid": 1369775 } }, { "bidder": "xandr_solution", "params": { "placementId": 24462505 } }, { "bidder": "pubmatic_solution", "params": { "adSlot": "4320130", "publisherId": "158979" } }, { "bidder": "rubicon_solution", "params": { "siteId": "414366", "zoneId": "2330992", "accountId": "22738" } }, { "bidder": "Xandr_mSupply", "params": { "placementId": 24469781 } }, { "bidder": "OMG_Adform", "params": { "mid": 1389270 } }, { "bidder": "Adform_Matterkind", "params": { "mid": 1412290 } }, { "bidder": "improve_solution", "params": { "placementId": 22892508 } }, { "bidder": "kobler", "params": {} } ], "mediaTypes": { "banner": { "sizes": [ [ 580, 400 ], [ 580, 500 ] ] } } } }, "map": { "000000000007248d": "Mr_gzQCQI", "0000000000072481": "xMEpMHX0N", "000000000007248b": "3yJNvzjNr", "000000000007248e": "KfOXgq7xt", "000000000007248f": "PMUievnG8", "0000000000072490": "wkSlH2wFq", "0000000000072492": "R6bEP4V-K" }, "analytics": false, "config": { "custom": "pbjs.que.push(function () {\n pbjs.setConfig({\n \"priceGranularity\": \"low\",\n \"currency\": {\n \"adServerCurrency\": \"NOK\",\n },\n \"schain\": {\n \"validation\": \"strict\",\n \"config\": {\n \"ver\":\"1.0\",\n \"complete\": 1,\n \"nodes\": [\n {\n \"asi\":\"concept.dk\",\n \"sid\":\"C-00422\",\n \"hp\":1\n },\n {\n \"asi\":\"netricsales.com\",\n \"sid\":\"17246\",\n \"hp\":1\n },\n {\n \"asi\":\"solution.no\",\n \"sid\":\"20139504954847088e49910e547790a5\",\n \"hp\":1\n }\n ]\n }\n }\n });\n});\n" }, "requester": { "siteId": "bqjk686n2hnvxrzg", "system": "adnuntius" }, "aliases": [ [ "pubmatic_solution", "pubmatic" ], [ "rubicon_solution", "rubicon" ], [ "adform_solution", "adform" ], [ "xandr_solution", "appnexus" ], [ "Xandr_mSupply", "appnexus" ], [ "Adform_Matterkind", "adform" ], [ "OMG_Adform", "adform" ], [ "improve_solution", "improvedigital" ] ] }, "tagType": "legacy", "cmp": false, "templates": false, "variables": [], "variableMap": {}, "tags": { "0MqCar65_": { "purposes": [], "type": "javascriptCustom", "content": { "url": "", "script": "" } } } } try { } catch (e) { throw new Error('Custom variables are not valid') } atm.containers[CONTAINER_ID].tags["0MqCar65_"].content.script = function(){console.log('')}; "use strict"; atm.log = function (type, message, ctx) { var makeBlock = function (color) { return 'background: ' + color + '; padding: 2px 10px; border-radius: 2px; color: rgba(0,0,0,.7); border-bottom: 1px solid rgba(0,0,0,.3);border-top: 1px solid rgba(255,255,255,.6);margin-left: 5px;'; }; var logType = 'log'; var eventType = ''; var color = '#79e1ec'; if (type == 'warn' || type == 'error') { logType = type; } else { eventType = '%c' + type; } switch (type) { case 'event': color = "#0aff82"; break; case 'tag': color = "#ee49d1"; break; case 'consent': color = "#af83ff"; break; } console[logType]('%cATM' + eventType, makeBlock("#00e6ff"), (eventType != '') ? makeBlock(color) : '', message || '', ctx || ''); }; atm.debug = function (type, message, ctx) { if (win.location.search.indexOf('atm_debug') > -1) { atm.log(type, message, ctx); } }; "use strict"; atm.utils = { createUuid: function () { var dt = new Date().getTime(); var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { var r = (dt + Math.random() * 16) % 16 | 0; dt = Math.floor(dt / 16); return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16); }); return uuid; }, getCookie: function (cname) { var name = cname + "="; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; }, replaceTags: function (str, tags) { var tagNames = Object.keys(tags); for (var i = 0; i < tagNames.length; i++) { var tag = tagNames[i]; var pattern = "{{" + tag + "}}"; str = str.replace(new RegExp(pattern, "g"), tags[tag]); } return str; }, replaceTag: function (str, search, replace) { return str.replace(new RegExp(search, 'g'), replace); }, remove: function (target) { var removeElement = target || 'adn-overlay'; atm.utils.forEachClass(removeElement, function (el) { el.remove(); }); }, addScript: function (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); }, addImage: function (src, width, height) { var img = doc.createElement('img'); img.src = src; if (width) img.width = width; if (height) img.height = height; doc.getElementsByTagName('body')[0].appendChild(img); }, addContent: function (content, targetId) { var node = doc.createElement("DIV"); node.innerHTML = content; if (targetId) { var target = doc.getElementById(targetId); target.innerHTML = ''; target.appendChild(node); } else doc.getElementsByTagName("body")[0].appendChild(node); }, addCss: function (url) { var link = doc.createElement("link"); link.href = url; link.type = "text/css"; link.rel = "stylesheet"; doc.getElementsByTagName("head")[0].appendChild(link); }, addCssString: function (string) { var css = string, head = doc.head || doc.getElementsByTagName('head')[0], style = doc.createElement('style'); head.appendChild(style); style.type = 'text/css'; if (style.styleSheet) { style.styleSheet.cssText = css; } else { style.appendChild(doc.createTextNode(css)); } }, forEachClass: function (classname, func) { var els = doc.getElementsByClassName(classname); for (var i = 0; i < els.length; i++) { func(els[i]); } }, forEachTag: function (tagName, func) { var els = doc.getElementsByTagName(tagName); for (var i = 0; i < els.length; i++) { func(els[i]); } }, merge: function (obj, src) { for (var key in src) { if (src.hasOwnProperty(key)) obj[key] = src[key]; } return obj; }, isObject: function (item) { return (item && typeof item === 'object' && !Array.isArray(item)); }, mergeDeep: function (target, source) { if (atm.utils.isObject(target) && atm.utils.isObject(source)) { for (const key in source) { if (atm.utils.isObject(source[key])) { if (!target[key]) Object.assign(target, { [key]: {} }); atm.utils.mergeDeep(target[key], source[key]); } else { Object.assign(target, { [key]: source[key] }); } } } return target; }, flatten: function (obj) { var returnObj = []; for (var key in obj) { returnObj.push(obj[key]); } return returnObj; }, findInArray: function (src, arr) { return arr.some(function (v) { return src.indexOf(v) >= 0; }); }, requestGAM: function (arr) { window.googletag.cmd.push(function () { for (let i = 0; i < arr.length; i++) { if (atm.prebidGoogle && atm.prebidGoogle[arr[i]]) { atm.prebidGoogle[arr[i]](); } } googletag.pubads().enableSingleRequest(); googletag.enableServices(); }); }, runTags: function (localContainerId, tagArray) { if (tagArray != undefined) { for (var i = 0; i < tagArray.length; i++) { try { var tagId = tagArray[i]; var tag = atm.containers[localContainerId].tags[tagId]; var runable = true; if (atm.GLOBALS.haltTriggers && tag.purposes) { if (tag.purposes.length > 0 && !atm.utils.findInArray(atm.GLOBALS.forcedPurposes, tag.purposes)) { runable = false; atm.haltedTags.push(tagId); } } else { if (tag.purposes && tag.purposes.length > 0 && !atm.utils.findInArray(atm.browser.consent.adnuntiusPurposes, tag.purposes)) { runable = false; } } if (runable) { atm.debug('tag', 'Running tag: ' + tagId + ' in container: ' + localContainerId); atm.containerFunctions[localContainerId][tag.type](tag.content); if (atm.eventList.indexOf('tags.' + tagId) != -1) atm.dispatch('tags.' + tagId); } } catch (e) { atm.log('error', e, ': Tag: ' + tag); } } } }, runTriggers: function (container, type) { atm.containers[container].triggers[type].forEach(function (fn) { fn(); }); }, clickElement: function (data) { if (atm.triggers.click) atm.triggers.click(data); }, toggleClass: function (element, className) { if (element.classList) { element.classList.toggle(className); } else { var classes = element.className.split(" "); var i = classes.indexOf(className); if (i >= 0) classes.splice(i, 1); else classes.push(className); element.className = classes.join(" "); } }, newAjax: function (method, url, func) { if (win.XDomainRequest) { // if XDomainRequest is defined and not IE10 if (win.navigator.appVersion.indexOf("MSIE 10") === -1) { var ajaxIe = new win.XDomainRequest(); ajaxIe.open(method, url); ajaxIe.contentType = "text/plain"; ajaxIe.onerror = function () { }; ajaxIe.ontimeout = function () { }; ajaxIe.onprogress = function () { }; ajaxIe.timeout = function () { }; ajaxIe.onload = function () { }; ajaxIe.onload = func; return ajaxIe; } } var ajax = new XMLHttpRequest(); ajax.open(method, url); ajax.setRequestHeader("Content-Type", "text/plain"); if (func && typeof func === "function") { ajax.onreadystatechange = func; } ajax.onerror = function (e) { console.log(e); }; return ajax; }, ajax: function (method, url, func) { var ajax = atm.utils.newAjax(method, url, function () { if (ajax.readyState && ajax.readyState !== 4) { return false; } if (!ajax.status || ajax.status === 200) { if (func && typeof func === "function") { func(JSON.parse(ajax.response)); } else { atm.log('error', 'Ajax function is not a function'); } } else { atm.log('error', 'Request to URL: ' + url + ' got status ' + ajax.status); } }); ajax.send(); }, }; atm.privacy = atm.privacy || undefined; "use strict"; atm.createPrebidRequest = function (request) { var prebidUnits = []; request.adUnits.forEach(function (adUnit) { var prebidId = atm.prebid.map[adUnit.auId]; if (atm.prebid.mappedUnits[prebidId]) { prebidUnits.push(atm.prebid.mappedUnits[prebidId]); } }); return prebidUnits; }; atm.requestAds = function (request) { if (atm.prebid.aliases.length > 0) { for (let i = 0; i < atm.prebid.aliases.length; i++) { const element = atm.prebid.aliases[i]; window.pbjs.que.push(function () { pbjs.aliasBidder(element[1], [element[0]]); }); } } if (atm.prebid.map) { if (request.adUnits) { for (let i = 0; i < request.adUnits.length; i++) { var adUnit = request.adUnits[i]; if (adUnit.refresh) { adUnit = atm.ads.setPrebidRefresh(adUnit, request); } } } adn.calls.push(function () { adn.chbRequest(atm.createPrebidRequest(request), request); }); } else { adn.calls.push(function () { adn.request(request); }); } }; atm.request = atm.request || {}; atm.request.adnuntius = function (callback) { adn.calls.push(function () { adn.request({ adUnits: atm.ads.setAdnuntius(atm.adUnits, callback), }); }); }; atm.request.prebid = function (callback) { pbjs.que.push(function () { pbjs.addAdUnits(atm.adUnits); pbjs.requestBids({ ortb2: atm.ortb2, bidsBackHandler: function (data) { if (callback) { callback(data); } else atm.ads.renderPrebidWinners(); }, timeout: 3000 }); }); }; atm.request.refresh = function (auId) { }; adn.requestAds = atm.requestAds; "use strict"; atm.ads.adUnitMeta = atm.ads.adUnitMeta || {}; atm.addAdUnits = function (adUnitList) { atm.utils.merge(atm.adUnits, adUnitList); }; atm.clearAdUnits = function () { atm.adUnits = []; }; atm.removeAdUnitByCodeArray = function (codeArray) { for (let i = 0; i < codeArray.length; i++) { atm.removeAdUnitByCode(codeArray[i]); } }; atm.removeAdUnitByCode = function (code) { for (let i = 0; i < atm.adUnits.length; i++) { if (atm.adUnits[i].code == code) { atm.adUnits.splice(i, 1); break; } } }; atm.addOrtb = function (ortbData) { atm.ortb2 = atm.utils.mergeDeep(atm.ortb2, ortbData); }; atm.addAlias = function (aliasList) { atm.adUnitAliases = atm.adUnitAliases.concat(aliasList); }; atm.prebid.mappedUnits = atm.utils.merge(atm.prebid.mappedUnits, atm.containers[CONTAINER_ID].prebid.units); atm.prebid.units = atm.utils.merge(atm.prebid.units, atm.utils.flatten(atm.containers[CONTAINER_ID].prebid.units)); atm.prebid.aliases = atm.prebid.aliases.concat(atm.containers[CONTAINER_ID].prebid.aliases); atm.prebid.map = atm.utils.merge(atm.prebid.map, atm.containers[CONTAINER_ID].prebid.map); atm.ads.onCallDone = function (matched, callback) { atm.removeAdUnitByCodeArray(matched); if (callback) callback(); }; atm.ads.renderPrebidWinners = function () { var bids = pbjs.getHighestCpmBids(); var output = []; for (var i = 0; i < bids.length; i++) { var b = bids[i]; var iframe = document.createElement('iframe'); iframe.id = b.adId; iframe.width = b.width; iframe.height = b.height; iframe.frameBorder = 'no'; var target = document.getElementById(b.adUnitCode); target.style.display = 'block'; output.push({ 'adunit': b.adUnitCode, 'adId': b.adId, 'bidder': b.bidder, 'time': b.timeToRespond, 'cpm': b.cpm }); var tag = { adServerDomain: "", pubUrl: window.location.href, targetingMap: {}, hbPb: "adnuntius", adId: b.adId }; target.appendChild(iframe); ucTag.renderAd(iframe.contentWindow.document, tag); } if (output.length) { if (console.table) { console.table(output); } else { for (var j = 0; j < output.length; j++) { console.log(output[j]); } } } else { console.warn('No prebid winners'); } }; atm.ads.setAdnuntius = function (adUnits, callback) { var mappedAliases = {}; var adnAdUnitArray = []; var matchedAds = []; var totalAds = []; var removefromTotal = function (adUnit) { var position = totalAds.indexOf(adUnit.targetId); totalAds.splice(position, 1); if (totalAds.length == 0) { atm.ads.onCallDone(matchedAds, callback); } }; atm.adUnitAliases.forEach(function (aliasItem) { mappedAliases[aliasItem.alias] = aliasItem.bidder; }); adUnits.forEach((adUnit) => { totalAds.push(adUnit.code); adUnit.bids.forEach(function (bid) { if (bid.bidder == "adnuntius" || mappedAliases[bid.bidder] == "adnuntius") { var adnAdunit = { auId: bid.params.auId, targetId: adUnit.code, onNoMatchedAds: function (data) { removefromTotal(data); }, onImpressionResponse: function (data) { matchedAds.push(data.targetId); removefromTotal(data); }, }; if (adUnit.mediaTypes && adUnit.mediaTypes.banner && adUnit.mediaTypes.banner.sizes) adnAdunit.dimensions = adUnit.mediaTypes.banner.sizes; if (bid.params.targeting) { console.log(bid.params.targeting); } adnAdUnitArray.push(adnAdunit); } }); }); return adnAdUnitArray; }; atm.ads.setInterval = function (auId, request) { if (!atm.ads.adUnitMeta[auId].interval) { atm.ads.adUnitMeta[auId].interval = setInterval(function () { if (atm.ads.adUnitMeta[auId].refresh.count != 0) { adn.calls.push(function () { adn.chbRequest(atm.createPrebidRequest(request), request); }); atm.ads.adUnitMeta[auId].refresh.count--; } else { clearInterval(atm.ads.adUnitMeta[auId].interval); } }, atm.ads.adUnitMeta[auId].refresh.delay * 1000); } }; atm.ads.setPrebidRefresh = function (adUnit, request) { var singleAdUnitRequest = Object.assign({}, request); delete singleAdUnitRequest.headerBids; var targetId = (adUnit.targetId) ? ':' + adUnit.targetId : ''; var auId = adUnit.auId + targetId; var refresh = adUnit.refresh; if (refresh.count) refresh.count = refresh.count || 999; else { refresh = { delay: adUnit.refresh, count: 999, }; } var event = refresh.event || 'onViewable'; if (event != 'onViewable' && event != "onVisible") throw new Error('refresh event needs to be "onViewable" or "onVisible"'); delete adUnit.refresh; adUnit.clearTarget = true; atm.ads.adUnitMeta[auId] = atm.ads.adUnitMeta[auId] || {}; atm.ads.adUnitMeta[auId].refresh = refresh; atm.ads.adUnitMeta[auId].refreshFunction = function () { singleAdUnitRequest.adUnits = [adUnit]; atm.ads.setInterval(auId, singleAdUnitRequest); }; adUnit[event] = atm.ads.adUnitMeta[auId].refreshFunction; return adUnit; }; "use strict"; atm.addListener = function (name, callback) { if (atm.eventList.indexOf(name) == -1) { atm.eventList.push(name); atm.events[name] = new CustomEvent(name, { bubbles: true }); } document.addEventListener(name, function () { if (callback) callback(atm.transitData); }); }; atm.dispatch = function (name, data) { atm.debug(name, data); atm.transitData = data; document.dispatchEvent(atm.events[name]); }; "use strict"; atm.containerFunctions[CONTAINER_ID].javascriptCustom = function (script) { try { script.script(); } catch (e) { atm.log('error', 'Custom Javascript is malformed ' + e.message, 'Custom JavaScript'); } }; atm.addListener("pageview.oTY8m7ysm", function(eventData){ if( (true) ) atm.utils.runTags('oTY8m7ysm', []) }); atm.utils.addScript("https://cdn.adnuntius.com/adn.js",false,false,{async:true}); if(atm.containers[CONTAINER_ID].prebid){ if(atm.containers[CONTAINER_ID].prebid.config && atm.containers[CONTAINER_ID].prebid.config.custom){ try { new Function(atm.containers[CONTAINER_ID].prebid.config.custom)(); } catch (e) { atm.log('error', 'Custom prebid script malformed: ' + e.message, 'Custom Prebid') } } if(atm.containers[CONTAINER_ID].prebid.loadPrebidJs){atm.utils.addScript("https://tags.adnuntius.com/pb/prebid.js")} } "use strict"; (function () { var executeQueue = function () { try { var queItem; while (queItem = atm.queue.shift()) { if (typeof queItem == 'function') queItem(); } } catch (e) { atm.log('error', e, 'queue handler'); } }; win.setTimeout(executeQueue, 25); atm.queue.push = function () { Array.prototype.push.apply(this, arguments); win.setTimeout(executeQueue, 1); return this.length; }; executeQueue(); })(); window.addEventListener('load', function (event) { if( atm.eventList.indexOf('pageload.' + CONTAINER_ID) != -1){ atm.dispatch('pageload.' + CONTAINER_ID) } }); if (atm.eventList.indexOf('pageview.' + CONTAINER_ID) > -1) atm.dispatch('pageview.' + CONTAINER_ID); })(atm, adn, document, window); } catch (e) { console.log('error', e); }