‘; outbrainEl.insertAdjacentHTML(“afterBegin”, AdCodeOutbrain); loadScript(‘//widgets.outbrain.com/outbrain.js’, function(){ // search for the widget. Required if there is another Outbrain widget in the page (eg: inread) OBR.extern.researchWidget( ); } function AnnunciOutbrain(callback) { var outbrainDiv = document.getElementById(‘outbrainWait’); // Check if the element exists if (outbrainDiv) { // Modify the id of the div element outbrainDiv.id = ‘outbrain’; } var load_method = impostazioni_testata.outbrain.load_method || ‘first-interaction’; var outbrainEl = document.getElementById(‘outbrain’); CED.log(“outbrain load_method:” + load_method); if (load_method == ‘when-near-viewport’) { // outbrain starts only when scrolling gets close enough to the viewport if (typeof callback === “function”) { // Listen for the scroll event //document.addEventListener (‘scroll’, onScroll(outbrainEl,callback), false); CedsWNV.watch(outbrainEl, callback, { checkInterval: 300, offset: 500 }); /*must call the function with arguments and variables */ } } else { // DEFAULT: outbrain starts at first interaction or after idle timeout _waitOnceFor(load_method, callback); } } AdvertiseOutbrain(WidgetOutbrainTag);