//=========================================================
//FUNÇÃO PARA ENVIAR EMAIL ASSÍNCRONAMENTE
//=========================================================
var recenteHash = "";
$(function(){
	//Funções manipulação banner Principal	
	$('.navBanner').fadeTo("slow", 0.0);	  
	$('#bannerPrincipal').hover(function(){
		if ($('.listabanner li').size() > 1) {
			$('.navBanner').stop().fadeTo("fast", 1.0);
		  }
	  },function(){
			$('.navBanner').stop().fadeTo("fast", 0.0);
	});
})

$(document).ready(function(){
//=========================================================
//   CARREGA JORNAL
//=========================================================
$('.itemlistajornal a').click(function(){
    $pagina = $(this).attr('rel');
	
	$('.mascara').fadeIn('slow',function(){
	  $('#sectionrevista01').empty();									  
										  
	  $.ajax({
			url:'jornal/'+$pagina+'.asp',
			type: 'POST',
			dataType: 'html',
			success:function(data){
			  $("#sectionrevista01").append(data);
			  $('.mascara').fadeOut('slow', function(){$('html, body').animate({scrollTop: 160 }, 1000)});
			}
	  });//FIM:ajax
    });
});
//=========================================================
//   FIM:CARREGA JORNAL
//=========================================================


//====================================================================
// PLUGIN GALERIA
//====================================================================
/*  CYCLE
*/
$('#bannerPrincipal ul').cycle({ 
	fx:     'fade',
	next: '#banner_next',
	prev: '#banner_prev',
	pauseOnPagerHover: 1,
	pause: 1
});


  
$('.galeria01').cycle({ 
	fx:     'fade',
	speed:  'slow', 
	timeout: 5000, 
	pager: '#pagergaleria'
});

/*  AD-GALLERY
*/
var galleries = $('.ad-gallery').adGallery({
	  loader_image: 'images/loading.gif',
	  width: 600, // Width of the image, set to false and it will read the CSS width
	  height: 337, // Height of the image, set to false and it will read the CSS height
	  thumb_opacity: 0.7, // Opacity that the thumbs fades to/from, (1 removes fade effect)
			// Note that this effect combined with other effects might be resource intensive
			// and make animations lag
	  display_next_and_prev: true, // Can you navigate by clicking on the left/right on the image?
	  display_back_and_forward: true, // Are you allowed to scroll the thumb list?
	  slideshow: {
	  enable: false,
	  autostart: true,
	  speed: 500,
	  start_label: false,
	  stop_label: false,
	  stop_on_scroll: true, // Should the slideshow stop if the user scrolls the thumb list?
	  countdown_prefix: '(', // Wrap around the countdown
	  countdown_sufix: ')',
	  onStart: function() {
	  alert('adgalery');
      // Do something wild when the slideshow starts
    }}
});  
  
//====================================================================
// FIM:PLUGIN GALERIA
//====================================================================

$(".toggle_container").hide(); 
$("h2.trigger").click(function(){
	$(this).toggleClass("active").next().slideToggle("slow");
	return false; //Prevent the browser jump to the link anchor
});

//=========================================================
//   CHAMA GALERIA
//=========================================================

//Ir para topo
$('#irTopo').click(function(){
  $('html, body').animate({scrollTop: 0 }, 1000)
});

})//FIM:document.ready



