geck.requireScript('js/jquery.timers.js');

var car = Math.round(Math.random()*2);

$(function () {
    
    //pretty photo
    $("a[rel^='gallery']").prettyPhoto({animationSpeed:'slow',slideshow:5000, autoplay_slideshow: false}); 
    
    $('#head-car2,#head-car1').css({display:'block', opacity:0});
    
    if (car == 2) {
        $('#head-car1').css({opacity:0});
        $('#head-car2').css({opacity:1});
    } else {
        $('#head-car1').css({opacity:1});
        $('#head-car2').css({opacity:0});
    }
    
    $(document).everyTime(8000, function() {
        if (car == 2) {
            $('#head-car2').animate({opacity:0},2000, function() {
                $('#head-car1').animate({opacity:1},2000);
            });
            car = 1;
        } else {
            $('#head-car1').animate({opacity:0},2000, function() {
                $('#head-car2').animate({opacity:1},2000);
            });
            car = 2;
        }       
    });
});






