window.optiload = window.optiload || {}; optiload.cmd = optiload.cmd || []; window.googletag = window.googletag || {}; googletag.cmd = googletag.cmd || []; window.evopbjs = window.evopbjs || {}; evopbjs.que = evopbjs.que || []; googletag.cmd.push(function() { googletag.pubads().enableSingleRequest(); googletag.pubads().disableInitialLoad(); googletag.pubads().collapseEmptyDivs(true, true); //googletag.pubads().setTargeting("advelvet",(Math.floor(Math.random() * 20) + 1) + ""); googletag.enableServices(); }); (function() { var s = document.createElement("script"); s.async = true; s.type = "text/javascript"; s.src = "https://assets.evolutionadv.it/optiload/3.0.0/optiload.min.js"; var node = document.getElementsByTagName("script")[0]; //@ts-ignore node.parentNode.insertBefore(s, node); })(); //CONFIG optiload.cmd.push(function() { optiload.config.domain = "orizzontescuola.it"; optiload.config.nuggad_nuggn= 428847970; optiload.config.nuggad_nuggsid= 1835075721; //optiload.config.cmp_type = 'pubmatic'; optiload.config.cmp_css = "auto"; optiload.config.amazon_bid = true; optiload.config.sellerid= 249; }); //UNITS optiload.cmd.push(function() { var adUnits = []; adUnits[0] = { name: '/5966054/OrizzonteScuola/OrizzonteScuola_BTF', sizes: [ [300, 250] ], lazy: true, mappings: { desktop: [ [300, 250] ], mobile: [ [300, 250] ] }, hb: { sizes: [ [300, 250] ], bids: [{ bidder: 'adform', params: { mid: '543448' } }, { bidder: 'appnexusAst', params: { placementId: '12953361' } }, { bidder: 'ix', params: { siteId: '358064', size: [300, 250] } }, { bidder: 'openx', params: { unit: '539864146', delDomain: 'evolution-d.openx.net' } }, // { // bidder: 'pubmatic', // params: { publisherId: '156394', adSlot: 'OrizzonteScuola_BTF@300x250'} // }, { bidder: 'rubicon', params: { accountId: "17322", siteId: "179998", zoneId: "877136", sizes: [15] } }, { bidder: 'smartadserver', params: { siteId: 219190, domain: 'https://prg.smartadserver.com', pageId: 916168, formatId: 41771 } } ] } }; adUnits[1] = { name: '/5966054/OrizzonteScuola/OrizzonteScuola_BTF_mobile', sizes: [ [300, 250] ], lazy: true, mappings: { desktop: [ [300, 250] ], mobile: [ [300, 250] ] }/*, hb: { sizes: [ [300, 250] ], bids: [{ bidder: 'adform', params: { mid: '543449' } }, { bidder: 'appnexusAst', params: { placementId: '12953363' } }, { bidder: 'openx', params: { unit: '539864148', delDomain: 'evolution-d.openx.net' } }, { bidder: 'pubmatic', params: { publisherId: '156394', adSlot: 'OrizzonteScuola_BTF_mobile@300x250'} }, { bidder: 'rubicon', params: { accountId: "17322", siteId: "180000", zoneId: "877140", sizes: [15] } }, { bidder: 'smartadserver', params: { siteId: 219190, domain: 'https://prg.smartadserver.com', pageId: 916168, formatId: 59003 } } ] }*/ }; adUnits[2] = { name: '/5966054/OrizzonteScuola/OrizzonteScuola_intext_mobile', sizes: [ [300, 250],'fluid' ], lazy: true, isIntext: 2, mappings: { desktop: [ [300, 250],'fluid' ], mobile: [ [300, 250],'fluid' ] }, hb: { sizes: [ [300, 250] ], bids: [{ bidder: 'adform', params: { mid: '543450' } }, { bidder: 'appnexusAst', params: { placementId: '12953365' } }, { bidder: 'ix', params: { siteId: '358063', size: [300, 250] } }, { bidder: 'openx', params: { unit: '539864149', delDomain: 'evolution-d.openx.net' } }, // { // bidder: 'pubmatic', // params: { publisherId: '156394', adSlot: 'OrizzonteScuola_intext_mobile@300x250'} // }, { bidder: 'rubicon', params: { accountId: "17322", siteId: "180000", zoneId: "877142", sizes: [15] } }, { bidder: 'smartadserver', params: { siteId: 219190, domain: 'https://prg.smartadserver.com', pageId: 916168, formatId: 58994 } }/*, { bidder:'widespace', params:{ sid: 'a2c9ac29-07db-4eb7-ab89-9964f54bf6da'} }*/ ] } }; adUnits[3] = { name: '/5966054/OrizzonteScuola/OrizzonteScuola_sidebarMiddle', sizes: [ [300, 250],'fluid' ], lazy: true, mappings: { desktop: [ [300, 250],'fluid' ], mobile: [ [300, 250],'fluid' ] }, hb: { sizes: [ [300, 250] ], bids: [{ bidder: 'adform', params: { mid: '543451' } }, { bidder: 'appnexusAst', params: { placementId: '12953366' } }, { bidder: 'openx', params: { unit: '539864166', delDomain: 'evolution-d.openx.net' } }, // { // bidder: 'pubmatic', // params: { publisherId: '156394', adSlot: 'OrizzonteScuola_sidebarMiddle@300x250'} // }, { bidder: 'rubicon', params: { accountId: "17322", siteId: "179998", zoneId: "877138", sizes: [15] } }, { bidder: 'smartadserver', params: { siteId: 219190, domain: 'https://prg.smartadserver.com', pageId: 916168, formatId: 58995 } } ] } }; adUnits[4] = { name: '/5966054/OrizzonteScuola/OrizzonteScuola_sidebarMiddle_mobile', sizes: [ [300, 250],'fluid' ], lazy: true, mappings: { desktop: [ [300, 250],'fluid' ], mobile: [ [300, 250],'fluid' ] }/*, hb: { sizes: [ [300, 250] ], bids: [{ bidder: 'adform', params: { mid: '543452' } }, { bidder: 'appnexusAst', params: { placementId: '12953367' } }, { bidder: 'openx', params: { unit: '539864167', delDomain: 'evolution-d.openx.net' } }, { bidder: 'pubmatic', params: { publisherId: '156394', adSlot: 'OrizzonteScuola_sidebarMiddle_mobile@300x250'} }, { bidder: 'rubicon', params: { accountId: "17322", siteId: "180000", zoneId: "877144", sizes: [15] } }, { bidder: 'smartadserver', params: { siteId: 219190, domain: 'https://prg.smartadserver.com', pageId: 916168, formatId: 58999 } } ] }*/ }; adUnits[5] = { name: '/5966054/OrizzonteScuola/OrizzonteScuola_ATF', sizes: [[300, 250], [336, 280],'fluid'], lazy: false, mappings: { desktop: [[300, 250], [336, 280],'fluid'], mobile: [[300, 250], [336, 280],'fluid'] }, hb: { sizes: [ [300, 250] ], bids: [{ bidder: 'adform', params: { mid: '545213' } }, { bidder: 'appnexusAst', params: { placementId: '12967143' } }, { bidder: 'ix', params: { siteId: '357015', size: [300, 250] } }, { bidder: 'openx', params: { unit: '539873010', delDomain: 'evolution-d.openx.net' } }, // { // bidder: 'pubmatic', // params: { publisherId: '156394', adSlot: 'OrizzonteScuola_ATF@300x250'} // }, { bidder: 'rubicon', params: { accountId: "17322", siteId: "179998", zoneId: "880604", sizes: [15] } }, { bidder: 'smartadserver', params: { siteId: 219190, domain: 'https://prg.smartadserver.com', pageId: 916168, formatId: 41770 } } ] } }; adUnits[6] = { name: '/5966054/OrizzonteScuola/OrizzonteScuola_ATF_mobile', sizes: [[300, 250], [336, 280],'fluid'], lazy: false, mappings: { desktop: [[300, 250], [336, 280],'fluid'], mobile: [[300, 250], [336, 280],'fluid'] }/*, hb: { sizes: [ [300, 250] ], bids: [{ bidder: 'adform', params: { mid: '545215' } }, { bidder: 'appnexusAst', params: { placementId: '12967144' } }, { bidder: 'openx', params: { unit: '539873011', delDomain: 'evolution-d.openx.net' } }, { bidder: 'pubmatic', params: { publisherId: '156394', adSlot: 'OrizzonteScuola_ATF_mobile@300x250'} }, { bidder: 'rubicon', params: { accountId: "17322", siteId: "180000", zoneId: "880606", sizes: [15] } }, { bidder: 'smartadserver', params: { siteId: 219190, domain: 'https://prg.smartadserver.com', pageId: 916168, formatId: 41770 } } ] }*/ }; adUnits[7] = { name: '/5966054/OrizzonteScuola/OrizzonteScuola_BTF_patrizia', sizes: [ [300, 250] ], lazy: true, mappings: { desktop: [ [300, 250] ], mobile: [ [300, 250] ] }, hb: { sizes: [ [300, 250] ], bids: [{ bidder: 'adform', params: { mid: '598344' } }, { bidder: 'appnexusAst', params: { placementId: '13894973' } }, { bidder: 'ix', params: { siteId: '358064', size: [300, 250] } }, { bidder: 'openx', params: { unit: '540291993', delDomain: 'evolution-d.openx.net' } }, // { // bidder: 'pubmatic', // params: { publisherId: '156394', adSlot: 'OrizzonteScuola_BTF_patrizia@300x250'} // }, { bidder: 'rubicon', params: { accountId: "17322", siteId: "179998", zoneId: "1045980", sizes: [15] } }, { bidder: 'smartadserver', params: { siteId: 257291, domain: 'https://prg.smartadserver.com', pageId: 984046, formatId: 41771 } } ] } }; adUnits[8] = { name: '/5966054/OrizzonteScuola/OrizzonteScuola_BTF_mobile_patrizia', sizes: [ [300, 250] ], lazy: true, mappings: { desktop: [ [300, 250] ], mobile: [ [300, 250] ] }/*, hb: { sizes: [ [300, 250] ], bids: [{ bidder: 'adform', params: { mid: '598343' } }, { bidder: 'appnexusAst', params: { placementId: '13894972' } }, { bidder: 'openx', params: { unit: '540291992', delDomain: 'evolution-d.openx.net' } }, { bidder: 'pubmatic', params: { publisherId: '156394', adSlot: 'OrizzonteScuola_BTF_mobile_patrizia@300x250'} }, { bidder: 'rubicon', params: { accountId: "17322", siteId: "180000", zoneId: "1045992", sizes: [15] } }, { bidder: 'smartadserver', params: { siteId: 257291, domain: 'https://prg.smartadserver.com', pageId: 984046, formatId: 59003 } } ] }*/ }; adUnits[9] = { name: '/5966054/OrizzonteScuola/OrizzonteScuola_intext_mobile_patrizia', sizes: [ [300, 250],'fluid' ], lazy: true, mappings: { desktop: [ [300, 250],'fluid' ], mobile: [ [300, 250],'fluid' ] }/*, hb: { sizes: [ [300, 250] ], bids: [{ bidder: 'adform', params: { mid: '598345' } }, { bidder: 'appnexusAst', params: { placementId: '13894975' } }, { bidder: 'openx', params: { unit: '540291994', delDomain: 'evolution-d.openx.net' } }, { bidder: 'pubmatic', params: { publisherId: '156394', adSlot: 'OrizzonteScuola_intext_mobile_patrizia@300x250'} }, { bidder: 'rubicon', params: { accountId: "17322", siteId: "180000", zoneId: "1045994", sizes: [15] } }, { bidder: 'smartadserver', params: { siteId: 257291, domain: 'https://prg.smartadserver.com', pageId: 984046, formatId: 58994 } } ] }*/ }; adUnits[10] = { name: '/5966054/OrizzonteScuola/OrizzonteScuola_sidebarMiddle_patrizia', sizes: [ [300, 250],'fluid' ], lazy: true, mappings: { desktop: [ [300, 250],'fluid' ], mobile: [ [300, 250],'fluid' ] }, hb: { sizes: [ [300, 250] ], bids: [{ bidder: 'adform', params: { mid: '598347' } }, { bidder: 'appnexusAst', params: { placementId: '13894979' } }, { bidder: 'openx', params: { unit: '540291996', delDomain: 'evolution-d.openx.net' } }, // { // bidder: 'pubmatic', // params: { publisherId: '156394', adSlot: 'OrizzonteScuola_sidebarMiddle_patrizia@300x250'} // }, { bidder: 'rubicon', params: { accountId: "17322", siteId: "179998", zoneId: "1045982", sizes: [15] } }, { bidder: 'smartadserver', params: { siteId: 257291, domain: 'https://prg.smartadserver.com', pageId: 984046, formatId: 58998 } } ] } }; adUnits[11] = { name: '/5966054/OrizzonteScuola/OrizzonteScuola_sidebarMiddle_mobile_patrizia', sizes: [ [300, 250],'fluid' ], lazy: true, mappings: { desktop: [ [300, 250],'fluid' ], mobile: [ [300, 250],'fluid' ] }/*, hb: { sizes: [ [300, 250] ], bids: [{ bidder: 'adform', params: { mid: '598346' } }, { bidder: 'appnexusAst', params: { placementId: '13894977' } }, { bidder: 'openx', params: { unit: '540291995', delDomain: 'evolution-d.openx.net' } }, { bidder: 'pubmatic', params: { publisherId: '156394', adSlot: 'OrizzonteScuola_sidebarMiddle_mobile_patrizia@300x250'} }, { bidder: 'rubicon', params: { accountId: "17322", siteId: "180000", zoneId: "1045998", sizes: [15] } }, { bidder: 'smartadserver', params: { siteId: 257291, domain: 'https://prg.smartadserver.com', pageId: 984046, formatId: 58999 } } ] }*/ }; adUnits[12] = { name: '/5966054/OrizzonteScuola/OrizzonteScuola_ATF_patrizia', sizes: [[300, 250], [336, 280],'fluid'], lazy: false, mappings: { desktop: [[300, 250], [336, 280],'fluid'], mobile: [[300, 250], [336, 280],'fluid'] }, hb: { sizes: [ [300, 250] ], bids: [{ bidder: 'adform', params: { mid: '598342' } }, { bidder: 'appnexusAst', params: { placementId: '13894971' } }, { bidder: 'ix', params: { siteId: '357015', size: [300, 250] } }, { bidder: 'openx', params: { unit: '540291991', delDomain: 'evolution-d.openx.net' } }, // { // bidder: 'pubmatic', // params: { publisherId: '156394', adSlot: 'OrizzonteScuola_ATF_patrizia@300x250'} // }, { bidder: 'rubicon', params: { accountId: "17322", siteId: "179998", zoneId: "1045976", sizes: [15] } }, { bidder: 'smartadserver', params: { siteId: 257291, domain: 'https://prg.smartadserver.com', pageId: 984046, formatId: 41770 } } ] } }; adUnits[13] = { name: '/5966054/OrizzonteScuola/OrizzonteScuola_ATF_mobile_patrizia', sizes: [[300, 250], [336, 280],'fluid'], lazy: false, mappings: { desktop: [[300, 250], [336, 280],'fluid'], mobile: [[300, 250], [336, 280],'fluid'] }, hb: { sizes: [ [300, 250] ], bids: [{ bidder: 'adform', params: { mid: '598341' } }, { bidder: 'appnexusAst', params: { placementId: '13894969' } }, { bidder: 'ix', params: { siteId: '357015', size: [300, 250] } }, { bidder: 'openx', params: { unit: '540291990', delDomain: 'evolution-d.openx.net' } }, // { // bidder: 'pubmatic', // params: { publisherId: '156394', adSlot: 'OrizzonteScuola_ATF_mobile_patrizia@300x250'} // }, { bidder: 'rubicon', params: { accountId: "17322", siteId: "180000", zoneId: "1045988", sizes: [15] } }, { bidder: 'smartadserver', params: { siteId: 257291, domain: 'https://prg.smartadserver.com', pageId: 984046, formatId: 41770 } } ] } }; optiload.config.adunits= adUnits; optiload.enable(); }); optiload.cmd.push(function() { optiload.addEventListener("ready", function() { if(document.getElementById('evoiframe')) { loadAdUnits(); } else { loadAdUnits(); optiload.fn.loadNuggAd(); } }); }); function loadAdUnits() { if( (!optiload.fn.isMobile()) && (window.location.href.indexOf("/webinar") == -1) && (window.location.href.indexOf("/contattaci") == -1) && (window.location.href.indexOf("/notifiche-iscrizione-e-cancellazione") == -1) && (window.location.href.indexOf("/pubblicizzati") == -1) && (optiload.$('#evo-no-adv').length == 0) ) { insertBanner(); } var slots = []; var divAdv = optiload.$(".gptslot").filter(function () { return (optiload.$(this).data('addesktop') == undefined && optiload.$(this).data('admobile') == undefined) || optiload.$(this).data('addesktop') == "1"; }); if (optiload.fn.isMobile()) { divAdv = optiload.$(".gptslot").filter(function () { return (optiload.$(this).data('addesktop') == undefined && optiload.$(this).data('admobile') == undefined) || optiload.$(this).data('admobile') == "1"; }); } //mod campagna febbraio 2018 var intextIdSlot = optiload.fn.utils.getIdIntext(); var mastheadIdSlot = optiload.fn.utils.getIdMasthead(); var gptslots; var gptneltesto; if(mastheadIdSlot !== -1) { //mh video gptslots = optiload.$(divAdv).filter(function () { return (optiload.$(this).data("adunitid") != intextIdSlot && optiload.$(this).data("adunitid") != mastheadIdSlot ); }); } else { gptslots = optiload.$(divAdv).filter(function () { return (optiload.$(this).data("adunitid") != intextIdSlot ); }); } gptneltesto = optiload.$(divAdv).filter(function () { return optiload.$(this).data("adunitid") == intextIdSlot; }); if(window.location.pathname == '/') { //key-value homepage optiload.$.each(gptslots, function() { optiload.addSlots(optiload.$(this),[ { key: "pagina", value: "homepageorizzontescuola" } ]); }); var gptneltestocounter = 1; optiload.$.each(gptneltesto, function() { optiload.addSlots(optiload.$(this), [ { key: "gptneltesto", value: gptneltestocounter.toString() }, { key: "pagina", value:'homepageorizzontescuola' } ]); gptneltestocounter++; }); } else { optiload.$.each(gptslots, function() { optiload.addSlots(optiload.$(this),null); }); var gptneltestocounter = 1; optiload.$.each(gptneltesto, function() { optiload.addSlots(optiload.$(this), [ { key: "gptneltesto", value: gptneltestocounter.toString() } ]); gptneltestocounter++; }); } } function insertBanner() { var $texte = optiload.$(".entry-content").last(); if ($texte.length > 0) { var $p = $texte.find("p"); var limit = $texte.data("banner") || 250; var currentLimit = limit; var wordCount = 0; var count = Date.now() + 1; var atfInserted = false; var $pAndImg = $texte.find("p, img"); for (var i = 0; i < $pAndImg.length; i++) { atfInserted = false; var $node = optiload.$($pAndImg[i]); if ($node.is("p")) { if(i == 1) { //first paragraph optiload.$($node).after( "
" ); count++; atfInserted = true; } wordCount += $node.text().split(' ').length; if ((wordCount > currentLimit) && (!atfInserted)) { var j = i + 1; var found = false; while (j < $pAndImg.length && !found) { if (optiload.$($pAndImg[j]).is("p:not(.toc)") && optiload.$($pAndImg[j]).text().trim().length > 0) { found = true; optiload.$($pAndImg[j]).before( "" ); } j++; } count++; wordCount = 0; break; } } } } }