$(document).ready(function(){
	$("#InqueritoBtn").click(function () {


	if (document.inqueritos.voto[0].checked) {
		 var voto1 = document.inqueritos.voto[0].value;
		 $("#Inquerito").load("inquerito.php?voto=1");
	} else if (document.inqueritos.voto[1].checked) {
		var voto1 = document.inqueritos.voto[0].value;
		$("#Inquerito").load("inquerito.php?voto=2");
	} else if (document.inqueritos.voto[2].checked) {
		var voto1 = document.inqueritos.voto[0].value;
		$("#Inquerito").load("inquerito.php?voto=3");
	} else {
		alert("Inquérito: Seleccione uma opção.");
	}

      	})

	$("#VerResultados").click(function () {

		 $("#Inquerito").load("inquerito.php");

      	})

});



//slideshow banner

/*** 
    Simple jQuery Slideshow Script
    Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc.
***/

function slideSwitch() {
    var $active = $('#BannerImg IMG.active');

    if ( $active.length == 0 ) $active = $('#BannerImg IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#BannerImg IMG:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $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()", 5000 );
});



//slideshow marcas

(function($) {
	$(function() { //on DOM ready
		$("#scroller").simplyScroll({
			autoMode: 'loop'
		});
	});
})(jQuery);

