

$(document).ready(function(){
	


	//Preload de imagens
	var _images = ['imagens/bt_hover_01.jpg','imagens/bt_hover_02.jpg', 'imagens/bt_hover_03.jpg', 'imagens/bt_hover_04.jpg', 'imagens/bt_hover_05.jpg','imagens/bt_hover_06.jpg', 'imagens/foto01.jpg', 'imagens/foto02.jpg', 'imagens/foto03.jpg', 'imagens/foto04.jpg', 'imagens/foto_next_over.jpg', 'imagens/foto_prev_over.jpg', 'imagens/home_over.jpg', 'imagens/navegue_over.jpg'];

	$.each(_images,function(e) {
		$(new Image()).load(function() {
		}).attr('src',this);
	});

	jQuery("input[type='text'], textarea").resetDefaultValue();

	$("#side_menu li a img").hover( function(){
		$(this).stop().animate({
			left: '+=5px'
		}, 200);
	}, function(){
		$(this).stop().animate({
			left: '0'
		}, 200);
	})	
	//Fim do preload de imagens
	
	



	//Animação do menu principal
	$('#nav ul li a').hover(function(){
		$(this).find('span').stop().animate({
			height: '+=47px'

		});
	}, function(){
		$(this).find('span').stop().animate({
			height: 0
		});
	})
	$('#nav ul li a span').each(function(){
		$(this).click(function(){
			var link = $(this).parent().attr('href');
			window.location = link;

		})
	})

	// Fim da animação do menu principal

	$('#ani-imagens').cycle({
		fx: 'scrollHorz',
		next: '#next',
		prev: '#prev',
		before: legenda,
		after: legenda02
	});

	function legenda(){
		$("#legenda p").html(this.alt).animate({ left: "+=10px"})
	}
	function legenda02() {
		$("#legenda p").animate({ left: "0"})
	}	

	//Tool Tip
	$('#home').hover(function(){
		var principal = $(this).find('a').attr('title');
		$(this).append('<span id="tool_principal">' + principal + '</span>').find('span').fadeIn('slow');
	}, function(){
		$(this).find('span').remove();

	})

});

