// JavaScript Document

//Data odierna
function WebDate() {
	var now = new Date();
	var year= now.getYear();if (year < 1000) year += 1900;
	dataMth = new Array('Gennaio','Febbraio','Marzo','Aprile','Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre','Dicembre');
	if(now.getMinutes() < 10)   
	document.write(now.getDate() + " " + dataMth[now.getMonth()] + " " + year + ". " + "Ore " + now.getHours() + ":0" + now.getMinutes());
	else                          
    document.write(now.getDate() + " " + dataMth[now.getMonth()] + " " + year + ". " + "Ore " + now.getHours() + ":" + now.getMinutes());
}

//Menu
function initMenu() {
	var li_ = document.getElementsByTagName('li');
	for (var i=0;li = li_[i];i++)
		if(li.className && li.className=="more") {
			for (j=0; j<li.childNodes.length; j++) 
				if (li.childNodes[j].nodeName.toLowerCase()=="ul") li.subMenu = li.childNodes[j];
			li.subMenu.className = "subMenu-off";
			li.onmouseover = li.onactivate = li.onfocus = function() { this.subMenu.className = "subMenu-on" };
			li.onmouseout = li.ondeactivate = li.onblur = function() { this.subMenu.className = "subMenu-off" };
		}
}
window.onload = function(e) {
if(document.getElementsByTagName('body')) initMenu() ;
}

//Aggiornamento
 var giorno = new initArray("Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato");
 var mese = new initArray("Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre");
 var modifica = new Date(document.lastModified);
 
function initArray() {  
      this.length = initArray.arguments.length
      for (var i = 0; i < this.length; i++)
      this[i+1] = initArray.arguments[i]
}

//grandezza testo
function scegliTesto (grandezza)  {  
	if ( grandezza == '1' ){
		document.getElementById("contenuti").style.fontSize = "10px";
	}
	if ( grandezza == '2' ){
		document.getElementById("contenuti").style.fontSize = "13px";
	}
	if ( grandezza == '3' ){
		document.getElementById("contenuti").style.fontSize = "16px";
	}
}
