$(window).bind("load", function() {
    $("div#fotos-quem-somos").slideViewerPro({ 
        thumbs: 3,  
        thumbsPercentReduction: 22, 
        galBorderWidth: 6, 
        galBorderColor: "f6f6f7", 
        thumbsTopMargin: 10, 
        thumbsRightMargin: 10, 
        thumbsBorderWidth: 5, 
        thumbsActiveBorderColor: "f6f6f7", 
        thumbsActiveBorderOpacity: 0.8, 
        thumbsBorderOpacity: 0, 
        buttonsTextColor: "#707070", 
        autoslide: true,  
        typo: false 
    });
});

$(document).ready(function() {
    
    /* XXX: textos expansiveis */
    
    $(".descricao").fadeOut(0);
    //$(".descricao:first").show();
    
    $(".descricao").prev("h3").css({cursor:'pointer'}).toggle(function(){
      var txt = $(this).text();
      $(this).text("-" + txt.substring(1,txt.length));
      $(this).next(".descricao").fadeIn(1500);
    }, function(){
      var txt = $(this).text();
      $(this).text("+" + txt.substring(1,txt.length));      
      $(this).next(".descricao").slideUp("slow", function(){$(this).fadeOut(0)});
    });
    
    /* XXX: fancybox */

    
    /* TODO: fazer isso de uma forma melhor */
    $(".btn-botoes").html($(".botoes").hide().clone().show());
    $(".btn-galeria").html($(".servicos-extras-images").hide().clone().show());
    $(".servicos-extras-images a, .qi").fancybox();
    
    /* XXX: Esconde especifique */
    if ($('#id_como_soube').val()=='outr'||$('#id_como_soube').val()=='cons'){
      $('#especifique').show();
    } else {
      $('#especifique').hide();
    }

    $('#id_como_soube').change(function(){
      if ($(this).val()=='outr'||$(this).val()=='cons') {
        $('#especifique').show();
      } else {
        $('#especifique').hide();
      }
    });
    
    $(".botoes a:not([href^='http://maps'])").jframe({width:450});
    $(".botoes a:[href^='http://maps']").attr('target', '_blank');
    
});


Shadowbox.init({
    language: 'en',
    players:  ['flv']
});


