This entire line:
Spire.Rotator.rotate().defer(5000);
is wrong. Because of the parentheses just after rotate, your function is immediately calling itself over and over again (infinite recursion). Removing the parentheses will fix that problem, but the code will probably not work. To fix the code, use the browser's window.setTimeout method, which accepts a function and a delay (in milliseconds) as two arguments:
setTimeout(function() {
Spire.Rotator.rotate();
}, 5000);
Why not just setTimeout(Spire.Rotator.rotate, 5000);? The reason is that this in that function would be window rather than Spire.Rotator. (There's plenty of information on the Internet about this.) Why not setTimeout("Spire.Rotator.rotate()", 5000);? That's a quite dated (deprecated) way to use the method that suffers from the same pitfalls of eval, a function that some JavaScript programmers including Douglas Crockford recommend not using.