no gif please, they are dead!
What's wrong with GIF?
this can be easily done with very little js code and a bit of css,and png!
Using JS would have the advantage that you could get straight random intervals. But also two disadvantages: cpu overhead (with the current state of JS engines) and non-compatibility with JS-incapable browsers (or just JS turned off).
Leslie