/*
 * Configurações em javascript
 * @author  André da Silva Severino
 * @date    2011-05-18
 **/

/* Inicialização do jquery */
$(document).ready(function() {    
    // Esconder/Mostrar departamentos
    
       //$("#box-dicassaude div").hide();
       $("#box-dicassaude h6").toggleClass("t-ativo");

    $("#box-dicassaude h6").click(function(){
        $(this).next("div").slideToggle("slow")
        .siblings("div:visible").slideUp("slow");
        $(this).toggleClass("t-ativo");
        $(this).siblings("#box-dicassaude h6").removeClass("t-ativo");
    });
    
    $("#box-departamento div").hide();

    $("#box-departamento h6").click(function(){
        $(this).next("div").slideToggle("slow")
        .siblings("div:visible").slideUp("slow");
        $(this).toggleClass("t-ativo");
        $(this).siblings("#box-departamento h6").removeClass("t-ativo");
    });
    
    // Mostrar o botão para voltar ao topo no canto da tela
    $().UItoTop({ 
        easingType: 'easeOutQuart',
        scrollSpeed: 3200
    }); 
    
    // Validação do formulário faleconosco
    jQuery("#form-crc").validationEngine();

    // Popup's de noticia e do bebe
    $(".gallery:not(.slideshow) a[rel^='prettyPhoto']").prettyPhoto({
        theme: 'facebook'
    });
    $(".gallery.slideshow a[rel^='prettyPhoto']").prettyPhoto({
        theme: 'facebook',
        slideshow:4000,
        autoplay_slideshow:true
    });
    $("a[rel^='prettyPhoto']").prettyPhoto({
        social_tools: '<div class="pp_social"><div class="twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="facebook"><iframe src="http://www.facebook.com/plugins/like.php?locale=en_US&href='+location.href+'&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div></div>'
    });

    // Efeito - Slide de notícias
    $('#coin-slider').coinslider({
        width: 430,
        height: 221,
        delay: 12000,
        sDelay: 20,
        opacity: 0.7,
        titleSpeed: 500,
        effect: "",
        navigation: true,
        links : true,
        hoverPause: true
    });


    // Efeito - Menu acesso rápido(transição ícones)
    $("#slide-acesso-rapido").jCarouselLite({
        btnPrev : '.prev',
        btnNext : '.next',
        auto    : 1800,
        speed   : 2800,
        visible : 3
    });
    
    // Efeito - Menu acesso rápido(transição ícones)
    $("#slide-acesso-rapido2").jCarouselLite({
        btnPrev : '.prev',
        btnNext : '.next',
        auto    : 1800,
        speed   : 2800,
        visible : 2
    });

});






