(function(){var positionIds=['@BODY','WIDELEADERBOARD','WIDELEADERBOARD2','HALFPAGE','HALFPAGE2','HALFPAGE3','HALFPAGE4','HEADER'] /** fmt_montagnatv - v. 2.0 */ try{ document.getElementById('WIDELEADERBOARD').style.textAlign = "center"; document.getElementById('WIDELEADERBOARD').style.backgroundColor = "white"; document.getElementById('WIDELEADERBOARD2').style.textAlign = "center"; document.getElementById('WIDELEADERBOARD2').style.backgroundColor = "white"; } catch(e){} adagioNOPrint = true; var adagioBCode = '', adagioFormatIndex = 0, async = false, formatAppend = true; adagioBCode = ''; try { /*background*/ async = false; formatAppend = true; try{ if ("background" != "background"){ document.getElementById(positionIds[adagioFormatIndex]).innerHTML = ""; } } catch(e){} var str = location.href; var patt = new RegExp("//www.montagna.tv/"); var resAutoU = patt.test(str); if(resAutoU) document.getElementById("wrapper").style.marginTop="0px"; }catch(e){console.log("ce "+positionIds[adagioFormatIndex] + " A");} try { if ((positionIds[adagioFormatIndex] != "@BODY") && formatAppend){ if(typeof(async)!='undefined' && async) document.getElementById(positionIds[adagioFormatIndex]).appendChild(adagioBCode); else{ document.getElementById(positionIds[adagioFormatIndex]).innerHTML += adagioBCode; } } }catch(e){ console.log("ce: "+positionIds[adagioFormatIndex] + " B");} adagioFormatIndex++; adagioBCode = ''; try { /*wideleaderboard*/ async = false; formatAppend = true; try{ if ("wideleaderboard" != "background"){ document.getElementById(positionIds[adagioFormatIndex]).innerHTML = ""; } } catch(e){} /** * Redirect JS CloudFront * v. 1.0 * 619769 */ var adagioBCode = '', adagioContentId = "adagioIframeJs_619769_1722768328371", width = "970", height = "250", site = "montagna.tv"; scriptId = "78801"; isTrueAsync = true; window.adCreateFriendlyIF = function(objNameParam){ var objName = objNameParam; this.createFI = function(ifr, ifr_id, width, height) { ifr = (ifr ? ifr : document).createElement("iframe"); ifr_id && ifr.setAttribute("id", ifr_id); ifr.style.display = width ? "" : "none"; ifr.style.width = width ? width + "px" : "0px"; ifr.style.height = height ? height + "px" : "0px"; ifr.style.position = "relative"; ifr.style.margin = "0 auto"; document.documentMode && 8 > document.documentMode ? (ifr.frameBorder = 0, ifr.margin = 0, ifr.marginWidth = 0, ifr.marginHeight = 0, ifr.scrolling = "no") : (ifr.setAttribute("scrolling", "no"), ifr.setAttribute("marginwidth", "0"), ifr.setAttribute("marginheight", "0"), ifr.setAttribute("frameborder", "0")); return ifr; }; this.enableIframeReady = function(ifr) { if (ifr) { ifr.setAttribute("ready-to-write", "false"); var src = "javascript:document.write('" + "\r" + ('try{' + 'parent.document.domain;' + '}catch(e){' + 'document.domain="' + document.domain + '";}\r') + "parent."+objName+".callbackFI(window);\r" + "\r');"; ifr.src = src; } }; this.callbackFI = function(elem) { for (var b = document.getElementsByTagName("iframe"), c = 0; c < b.length; c++) try { if ((b[c].contentWindow || b[c].contentDocument.window || b[c].window) == elem) { b[c].setAttribute("ready-to-write", "true"); break; } } catch (d) {} }; this.writeToFI = function(ifr, code) { if (document.documentMode && 7 < document.documentMode && "false" == ifr.getAttribute("ready-to-write")) setTimeout(function() { writeToFI(ifr, code, c); }, 100); else { var d = ifr.contentWindow ? ifr.contentWindow.document : ifr.contentDocument && ifr.contentDocument.document ? ifr.contentDocument.document : ifr.contentDocument; d.write("

" + "inDapIF = true;"+ code); setTimeout(function() { d.close(); }, 1000); } }; }; var createIframe = function (id, code, width, height, id_parent) { var ifrm = document.createElement('iframe'); ifrm.id = id; var attrs = {"frameborder":"0","scrolling":"no","width":width,"height":height,"marginwidth":"0","marginheight":"0","vspace":"0","hspace":"0"}; for (var key in attrs){ ifrm.setAttribute(key, attrs[key]); } ifrm.src = "JavaScript:''"; document.getElementById(id_parent).appendChild(ifrm); setTimeout(function(){ ifrm = document.getElementById(id); ifrm.contentWindow.document.open('text/html', 'replace'); ifrm.contentWindow.document.write(code); ifrm.contentWindow.document.close(); },500); }; var getTrackImpressionUrl = function(){ if (''!='') return ''.replace("//","//"); if (''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if (''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); return ""; }; var setConfirmCode = function(){ var confirm = ''.replace("//","//"); return '
'+confirm+'
'; }; var getTrackFirstQuartile = function(){ return ''; }; adagioBCode+= '
'; //'; adagioBCode += getTrackFirstQuartile(); adagioBCode += setConfirmCode(); if (getTrackImpressionUrl() != "") adagioBCode+=''; if (typeof(adagioNOPrint) == "undefined" || adagioNOPrint==null || adagioNOPrint == false) { document.write(adagioBCode); } else if (typeof positionIds !== "undefined"){ document.getElementById(positionIds[adagioFormatIndex]).innerHTML = adagioBCode; adagioBCode = ""; } else{ isTrueAsync = false; } try{ if (document.getElementById(adagioContentId).parentNode.parentNode.className == "genericBanner section"){ document.getElementById(adagioContentId).parentNode.parentNode.style.height="auto"; } } catch(e){} var code = "

" + "inDapIF = true;" + "" + "var aplus_clickurl = '//adagiofe.neodatagroup.com/ad/clk.jsp?x=422501.619769.1063.465791.-1.device_desktop^gdpr_0.51.88.1.1877.1.-1.-1.-1..-1.0...&link='; " + "var aplus_referrer = '" + site + "';" + "var aplus_resize_parent_tag = true;" + "" + ""; var jsCode = function(){ window.adObj_redir_619769_1722768328371 = new window.adCreateFriendlyIF("adObj_redir_619769_1722768328371"); var ifr = adObj_redir_619769_1722768328371.createFI(false,"ifr_"+adagioContentId,width,height); document.getElementById(adagioContentId).appendChild(ifr); adObj_redir_619769_1722768328371.enableIframeReady(ifr); adObj_redir_619769_1722768328371.writeToFI(ifr, code); }; if (!isTrueAsync){ setTimeout(function(){ jsCode(); },1000); } else{ jsCode(); } formatAppend = false; window.adagioAppendInAsync = function(id,src,type){ // todo aggiungere alla lib if(document.getElementById(id) != null){ switch (type){ case "script": var s = document.createElement("script"); s.type = "text/javascript"; s.src = src; document.getElementById(id).appendChild(s); break; default: break; } } else{ setTimeout(function(){ adagioAppendInAsync(id, src, type); },250); } }; window.adagioAppendInAsync(adagioContentId, "", "script"); function waitForElement_619769(adagioContentId){ if(document.getElementById(adagioContentId) != null){ objName=window.activeCheckViewability(619769, 422501, 465791, 50, 1, 88, adagioContentId); } else{ setTimeout(function(){ waitForElement_619769(adagioContentId); },250); } } waitForElement_619769(adagioContentId); }catch(e){console.log("ce "+positionIds[adagioFormatIndex] + " A");} try { if ((positionIds[adagioFormatIndex] != "@BODY") && formatAppend){ if(typeof(async)!='undefined' && async) document.getElementById(positionIds[adagioFormatIndex]).appendChild(adagioBCode); else{ document.getElementById(positionIds[adagioFormatIndex]).innerHTML += adagioBCode; } } }catch(e){ console.log("ce: "+positionIds[adagioFormatIndex] + " B");} adagioFormatIndex++; adagioBCode = ''; try { /*wideleaderboard2*/ async = false; formatAppend = true; try{ if ("wideleaderboard2" != "background"){ document.getElementById(positionIds[adagioFormatIndex]).innerHTML = ""; } } catch(e){} }catch(e){console.log("ce "+positionIds[adagioFormatIndex] + " A");} try { if ((positionIds[adagioFormatIndex] != "@BODY") && formatAppend){ if(typeof(async)!='undefined' && async) document.getElementById(positionIds[adagioFormatIndex]).appendChild(adagioBCode); else{ document.getElementById(positionIds[adagioFormatIndex]).innerHTML += adagioBCode; } } }catch(e){ console.log("ce: "+positionIds[adagioFormatIndex] + " B");} adagioFormatIndex++; adagioBCode = ''; try { /*halfpage*/ async = false; formatAppend = true; try{ if ("halfpage" != "background"){ document.getElementById(positionIds[adagioFormatIndex]).innerHTML = ""; } } catch(e){} /** * Redirect JS CloudFront * v. 1.0 * 619763 */ var adagioBCode = '', adagioContentId = "adagioIframeJs_619763_1722768328378", width = "300", height = "250", site = "montagna.tv"; scriptId = "78764"; isTrueAsync = true; window.adCreateFriendlyIF = function(objNameParam){ var objName = objNameParam; this.createFI = function(ifr, ifr_id, width, height) { ifr = (ifr ? ifr : document).createElement("iframe"); ifr_id && ifr.setAttribute("id", ifr_id); ifr.style.display = width ? "" : "none"; ifr.style.width = width ? width + "px" : "0px"; ifr.style.height = height ? height + "px" : "0px"; ifr.style.position = "relative"; ifr.style.margin = "0 auto"; document.documentMode && 8 > document.documentMode ? (ifr.frameBorder = 0, ifr.margin = 0, ifr.marginWidth = 0, ifr.marginHeight = 0, ifr.scrolling = "no") : (ifr.setAttribute("scrolling", "no"), ifr.setAttribute("marginwidth", "0"), ifr.setAttribute("marginheight", "0"), ifr.setAttribute("frameborder", "0")); return ifr; }; this.enableIframeReady = function(ifr) { if (ifr) { ifr.setAttribute("ready-to-write", "false"); var src = "javascript:document.write('" + "\r" + ('try{' + 'parent.document.domain;' + '}catch(e){' + 'document.domain="' + document.domain + '";}\r') + "parent."+objName+".callbackFI(window);\r" + "\r');"; ifr.src = src; } }; this.callbackFI = function(elem) { for (var b = document.getElementsByTagName("iframe"), c = 0; c < b.length; c++) try { if ((b[c].contentWindow || b[c].contentDocument.window || b[c].window) == elem) { b[c].setAttribute("ready-to-write", "true"); break; } } catch (d) {} }; this.writeToFI = function(ifr, code) { if (document.documentMode && 7 < document.documentMode && "false" == ifr.getAttribute("ready-to-write")) setTimeout(function() { writeToFI(ifr, code, c); }, 100); else { var d = ifr.contentWindow ? ifr.contentWindow.document : ifr.contentDocument && ifr.contentDocument.document ? ifr.contentDocument.document : ifr.contentDocument; d.write("

" + "inDapIF = true;"+ code); setTimeout(function() { d.close(); }, 1000); } }; }; var createIframe = function (id, code, width, height, id_parent) { var ifrm = document.createElement('iframe'); ifrm.id = id; var attrs = {"frameborder":"0","scrolling":"no","width":width,"height":height,"marginwidth":"0","marginheight":"0","vspace":"0","hspace":"0"}; for (var key in attrs){ ifrm.setAttribute(key, attrs[key]); } ifrm.src = "JavaScript:''"; document.getElementById(id_parent).appendChild(ifrm); setTimeout(function(){ ifrm = document.getElementById(id); ifrm.contentWindow.document.open('text/html', 'replace'); ifrm.contentWindow.document.write(code); ifrm.contentWindow.document.close(); },500); }; var getTrackImpressionUrl = function(){ if (''!='') return ''.replace("//","//"); if (''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if (''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); return ""; }; var setConfirmCode = function(){ var confirm = ''.replace("//","//"); return '
'+confirm+'
'; }; var getTrackFirstQuartile = function(){ return ''; }; adagioBCode+= '
'; //'; adagioBCode += getTrackFirstQuartile(); adagioBCode += setConfirmCode(); if (getTrackImpressionUrl() != "") adagioBCode+=''; if (typeof(adagioNOPrint) == "undefined" || adagioNOPrint==null || adagioNOPrint == false) { document.write(adagioBCode); } else if (typeof positionIds !== "undefined"){ document.getElementById(positionIds[adagioFormatIndex]).innerHTML = adagioBCode; adagioBCode = ""; } else{ isTrueAsync = false; } try{ if (document.getElementById(adagioContentId).parentNode.parentNode.className == "genericBanner section"){ document.getElementById(adagioContentId).parentNode.parentNode.style.height="auto"; } } catch(e){} var code = "

" + "inDapIF = true;" + "" + "var aplus_clickurl = '//adagiofe.neodatagroup.com/ad/clk.jsp?x=422485.619763.1063.465795.-1.device_desktop^gdpr_0.51.88.1.1728.1.-1.-1.-1..-1.0...&link='; " + "var aplus_referrer = '" + site + "';" + "var aplus_resize_parent_tag = true;" + "" + ""; var jsCode = function(){ window.adObj_redir_619763_1722768328378 = new window.adCreateFriendlyIF("adObj_redir_619763_1722768328378"); var ifr = adObj_redir_619763_1722768328378.createFI(false,"ifr_"+adagioContentId,width,height); document.getElementById(adagioContentId).appendChild(ifr); adObj_redir_619763_1722768328378.enableIframeReady(ifr); adObj_redir_619763_1722768328378.writeToFI(ifr, code); }; if (!isTrueAsync){ setTimeout(function(){ jsCode(); },1000); } else{ jsCode(); } formatAppend = false; window.adagioAppendInAsync = function(id,src,type){ // todo aggiungere alla lib if(document.getElementById(id) != null){ switch (type){ case "script": var s = document.createElement("script"); s.type = "text/javascript"; s.src = src; document.getElementById(id).appendChild(s); break; default: break; } } else{ setTimeout(function(){ adagioAppendInAsync(id, src, type); },250); } }; window.adagioAppendInAsync(adagioContentId, "", "script"); function waitForElement_619763(adagioContentId){ if(document.getElementById(adagioContentId) != null){ objName=window.activeCheckViewability(619763, 422485, 465795, 50, 1, 88, adagioContentId); } else{ setTimeout(function(){ waitForElement_619763(adagioContentId); },250); } } waitForElement_619763(adagioContentId); }catch(e){console.log("ce "+positionIds[adagioFormatIndex] + " A");} try { if ((positionIds[adagioFormatIndex] != "@BODY") && formatAppend){ if(typeof(async)!='undefined' && async) document.getElementById(positionIds[adagioFormatIndex]).appendChild(adagioBCode); else{ document.getElementById(positionIds[adagioFormatIndex]).innerHTML += adagioBCode; } } }catch(e){ console.log("ce: "+positionIds[adagioFormatIndex] + " B");} adagioFormatIndex++; adagioBCode = ''; try { /*halfpage2*/ async = false; formatAppend = true; try{ if ("halfpage2" != "background"){ document.getElementById(positionIds[adagioFormatIndex]).innerHTML = ""; } } catch(e){} }catch(e){console.log("ce "+positionIds[adagioFormatIndex] + " A");} try { if ((positionIds[adagioFormatIndex] != "@BODY") && formatAppend){ if(typeof(async)!='undefined' && async) document.getElementById(positionIds[adagioFormatIndex]).appendChild(adagioBCode); else{ document.getElementById(positionIds[adagioFormatIndex]).innerHTML += adagioBCode; } } }catch(e){ console.log("ce: "+positionIds[adagioFormatIndex] + " B");} adagioFormatIndex++; adagioBCode = ''; try { /*halfpage3*/ async = false; formatAppend = true; try{ if ("halfpage3" != "background"){ document.getElementById(positionIds[adagioFormatIndex]).innerHTML = ""; } } catch(e){} }catch(e){console.log("ce "+positionIds[adagioFormatIndex] + " A");} try { if ((positionIds[adagioFormatIndex] != "@BODY") && formatAppend){ if(typeof(async)!='undefined' && async) document.getElementById(positionIds[adagioFormatIndex]).appendChild(adagioBCode); else{ document.getElementById(positionIds[adagioFormatIndex]).innerHTML += adagioBCode; } } }catch(e){ console.log("ce: "+positionIds[adagioFormatIndex] + " B");} adagioFormatIndex++; adagioBCode = ''; try { /*halfpage4*/ async = false; formatAppend = true; try{ if ("halfpage4" != "background"){ document.getElementById(positionIds[adagioFormatIndex]).innerHTML = ""; } } catch(e){} }catch(e){console.log("ce "+positionIds[adagioFormatIndex] + " A");} try { if ((positionIds[adagioFormatIndex] != "@BODY") && formatAppend){ if(typeof(async)!='undefined' && async) document.getElementById(positionIds[adagioFormatIndex]).appendChild(adagioBCode); else{ document.getElementById(positionIds[adagioFormatIndex]).innerHTML += adagioBCode; } } }catch(e){ console.log("ce: "+positionIds[adagioFormatIndex] + " B");} adagioFormatIndex++; adagioBCode = ''; try { /*header*/ async = false; formatAppend = true; try{ if ("header" != "background"){ document.getElementById(positionIds[adagioFormatIndex]).innerHTML = ""; } } catch(e){} }catch(e){console.log("ce "+positionIds[adagioFormatIndex] + " A");} try { if ((positionIds[adagioFormatIndex] != "@BODY") && formatAppend){ if(typeof(async)!='undefined' && async) document.getElementById(positionIds[adagioFormatIndex]).appendChild(adagioBCode); else{ document.getElementById(positionIds[adagioFormatIndex]).innerHTML += adagioBCode; } } }catch(e){ console.log("ce: "+positionIds[adagioFormatIndex] + " B");} adagioFormatIndex++; })()