function dropShadow(eid) { if(!document.getElementById || !document.getElementsByTagName || !document.createElement) return; var obj = document.getElementById(eid); if(!obj|| !obj.offsetParent) return; /* riferimento al body del documento */ var body = document.getElementsByTagName('body')[0]; var left = 0, top = 0; /* ottiene la posizione assoluta del div */ /* distanza dal bordo sinistro della pagina */ for (var tmpObj = obj; tmpObj.offsetParent; tmpObj = tmpObj.offsetParent) left += tmpObj.offsetLeft; /* distanza dal bordo superiore */ for (var tmpObj = obj; tmpObj.offsetParent; tmpObj = tmpObj.offsetParent) top += tmpObj.offsetTop; /* spessore dell'ombra ovvero dei bordi del div che andremo ad aggiungere */ var x1 = 2; /* crea il nuovo div */ var ombra = document.createElement('div'); /* viene assegnato lo stile al div ombra in modo che si affianchi al div obiettivo */ /* posizione */ ombra.style.position = 'absolute'; ombra.style.left = left + x1 + 'px'; ombra.style.top = top + x1 + 'px'; /* dimensioni */ ombra.style.height = obj.offsetHeight - x1 + 'px'; ombra.style.width = obj.offsetWidth - x1 + 'px'; /* bordi (l'ombra effettiva) */ ombra.style.borderRight = x1 + 'px solid #eee'; ombra.style.borderBottom = x1 + 'px solid #eee'; /* appende il div creato al corpo del documento */ if(body.appendChild) body.appendChild(ombra); } window.onload = function() { dropShadow('BoxUltimiComunicati'); }; window.onload = function() { dropShadow('BoxDbCalendario'); }; window.onload = function() { dropShadow('BoxDbEuropa'); }; window.onload = function() { dropShadow('BoxDbEuropaSX'); }; //accessibility window.onload = function(e) { var cookie = readCookie("style"); if (cookie && cookie != "null") { setActiveStyleSheet(cookie); } else { setActiveStyleSheet("small"); } //print page if (document.location.href.indexOf("print") > -1) { window.print(); } } window.onunload = function(e) { var title = getActiveStyleSheet(); createCookie("style", title, 365); } function setActiveStyleSheet(title) { var i, a, main; for (i = 0; (a = document.getElementsByTagName("link")[i]); i++) { if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) { a.disabled = true; if (a.getAttribute("title") == title) a.disabled = false; } } } function getActiveStyleSheet() { var i, a; for (i = 0; (a = document.getElementsByTagName("link")[i]); i++) { if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled ) return a.getAttribute("title"); } return null; } function getPreferredStyleSheet() { var i, a; for (i = 0; (a = document.getElementsByTagName("link")[i]); i++) { if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("rel").indexOf("alt") == -1 && a.getAttribute("title") ) return a.getAttribute("title"); } return null; } function createCookie(name, value, days) { if (days) { var date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); var expires = "; expires=" + date.toGMTString(); } else expires = ""; document.cookie = name+ "=" + value + expires + "; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') c = c.substring(1, c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); } return null; } //menu hiligtht function litMenu(menuId) { itemLi = document.getElementById("m" + menuId); if (itemLi != null) itemLi.className = "menuon"; } //home flash function homeFlash() { document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); } //stock ticker function stockTicker(lang) { document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); } //prezzo titolo function intraDaySmall() { document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); } //date and time var dayNamesIt = new Array('domenica','lunedì','martedì','mercoledì','giovedì','venerdì','sabato') var monthNamesIt = new Array('gennaio','febbraio','marzo','aprile','maggio','giugno','luglio','agosto','settembre','ottobre','novembre','dicembre') var dayNamesEn = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday') var monthNamesEn = new Array('January','February','March','April','May','June','July','August','September','October','November','December') function dateFromInt(datastr,lang) { var year = '20'+datastr.substring(6,8) var month = datastr.substring(3,5) var day = datastr.substring(0,2) var date = new Date(year, month - 1, day) if(lang == 'it') data = dayNamesIt[date.getDay()] +' '+day+' '+ monthNamesIt[month - 1] + ' ' +year else data = dayNamesEn[date.getDay()] +' '+day+' '+ monthNamesEn[month - 1] +' '+ year document.write(data) } function time(datastr){ var ora = datastr.substring(9,14) document.write(ora) } /* service */ function readUrl(param){ var theurl=window.location.toString()+"&"; var posparam=theurl.indexOf(param+"="); if(posparam==-1)return""; var sottostringa=theurl.substring(posparam); var start=sottostringa.indexOf("="); var end=sottostringa.indexOf("&"); var val=sottostringa.substring(start+1,end); return val; } /* google */ var ALPHANUMERICS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890אטילעש" function tok(theObj,lang){ var text=theObj.value+" "; var pos,pos1=0; var finale,word,ch=" "; var find=true; var fword=false; for(var i=0;i 0) { if (tok(obj.q, lang) == true) return true; } else { if (lang == 'en') { alert("Please, insert the text to search!"); } else { alert("Per favore, inserire il testo da cercare!"); } } return false; } /*end google*/ /* send page by email */ function sendByEmail(lang){ /* var pTitle = document.title; var pUrl = document.location.href; var head = (lang == 'en') ? "Please check the page at the following address:\n" : "Ti segnalo la pagina all'indirizzo:\n"; var foot = (lang == 'en') ? "Mediaset Group - Investor Center\nhttp://www.mediaset.it/investor/home_en.shtml" : "Gruppo Mediaset - Investor Center\nhttp://www.mediaset.it/investor/home_it.shtml"; var subj = escape(pTitle); var body = escape(head + pUrl + "\n\n=========================\n" + foot); var sendmail = window.open("mailto:?subject=" + subj + "&body=" + body, "sendmail"); */ var sendmail = window.open("mailto:mediaset@mediaset.it"); } /* print page */ function printPage() { window.print(); } /* add to favorites */ function addToFavorites(lang) { if (document.all) { window.external.AddFavorite(document.location.href, document.title); // Internet Explorer } else if (window.sidebar) { window.sidebar.addPanel(document.title, document.location.href, ""); // Mozilla Firefox } else if (navigator.appName == "Netscape") { if (lang == 'en') { alert("Puoi aggiungere la pagina all\'elenco dei \'Preferiti\' premendo i tasti CTRL+D"); } else { alert("You can add this page to your \'Favorites\' with the key sequence CTRL+D"); } } }