I'd like to sugest a delay() function because, in my opinion, it will be helpful and it will save you from using plenty of setTimers or any function like that.
How can this function can be helpful?:
Delay between two actions( switching two images )
Some interesting effects etc...
(I'm sorry if this kind of function exists, i didn't notice it)