// Set Global Variables & initial valuesvar imageNum = 0var HiResImage = "Images/Group/High_Res/Group_0001.jpg"var HiResWidth = 720var HiResHeight = 409// Function to place selected Preview image in space below thumbnailsfunction showPreview(imageNum,URL,detailWidth,detailHeight) {	// Pass the array number of the Preview image (from the selected thumbnail) to the function	// plus the URL/path to the Hi Res image, its width and its height	// The "selectedPreview" is defined from the array	selectedPreview = new Image(Gallery[imageNum].Width,Gallery[imageNum].Height)	selectedPreview.src = Gallery[imageNum].Image	document.PreviewImage.src = selectedPreview.src		HiResImage = URL			// Put the passed variables into the global variables	HiResWidth = detailWidth	// for use in the openWindow function	HiResHeight = detailHeight		}	// When preview image is clicked, open a new window and show the current "HiResImage"	function openWindow() {	var features = "WIDTH="+HiResWidth+",HEIGHT="+HiResHeight+",scrollbars=yes,resizable=yes"	var newWindow = window.open(HiResImage,"DetailWindow",features)	}// Define photo array variable for all the Preview images with 3 elements (image, width, height)function Photo(Image,Width,Height)	{	this.Image = Image			// "Image" defines the URL/path of the PREVIEW image	this.Width = Width			// "Width" defines the width of the PREVIEW image	this.Height = Height		// "Height" defines the height of the PREVIEW image	}	// Create the photo Gallery array with names of Preview photos, widths and heights	Gallery = new Array(22)	Gallery[0] = new Photo("Images/Group/Preview/Group_0001P.jpg",442,251)	Gallery[1] = new Photo("Images/Group/Preview/Group_0002P.jpg",386,287)	Gallery[2] = new Photo("Images/Group/Preview/Group_0003P.jpg",376,296)	Gallery[3] = new Photo("Images/Group/Preview/Group_0004P.jpg",461,240)	Gallery[4] = new Photo("Images/Group/Preview/Group_0005P.jpg",349,317)	Gallery[5] = new Photo("Images/Group/Preview/Group_0006P.jpg",375,295)	Gallery[6] = new Photo("Images/Group/Preview/Group_0007P.jpg",375,295)	Gallery[7] = new Photo("Images/Group/Preview/Group_0008P.jpg",500,190)	Gallery[8] = new Photo("Images/Group/Preview/Group_0009P.jpg",376,294)	Gallery[9] = new Photo("Images/Group/Preview/Group_0010P.jpg",500,156)	Gallery[10] = new Photo("Images/Group/Preview/Group_0011P.jpg",375,295)	Gallery[11] = new Photo("Images/Group/Preview/Group_0012P.jpg",394,282)	Gallery[12] = new Photo("Images/Group/Preview/Group_0013P.jpg",372,298)	Gallery[13] = new Photo("Images/Group/Preview/Group_0014P.jpg",453,245)	Gallery[14] = new Photo("Images/Group/Preview/Group_0015P.jpg",372,298)	Gallery[15] = new Photo("Images/Group/Preview/Group_0016P.jpg",372,298)	// Define the Group Gallery Image Array	var imgArray = new Array()	imgArray[0] = new Image(Gallery[0].Width,Gallery[0].Height) 	// define the image's width & height	imgArray[1] = new Image(Gallery[1].Width,Gallery[1].Height)  	imgArray[2] = new Image(Gallery[2].Width,Gallery[2].Height)	imgArray[3] = new Image(Gallery[3].Width,Gallery[3].Height)	imgArray[4] = new Image(Gallery[4].Width,Gallery[4].Height)	imgArray[5] = new Image(Gallery[5].Width,Gallery[5].Height)	imgArray[6] = new Image(Gallery[6].Width,Gallery[6].Height)	imgArray[7] = new Image(Gallery[7].Width,Gallery[7].Height)	imgArray[8] = new Image(Gallery[8].Width,Gallery[8].Height)	imgArray[9] = new Image(Gallery[9].Width,Gallery[9].Height)	imgArray[10] = new Image(Gallery[10].Width,Gallery[10].Height)	imgArray[11] = new Image(Gallery[11].Width,Gallery[11].Height)	imgArray[12] = new Image(Gallery[12].Width,Gallery[12].Height)	imgArray[13] = new Image(Gallery[13].Width,Gallery[13].Height)	imgArray[14] = new Image(Gallery[14].Width,Gallery[14].Height)	imgArray[15] = new Image(Gallery[15].Width,Gallery[15].Height)				imgArray[0].src = Gallery[0].Image		// load the image from the Gallery Array	imgArray[1].src = Gallery[1].Image	imgArray[2].src = Gallery[2].Image	imgArray[3].src = Gallery[3].Image	imgArray[4].src = Gallery[4].Image	imgArray[5].src = Gallery[5].Image	imgArray[6].src = Gallery[6].Image	imgArray[7].src = Gallery[7].Image	imgArray[8].src = Gallery[8].Image	imgArray[9].src = Gallery[9].Image	imgArray[10].src = Gallery[10].Image	imgArray[11].src = Gallery[11].Image	imgArray[12].src = Gallery[12].Image	imgArray[13].src = Gallery[13].Image	imgArray[14].src = Gallery[14].Image	imgArray[15].src = Gallery[15].Image	