Automate 3 different click events on a timer using javascript/jQuery
<p>I need to automate the click events defined below on a timer. Say every 5-6 seconds or so. So the page starts out on 'longevity' and a user click is simulated using javascript on a loop. The loop should stop running once a user has manually clicked on a tab as well. Any ideas ?</p>

<pre><code> &lt;script type="text/javascript"&gt;
      $("document").ready(function(){
         $("#integrity").click(function(){
          $('#home_image').removeClass('bg2 , bg3').addClass('bg1');
         });
      });

      $("document").ready(function(){
         $("#quality").click(function(){
          $('#home_image').removeClass('bg1 , bg3').addClass('bg2');
         });
      });

      $("document").ready(function(){
         $("#longevity").click(function(){
          $('#home_image').removeClass('bg1 , bg2').addClass('bg3');
         });
      });
      &lt;/script&gt;
</code></pre>
