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",
"jackhammer1.gif",
"jackhammer2.gif",
"jackhammer3.gif",
"jackhammer4.gif",
"jackhammer5.gif",
"jackhammer6.gif",
"jackhammer7.gif",
"jackhammer8.gif",
"jackhammer9.gif",
"jackhammer10.gif")
var curHammer=0;

var numImg=11
function getHammer(){

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

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

var nextHammer=curHammer+1;
nextHammer=0;
{


}

}
}
}


setTimeout("getHammer()", 5000);

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