How to delay in JavaScript
<p>the <code>.defer(5000)</code> is causing a <code>too much recursion</code> error in JavaScript.  How do I delay the execution by 5 seconds?</p>

<pre><code>rotate: function () {
  if (!paused) {
    this.show(counter);

    counter = counter + 1;

    if (counter === Spire.Rotator.data.items.length) {
      counter = 0;
    }

    Spire.Rotator.rotate().defer(5000);
    //$.proxy(Spire.Rotator.rotate, Spire.Rotator).defer(delay);
  }
}
</code></pre>
