jQuery(document).ready(function(){
    //LightBox
    $('.lightBox').colorbox();



    /* Validador */
    $(".validacao").validate();
    $(".validacao input,.validacao textarea").blur(function() {
        //$(this).valid();
        });

    /* Agenda */
    $('.agenda-conteudo').attr('style','display:none');
    $('.agenda-botao').toggle(function(){
        $(this).siblings('.agenda-conteudo').slideDown('slow');
        $(this).html('Fechar Evento');
        $(this).fadeTo(200,0.50,function(){
            $(this).removeClass('botao-01').addClass('botao-02');
            $(this).fadeTo(400,1);
        })
        
    },function(){
        $(this).siblings('.agenda-conteudo').slideUp('slow');
        $(this).html('Abrir Evento');
        $(this).fadeTo(200,0.50,function(){
            $(this).removeClass('botao-02').addClass('botao-01');
            $(this).fadeTo(400,1);
        })
    }
    );

    //ORAÇÃO
    $('.oracao-botao').hover(function(){
        $(this).addClass('oracao-botaoActive');
    },function(){
        $(this).removeClass('oracao-botaoActive');
    });

    

    //Pastores
    $('.pastores-conteudo').attr('style','display:none');
    $('.pastores-botao').toggle(function(){
        $(this).siblings('.pastores-conteudo').slideDown('slow');
        $(this).html('Fechar Biografia');
        $(this).fadeTo(200,0.50,function(){
            $(this).removeClass('botao-01').addClass('botao-02');
            $(this).fadeTo(400,1);
        })
    },function(){
        $(this).siblings('.pastores-conteudo').slideUp('slow');
        $(this).html('Ver Biografia');
        $(this).fadeTo(200,0.50,function(){
            $(this).removeClass('botao-02').addClass('botao-01');
            $(this).fadeTo(400,1);
        })
    }
    );

    //Loja Virtual
    $('#lv-menu-links .cat').toggle(function(){
        $(this).addClass('end').siblings('.sub').slideDown('slow');
    },function(){
        $(this).siblings('.sub').slideUp('slow',function(){
            if($(this).siblings('.cat').attr('id')!=1){
                $(this).siblings('.cat').removeClass('end');
            }
        });


    }
    );

    //Home-LojaVirtual
    jQuery('.mycarousel').jcarousel({
        easing: 'BounceEaseOut',
        animation: 1000,
        scroll:1
    });

    //home-noticias
    $('#home-noticias .thumb').hover(function(){
        //$("#alvo img").attr('src',$(this).children('img').attr('thumb'));
    });


});


//Funcions extras
jQuery.easing['BounceEaseOut'] = function(p, t, b, c, d) {
    if ((t/=d) < (1/2.75)) {
        return c*(7.5625*t*t) + b;
    } else if (t < (2/2.75)) {
        return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
    } else if (t < (2.5/2.75)) {
        return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
    } else {
        return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
    }
};
