(function ($) {

  Drupal.behaviors.autonal_theme = {
    attach: function (context, settings) {

      $('.view-benefits-list .view-content h3').once('processed', function(){
        var temp = $(this).html();

        $(this).html("<span class='list-benefics'>" + temp +"</span>");

        $(this).addClass('benefits-close');
        $(this).append("<span class='benefit-arrow'> </span>");
        $(this).nextUntil('h3').hide();
        $(this).toggle(function(){
          $(this).removeClass('benefits-close').addClass('benefits-open');
          $(this).nextUntil('h3').slideDown('fast');
        }, 
        function(){
          $(this).removeClass('benefits-open').addClass('benefits-close');
          $(this).nextUntil('h3').slideUp('fast');
        });
      });

      $('.gallery-thumbs .forward').remove();
      $('.gallery-thumbs .back').remove();
      setInterval(function(){$('.gallery-slides a.next-slide').click();}, 4500);
      $('.gallery-slides a').hide();

      var contactAdviserButton = $('.autonal-contact-adviser-form').clone();
      contactAdviserButton.appendTo('.group_vehicle_info');
    }
  };
}(jQuery));;

