// Set Global Variables & initial valuesvar imageNum = 0var HiResImage = "Images/Portrait/High_Res/Portrait_0001.jpg"var HiResWidth = 720var HiResHeight = 540// 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(28)	Gallery[0] = new Photo("Images/Portrait/Preview/Portrait_0001P.jpg",385,289)	Gallery[1] = new Photo("Images/Portrait/Preview/Portrait_0002P.jpg",271,407)	Gallery[2] = new Photo("Images/Portrait/Preview/Portrait_0003P.jpg",281,394)	Gallery[3] = new Photo("Images/Portrait/Preview/Portrait_0004P.jpg",406,272)	Gallery[4] = new Photo("Images/Portrait/Preview/Portrait_0005P.jpg",281,394)	Gallery[5] = new Photo("Images/Portrait/Preview/Portrait_0006P.jpg",281,394)	Gallery[6] = new Photo("Images/Portrait/Preview/Portrait_0007P.jpg",408,272)	Gallery[7] = new Photo("Images/Portrait/Preview/Portrait_0008P.jpg",267,414)	Gallery[8] = new Photo("Images/Portrait/Preview/Portrait_0009P.jpg",281,394)	Gallery[9] = new Photo("Images/Portrait/Preview/Portrait_0010P.jpg",408,272)	Gallery[10] = new Photo("Images/Portrait/Preview/Portrait_0011P.jpg",281,394)	Gallery[11] = new Photo("Images/Portrait/Preview/Portrait_0012P.jpg",281,394)	Gallery[12] = new Photo("Images/Portrait/Preview/Portrait_0013P.jpg",272,408)	Gallery[13] = new Photo("Images/Portrait/Preview/Portrait_0014P.jpg",354,312)	Gallery[14] = new Photo("Images/Portrait/Preview/Portrait_0015P.jpg",376,295)	Gallery[15] = new Photo("Images/Portrait/Preview/Portrait_0016P.jpg",289,383)	Gallery[16] = new Photo("Images/Portrait/Preview/Portrait_0017P.jpg",369,301)	Gallery[17] = new Photo("Images/Portrait/Preview/Portrait_0018P.jpg",407,272) 	Gallery[18] = new Photo("Images/Portrait/Preview/Portrait_0019P.jpg",272,408)	Gallery[19] = new Photo("Images/Portrait/Preview/Portrait_0020P.jpg",362,307)	Gallery[20] = new Photo("Images/Portrait/Preview/Portrait_0021P.jpg",404,274)	Gallery[21] = new Photo("Images/Portrait/Preview/Portrait_0022P.jpg",281,394)	Gallery[22] = new Photo("Images/Portrait/Preview/Portrait_0023P.jpg",278,399)	Gallery[23] = new Photo("Images/Portrait/Preview/Portrait_0024P.jpg",281,394)	Gallery[24] = new Photo("Images/Portrait/Preview/Portrait_0025P.jpg",281,394)	Gallery[25] = new Photo("Images/Portrait/Preview/Portrait_0026P.jpg",272,408)	Gallery[26] = new Photo("Images/Portrait/Preview/Portrait_0027P.jpg",372,298)	Gallery[27] = new Photo("Images/Portrait/Preview/Portrait_0028P.jpg",272,408)	// Define the Portrait 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[16] = new Image(Gallery[16].Width,Gallery[16].Height)	imgArray[17] = new Image(Gallery[17].Width,Gallery[17].Height)	imgArray[18] = new Image(Gallery[18].Width,Gallery[18].Height)	imgArray[19] = new Image(Gallery[19].Width,Gallery[19].Height)	imgArray[20] = new Image(Gallery[20].Width,Gallery[20].Height)	imgArray[21] = new Image(Gallery[21].Width,Gallery[21].Height)	imgArray[22] = new Image(Gallery[22].Width,Gallery[22].Height)	imgArray[23] = new Image(Gallery[23].Width,Gallery[23].Height)	imgArray[24] = new Image(Gallery[24].Width,Gallery[24].Height)	imgArray[25] = new Image(Gallery[25].Width,Gallery[25].Height)	imgArray[26] = new Image(Gallery[26].Width,Gallery[26].Height)	imgArray[27] = new Image(Gallery[27].Width,Gallery[27].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	imgArray[16].src = Gallery[16].Image	imgArray[17].src = Gallery[17].Image	imgArray[18].src = Gallery[18].Image	imgArray[19].src = Gallery[19].Image	imgArray[20].src = Gallery[20].Image	imgArray[21].src = Gallery[21].Image	imgArray[22].src = Gallery[22].Image	imgArray[23].src = Gallery[23].Image	imgArray[24].src = Gallery[24].Image	imgArray[25].src = Gallery[25].Image	imgArray[26].src = Gallery[26].Image	imgArray[27].src = Gallery[27].Image