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

<head>
<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){
      i++;
      setTimeout('startAnim()', 1000);
    }
    else {
      i=0;
      setTimeout('startAnim()', 1000);
    }

}

</script>
</head>