$(document).ready(function(){
    //Efeitos do site
    $('#menu').fadeIn(700);
    $('.bloco').fadeIn(900);
    $('#logo').fadeIn(1000);
    $('h1').fadeIn(1000);
    $('#inline').fancybox().trigger('click');
    
    //Abre imagens na página seminovos
    $(".abreImagens").click(function() {
        //        //alert($(".escondeImagens",this).html());
        var html = ($(".escondeImagens",this).html().split(","));           
        $.fancybox(html, {
            'transitionIn'	:	'elastic',
            'transitionOut'	:	'elastic',
            'speedIn'		:	300,
            'speedOut'		:	300,
            'overlayShow'	:	true
        });
   
    });

    //Abre imagens na página galeria
    $("a.grupo").fancybox({
        'transitionIn'	:	'elastic',
        'transitionOut'	:	'elastic',
        'titleShow'     :       true,
        'titlePosition' 	: 'over',
        'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
            return '<span id="fancybox-title-over">Image ' +  (currentIndex + 1) + ' / ' + currentArray.length + ' ' + title + '</span>';
        },
        'speedIn'	:	300, 
        'speedOut'	:	300, 
        'overlayShow'	:	true
    });
    
    //Abre especificações do helicopteros selecionado nas miniaturas
    if (location.href == "http://www.powerhelicopteros.com.br/novo/robinson?id="){
        $.fancybox({
            'href': '#data'
        });
    }
    
    //Carrousel
    jQuery('#mycarousel').jcarousel({
        scroll: 1
    });
});
