// AUMENTE este número para a animação de scroll ficar mais RÁPIDA
// ou DIMINUA para ficar mais LENTA
var VELOCIDADE_SCROLL = 10;

jQuery(function ($) {
    // scroll
    $('.contentMenu ul li a').click(function(){
        $.scrollTo($(this).attr('href'), 10000/VELOCIDADE_SCROLL);
        return false
    })
    $('.blockLogo').click(function(){
        $.scrollTo('body', 10000/VELOCIDADE_SCROLL);
        return false
    });

    // cycle da categoria em Trabalhos
    $('.cycleCategoria').cycle({
        fx: 'scrollVert',
        pager:  '.contentTrabalhos > ul',
        pagerAnchorBuilder: function(idx, slide) {
            return '<li><a href="#">' + $(slide).find('h3').text() + '</a></li>';
        },
        rev: 1,
        timeout: 0,
        next: '.nextJobType',
        prev: '.prevJobType'
    });

    // cycle de post (cada trabalho dentro da categoria)
    $('.cyclePost').each(function () {
        $(this).cycle({
            fx: 'scrollHorz',
            timeout: 0,
            next: '.nextJob',
            prev: '.prevJob',
            pager: $(this).siblings('.numbJobs').find('ul')
        });
    });

    $(window).bind('scroll', function (evento) {
        var posicao = ($.browser.msie) ? document.body.scrollTop : evento.currentTarget.scrollY ;

        var as = $('.contentMenu ul li a');
        var ativo = as.first();

        as.removeClass('ativo');
        as.each(function () {
            var href = $(this).attr('href');
            if (posicao + 300 >= $(href).offset().top)
                ativo = $(this);
            else
                return false;
        });

        ativo.addClass('ativo');
    });
    $(window).trigger('scroll');
    $("a.lightbox").prettyPhoto({
        animationSpeed: 'normal', /* fast/slow/normal */
        padding: 40,
        opacity: 0.35,
        showTitle: true,
        allowresize: true,
        counter_separator_label: '/',
        theme: 'light_square',
        hideflash: true,
        social_tools: ''
    });
});

