function loadorcamento(){

    //painel de orcamento
    $('#orcamento-toggle').click(function(){
        
        //verificar se o painel esta expandido
        if($('#orcamento').attr('class') == 'expanded'){
            //animar a retraccao
            $('#orcamento').animate({
                left: '-290px'
            }, function(){
                $(this).removeClass('expanded');
            })
        }
        else{
            //animar a expansao
            $('#orcamento').animate({
                left: '0px'
            }, function(){
                $(this).addClass('expanded');
            })
        }   
        
        return false;
    });
    
    //customizar erro
    $.validator.setDefaults({
        errorPlacement: function(error, element) {
            //silence
            var elementobj = $(element);
            elementobj.css('border', '1px solid #C31E2E');
        }
    });
    
    //form de orcamento - validate
    $('#orcamento-form').validate({
        onkeyup: false,
        rules: {
            nome: "required",
            email: {
                required: true,
                email: true
            },
            telefone: {
                required: true,
                number: true
            },
            observacoes: "required"
        }
    });
    
    $('#orcamento-form').submit(function(){
        var str = $(this).serialize();
        $.ajax({
            async: false,
            url: 'orcamento.php',
            type: 'POST',
            data: str,
            success: function(msg){
            
                if(msg == 1){
                    $('#orcamento-form input[type=text], #orcamento-form textarea').css({
                        background: '#DAF2C9'
                    });
                
                    $('#orcamento').animate({
                        left: '-290px'
                    }, function(){
                        $(this).removeClass('expanded');
                    })
                }
                if(msg == 0){
                //silence
                }
            
            }
        });
        
        return false;
    });

}
