/* ++++++++++++++++++++++++++++++++++++++++++
   FUNZIONE PER LE PAGINE 'PERINVESTIRE'
   ++++++++++++++++++++++++++++++++++++++++++ */
function perinvestire() {
	if (location.hostname=='www.corriere.it'){
	var url_PI = 'http://perinvestire.corriere.it';
	} else {
		if (location.hostname=='corriere.virgilio.it'){
		var url_PI = 'http://perinvestire.corriere.virgilio.it';
		}
	}
	
	this.location.href = url_PI;
		
}


/* ++++++++++++++++++++++++++++++++++++++++++
   FUNZIONE PER APRIRE I POPUP DI RTSI
   ++++++++++++++++++++++++++++++++++++++++++ */
function pr99(rif) {
var largh = 295;
var hpos = screen.width-largh-20;
var vpos = 0;
if (rif==undefined) rif='';
mywindow = window.open('http://www.rtsi.ch/iraq/miniplayer.cfm?rif='+rif,'miniplayer','resizable=no,width=295,height=550,left='+hpos+',top=8,screenX=0,screenY=0');
}


/* ******************************************
   FUNZIONE PER APRIRE URL ESTERNI
   IN FRAME  (MODIFICATO 11 september version)
****************************************** */
function openlink_b(xlink){
	window.open("/openxlink_b.shtml?" + xlink, "xpage");
	}
	
/* ******************************************
   FUNZIONE PER APRIRE URL ESTERNI
   DENTRO IL FRAME PREDISPOSTO
****************************************** */
function openlink(xlink){
	window.open("/openxlink.shtml?" + xlink, "xpage");
	}
		
/* ******************************************
   FUNZIONE GALLERIE FOTOGRAFICHE UNIVERSALE 
   (c) g.angeli 2000 
****************************************** */
function galleria(path,n_galleria){
pathcompleta="/speciali/"+path+"/galleria/sopra.html?"+n_galleria
path_sin="/speciali/popup/foto.html"
path_des="/speciali/popup/vuoto.html"
newWin=open("","","menubar=no,location=no,toolbar=yes,status=no,scrollbars=yes,resizable=no,width=680,height=480");
newWin.document.write('<html><head><title>Galleria di immagini</title>');
newWin.document.write('</head>');
newWin.document.write('<frameset rows="45,*" border="0" frameborder="NO" framespacing="0">');
newWin.document.write('<frame src="'+pathcompleta+'" name="sopra" scrolling="NO" marginheight="5" marginwidth="5">');
newWin.document.write('<frameset cols="120,*" border="0" frameborder="NO" framespacing="0">');
newWin.document.write('<frame src="'+path_sin+'" name="sin">');
newWin.document.write('<frame src="'+path_des+'" name="des">');
newWin.document.write('</frameset></frameset>');
newWin.document.write('<noframes><body>Per visualizzare questa pagina &egrave; necessario un browser che supporti i frames</body></noframes>');
newWin.document.write('</html>');
//newWin.frames["sopra"].location.href=pathcompleta
}

function galleria2(path,n_galleria){
pathcompleta="/speciali/"+path+"/galleria/sopra.html?"+n_galleria
path_sin="/speciali/popup/foto.html"
path_des="/speciali/popup/vuoto.html"
newWin=open('','',"menubar=no,location=no,toolbar=yes,status=no,scrollbars=yes,resizable=no,width=680,height=490");
newWin.document.write('<html><head><title>Galleria di immagini</title></head>');
newWin.document.write('<frameset rows="60,*" border="0" frameborder="NO" framespacing="0">');
newWin.document.write('<frame src="'+pathcompleta+'" name="sopra" scrolling="NO" marginheight="5" marginwidth="5">');
newWin.document.write('<frameset cols="120,*" border="0" frameborder="NO" framespacing="0">');
newWin.document.write('<frame src="'+path_sin+'" name="sin">');
newWin.document.write('<frame src="'+path_des+'" name="des">');
newWin.document.write('</frameset></frameset>');
newWin.document.write('<noframes><body>Per visualizzare questa pagina &egrave; necessario un browser che supporti i frames</body></noframes>');
newWin.document.write('</html>');
//newWin.frames["sopra"].location.href=pathcompleta
}

/* ******************************************

 
****************************************** */
function spedisci() {

var argomento = (self.document.forms[0].val_testo.value);
var url_ricerca = "";

var returnString = "";
for (var i = 0; i < argomento.length; i++) {
	c = argomento.charAt(i);
	if (c == " ") c = "+";
	returnString += c;
}

if (self.document.forms[0].elements[1].checked){
			self.location.href="http://www.corriere.it/ricerca/ricerca.jsp?query=" + returnString + "&dn=ricerca.corriere.it"

	}

if (self.document.forms[0].elements[2].checked){
			self.location.href="http://www.corriere.it/ricerca/ricerca.jsp?query=" + returnString
	}

//self.location.href = url_ricerca;
}




   /*funzione per visualizzazione layer */
    
