$(document).ready(function() {
	
	// Home Page scroller
$('.scroller').cycle({ fx:'fade',speed:1000,timeout:5000,random:1,next:'.scroller-right a',prev:'.scroller-left a' });
$('.immagine_dove').cycle({ fx:'fade',speed:1000,timeout:3000,random:1});
	
$('a.active').click(function() { return false });


	// Gestione Cufon

Cufon.replace('.title_opener, .main_accono, .main_accono_specie', {
	hover: true
});


	// Gestione Accordion

$('#menu .subsub.active').parent().show();

$('#menu .main').click( function() {
	var checkElement = $(this).next();
	$('#menu .menu_2nd').animate({ opacity : 0 }, 300);
	$('#menu .menu_2nd:visible').slideUp(500, 'easeOutBack');
	$('#menu .menu_3rd').animate({ opacity : 0 }, 150);
	$('#menu .menu_3rd:visible').slideUp(500, 'easeOutBack');
	if((checkElement.is('.menu_2nd')) && (!checkElement.is(':visible'))) {
	$('#galleryviewer').fadeOut('slow');
		checkElement.children('.sub:first').children('a').animate({'opacity' : 1}, 'medium');
		checkElement.slideDown(650, 'easeOutBack').animate({ opacity : 1 }, 200);
		return false;
	}
});

$('#menu .subtitle').click( function() {
	var checkElement = $(this).next();
	$('#menu .menu_3rd').animate({ opacity : 0 }, 150);
	$('#menu .menu_3rd:visible').slideUp(500, 'easeOutBack');
	if((checkElement.is('.menu_3rd')) && (!checkElement.is(':visible'))) {
		checkElement.slideDown(650, 'easeOutBack').animate({ opacity : 1 }, 150);
		return false;
	}
});

$('#menu .main_accono_specie').click( function() {
	var checkElement = $(this).next();
	checkElement.animate({ opacity : 0 }, 150);
	checkElement.slideUp(500, 'easeOutBack');
	if(!checkElement.is(':visible')) {
		checkElement.slideDown(650, 'easeOutBack').animate({ opacity : 1 }, 150);
		return false;
	}
});
	
});
