var i, pref = new Array(4);
var frame=1, timerID;
for (i=0; i<4; i++){
pref[i] = new Image;
}
for (i=0; i<4; i++){
pref[i].src="new" + i +
".gif";
}
timerID=setTimeout("animate()",5000);
function animate(){
frame = (frame+1)%4;
document.images[0].src=pref[frame].src
if (frame == 0)
timeID =
setTimeout("animate()",5000);
else
timeriD =
setTimeout("animate()",30);
}