function BrowserCheck() {
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.version = navigator.appVersion
	this.v = parseInt(this.version)
	this.ns = (this.b=="ns" && this.v>=4)
	this.ns4 = (this.b=="ns" && this.v==4)
	this.ns5 = (this.b=="ns" && this.v==5)
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (this.version.indexOf('MSIE 4')>0)
	this.ie5 = (this.version.indexOf('MSIE 5')>0)
	this.min = (this.ns||this.ie)
}

is = new BrowserCheck()
    
/* funzione per far visualizzare i vari menu */
function mostra (quale)
{
	return true;

}
	
var giftop;

var gifdown;

loaded = true;



/* funzione per far scomparire le giffone trasparenti*/

function showObject(obj) {
	return true
}

function hideObject(obj) {
	return true
}
	

function preload (){
/*    
            giftop= new Image();

            giftop.src = "/images/pix.gif"
*/      
}



     
    /* funzione per rollover immagine */
	function rollover(imgName,imgSrc)
	{
		if(document.images)
		{
        if (is.ie)
			document.images[imgName].src=imgSrc;
		
        else
            
            eval('document.images["'+imgName+'"].src = "'+imgSrc+'"')	
		}
	}  
	

    /* back dela pagina */
    function pagprec (x){
    history.go(x);

    }
    
    
    
    /* funzione per il box della sezione edicola */
    


function edicola(){
var OptionSelected
var LinkSelected

  OptionSelected = document.edicola.list.selectedIndex;

  
  SelectedLink = document.edicola.list.options[OptionSelected].value;

  
  if (SelectedLink == '../edicola/')
  {
    document.location = SelectedLink;

  }
  else
  {
    document.location = SelectedLink;

  }
  
}

/* FUNZIONE PER L'AGGIORNAMENTO DELLA DATA*/

function data (){
thisDate = new Date()
giorno = thisDate.getDay();
oggi = thisDate.getDate();
monthNum = thisDate.getMonth();
Year = thisDate.getYear();
if (Year <=100)
Year=1900+Year;
switch (monthNum){ 
case 0 : NomeMese = "Gennaio ";break; 
case 1 : NomeMese = "Febbraio ";break; 
case 2 : NomeMese = "Marzo ";break; 
case 3 : NomeMese = "Aprile ";break; 
case 4 : NomeMese = "Maggio ";break; 
case 5 : NomeMese = "Giugno ";break; 
case 6 : NomeMese = "Luglio ";break; 
case 7 : NomeMese = "Agosto ";break; 
case 8 : NomeMese = "Settembre ";break; 
case 9 : NomeMese = "Ottobre ";break; 
case 10 : NomeMese = "Novembre ";break; 
case 11 : NomeMese = "Dicembre ";break; 
} 
switch (giorno){ 
case 0 : NomeGiorno = "Domenica";break; 
case 1 : NomeGiorno = "Luned&igrave;";break; 
case 2 : NomeGiorno = "Marted&igrave;";break; 
case 3 : NomeGiorno = "Mercoled&igrave;";break; 
case 4 : NomeGiorno = "Gioved&igrave;";break; 
case 5 : NomeGiorno = "Venerd&igrave;";break; 
case 6 : NomeGiorno = "Sabato";break; 
}
document.write(NomeGiorno+' '+oggi+' '+NomeMese+ ' '+Year);}


/*  funzioni per aprire i pop pup   */
function mare()    {window.open('pop_up.shtml','mare','width=446,height=446,scrollbars=no,resizable=no');

}


function pop_lente()
{window.open('/pop_up.shtml','popup','width=181,height=420,scrollbars=yes,resizable=no');
}

function pop_nlente()
{window.open('/includes/lente_popup.shtml','popup','width=190,height=465,scrollbars=yes,resizable=no');}

 function Apri(quale){
    if (window.name=='popup')
	{
  
    window.close()
    opener.parent.location.href=quale             
    
    }
    else
    {
    document.location.href=quale             
    }
 }


function Apri2(quale){
   window.close()
   opener.parent.location.href=quale             
}


function pr1(filename) {window.open(filename,'Test1','menubar=no,location=no,toolbar=no,status=no,scrollbars=yes,resizable=no,width=730,height=540')
}

function pr2(filename) {window.open(filename,'','menubar=yes,location=no,toolbar=no,status=no,scrollbars=yes,resizable=no,width=450,height=480')}

