function slideSwitch() {
    var $active = $('#slideshow img.active');

	$active.addClass('last-active');

	// verifica se existe um próximo objeto na div #slideshow, caso ele nao exista, retorna para o primeiro
    var $next =  $active.next().length ? $active.next() : $('#slideshow img:first');

	// Codigo que define as transicoes entre as imagens
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
	//Executa a função a cada 5 segundos
	setInterval( "slideSwitch()", 7000 );
});

function enviarComentario() {
	
	if(document.formContato.nome.value == "") {
		alert("Preencha o campo Nome");
		document.formContato.nome.focus();
		return false;
	}
	
	if(document.formContato.empresa.value == "") {
		alert("Preencha o campo Empresa");
		document.formContato.empresa.focus();
		return false;
	}
	
	if(document.formContato.cnpj.value == "") {
		alert("Preencha o campo CNPJ");
		document.formContato.cnpj.focus();
		return false;
	}
	
	if(document.formContato.ddd.value == "" ||  document.formContato.fone.value == "") {
		alert("Preencha o campo Fone");
		if(document.formContato.ddd.value == "")
			document.formContato.ddd.focus();
		else
			document.formContato.fone.focus();
		return false;
	}
	
	if(document.formContato.email.value == "") {
		alert("Preencha o campo Email");
		document.formContato.email.focus();
		return false;
	}
	
	return true;

}

