$(function() {
	not_slide = 0;
	win=null;
	// Máscaras
	$(".data").mask("99/99/9999");
	$(".hora").mask("99:99");
	$(".fone").mask("(99) 9999-9999");
	
	$('#n_passageiros').keypress(function(event) {
		if (event.charCode && (event.charCode < 48 || event.charCode > 57)) {
		   event.preventDefault();
		}
	});
	
	// Banners
	$('#banner_publicidade').cycle({
		timeout: 10000,
		fx: 'fade' ,// tipos de efeitos: blindX, blindY, blindZ, cover, curtainX, curtainY, fade, fadeZoom, growX, growY, none, scrollUp, scrollDown, scrollLeft, scrollRight, scrollHorz, scrollVert, shuffle, slideX, slideY,toss,turnUp,turnDown,turnLeft,turnRight,uncover,wipe,zoom
		pager: '#home_nav'		
	});
	
	if($("#home_nav").length){
		$("#home_nav > a").eq($("#home_nav > a").length-1).css('border', 0);
	}
	
	// Album - Aviões
	$('.fotos-aviao > .imagens_block').each(function(){
		$(this).mousewheel(function(objEvent, intDelta){
			if(!not_slide){
				intDelta>0?$('#carrousel-set-left-'+$(this).attr('id')).trigger('click'):$('#carrousel-set-right-'+$(this).attr('id')).trigger('click');
			}
				
			objEvent.preventDefault();
		});
		
		$(this).cycle({
			fx: 'scrollHorz',
			timeout: 0,
			next: '#carrousel-set-left-[id_element]',
		    prev: '#carrousel-set-right-[id_element]',
			before: before_slide_produtos,
		    after: after_slide_produtos
		});
	});
	
	// Imagens - Zoom
	$(".imagens").fancybox({
		padding					: 0,
		overlayOpacity			: 0.8,
		'transitionIn'			: 'elastic',
		'transitionOut'			: 'elastic',
		'hideOnContentClick'	: true,
		'autoScale'         	: true,
		'autoDimensions'    	: true,
		centerOnScroll          : false,
		enableEscapeButton		: true,
		titleShow				: false,
		titlePosition			: 'inside',
		overlayShow				: true
	});
	
	// Imagens - Zoom
	$(".textos").fancybox({
		padding					: 0,
		overlayOpacity			: 0.8,
		'transitionIn'			: 'elastic',
		'transitionOut'			: 'elastic',
		'hideOnContentClick'	: true,
		'autoScale'         	: true,
		'autoDimensions'    	: true,
		centerOnScroll          : false,
		enableEscapeButton		: true,
		titleShow				: false,
		titlePosition			: 'inside',
		overlayShow				: true,
		width				  	: 250
	});
	
		
	
	
});

$(document).ready(function(){
	$("._case").live("hover", function(){
		$(this).hide();
		$("._case_hover[case="+$(this).attr("case")+"]").show();
    });
    
	$("._case_hover").hover(function(){ }, function(){
    	$(this).hide();
		$("._case[case="+$(this).attr("case")+"]").show();
    });
});

function topBox(n,m){
	if(!$("#top_box_inside").length)
		$("body").append('<div align="center" id="top_box"><div id="top_box_inside"></strong></div></div>');
	
	if(n){
		if(m)
			$("#top_box_inside").html(m);
			
		if($("#top_box").is(":hidden")){
			$("#top_box").fadeIn('medium');
		}
	}else{
		$("#top_box").fadeOut('medium',function(){$("#top_box_inside").html('');});
	}
}

function before_slide_produtos(){
	not_slide = 1;	
}

function after_slide_produtos(){
	not_slide = 0;
}
function printIt(printThis)
		{
		win = window.open();
		self.focus();
		win.document.open();
		win.document.write('<'+'html'+'><'+'head'+'><'+'style'+'>');
		win.document.write('body, td { font-family: Verdana; font-size: 10pt;}');
		win.document.write('<'+'/'+'style'+'><'+'/'+'head'+'><'+'body'+'>');
		win.document.write(printThis);
		win.document.write('<'+'/'+'body'+'><'+'/'+'html'+'>');
		win.document.close();
		win.print();
		win.close();
		}