function pr3(filename) {window.open(filename,'','menubar=yes,location=yes,toolbar=no,status=no,scrollbars=yes,resizable=no,width=400,height=420')}

function pr5(nomefile,larghezza,altezza) {
	parametri="menubar=no,location=no,toolbar=yes,status=no,scrollbars=no,resizable=no,width="
	parametri=parametri+larghezza+",height="+altezza
	newWin=open('','',parametri)
	newWin.location.href=nomefile
}

function pr6(nomefile,larghezza,altezza) {
	parametri="menubar=no,location=no,toolbar=no,status=no,scrollbars=yes,resizable=no,width="
	parametri=parametri+larghezza+",height="+altezza
	newWin=open('','',parametri)
	newWin.location.href=nomefile
}

/* FUNZIONE POP UP UNIVERSALE */
function pr4(nomefile,larghezza,altezza) {
	var pathToRemove = "/Corriere della Sera";
	var lenPathToRemove = pathToRemove.length;
	if (nomefile.indexOf(pathToRemove) > -1) nomefile = nomefile.substring(lenPathToRemove);
	if (nomefile.indexOf(".xml") > -1)  nomefile = nomefile.substring(0, nomefile.indexOf(".xml")) + ".shtml";
	parametri="menubar=no,location=yes,toolbar=yes,status=no,scrollbars=yes,resizable=yes,width="
	parametri=parametri+larghezza+",height="+altezza
	newWin=open('','',parametri)
	newWin.location.href=nomefile
}


// FUNZIONE POPUP SONDAGGI
function apripop_sondaggio(PATH, width, height)
{
window.open('/sondaggi/popup.jsp?xml='+PATH,'Sondaggio','height='+height+',width='+width+',toolbar=no,menubar=no,status=no,directories=no,location=no,resizable=YES,scrollbars=yes,marginwidth=0,marginheight=0,left=120,top=85')
}

// METEO

// FUNZIONE PER IL POP UP DI DESCRIZIONE DEI VENTI 
function vento(){
window.open('/meteo/pop_vento.shtml','','menubar=no,location=no,toolbar=no,status=no,scrollbars=yes,resizable=no,width=465,height=447')
}

// FUNZIONE PER IL POP UP PER LE AVVERTENZE D'USO
function avvert(){
window.open('/meteo/pop_avvertenza.shtml','','menubar=no,location=no,toolbar=no,status=no,scrollbars=yes,resizable=no,width=275,height=275')
}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function init() {
}

/* FUNZIONE POP UP ICONMEDIALAB */
function picon(nomefile,larghezza,altezza) {
	parametri="menubar=no,location=no,toolbar=no,status=no,scrollbars=yes,resizable=no,width="
	parametri=parametri+larghezza+",height="+altezza
	newWin=open('','',parametri)
	newWin.location.href=nomefile
}

function apri_finestra_sondaggi(url_pag, windowsname, dimLar, left, top, dimAlt){
			var hWnd = window.open(url_pag, windowsname, "toolbar=no,width=" + dimLar + ",height=" + dimAlt + ",left=" + left + ",top=" + top + ",directories=no,location=no,status=yes,statusbar=yes,resizable=1,menubar=no,scrollbars=yes");
			if(!hWnd.opener) hWnd.opener=self;	
			if(hWnd.focus!=null) hWnd.focus();
		}

// FUNZIONE PER APERTURA PAGINA CONCORSO CONCENTO SEGNALINI
function apri_finestra(url_pag,windowsname,dime,dimes,left,top){
        var hWnd=window.open(url_pag,windowsname,"toolbar=no,width="
+dime+",height="+dimes+",left="+left+",top="+

top+",directories=no,status=no,statusbar=no,resizable=0,menubar=no,scrollbars=no,location=no");
        //if(!hWnd.opener) hWnd.opener=self;
        if(hWnd.focus!=null) hWnd.focus();
        }

// FUNZIONE PER HREF SENZA HTTP e WWW 

function apri_pagina(url){
	window.location.href=url;
}


