//********************************************
// Name:	loadItem(imgObj)
// Author:	Yoann Roman
// Date:	07/19/04
// Purpose:	Change the item to the passed
//			in image object name
//********************************************
function loadItem(sItem,imgObj) {
	if (document.layers)
		eval('document.div' + sItem + '.document.images["img' + sItem + '"].src = '+imgObj+'.src');
	else
		document.images['img' + sItem].src = eval(imgObj+".src");
}

//********************************************
// Name:	clearItem()
// Author:	Yoann Roman
// Date:	07/19/04
// Purpose:	Clears the given item to blank
//********************************************
function clearItem(sItem) {
	loadItem(sItem,'imgBlank');
}

//********************************************
// Name:	preloadImg(imgObj,imgSrc)
// Author:	Yoann Roman
// Date:	07/19/04
// Purpose:	Load an image into memory
//********************************************
function preloadImg(imgObj,imgSrc) {
	if (document.images) {
		eval(imgObj+' = new Image()')
		eval(imgObj+'.src = "/common/images/selection/'+imgSrc+'"')
	}
}

//********************************************
// Name:	preload()
// Author:	Yoann Roman
// Date:	07/19/04
// Purpose:	Load the images into memory
//********************************************
function preload() {
	preloadImg('imgBusinessPhotos','business.jpg');
	preloadImg('imgStudentPhotos','students.jpg');
	preloadImg('imgBlank','blank.gif');
}

// Preload the images as soon as script is read
preload();