/* FUNÇÕES - JQUERY */
/* Autor: Hilder Santos */

$j = jQuery.noConflict(); // Ninguém quer ver o jQuery conflitando com nada.

// Inicio o jQuery
$j(function() {
	
/* Controle de transparência nos links */
	
	$j('a:not(.noef)').animate({'opacity': 0.5}, 0); // Instância inicial dos links (transparentes)
	
	var t = 100; // Tempo do fadeIn e fadeOut dos links;
	
	// Aplico a transparência nos links e no hover
	$j('a:not(.noef)').hover(function() {
		$j(this).animate({'opacity': 1}, {queue:false, duration:t});				   
	},
	function() {
		$j(this).animate({'opacity': 0.5}, {queue:false, duration:t});  			   
	});

/*** Controle da transparência do box de info ***/
	var corBg = $j('.texto_info').css('backgroundColor');


/*** Controle do botão de info ***/
	$j('.texto_info').fadeOut(0);
	$j('.texto_info').css('background', 'none').prepend('<div class="box_bg">&nbsp;</div>');
	$j('.box_bg').css('background', corBg).animate({'opacity': 0.8}, 0);
	$j('#Meio.portfolio div.txt').animate({'opacity': 0}, 0)
	
	$j('#Meio.portfolio .info').click(function(e) {
		e.preventDefault();
			if(!$j(this).hasClass('ativa')) {
				$j(this).addClass('ativa').parent().next().children('.texto_info').animate({'width': 'toggle'}, 'medium', 'easeOutQuad', function() {
																						$j('div.txt', this).animate({'opacity': 1}, 'slow');			 
																					});
			} else {
				$j(this).removeClass('ativa').parent().next().children('.texto_info').children('.txt').animate({'opacity': 0}, 'medium', '', function() {
																						$j(this).parent().animate({'width': 'toggle'}, 'medium', 'easeOutQuad');			 
																					});
			}
		
	});
	
	

});
