var imgs = new Array();
var pairs = new Array();

imgs[0] = new Image(); imgs[0].src = "images/gli-2b.JPG"; 
imgs[1] = new Image(); imgs[1].src = "images/glu-1b.JPG"; 
imgs[2] = new Image(); imgs[2].src = "images/col-1b.JPG"; 
imgs[3] = new Image(); imgs[3].src = "images/col-2b.JPG"; 
imgs[4] = new Image(); imgs[4].src = "images/box-2b.JPG"; 
imgs[5] = new Image(); imgs[5].src = "images/tav-2b.JPG"; 

function imgPair(name, i1, i2, time)
	{
	this.name = name;
	this.i1 = i1;
	this.i2 = i2;
	this.first = true;
	this.time = time;
	this.swap = swapImage;
	pairs[this.name] = this;
	}

ip1 = new imgPair("pic1", 0, 1, 2000);
ip2 = new imgPair("pic2", 2, 3, 2500);
ip3 = new imgPair("pic3", 4, 5, 2800);

function swapImage()
	{
	if (this.first)
		{
		this.first=false;
		document.images[this.name].src=imgs[this.i1].src;
		}
	else
		{
		this.first=true;
		document.images[this.name].src=imgs[this.i2].src;
		}
	setTimeout("pairs['"+this.name+"'].swap()", this.time);
	}
