flippers = new Array();

function NextImage()
{
	this.curimg++;
	if (this.curimg >= this.src.length)
	{
		this.curimg = 0;
	}
	document.images[this.tag].src = this.src[this.curimg];
}

function ImgFlip(basename, imagecount)
{
	this.image = new Array();
	this.src = new Array();
	numlen = Math.round(Math.log(imagecount) / Math.log(10));
	for (i = 0; i < imagecount; i++)
	{
		num = '0000' + i;
		num = num.substr(num.length - numlen, numlen);
		this.src[i] = basename + num + '.gif';
		this.image[i] = new Image();
		this.image[i].src = this.src[i];
	}
	this.curimg = -1;
	this.tag = basename;

	this.NextImage = NextImage;

	flippers[flippers.length] = this;
}

function startflip()
{
	for (i = 0; i < flippers.length; i++)
	{
		flippers[i].NextImage();
	}

	setTimeout("startflip()", 16);
}

