<!--//

	/******************************************************
	* Stampa delle statistiche - Variabili comuni
	*******************************************************/
    var datiStazioni=new Array(
        "Stazione MeteoVedano","Vedano Olona 370 s.l.m.",
        "Centro Geofisico Prealpino","Varese 410 s.l.m.",
        "MeteoLecco","Lecco centro 238 s.l.m.");

	/******************************************************
	* Stampa dei riferimenti alle statistiche
	*******************************************************/
    var ie=document.all && !window.opera;
	oStagioni={p:0, l:5, v:vStagioni};
	oMesi={p:0, l:12, v:vMesi};
	statData={s:true, v:vStagioni, i:0};
		
	function lista_statistiche(cosa) {
	 	var oLista=(cosa=="stagionali")?oStagioni:oMesi;
        var da=oLista.p;
        var per=oLista.l;
        per=((oLista.v.length-da)>=per)?per:oLista.v.length-da;
        if (cosa=="stagionali")
		    ListaStatistiche=ie?document.all.Stagionali:document.getElementById("Stagionali");
		else
		    ListaStatistiche=ie?document.all.Mensili:document.getElementById("Mensili");
		var testo="";
        for (i=da; i<(da+per); i++) {
         	commento=oLista.v[i].Periodo;
         	commento=(commento.length<20)?commento:commento.substring(0,20)+"...";
         	testo+='<a class="TestoListe" href="javascript:void(0)"';
         	testo+='onclick="stampa_statistica(\''+cosa+'\','+i+')"> '+commento+' </a><br />\n';
        }
        da=(i==oLista.v.length)?0:i;
		oLista.p = da;
        if (per<oLista.v.length) {
			testo+='<a class="AltroListe" href="javascript:void(0)" onclick="lista_statistiche(\''+cosa+'\')"> Altro... </a>\n';
		}
        ListaStatistiche.innerHTML=testo;
	}

	/******************************************************
	* Gestione frecce sinistra - destra
	*******************************************************/
	function vai_a(indice){
	 	if (indice==1)
	 		indice=(statData.i==statData.v.length-1)?0:statData.i+1;
	 	else
	 		indice=(statData.i==0)?statData.v.length-1:statData.i-1;
		stampa_statistica(null, indice);
	}

	function stampa_statistica(cosa, indice){
	 	if (cosa!=null){
        	statData.v=(cosa=="stagionali")?vStagioni:vMesi;
        	statData.s=(cosa=="stagionali")?true:false;
		}
        statData.i=indice;
		// Inizio tabella
	 	tabella='<table class="Cornice" "width="100%" cellpadding="5" cellspacing="2" align="center" summary="Statistiche'+cosa+'">'; 
		tabella+='<tr>\n';
	 	// PERIODO
	 	tabella+='<td class="CellaNome" colspan="'+(statData.s?5:4)+'">\nPeriodo <span class="Evidenzia">';
		tabella+=statData.v[indice].Periodo+'</span>\n</td>\n';
	 	// Link a FILE COMMENTO
		tabella+='<td class="CellaNome" colspan="2">\n<a class="Link" href="Commenti/'+statData.v[indice].fCommento+'">Commento</a>\n</td>\n';
		tabella+='</tr>\n<tr>\n';
	 	// Riga con titoli colonne
		tabella+='<td class="CellaNome">'+(statData.s?'&nbsp;':'Condizioni')+'</td>\n';
		tabella+='<td class="CellaNome">'+(statData.s?'Giorni':'N. Giorni')+'</td>\n';
		tabella+='<td class="CellaNome">'+(statData.s?'Totale':'Temperature')+'</td>\n';
		tabella+='<td class="CellaNome">'+(statData.s?'Temperature':'Min')+'</td>\n';
		tabella+='<td class="CellaNome">'+(statData.s?'Min':'Med')+'</td>\n';
		tabella+='<td class="CellaNome">'+(statData.s?'Med':'Max')+'</td>\n';
		if (statData.s) tabella+='<td class="CellaNome">Max</td>\n';
		tabella+='</tr>\n<tr>\n';
	 	// Riga con FAVONIO / SERENO
		tabella+='<td class="CellaNome">'+(statData.s?'Favonio':'Sereno/Poco nuvoloso')+'</td>\n';
		tabella+='<td class="CellaValore">'+(statData.s?statData.v[indice].gFavonio:statData.v[indice].gSereno)+'</td>\n';
		tabella+='<td class="CellaNome">'+(statData.s?'&nbsp;':'Meteovedano')+'</td>\n';
		if (statData.s){
			tabella+='<td class="CellaNome">Periodo</td>\n';
			tabella+='<td class="CellaNome">-</td>\n';
		}else{
			tabella+='<td class="CellaValore">'+statData.v[indice].tMinMeseMV+'</td>\n';
			tabella+='<td class="CellaValore">'+statData.v[indice].tMedMeseMV+'</td>\n';
		}
		tabella+='<td class="CellaValore">'+(statData.s?statData.v[indice].tMedia:statData.v[indice].tMaxMeseMV)+'</td>\n';
		if (statData.s) tabella+='<td class="CellaNome">-</td>\n';
		tabella+='</tr>\n<tr>\n';
	 	// Riga con PIOGGIA (mm) / NUVOLOSO
		tabella+='<td class="CellaNome">'+(statData.s?'Pioggia (mm)':'Nuvoloso/Coperto')+'</td>\n';
		tabella+='<td class="CellaValore">'+(statData.s?statData.v[indice].gPioggia:statData.v[indice].gNuvoloso)+'</td>\n';
		if (statData.s){
			tabella+='<td class="CellaValore">'+statData.v[indice].mPioggia+'</td>\n';
			tabella+='<td class="CellaNome">Media</td>\n';
			tabella+='<td class="CellaValore">'+statData.v[indice].tMediaMin+'</td>\n';
			tabella+='<td class="CellaNome">-</td>\n';
		}else{
			tabella+='<td class="CellaNome">'+statData.v[indice].Desc2+'</td>\n';
			tabella+='<td class="CellaValore">'+statData.v[indice].tMinMese2+'</td>\n';
			tabella+='<td class="CellaValore">'+statData.v[indice].tMedMese2+'</td>\n';
			tabella+='<td class="CellaValore">'+statData.v[indice].tMaxMese2+'</td>\n';
		}
		if (statData.s) tabella+='<td class="CellaValore">'+statData.v[indice].tMediaMax+'</td>\n';
		tabella+='</tr>\n<tr>\n';
	 	// Riga con NEVE (cm) / FAVONIO
		tabella+='<td class="CellaNome">'+(statData.s?'Neve (cm)':'Favonio')+'</td>\n';
		tabella+='<td class="CellaValore">'+(statData.s?statData.v[indice].gNeve:statData.v[indice].gFavonio)+'</td>\n';
		if (statData.s){
			tabella+='<td class="CellaValore">'+statData.v[indice].mNeve+'</td>\n';
			tabella+='<td class="CellaNome">Assoluta</td>\n';
			tabella+='<td class="CellaValore">'+statData.v[indice].tAssMin+'</td>\n';
			tabella+='<td class="CellaNome">-</td>\n';
		}else{
			tabella+='<td class="CellaNome">'+statData.v[indice].Desc3+'</td>\n';
			tabella+='<td class="CellaValore">'+statData.v[indice].tMinMese3+'</td>\n';
			tabella+='<td class="CellaValore">'+statData.v[indice].tMedMese3+'</td>\n';
			tabella+='<td class="CellaValore">'+statData.v[indice].tMaxMese3+'</td>\n';
		}
		if (statData.s) tabella+='<td class="CellaValore">'+statData.v[indice].tAssMax+'</td>\n';
		if (!statData.s){ // Righe aggiuntive statistiche mese
			tabella+='</tr>\n<tr>\n';
		 	// Riga con NEBBIA
			tabella+='<td class="CellaNome">Nebbia</td>\n';
			tabella+='<td class="CellaValore">'+statData.v[indice].gNebbia+'</td>\n';
			tabella+='<td class="CellaNome">media 1a decade</td>\n';
			tabella+='<td class="CellaValore">'+statData.v[indice].tMin1aDecade+'</td>\n';
			tabella+='<td class="CellaValore">-</td>\n';
			tabella+='<td class="CellaValore">'+statData.v[indice].tMax1aDecade+'</td>\n';
			tabella+='</tr>\n<tr>\n';
		 	// Riga con PIOGGIA
			tabella+='<td class="CellaNome">Pioggia</td>\n';
			tabella+='<td class="CellaValore">'+statData.v[indice].gPioggia+'</td>\n';
			tabella+='<td class="CellaNome">media 2a decade</td>\n';
			tabella+='<td class="CellaValore">'+statData.v[indice].tMin2aDecade+'</td>\n';
			tabella+='<td class="CellaValore">-</td>\n';
			tabella+='<td class="CellaValore">'+statData.v[indice].tMax2aDecade+'</td>\n';
			tabella+='</tr>\n<tr>\n';
		 	// Riga con NEVE
			tabella+='<td class="CellaNome">Neve</td>\n';
			tabella+='<td class="CellaValore">'+statData.v[indice].gNeve+'</td>\n';
			tabella+='<td class="CellaNome">media 3a decade</td>\n';
			tabella+='<td class="CellaValore">'+statData.v[indice].tMin3aDecade+'</td>\n';
			tabella+='<td class="CellaValore">-</td>\n';
			tabella+='<td class="CellaValore">'+statData.v[indice].tMax3aDecade+'</td>\n';
		}
		tabella+='</tr>\n<tr>\n';
	 	// MINIMA, MASSIMA ASSOLUTE
	 	testo="";
		if (statData.v[indice].nTemporali != "-")
			testo+='Manifestazioni temporalesche: <font class="FontValore">'+statData.v[indice].nTemporali+'</font><br />';
	 	if (statData.s){
			if (statData.v[indice].tAssMinGiorno != "-")
				testo+='Min. assoluta registrata il <font class="FontValore">'+statData.v[indice].tAssMinGiorno+'</font><br />';
			if (statData.v[indice].tAssMaxGiorno != "-")
				testo+='Min. assoluta registrata il <font class="FontValore">'+statData.v[indice].tAssMaxGiorno+'</font>';
		}else{
			if (statData.v[indice].tAssMinGiorno != "-")
				testo+='Min. assoluta registrata in data <font class="FontValore">'+statData.v[indice].tAssMinGiorno+'</font><br />';
			if (statData.v[indice].tAssMaxGiorno != "-")
				testo+='Max. assoluta registrata in data <font class="FontValore">'+statData.v[indice].tAssMaxGiorno+'</font><br />';
			if (statData.v[indice].mPioggia != "-"){
				testo+='Pioggia caduta '+'<font class="FontValore">'+statData.v[indice].mPioggia+'</font>';
				if (statData.v[indice].dPioggia != "-")
					testo+='(diff.: <font class="FontValore">'+statData.v[indice].dPioggia+'</font>)';
				testo+='<br />';
				if (statData.v[indice].datePioggia != "-")
					testo+='Pioggia caduta in data <font class="FontValore">'+statData.v[indice].datePioggia+'</font><br />';
			}
			if (statData.v[indice].mNeve != "-"){
				testo+='Neve caduta '+'<font class="FontValore">'+statData.v[indice].mNeve+'</font>';
				if (statData.v[indice].dNeve != "-")
					testo+='(diff.: <font class="FontValore">'+statData.v[indice].dNeve+'</font>)';
				testo+='<br />';
				if (statData.v[indice].dateNeve != "-")
					testo+='Neve caduta in data <font class="FontValore">'+statData.v[indice].dateNeve+'</font><br />';
			}
		}
	 	if (testo.length>0) tabella+='<td class="CellaNome" colspan="'+(statData.s?7:6)+'">'+testo+'</td>\n';
		tabella+='</tr>\n';
		tabella+='</table>';
	    TabellaStatistiche=ie?document.all.Tabella:document.getElementById("Tabella");
	    if (window.TabellaStatistiche) TabellaStatistiche.innerHTML=tabella;
	}

//-->


