/*javascript per menu espandibile*/
window.onload=function(){
if(document.getElementsByTagName && document.getElementById){
    document.getElementById("nav").className="jsenable";
    BuildList();
    }
doEvents();
}

function BuildList(){
var hs=document.getElementById("nav").getElementsByTagName("h3");
for(var i=0;i<hs.length;i++){
    hs[i].onclick=function(){
        if(this.parentNode.className=="show1"){this.parentNode.className="hide1";}
		else if (this.parentNode.className=="hide1"){this.parentNode.className="show1";}
		else if(this.parentNode.className=="show2"){this.parentNode.className="hide2";}
		else if (this.parentNode.className=="hide2"){this.parentNode.className="show2";}
		else if(this.parentNode.className=="show3"){this.parentNode.className="hide3";}
		else if (this.parentNode.className=="hide3"){this.parentNode.className="show3";}
		else if(this.parentNode.className=="show4"){this.parentNode.className="hide4";}
		else if (this.parentNode.className=="hide4"){this.parentNode.className="show4";}
        }
    }
}

function doEvents(){
	//document.getElementById("rosso").onClick=changecolorr
	var news = document.getElementsByTagName('div');
	for (var i=0; i<news.length; i++) {
		
		var divclass = news[i].className;
		if(divclass == "homeNews" || divclass == "homeNews2"){news[i].onclick = function () {
			var linkato = this.getAttribute('name');
			window.location.href = linkato;
			};}
		if(divclass == "homeNews" || divclass == "homeNews2"){news[i].onmouseover = function () {	
			this.className = (this.className=="homeNews")? "homeNews2" : "homeNews";
			};}
		if(divclass == "homeNews" || divclass == "homeNews2"){news[i].onmouseout = function () {	
			this.className = (this.className=="homeNews")? "homeNews2" : "homeNews";
			};}
	}
}
