$(function() {

    $('.img-trabalho a').lightBox({fixedNavigation:true});

    $('.sessao ul li a').click(function(){
        $('.sessao ul li a').css('font-weight','normal');
        $(this).css('font-weight','bold');
    });

    $('#scrollable').jScrollPane();


    $(".rolagemcliente").jCarouselLite({
        btnNext: ".proximoseta1",
        btnPrev: ".anteriorseta1",
        visible:3,
        mouseWheel: true,
        scroll: 3

    });

    $(".1").addClass("img-ativa");
    $(".legenda").html($(".img-ativa").next().html());

    $(".legendacli").html("<img src='../image/red.png' width='12' height='12' style='padding-right: 10px;'>"+$(".nomecli").html());
    $(".numeros-trabalhos a").click(function(){
        $(".legenda").html($(this).next().html());
        $(".numeros-trabalhos a").removeClass("img-ativa");
        $(this).addClass("img-ativa");
    }
    );



   $(".img-trabalho").jCarouselLite({
        visible:1,
        vertical:true,
        btnGo:
    [".numeros-trabalhos .1",
     ".numeros-trabalhos .2",
     ".numeros-trabalhos .3",
     ".numeros-trabalhos .4",
     ".numeros-trabalhos .5",
     ".numeros-trabalhos .6",
     ".numeros-trabalhos .7",
     ".numeros-trabalhos .8",
     ".numeros-trabalhos .9",
     ".numeros-trabalhos .10",
     ".numeros-trabalhos .11"]
     
    });
    
    $('.rolagemcliente ul li a img').fadeTo(300,0.5);
    $('.rolagemcliente ul li a img').hover(function() {
        $(this).stop().fadeTo(300,1);
        }, function() {
        $(this).stop().fadeTo(300,0.5);
    });

     $(".enviar").click(function() {

                resetFields();
                var emptyfields = $("input[value=],textarea[value=]");
                if (emptyfields.size() > 0) {
                    emptyfields.each(function() {
                        $(this).stop()
                            .animate({ left: "-10px" }, 100).animate({ left: "10px" }, 100)
                            .animate({ left: "-10px" }, 100).animate({ left: "10px" }, 100)
                            .animate({ left: "0px" }, 100)
                            .addClass("required");
                    });
                    return false;
                 }

            });

        function resetFields() {
            $("input[type=text], input[type=password]").removeClass("required");
        }

  

});

function paginar(pgatual,entidade,cont,campoordem,where){
    if (where == null){
        where = '';
    }

    $(cont).html('<center><img src="/image/loader-paginas.gif" alt="carregando" /></center>');
    $(cont).load('/include/requestAjax.php',{'request' : 'paginar', 'cont' : cont, 'entidade' : entidade, 'pgatual' : pgatual, 'ordem' : campoordem, 'where' : where});

}