function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		europe_01_ImageMap_01_sopra = newImage("immagini/europe_01-ImageMap_01_sopra.gif");
		europe_01_ImageMap_02_sopra = newImage("immagini/europe_01-ImageMap_02_sopra.gif");
		europe_01_ImageMap_03_sopra = newImage("immagini/europe_01-ImageMap_03_sopra.gif");
		europe_01_ImageMap_04_sopra = newImage("immagini/europe_01-ImageMap_04_sopra.gif");
		europe_01_ImageMap_05_sopra = newImage("immagini/europe_01-ImageMap_05_sopra.gif");
		europe_01_ImageMap_06_sopra = newImage("immagini/europe_01-ImageMap_06_sopra.gif");
		europe_01_ImageMap_07_sopra = newImage("immagini/europe_01-ImageMap_07_sopra.gif");
		europe_01_ImageMap_08_sopra = newImage("immagini/europe_01-ImageMap_08_sopra.gif");
		europe_01_ImageMap_09_sopra = newImage("immagini/europe_01-ImageMap_09_sopra.gif");
		europe_01_ImageMap_10_sopra = newImage("immagini/europe_01-ImageMap_10_sopra.gif");
		europe_01_ImageMap_11_sopra = newImage("immagini/europe_01-ImageMap_11_sopra.gif");
		europe_01_ImageMap_12_sopra = newImage("immagini/europe_01-ImageMap_12_sopra.gif");
		europe_01_ImageMap_13_sopra = newImage("immagini/europe_01-ImageMap_13_sopra.gif");
		europe_01_ImageMap_14_sopra = newImage("immagini/europe_01-ImageMap_14_sopra.gif");
		preloadFlag = true;
	}
}

function init() {
if (!document.getElementById) return
var imgOriginSrc;
var imgTemp = new Array();
var imgarr = document.getElementsByTagName('img');
for (var i = 0; i < imgarr.length; i++) {
if (imgarr[i].getAttribute('hsrc')) {
imgTemp[i] = new Image();
imgTemp[i].src = imgarr[i].getAttribute('hsrc');
imgarr[i].onmouseover = function() {
imgOriginSrc = this.getAttribute('src');
this.setAttribute('src',this.getAttribute('hsrc'))
}
imgarr[i].onmouseout = function() {
this.setAttribute('src',imgOriginSrc)
}
}
}
}
onload=init;

// FUNZIONI POPUP AUDIO VIDEO 

function videoDSL(percorso) {
var pathToRemove = "/Corriere della Sera";
var lenPathToRemove = pathToRemove.length;
if (percorso.indexOf(pathToRemove) > -1) percorso = percorso.substring(lenPathToRemove);
window.open('/speciali/multimedia/multimedia-vDSL.shtml?'+percorso,'multimedia','height=470,width=380,toolbar=no,menubar=no,status=no,directories=no,location=no,resizable=no,scrollbars=no')
}

function videoTrailer(percorso) {
var pathToRemove = "/Corriere della Sera";
var lenPathToRemove = pathToRemove.length;
if (percorso.indexOf(pathToRemove) > -1) percorso = percorso.substring(lenPathToRemove);
window.open('/speciali/multimedia/multimedia-vTrailer.shtml?'+percorso,'multimedia','height=480,width=550,toolbar=no,menubar=no,status=no,directories=no,location=no,resizable=no,scrollbars=no')
}

function video56k(percorso) {
var pathToRemove = "/Corriere della Sera";
var lenPathToRemove = pathToRemove.length;
if (percorso.indexOf(pathToRemove) > -1) percorso = percorso.substring(lenPathToRemove);
window.open('/speciali/multimedia/multimedia-v56k.shtml?'+percorso,'multimedia','height=360,width=320,toolbar=no,menubar=no,status=no,directories=no,location=no,resizable=no,scrollbars=no')
}

function videoDSLs(percorso) {
var pathToRemove = "/Corriere della Sera";
var lenPathToRemove = pathToRemove.length;
if (percorso.indexOf(pathToRemove) > -1) percorso = percorso.substring(lenPathToRemove);
window.open('/speciali/multimedia/multimedia-vDSLsolo.shtml?'+percorso,'multimedia','height=450,width=380,toolbar=no,menubar=no,status=no,directories=no,location=no,resizable=no,scrollbars=no')
}

function video56ks(percorso) {
var pathToRemove = "/Corriere della Sera";
var lenPathToRemove = pathToRemove.length;
if (percorso.indexOf(pathToRemove) > -1) percorso = percorso.substring(lenPathToRemove);
window.open('/speciali/multimedia/multimedia-v56ksolo.shtml?'+percorso,'multimedia','height=340,width=320,toolbar=no,menubar=no,status=no,directories=no,location=no,resizable=no,scrollbars=no')
}

function audio(percorso) {
var pathToRemove = "/Corriere della Sera";
var lenPathToRemove = pathToRemove.length;
if (percorso.indexOf(pathToRemove) > -1) percorso = percorso.substring(lenPathToRemove);
window.open('/speciali/multimedia/multimedia-audio.shtml?'+percorso,'multimedia','height=300,width=320,toolbar=no,menubar=no,status=no,directories=no,location=no,resizable=no,scrollbars=no')
}

