//
// © Copyright Graham Johnson 2002
// Display three rows of four images, selecting twelve different images randomly.
//
// Requires defineartistes.js have been called first
//
var usedyet = new Array(artiste.length);

// Initialise a usage flag just to make sure
for (var counter = 0; counter < usedyet.length; counter++) usedyet[counter] = 0;
				
for (counter = 1; counter <= 12; counter++)
{
	var index = Math.floor(Math.random() * artiste.length);

	// Cycle round until get an unused one.
	while (usedyet[index] == 1)
	{
		index++;
		index = index % artiste.length;
	}

	// Flag this one as used.
	usedyet[index] = 1;

	document.write(artiste[index]);
	
	// Put in <br> to be paranoid in case browsers are stupid and don't wrap, and make sure 
	// have a <br> after last line as iCab formats the line wrong otherwise.

	if ((counter % 4) == 0) document.write('<br>\n');
}