// this over writes the css masthead background url in the page header
function chooseRandomPhoto(photoTheme,numOfPhotos)
{

var whichPhoto = Math.ceil(Math.random()*(numOfPhotos));

// over write css url
var updateCSS = '<style type="text/css">';
updateCSS += '<!--';
updateCSS += '.masthead { background-image:url(imgs/masthead_photos/'+photoTheme+'_'+whichPhoto+'.jpg); }'
updateCSS += '-->';
updateCSS += '</style>';

document.write(updateCSS);
}


function chooseClassPhotos()
{
	var numAvail = 24
	var firstRandomPhoto = Math.ceil(Math.random()*(numAvail));
	var secondRandomPhoto = firstRandomPhoto;
	var thirdRandomPhoto = firstRandomPhoto;
	// choose a different second photo
	do
    {
		secondRandomPhoto = Math.ceil(Math.random()*(numAvail));
	}
	while(secondRandomPhoto == firstRandomPhoto)
	// choose a different third photo.
	do
	{
		thirdRandomPhoto = Math.ceil(Math.random()*(numAvail));
	}
	while(thirdRandomPhoto == firstRandomPhoto || thirdRandomPhoto == secondRandomPhoto)
	
	// display.			
	var addStudentPhotos = '<img src="imgs/photos/class/class_'+firstRandomPhoto+'.jpg" alt="photo : Tai Chi Students" />'
	+ '<img src="imgs/photos/class/class_'+secondRandomPhoto+'.jpg" alt="photo : Tai Chi Students" />'
	+ '<img src="imgs/photos/class/class_'+thirdRandomPhoto+'.jpg" alt="photo : Tai Chi Students" />';
				
	document.write(addStudentPhotos);   // write in the 3 picked photos
	
}

// this is here only as a temporary measure!
var numOfStudentPhotos = 9;



	
	


		
