Animacja poklatkowa: paląca się świeca

Listing

    <img  name="slide" src="images/candle/le02.jpg" width="150" height="300"/>
        
var i = 0;
	var path = new Array();
	path[0] = "https://javafx.pl/wp-content/uploads/candle/le02.jpg";
	path[1] = "https://javafx.pl/wp-content/uploads/candle/le03.jpg";
	path[2] = "https://javafx.pl/wp-content/uploads/candle/le04.jpg";
	path[3] = "https://javafx.pl/wp-content/uploads/candle/le05.jpg";
	path[4] = "https://javafx.pl/wp-content/uploads/candle/le06.jpg";
	path[5] = "https://javafx.pl/wp-content/uploads/candle/le07.jpg";
	path[6] = "https://javafx.pl/wp-content/uploads/candle/le08.jpg";
	path[7] = "https://javafx.pl/wp-content/uploads/candle/le09.jpg";
	path[8] = "https://javafx.pl/wp-content/uploads/candle/le10.jpg";
	path[9] = "https://javafx.pl/wp-content/uploads/candle/le11.jpg";
	path[10] = "https://javafx.pl/wp-content/uploads/candle/le12.jpg";
	path[11] = "https://javafx.pl/wp-content/uploads/candle/le13.jpg";
	path[12] = "https://javafx.pl/wp-content/uploads/candle/le14.jpg";
	path[13] = "https://javafx.pl/wp-content/uploads/candle/le15.jpg";
	path[14] = "https://javafx.pl/wp-content/uploads/candle/le16.jpg";
	path[15] = "https://javafx.pl/wp-content/uploads/candle/le17.jpg";
	path[16] = "https://javafx.pl/wp-content/uploads/candle/le18.jpg";
	path[17] = "https://javafx.pl/wp-content/uploads/candle/le19.jpg";
	path[18] = "https://javafx.pl/wp-content/uploads/candle/le20.jpg";
	path[19] = "https://javafx.pl/wp-content/uploads/candle/le21.jpg";
	path[20] = "https://javafx.pl/wp-content/uploads/candle/le22.jpg";
	path[21] = "https://javafx.pl/wp-content/uploads/candle/le23.jpg";
	path[22] = "https://javafx.pl/wp-content/uploads/candle/le24.jpg";
	function swapImage() {
		document.slide.src = path[i];
		if (i < path.length - 1)
			i++;
		else
			i = 0;
		setTimeout("swapImage()", 120);
	}
	window.onload = swapImage;