$(document).ready(function(){
	$("div.paragraphs h2.OpenClose, div.paragraphs h3.OpenClose").each(function() {
	    $(this).next("div").hide() ;
	}) ;
	// Apertura/chiusura Blocchi
	$("div.paragraphs h2.OpenClose, div.paragraphs h3.OpenClose").click(function (){
		$(this).next("div").toggle() ;
		
		if($(this).next("div").is(":visible")) {
			$(this).addClass("opened") ;	
		} else {
			$(this).removeClass("opened") ;	
		}
	})  ;
	
	$(".expandall").click(function() { 
		$("div.paragraphs h2.OpenClose, div.paragraphs h3.OpenClose").not("h2.noExpand").each(function() {
			$(this).next("div").show();
			$(this).addClass("opened") ;	
		}) ;
	})  ;
	$("div.paragraphs  .collapseall").click(function() { 
		$("h2.OpenClose, h3.OpenClose").not("h2.noExpand, h3.noExpand").each(function() {
			$(this).next("div").hide();
			$(this).removeClass("opened") ;	
		}) ;
	})  ;
});
