$j = jQuery.noConflict();

$j(document).ready(function(){
	
	
	/* animació de color del títol i links */
	$j("#page a").hover(function() {
		$j(this).stop(false, false).animate({color: '#000'}, 'fast');
	},
	function() {
		$j(this).stop(false, true).animate({color: '#616265'}, 'fast');
	});
	
	/* animació de color del títol i links */
	$j("#menu-principal a").unbind('hover').hover(function() {
		$j(this).stop(false, false).animate({color: '#000'}, 'fast');
	},
	function() {
		$j(this).stop(false, true).animate({color: '#A6A6A6'}, 'fast');
	});
	
	/* animació de color del botó de cerca */
	$j("#searchsubmit").hover(function() {
		$j(this).stop(false, false).animate({backgroundColor: '#000'}, '50');
	},
	function() {
		$j(this).stop(false, false).animate({backgroundColor: '#616265'}, '50');
	});
	
	/* animació d'opacitat de les imatges de galeria i mes*/
	$j("#content .ngg-galleryoverview img, #gmaps").hover(function() {
		$j(this).stop(false, false).animate({opacity: 1}, '100');
	},
	function() {
		$j(this).stop(false, true).animate({opacity: .5}, '100');
	});
	
	/* animació de la llargada del buscador */
	$j("#s").focus(function() {
		$j(this).stop(false, false).animate({width: '15em'}, 'fast');
	});
	$j("#s").focusout(function() {
		$j(this).stop(false, false).animate({width: '7em'}, 'fast');
	});

	/* animació títol */
	$j("#header h1 a").hover(function() {
		$j(this).parent().find(".espiral-hover").stop(true, false).animate({opacity: 1},'100');
	},
	function() {
		$j(this).parent().find(".espiral-hover").stop(false, true).animate({opacity: 0},'100');
	});

	/* animació d'opacitat de les imatges de galeria */
	$j(".fancybox-vimeo").hover(function() {
		$j(this).find('.vimeo-play-button').stop(true, false).animate({opacity: 1}, '100');
	},
	function() {
		$j(this).find('.vimeo-play-button').stop(false, true).animate({opacity: 0}, '100');
	});


	/* Animació per a les descripcions dels videos */
	$j(".video-wrapper").hover(function() {
		$j(this).find('p').stop(true, true).slideDown('100');
	},
	function() {
		$j(this).find('p').stop(true, true).slideUp('100');
	});

	
});

