/*
*
*	JavaScript Document
*
*	Data:				00/00/0000
*	Descricao:			Arquivo com as funções globais do projeto
*	Autor:				Marcelo Casinha
*	E-mail: 			marcelo@gadbrivia.com.br
	
*	Observacoes:		USE ESTE ARQUIVO SOMENTE PARA FUNÇÕES GENÉRICAS APLICÁVEIS A MAIS DE UMA ENTIDADE (EF) 
*
*/

function onAfter() {

	var linkPost = $(this).find('a').attr('href');
	$(this).parents('.revista-home').find('.revista-home-hover').attr('href', linkPost);

}


// Função para iniciar as demais
$(document).ready(function() 
{
	var classImage;
	$('.cycle-destaques').cycle({ 
	   fx:   'scrollHorz',
	   timeout: 0,
	   speed: 'slow',
	   next:   '.lk-next', 
	   prev:   '.lk-prev',
	   before: function(){
			classImage = $(this).attr('class');
			$('.lk-prev').removeClass().addClass('lk-prev lk-prev-' + classImage + ' replace');
			$('.lk-next').removeClass().addClass('lk-next lk-next-' + classImage + ' replace');
	   }
	});
	
	$('.cycle-revistas').cycle({ 
	   fx:   'scrollHorz',
	   timeout: 0,
	   speed: 'slow',
	   next:   '.lk-next-revistas', 
	   prev:   '.lk-prev-revistas',
	   after: onAfter
	});
	
	$('.hover-home').hover(
		function () {
			$(this).find('.lk-hover-home').stop().animate({left:'0'}, 500);
		}, 
		function () {
			$(this).find('.lk-hover-home').stop().animate({left:'-302'}, 500);
		}
	);
	
	$('.revista-home-hover').hover(
		function () {
			$('.revista-home .lk-hover-home').stop().animate({left:'0'}, 500);
		}, 
		function () {
			$('.revista-home .lk-hover-home').stop().animate({left:'-302'}, 500);
		}
	);
	
	/*BANNER HOME*/
	$('.lk-fechar-banner').click(function(){
		$('.banner-home').slideUp();	
	});
	
	$('.img-60').animate({width:'69'}, 1000, 
		function(){ $('.tt-60').animate({height:'89'}, 1000,
			function(){ $('.img-70').animate({width:'73'}, 1000,
				function(){ $('.tt-70').animate({height:'89'}, 1000,
					function(){ $('.img-80').animate({width:'97'}, 1000,
						function(){ $('.tt-80').animate({height:'89'}, 1000,
							function(){ $('.img-90').animate({width:'66'}, 1000,
								function(){ $('.tt-90').animate({height:'89'}, 1000,
									function(){ $('.img-00').animate({width:'63'}, 1000,
										function(){ $('.tt-00').animate({height:'89'}, 1000,
											function(){ $('.img-50').animate({width:'105'}, 1000,
												function(){ $('.tt-50').animate({height:'146'}, 1000,
													function(){ $('.tt-ramarim-banner').animate({width:'292'}, 1000,
														function(){ $('.tt-decada').animate({height:'84'}, 1000,
															function(){setTimeout(function(){ $('.banner-home').slideUp(); }, 2000);}
														)}
													)}
												)}
											)}
										)}
									)}
								)}
							)}
						)}
					)}
				)}
			)}
		)}
	);

});


