Really simple JavaScript ?

I've been looking for ages for something to do this, but haven't found anything close yet.

All I want (which seems simple with JavaScript) is two have two graphics (a static image and a short animated gif).
At random intervals I want the static image to be replaced by the animated gif, once the cycle is played one retrun to the static image.

Repeat constantly but with random intervals between the animated gif being displayed.