So far I've created an array with 11 images, initialized the counter with a for loop, but this is where I get lost on what to do next to call the function to actually change the images. I ended the code with a setTimeout() function , 5000, which is the interval between the images. Any Suggestion. I want to stick to javascript solutions only. Here is the code.

<script type="text/javascript">
var hammer=new Array("jackhammer0.gif",
var curHammer=0;

var numImg=11
function getHammer(){

for(i = 0; i<hammer.length; i++)
curHammer = curHammer +1;

hammer[i] = new Image();
hammer[i].src="poses/jackhammer" +(i+1) + ".gif";

var nextHammer=curHammer+1;



setTimeout("getHammer()", 5000);

<body onload = "getHammer()";>
<img id="jack" name="jack" src = "poses/jackhammer0.gif" width= "100" height ="113" alt = "Man and Jackhammer" /><br/>
<button id="j