// JavaScript Document

$(document).ready(function() {
   
   //Topo rotativo
   $('.slidetopo').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});
	
	//Fotos das páginas internas
	$('.slideshow').cycle({
		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});
	
		//Fotos das páginas internas
	$('.galeria').cycle({
		fx:     'slideY', 
		speed:  300, 
		next:   '.galeria', 
		timeout: 0 
	});
	
}); 



function slideSwitch() {
    var $active = $('#slideshowcapa DIV.active');
    if ( $active.length == 0 ) $active = $('#slideshowcapa DIV:last');
    var $next =  $active.next().length ? $active.next()
        : $('#slideshowcapa DIV:first');
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}
$(function() {
    setInterval( "slideSwitch()", 4000 );
});




function slideSwitch3() {

}

$(function() {
    setInterval( "slideSwitch3()", 5000 );
});

function slideSwitchCENTRAL() {
    var $active = $('#slideshowCENTRAL DIV.active');
    if ( $active.length == 0 ) $active = $('#slideshowCENTRAL DIV:last');
    // use this to pull the divs in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshowCENTRAL DIV:first');
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}
$(function() {
    setInterval( "slideSwitchCENTRAL()", 7000 );
});




function post_mail() {

	$.post('actions/mailing.php',{nome:document.getElementById("nome").value,mail:document.getElementById("mail").value}, function(data){
		alert(data);
	});
document.getElementById("nome").value = "Digite seu nome";
document.getElementById("mail").value = "Digite seu e-mail";
}








