// JavaScript Document
$(document).ready(function () {
	$(".btn").hover(function () {
		src = $(this).attr("src");
		src = src.replace("_0","_1");
		$(this).attr("src", src);
	},function () {
		src = $(this).attr("src");
		src = src.replace("_1","_0");
		$(this).attr("src", src);					  
	});
	$("#menu_principal a, #menu_footer a").hover(function () {
		src = $(this).find('img').attr("src");
		src = src.replace("_0","_1");
		$(this).find('img').attr("src", src);
	},function () {
		src = $(this).find('img').attr("src");
		src = src.replace("_1","_0");
		$(this).find('img').attr("src", src);					  
	});
	
	$(".scroll_seta_cima").click(function(event)	{
		event.preventDefault();
		obj = $('#'+$(this).attr("rel"));
		obj.scrollTo( '-=200px', 800, { easing:'swing', queue:true, axis:'y' } );
	});
	$(".scroll_seta_baixo").click(function(event)	{
		event.preventDefault();
		obj = $('#'+$(this).attr("rel"));
		obj.scrollTo( '+=200px', 800, { easing:'swing', queue:true, axis:'y' } );
	});
	$(".scroll_seta_esq").click(function(event)	{
		event.preventDefault();
		obj = $('#'+$(this).attr("rel"));
		obj.scrollTo( '-=200px', 800, { easing:'swing', queue:true, axis:'x' } );
	});
	$(".scroll_seta_dir").click(function(event)	{
		event.preventDefault();
		obj = $('#'+$(this).attr("rel"));
		obj.scrollTo( '+=200px', 800, { easing:'swing', queue:true, axis:'x' } );
	});
	
	hotel_w = 0;
	$.each($('.hotel'), function(i, v) {
		hotel_w += $(v).outerWidth(true);
	});
	$('#hoteis_content').width(hotel_w);
	
	if ($(".banner_slider")[0]!= null) {
			$(".banner_slider").cycle({ 
				fx: 'fade', 
				speed:  300 
			});
	}
	if ($(".home")[0]!= null) {
		$('#menu_destino_opcao a').live("click", function (event) {
			event.preventDefault();
			pg = $(this).attr('href');
			$('#menu_destino').load('func/destinos.php?pg='+pg);
		})	
	}
	if ($(".destino_horizontal_titulo")[0]!= null) {
		$(".destino_horizontal_titulo").each(function () {
			if ($.trim($(this).text()).length > 16) {
				$(this).css("backgroundImage", "none");
			}
		})		
	}
})
