$(document).ready(function(){  
    
    //VALIDAR O FORMULARIO DE CADASTRO DE USUÁRIO
    $(".camp_obg").hide();
    $("#form_contato").submit(function(){
        erro = true;
        cont = 0;
       if ($("#txtNome").val() == ""){
           $("#txtNome").next().show();
           erro = false;
       }
       else {
           $("#txtNome").next().hide();
           cont++;
       }
       
       if ($("#txtEmail").val() == ""){
           $("#txtEmail").next().show();
       }
       else {
           $("#txtEmail").next().hide();
           cont++;
       }
       if ($("#txtAssunto").val() == ""){
           $("#txtAssunto").next().show();
           erro = false;
       }
       else {
           $("#txtAssunto").next().hide();
           cont++;
       }
       if ($("#txtMensagem").val() == ""){
           $("#txtMensagem").next().show();
           erro = false;
       }
       else {
           $("#txtMensagem").next().hide();
           cont++;
       }
       if (cont == 4 ){
           erro = true;
           alert('E-mail enviado com sucesso!');
           return erro;
       }
       else if (erro == false) {
           return erro;
        }
        else {
           erro = true;
           alert('E-mail enviado com sucesso!');
           return erro;
        }
   });
   
   
   //MENU
   
   $("ul.subnav").parent().append("<span></span>");
  
    $("ul.topnav li span").click(function() {
        $(this).parent().find("ul.subnav").slideDown('fast').show();
  
        $(this).parent().hover(function() {  
        }, function(){  
            $(this).parent().find("ul.subnav").slideUp('slow');
        });  
        }).hover(function() {  
            $(this).addClass("subhover");
        }, function(){  //On Hover Out  
            $(this).removeClass("subhover"); 
    });
    
    
    //EFEITO SERVIÇOS
    
    $("#bt_service").addClass("fundo_service");
    $(".mostra2").hide();
    $(".bt_service1").css('color','#191f39');
    
    $(".bt_service1").click(function(){
        $(".mostra2").hide();
        $(".mostra1").fadeIn("slow");
        $("#bt_service").removeClass("fundo_service1");
        $("#bt_service").addClass("fundo_service");
        $(".bt_service1").css('color','#191f39');
        $(".bt_service2").css('color','#666666');
    });
    $(".bt_service2").click(function(){
        $(".mostra1").hide();
        $(".mostra2").fadeIn("slow");
        $("#bt_service").removeClass("fundo_service");
        $("#bt_service").addClass("fundo_service1");
        $(".bt_service2").css('color','#191f39');
        $(".bt_service1").css('color','#666666');
    });
    /*
    $(".mostra1").hide();
    $(".mostra2").hide();
    $("#serv1").click(function(){
        $(".mostra2").hide();
        $(".mostra1").fadeIn("slow");
    });
    $("#serv2").click(function(){
        $(".mostra1").hide();
        $(".mostra2").fadeIn("slow");
    });
    */
});  
