// JavaScript Document

//random person image on refresh

// Function that return a number between 0 and "nums - 1"

var theImages = new Array();

theImages[0]="nationalguide/images/people/african-american-man.png";
theImages[1]="nationalguide/images/people/african-american-woman.png";
theImages[2]="nationalguide/images/people/hispanic-man.png";
theImages[3]="nationalguide/images/people/asian-woman.png";
theImages[4]="nationalguide/images/people/caucasian-woman.png";

var j = 0
var p = theImages.length;
var preBuffer = new Array();
for (i = 0; i < p; i++){
	preBuffer[i] = new Image();
	preBuffer[i].src = theImages[i];
}

var whichImage = Math.round(Math.random()*(p-1));

function showImage(){
	document.write('<img src="'+theImages[whichImage]+'" class="person" alt="a confident adult learner">');
}
