The startAnim() function is first called in the body tag by implementing the onLoad event. The function calls itself recursively, changing the source data for the <img> tag that is coded in the body of the html

<script language="JavaScript">

var i=0;

var name = new Array( "/icons/ball.gif", "/icons/unknown.gif",
"/icons/text.gif", "/icons/binary.gif" );

function startAnim(){

    document.images[0].src= name[i];
    if( i<3){
      setTimeout('startAnim()', 1000);
    else {
      setTimeout('startAnim()', 1000);