// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

function swapImages(){
  var $active = $('.center_picture .active');
  var $next = ($('.center_picture .active').next().length > 0) ? $('.center_picture .active').next() : $('.center_picture img:first');
  $active.fadeOut(function(){
    $active.removeClass('active');
    $next.fadeIn().addClass('active');
  });
}

setInterval('swapImages()', 5000);

function add_new_car(){
  jQuery('.car_one').css('visibility','hidden');
  jQuery('.second_car').css('display','block');
}
