jQuery simple slider is not looping
<p>I have a simple slider for 5 different div tags, and a fixed ticker at the end of the page. It works fine but it's not looping.</p>

<p>*not: I got this code from a previous topic here (I am a beginner)</p>

<p>HTML:</p>

<pre><code>&lt;body&gt;
  &lt;div id="slide1"&gt;text 1&lt;/div&gt;
  &lt;div id="slide2"&gt;text 2&lt;/div&gt;
  &lt;div id="slide3"&gt;text 3&lt;/div&gt;
  &lt;div id="slide4"&gt;text 4&lt;/div&gt;
  &lt;div id="slide4"&gt;text 5&lt;/div&gt;
  &lt;div id="footer"&gt;java script ticker goes here&lt;/div&gt;
&lt;/body&gt;
</code></pre>

<p>Script:</p>

<pre><code>/* Hide all but first promo div */
$("div[id^=slide]:gt(0)").hide();

/* Setup Interval */
setInterval(function(){
/* Hide visible div, get reference to next promo div */
reference = $("div:visible:not(#footer)").hide().next("div[id^=slide]");
/* If there is not a next promo div, show the first promo div */
reference.size() ? $(reference).fadeIn() : $("div:first").fadeIn() ;
/* Do this every five seconds */
}, 5000);
</code></pre>
