// JavaScript ZapJuice - edit: tonidigrigio.it - 2011

$(function()
{
	$('.scroll-pane').jScrollPane();
	$('.scroll-pane-arrows').jScrollPane(
		{
			showArrows: true,
			horizontalGutter: 10
		}
	);
});

$(document).ready(function() {

	//CONTROLLO ACCORDION
	$('.visual').click(function() {
		$('.visual').removeClass('on');
		$('.content').slideUp('normal');
			if($(this).next().is(':hidden') == true) {
			$(this).addClass('on');
		$(this).next().slideDown('normal');
		} 
	});
	
	//FADE FOOTER
	$("#foot_wrapper ul li a").fadeTo("fast", 0.5);
		$("#foot_wrapper ul li a").hover(function(){
		$(this).fadeTo("slow", 0.8);
		},function(){
		$(this).fadeTo("slow", 0.5);
	});
		
	//SCROLL
	$('a[href^=#]:not([href=#])').click(function(e){
		$('html, body').animate({ 
		scrollTop: $($(this).attr("href"))
		.offset().top }, 1000);
		e.preventDefault();
	});
	
	//TIPSI
	$('.modulo_side ul li img').tipsy({gravity: 's', fade: true});
	$('.partners li img').tipsy({gravity: 's', fade: true});
	$('.button a').tipsy({gravity: 's', fade: true});
	
	//FANCYBOX
	$(".vantaggi").fancybox();
	
	$("a[rel=gal_1]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'over',
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
			return '';
		}
	});

	$("a[rel=gal_2]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'over',
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
			return '';
		}
	});
			
});
