$(document).ready(funzioni);

function funzioni() {
     	 $("#Menu2 li").each(function() {
         		var Elemento= $(this);
         		var ElementoTesto=Elemento.text();
         		var ElementoLunghezza=ElementoTesto.length;
            			if (ElementoLunghezza>15){
               				Elemento.addClass("DoppiaRiga");
			}	
            	});

	
	var figli  =  0;
	$("#Menu3  ul").find("li").each(function(){
		figli = figli +1;
	});
	if (figli < 1) {
		$("#Menu3").hide();
		$("#Banner2").show();
		var TagBanner=$("#Banner2 img").attr("alt");
		$(".scritta_banner").text(TagBanner);
		$(".scritta_banner").show();
		}
	else
		{
		$("#Banner2").hide();
		$(".scritta_banner").hide();
		}
	
	var path = 0;
	$("#BreadCrumb h5").find("span").each(function() {
		path = path +1;
	});
	if (path > 1) {
		$("#Menu3").hide();
		$("#Banner2").hide();
		$(".scritta_banner").hide();
		$("#Menu4").show();
		}

	else
		 {
		$("#Menu4").hide();
		}




	var Sotto_titolo=$("#Content h2");
	var Sotto_titolo_text=Sotto_titolo.text();
	var Sotto_titolo_lungh=Sotto_titolo_text.length;
		if (Sotto_titolo_lungh<1) {
			Sotto_titolo.addClass("sottotitol_class");
			}

}
