/*
	FILE PURPOSE:
		Swaps an image for another e.g. roll over buttons
	
	UPDATE HISTORY:
		DATE				DESCRIPTION
		12-Oct-05			File header added - Whole site moved to comShortCourse
		1-Feb-06			First live version
	
	PARAMS: 
		NAME				TYPE		REQUIRED/OPTIONAL 		DESCRIPTION	
		image				image(DOM)	required				The current image
		newImageFilename	string		required				Filename of the image to swap in
	
	ADDITIONAL NOTES: N/A
*/
function swapImage(image, newImageFilename) {
	var src = image.src;
	
	// get the last slash
	lastDirectorySlash = src.lastIndexOf('/');
	imageDirectory = src.substring(0, lastDirectorySlash);
	
	// change only the filename for the image
	src = imageDirectory + '/' + newImageFilename;

	// swap the image
	image.src = src;
}