$(document).ready(function(){

	function espandi(id) {
		//giro immagine
		if($("div#"+id).css('display') == 'none') {
			$("#img-"+id).rotateRight();
			$("div#"+id).show();
		} else {
			$("#img-"+id).rotateLeft();
			$("div#"+id).hide();
		}
		
		//buggy in IE8
		//scambio quello con id = id
		//$("div#"+id).slideToggle("slow");
	}

	$("div#proposta").hide();
	$("div#teatro").hide();
	$("div#facilitatore").hide();
	
	$("a#show-progetto").click(function(){
		espandi("progetto");
	});
	
	$("a#show-teatro").click(function(){
		espandi("teatro");
	});
	
	$("a#show-facilitatore").click(function(){
		espandi("facilitatore");
	});
	
	$("a#butt-proposta").click(function(){
		$("div#proposta").slideToggle("slow");
	});
	
	$("a#butt-proposta").hover( 
	  function () { 
	    $("#img-proposta").fadeTo("fast", 0.60); 
	  }, 
	  function () { 
	    $("#img-proposta").fadeTo("slow", 1.00); 
	  } 
	);
	
});
