/* initialise a boolean variable that will ensure random numbers are not duplicated */

var rDiff = false;



/* loop through random number generation until all numbers are different*/

do{

var rand1 = Math.floor(Math.random()*6)+1;


var rand2 = Math.floor(Math.random()*6)+1;


var rand3 = Math.floor(Math.random()*6)+1;

if (rand1 != rand2 && rand1 != rand3 && rand2 != rand3){
rDiff = true;
}
}while (rDiff == false);



/* create an array of images to utilise the rand outcome */

imageChoice = new Array(6);

imageChoice[1] = "1.gif";
imageChoice[2] = "2.gif";
imageChoice[3] = "3.gif";
imageChoice[4] = "4.gif";
imageChoice[5] = "5.gif";
imageChoice[6] = "6.gif";


/* document.write(
				'<A HREF="mailto:' + emailE + '">' + emailE + '</a>'
				 )
/* write the images to the page */

function writeImage1() {
document.write("<img src='images/" + imageChoice[rand1] + "' width='100' height='100'>");
}

function writeImage2() {
document.write("<img src='images/" + imageChoice[rand2] + "' width='100' height='100'>");
}

function writeImage3() {
document.write("<img src='images/" + imageChoice[rand3] + "' width='100' height='100'>");
}