function opaque1() {
  	$("#menu ul.hover li.section-title").nextAll().stop();
}
function opaque0() {
  	$("#menu ul.hover li.section-title").nextAll().stop();
}


$(document).ready(function()
{
	
	$("#menu ul").each(function(){
		$(this).find("li.active").prevAll().nextAll().show();
		$(this).find("li.active").parent().addClass("prova");
		
	
	});
	
	//$("#menu ul li.section-title").nextAll().css("opacity", "0");
	//$("#menu ul li.section-title").nextAll().css("height", "0");
	$("#menu ul li.section-title").nextAll().hide();
	$("#menu ul li.section-title").css("cursor", "pointer");
	
	$("#menu ul").not(".prova").hover(
		function () {	
			$(this).toggleClass("hover");
			$("#menu ul.hover li.section-title").nextAll().stop().animate({height:"100%"},{queue:false,duration:300}).animate({opacity:1},{queue:false,duration:200});
			//$("#menu ul.hover li.section-title").nextAll().slideDown();
	      }, 
		function () {
			$("#menu ul.hover li.section-title").nextAll().stop().animate({height:"0"},{queue:false,duration:300}).animate({opacity:0},{queue:false,duration:200});
			//$("#menu ul.hover li.section-title").nextAll().slideUp();
			$(this).toggleClass("hover");
	      }
	    );
	
	
	
	

	// then the active exhibit is showed

	$("#menu ul").each(function(){
		$(this).find("li.active").prevAll().nextAll().show();
		$(this).find("li.active").parent().addClass("prova");
		
	
	});

	//This is the toggle function
	
	//$("#menu ul li.section-title").click(function(){
	//	$(this).nextAll().toggle("fast");
	//});
	
});

$('window').load(function(){
    $('#news-wrapper').masonry({ columnWidth: 200 });
});




