jQuery.noConflict();

jQuery(function(){

	jQuery('.nivoSlider').nivoSlider({
		'effect' 		:   'fade',
		'directionNav'	:	false,	
		'pauseTime'     :   4000,
		'animSpeed'		: 	100,
		'afterChange'	:	function(){
			var elementoAtivo = jQuery('.nivo-controlNav').children('.active').index() + 1;	
			jQuery('.destaque_titulo li').removeClass('ativo');
			jQuery('.destaque_titulo li:nth-child('+ elementoAtivo + ')').addClass('ativo');
			jQuery('.destaque_resumo li').removeClass('ativo');
			jQuery('.destaque_resumo li:nth-child('+ elementoAtivo + ')').addClass('ativo');
		}
	});
	
	jQuery("a.link_youtube").click(function(e){
		e.preventDefault();
		jQuery.fancybox({
			'padding'			: 0,
			'autoScale'			: false,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'href'				: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'				: 'swf',
			'swf'				: {
				'wmode'				: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});
	});
	
	jQuery('#select_aniversariantes').change(function() {
    	var link = jQuery(this).val();	
    	if(parseInt(link) < 10) {
    		link = '0'+link;
    	}
    	window.location.replace('/aniversariantes/'+link+'/');
    });	
                	        	    	          				
	jQuery('.fancybox').fancybox({
        'titleShow'        : false,
        'transitionIn'    : 'fade',
        'transitionOut'    : 'fade',
        'overlayOpacity' : 0.8,
        'overlayColor' : '#000',
        'padding': 0
	});	 
    
    for (i=1;i<=3;i++)
    {
        jQuery('.lista-sedes-'+i).cycle({
                next:   '.cycle-next-'+i, 
                prev:   '.cycle-prev-'+i
        });
    }

});
