console.log('Epeex: <-------------------- Widget on EPX-12 --------------------> ');console.log('Epeex: New Adv Enabled');console.log('Epeex: FormatID Video Bumper GLOBAL');console.log('Epeex: GUID - epx-wn5A-qcic-oHTj-oURW '); var epx1_x1_1_activator = document.currentScript; if ((typeof(epx1_x1_1_activator) == 'undefined') || (epx1_x1_1_activator === null)){ epx1_x1_1_activator = document.querySelector('script[src="//epeex.com/related/service/widget/epeex/?ac=sardiniapost&ch=1"]'); console.log('Epeex: IE Browser Found'); } var Div1_x1_1_Container = document.createElement('div'); Div1_x1_1_Container.id = "epx1_x1_1_Container"; Div1_x1_1_Container.className = "epx1_x1_1_Box"; var Style_Global_1_x1_1 = document.createElement('link'); Style_Global_1_x1_1.type = 'text/css'; Style_Global_1_x1_1.rel = 'stylesheet'; Style_Global_1_x1_1.href = "//epeex.com/related/service/widget/epeex/widget.min.asp?idw=1_x1_1&spe=2"; epx1_x1_1_activator.parentNode.insertBefore(Style_Global_1_x1_1, epx1_x1_1_activator); var Style_Template_1_x1_1 = document.createElement('style'); Style_Template_1_x1_1.type = 'text/css'; Style_Template_1_x1_1.innerHTML = "@media only screen and (max-width: 480px) {\.epx1_x1_1_Result{width:98%; height: 215px; float:none !important; margin:auto !important;}\.epx1_x1_1_Result_Image, div.epeex_Sas > div > a > img:first-of-type{height: 141px !important;}\}\@media only screen and (min-width: 481px) {\.epx1_x1_1_Result{width:32%; height:235px; margin:0 !important; margin-right:2% !important;}\div.epx1_x1_1_Result:nth-child(3n+1){margin-right:0 !important;}\.epx1_x1_1_Result_Image, div.epeex_Sas > div > a > img:first-of-type{height: 141px !important;}\}\.epx1_x1_1_Box{width:100%; margin:15px 0; text-align:left;}\.epx1_x1_1_TitleBox{border-bottom:1px solid #333; color:#333; font-family:Arial,sans-serif; font-size:15px; font-weight:bold; margin-bottom:15px; margin-left:0px; text-align:left;}\.epx1_x1_1_Result a {border:0px none; color:#333; font-family:Arial,sans-serif; font-size:14px; font-weight:normal; margin:0px; padding:0px; text-decoration:none;}\.epx1_x1_1_Result a:hover{color:#333; text-decoration:underline;}\.epx1_x1_1_Result_Data{display:none;}"; epx1_x1_1_activator.parentNode.insertBefore(Style_Template_1_x1_1, epx1_x1_1_activator); var epx1_x1_1_Account = "sardiniapost"; var epx1_x1_1_Channel = "1"; var epx1_x1_1_Title_Box = ""; var epx1_x1_1_Title_Lenght = "80"; var epx1_x1_1_Image_Default = ""; var epx1_x1_1_IndexMode = "1"; var epx1_x1_1_SponsorFormat = "2"; var epx1_x1_1_Image = ""; var epx1_x1_1_Title = ""; var epx1_x1_1_Location = escape(document.location.href); var epx1_x1_1_Url = '//epeex.com/related/service/query/jscript/?ac=' + epx1_x1_1_Account + '&ch=' + epx1_x1_1_Channel + '&im=' + epx1_x1_1_IndexMode + '&jo=epx1_x1_1_ObjSrc&jc=epx1_x1_1_Creator('+"epx1_x1_1_ObjSrc"+');&rf=' + epx1_x1_1_Location + '&th=' + epx1_x1_1_Image + '&sf=' + epx1_x1_1_SponsorFormat + '&ti=' + epx1_x1_1_Title; try{ var epx_Script_Smart1_x1_1 = document.createElement("script"); epx_Script_Smart1_x1_1.type = "application/javascript"; epx_Script_Smart1_x1_1.async = "true"; epx_Script_Smart1_x1_1.src = "//ced.sascdn.com/tag/1247/smart.js"; document.body.appendChild(epx_Script_Smart1_x1_1); if(!window.sas){ var sas = sas || {}; sas.cmd = sas.cmd || []; sas.cmd.push(function() { sas.setup({ networkid: 1247, domain: "//www3.smartadserver.com", async: true }); }); } sas.cmd.push(function() { sas.call("onecall", { siteId: 219297, pageId: 916486, formats: [ { id: 65908 } ,{ id: 52593 } ,{ id: 29844 } ], target:'epx_AccountChannel=sardiniapost/1' }); }); epx_sas_Bumper_Div1_x1_1 = document.createElement("div"); epx_sas_Bumper_Div1_x1_1.id = "sas_52593"; document.body.appendChild(epx_sas_Bumper_Div1_x1_1); sas.cmd.push(function() { sas.render("52593"); }); console.log("Epeex: Call Video Bumper"); }catch(error){ console.log("Epeex: Smart AdServer ERROR " + error); } try{ console.log("Epeex: <--------------------- DFP INTEGRATION --------------------->"); if(window.googletag){console.log('Epeex: googletag found');}else{console.log('googletag not found');} var epx_Script_DFP1_x1_1 = document.createElement("script"); epx_Script_DFP1_x1_1.type = "application/javascript"; epx_Script_DFP1_x1_1.async = "true"; epx_Script_DFP1_x1_1.src = "//www.googletagservices.com/tag/js/gpt.js"; //document.body.appendChild(epx_Script_DFP1_x1_1); var node1_x1_1 = document.getElementsByTagName('script')[0]; node1_x1_1.parentNode.insertBefore(epx_Script_DFP1_x1_1, node1_x1_1); epx_Script_DFP1_x1_1 = document.createElement("script"); epx_Script_DFP1_x1_1.text = "var googletag = googletag || {}; googletag.cmd = googletag.cmd || [];"; //document.body.appendChild(epx_Script_DFP1_x1_1); var node1_x1_1 = document.getElementsByTagName('script')[0]; node1_x1_1.parentNode.insertBefore(epx_Script_DFP1_x1_1, node1_x1_1); var slots1_x1_1 = "var gpt1_x1_1adslots=[];"; slots1_x1_1 = slots1_x1_1 + "googletag.cmd.push(function() {"; slots1_x1_1 = slots1_x1_1 + "gpt1_x1_1adslots[0] = googletag.defineSlot('/43775887/sardiniapost/1', ['fluid'], 'div-gpt-ad-sardiniapost_1-0').addService(googletag.pubads());"; slots1_x1_1 = slots1_x1_1 + "gpt1_x1_1adslots[1] = googletag.defineSlot('/43775887/sardiniapost/1', ['fluid'], 'div-gpt-ad-sardiniapost_1-1').addService(googletag.pubads());"; slots1_x1_1 = slots1_x1_1 + "gpt1_x1_1adslots[2] = googletag.defineSlot('/43775887/sardiniapost/1', ['fluid'], 'div-gpt-ad-sardiniapost_1-2').addService(googletag.pubads());"; slots1_x1_1 = slots1_x1_1 + " googletag.pubads().enableSingleRequest(); "; console.log("Epeex: DFP_EnableSingleRequest = 1"); slots1_x1_1 = slots1_x1_1 + " googletag.pubads().disableInitialLoad(); "; console.log("Epeex: DFP_DisableInitialLoad = 1"); slots1_x1_1 = slots1_x1_1 + " googletag.enableServices(); "; slots1_x1_1 = slots1_x1_1 + " });"; epx_Script_DFP1_x1_1 = document.createElement("script"); epx_Script_DFP1_x1_1.text = slots1_x1_1; //document.body.appendChild(epx_Script_DFP1_x1_1); var node1_x1_1 = document.getElementsByTagName('script')[0]; node1_x1_1.parentNode.insertBefore(epx_Script_DFP1_x1_1, node1_x1_1); console.log("Epeex: DFP Initial Calls - Add to BODY"); }catch(error){ console.log("Epeex: DFP Initial Calls - ERROR: " + error); } function epx1_x1_1_Creator(epx1_x1_1_ObjSrc){ var epx_ObjSource=eval(epx1_x1_1_ObjSrc); var SpCounter = 1; var InCounter = 0; var DfpCounter = 0; var NumSponsor = 3; try{ epx_Counter = epx_ObjSource.Link.Record.length; }catch(e){ epx_Counter = 0; } console.log("Epeex: Num Results Interni: " + epx_Counter + " su 6"); console.log("Epeex: Ris Int + Ext: " + epx_Counter + " - " + NumSponsor); console.log("Epeex: Num Results Sponsor: 3"); console.log("Epeex: Sponsor Position 2"); var epx_SpPos = []; for(I=0; I < epx_Counter; I++){ epx_SpPos[I] = "I"; } for(I=epx_Counter; I < (NumSponsor + epx_Counter); I++){ epx_SpPos[I] = "S"; } epx_SpPos = shuffle1_x1_1(epx_SpPos); console.log("Epeex: Array " + epx_SpPos); console.log("Epeex: Array Lenght " + epx_SpPos.length); epx1_x1_1_activator.parentNode.insertBefore(Div1_x1_1_Container, epx1_x1_1_activator); epx_Div=document.getElementById("epx1_x1_1_Container"); if((epx_SpPos.length > 0)){ for(epx_I=0; epx_I < epx_SpPos.length; epx_I++){ if(epx_I == 0){ epx_Div_Title = document.createElement("div"); epx_Div_Title.className = "epx1_x1_1_TitleBox"; epx_Txt_Title = document.createTextNode(epx1_x1_1_Title_Box); epx_Div_Title.appendChild(epx_Txt_Title); epx_Div.appendChild(epx_Div_Title); } if(epx_SpPos[epx_I] == "I"){ epx_Record = epx_ObjSource.Link.Record[InCounter]; //Image epx_Image = epx_Record.Image; if(epx_Image == null || epx_Image == "" || epx_Image == "undefined"){ epx_Image = epx1_x1_1_Image_Default; } //Titles epx_Title = epx_Record.Title; var epx_expBr=new RegExp("
","g"); epx_Title=epx_Title.replace(epx_expBr," "); if(epx_Title.length > epx1_x1_1_Title_Lenght){ epx_TitleText=epx_Title.substring(0,epx1_x1_1_Title_Lenght)+"..."; wl_altTitleVisible=true; }else{ epx_TitleText=epx_Title; wl_altTitleVisible=false; } //Urls epx_URL=epx_Record.Url; //Elements Creation epx_Div_Result=document.createElement("div"); epx_Div_Result.className="epx1_x1_1_Result" epx_Div_Result.id = "epx1_x1_1_Result_" + (epx_I+1) ; epx_Link_Result = document.createElement("a"); epx_Link_Result.className="epeex-interstitial"; epx_Link_Result.href = location.protocol + epx_URL; epx_Link_Result.setAttribute("rel","nofollow"); epx_Link_Result.target = "_top"; if(wl_altTitleVisible){ var wl_regex_html = /( |<([^>]+)>)/ig; epx_Title=epx_Title.replace(wl_regex_html," "); epx_Link_Result.setAttribute("title",epx_Title); } epx_Div_Img_Result = document.createElement("div"); epx_Div_Img_Result.style.background = "url('"+epx_Image+"') center center no-repeat"; epx_Div_Img_Result.style.boxSizing = "border-box"; epx_Div_Img_Result.style.backgroundSize = "cover"; epx_Div_Img_Result.style.position = "relative"; epx_Div_Img_Result.className = "epx1_x1_1_Result_Image epx1_x1_1_Result_Image_Effect"; epx_Div_Content = document.createElement("div"); epx_Div_Content.className = "epx1_x1_1_Result_Content"; epx_Div_Result_Title = document.createElement("div"); epx_Div_Result_Title.className = "epx1_x1_1_Result_Title"; epx_Record_Link_Text = document.createTextNode(epx_TitleText); epx_Div_Result_Title.appendChild(epx_Record_Link_Text); epx_Div_Content.appendChild(epx_Div_Result_Title); epx_Link_Result.appendChild(epx_Div_Img_Result); epx_Link_Result.appendChild(epx_Div_Content); epx_Div_Result.appendChild(epx_Link_Result); epx_Div.appendChild(epx_Div_Result); InCounter++; } if(epx_SpPos[epx_I]=="S"){ try{ epx_DFP_Div1_x1_1 = document.createElement("div"); epx_DFP_Div1_x1_1.id = "div-gpt-ad-sardiniapost_1-" + DfpCounter; epx_DFP_Div1_x1_1.className = "epx1_x1_1_Result epeex_Sas epeex_result"; epx_Div.appendChild(epx_DFP_Div1_x1_1); epx_Script_DFP_Div1_x1_1 = document.createElement("script"); if(DfpCounter != 2){ epx_Script_DFP_Div1_x1_1.text = "googletag.cmd.push(function() { googletag.display('div-gpt-ad-sardiniapost_1-" + DfpCounter + "');});"; }else{ epx_Script_DFP_Div1_x1_1.text = "googletag.cmd.push(function() { googletag.display('div-gpt-ad-sardiniapost_1-" + DfpCounter + "'); });"; console.log('Epeex: DFP Refresh Mode Disabled'); } epx_DFP_Div1_x1_1.appendChild(epx_Script_DFP_Div1_x1_1); DfpCounter++; console.log('Epeex: DFP attach Item:' + DfpCounter); }catch(error){ console.log('Epeex: ERROR DFP attach Item:' + error); } } } } if(epx_SpPos.length >0){ epx_Div_Sign=document.createElement("div"); epx_Div_Sign.className="epx1_x1_1_Sign"; epx_Div_Sign.style.position="relative"; epx_Div_Sign.style.lineHeight="16px"; epx_Div_Sign.style.clear="both"; epx_Div_Sign.style.direction="ltr"; epx_Div_Sign.style.padding="5px 0px 0"; epx_Div_Sign.style.marginBottom="25px"; epx_Div_Sign.style.textAlign="right"; epx_Div_Sign.style.display="block"; epx_Link_Sign=document.createElement("a"); epx_Link_Sign.setAttribute("rel","nofollow"); epx_Link_Sign.style.color="#999"; epx_Link_Sign.style.fontFamily="arial"; epx_Link_Sign.style.fontSize="10px"; epx_Link_Sign.style.textDecoration="none"; epx_Link_Sign.style.textTransform="none"; epx_Link_Sign.href="//epeex.it"; epx_Link_Sign.target="_blank"; epx_Link_Sign_Text=document.createTextNode("Raccomandati da"); epx_Div_Sign_logo=document.createElement("span"); epx_Div_Sign_logo.style.background="rgba(0, 0, 0, 0) url('//epeex.com/related/service/widget/epeex/img/logo_epeex.png') no-repeat scroll center top"; epx_Div_Sign_logo.style.height="13px"; epx_Div_Sign_logo.style.width="62px"; epx_Div_Sign_logo.style.boxSizing="content-box"; epx_Div_Sign_logo.style.display="inline-block"; epx_Div_Sign_logo.style.padding="1px 0px 2px 6px"; epx_Div_Sign_logo.style.verticalAlign="middle"; epx_Link_Sign.appendChild(epx_Link_Sign_Text); epx_Link_Sign.appendChild(epx_Div_Sign_logo); epx_Div_Sign.appendChild(epx_Link_Sign); epx_Div.appendChild(epx_Div_Sign); epx_Div_Clear=document.createElement("div"); epx_Div_Clear.style.clear="both"; epx_Div.appendChild(epx_Div_Clear); } // ################################ Modifica Test ##################################### var ep1_x1_1 = document.getElementsByClassName("epeex-interstitial"); for (var i = 0; i < ep1_x1_1.length; i++) { ep1_x1_1[i].id = String("epeex-"+i); } } var Script_Global_1_x1_1 = document.createElement("script"); Script_Global_1_x1_1.type = "text/javascript"; Script_Global_1_x1_1.src = epx1_x1_1_Url; epx1_x1_1_activator.parentNode.insertBefore(Script_Global_1_x1_1, epx1_x1_1_activator); function shuffle1_x1_1(array){var currentIndex = array.length, temporaryValue, randomIndex; while (0 !== currentIndex) {randomIndex = Math.floor(Math.random() * currentIndex);currentIndex -= 1;temporaryValue = array[currentIndex];array[currentIndex] = array[randomIndex];array[randomIndex] = temporaryValue;}return array;} var PostMessageCounter1_x1_1 = 0; var eventMethod1_x1_1 = window.addEventListener ? "addEventListener" : "attachEvent"; var eventer1_x1_1 = window[eventMethod1_x1_1]; var messageEvent1_x1_1 = eventMethod1_x1_1 == "attachEvent" ? "onmessage" : "message"; // Listen to message from child window eventer1_x1_1(messageEvent1_x1_1,function(e) { try{ var key1_x1_1 = e.message ? "message" : "data"; var datas1_x1_1 = e[key1_x1_1]; var eventName1_x1_1 = datas1_x1_1.message || 'ignore'; if (eventName1_x1_1 == 'adContentAvailable' && PostMessageCounter1_x1_1 <= 2){ console.log( 'Epeex: Ads(2) data available: ['+ PostMessageCounter1_x1_1 +'] ', datas1_x1_1 ); if(PostMessageCounter1_x1_1 <= 2){ document.getElementById('div-gpt-ad-sardiniapost_1-' + PostMessageCounter1_x1_1).innerHTML = datas1_x1_1.content.replace(/epeex_/g, 'epx1_x1_1_'); } console.log('Epeex: Injection & PostMessageCounter = ' + PostMessageCounter1_x1_1); PostMessageCounter1_x1_1++; } }catch(e){ console.log( 'Epeex: ERROR Ads data: ['+ PostMessageCounter1_x1_1 +'] : ' + e , datas1_x1_1 ); } },false);