$(document).ready(function(){


  	 //menu desplegable
	$("#firstpane2 #desp2").click(function()
	{
	$(this).next("#menu_amagat3b").slideToggle("slow").siblings("#menu_amagat3b").slideUp("slow");
	});
	
	$("#firstpane1 #desp1").click(function()
	{
	$(this).next("#menu_amagat3").slideToggle("slow").siblings("#menu_amagat3").slideUp("slow");
	});

	//formacio desplegable
	$("#intro ").click(function()
	{
	$("div.apt").hide("slow");
	$("#apt_intro").show("slow");
	});

	$("#avanc ").click(function()
	{
	$("div.apt").hide("slow");
	$("#apt_avanc").show("slow");
	});

	$("#alli").click(function()
	{
	$("div.apt").hide("slow");
	$("#apt_alli").show("slow");
	});

	$("#allig").click(function()
	{
	$("div.apt").hide("slow");
	$("#apt_allig").show("slow");
	});

	$("#probl").click(function()
	{
	$("div.apt").hide("slow");
	$("#apt_probl").show("slow");
	});

	$("#anali").click(function()
	{
	$("div.apt").hide("slow");
	$("#apt_anali").show("slow");
	});

	$("#hist").click(function()
	{
	$("div.apt").hide("slow");
	$("#apt_hist").show("slow");
	});





	// overlay
	$("spam[rel]").each(function(i) {
		$(this).overlay({

			// common configuration for each overlay
			expose: '#f1f1f1',
			oneInstance: false,
			closeOnClick: true,
			}
		);
	});

	//scroll
	// initialize scrollable
	$("div.scrollable").scrollable({
		size: 3,
		items: '#thumbs',
		hoverClass: 'hover'
	});

	
   

});

