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

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

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