

$(function() {
	//bind per effetto expose
	$("form").bind("click", function() {

		var expose = $(this).expose({
			color: '#9696CA', 
			opacity: 0.7,
			onClose: function() {
					this.close();
					this.getExposed().css({opacity:1});
			},
			api: true

		});
		expose.load();
	});
	
	$("form").bind("blur", function() {
		expose.close();
	});
	
	//accordion homepage
	$(".tabs").tabs(".contenutopost", {
		tabs: 'h2.titolowordpresspost',
		effect: 'slide',
		initialIndex: 0
	});
	
	//news homepage	
	$(".scrollable").scrollable().circular().autoscroll({ 
		autoplay: true, 
		interval: 3000,
		steps: 1
	});
	
	//tooltip news
	$(".items a[title]").tooltip({
			tip: '#tooltipnews',  
			offset: [0, -50], 
			effect: 'slide' 
		}).dynamic({ 
			bottom: { 
				direction: 'down',  
				bounce: true 
			} 
    }); 
	
	// carousel ultimi interventi forum
    $("div.lastforum").scrollable({
		vertical: true,
		size: 3,
		nextPage: '.scorrilastforum',
		loop: true
    }).circular().autoscroll({ 
		api: true,
		autoplay: true, 
		interval: 3000,
		steps: 1
	});
	
	//effetti menu
	$('#sidebar ul li a').bind('mouseenter', function() {
		$(this).animate({"backgroundPosition":"100% 0"},1000);
	});
	
	$('#sidebar ul li a').bind('mouseleave', function() {
		//$(this).animate({paddingLeft:'0px', opacity: 0.5,  borderLeftWidth: '1px'},100);
		$(this).stop();
		$(this).css('background-position','0 0');
	});
	
});