// JavaScript Document//total in galleriesGalleryTotal1 = 25;GalleryTotal2 = 20;//starting valuescurrentImage = 1;ChosenGallery = 1;//currentgallery valudsgallery1Current = 1;gallery2Current = 2;function checkGallery(x){	if(x == 1){		return(gallery1Current);	}else{		return(gallery2Current);	}}function Previous(x){	if(ChosenGallery != x){		if(checkGallery(x) == 1){			currentImage = 1;		}else{			currentImage = checkGallery(x);		}	}	if(x == 1){currentTotal = GalleryTotal1; ChosenGallery = 1;}	if(x == 2){currentTotal = GalleryTotal2; ChosenGallery = 2;}		if(currentImage > 1){			currentImage = currentImage - 1;		}else{			currentImage = currentTotal;		}		if(x == 1){			gallery1Current = currentImage;			document.galleryImage1.src = "images/gallery/" + currentImage + ".jpg";			document.gallery1.desc.value = "Image " + currentImage + " of " + GalleryTotal1;		}else if(x == 2){			gallery2Current = currentImage;			document.galleryImage2.src = "images/gallery/ba/" + currentImage + ".jpg";			document.gallery2.desc2.value = "Image " + currentImage + " of " + GalleryTotal2;		}		}function Next(y){	if(ChosenGallery != y){		if(checkGallery(y) == 1){			currentImage = 1;		}else{			currentImage = checkGallery(y);		}	}	if(y == 1){currentTotal = GalleryTotal1; ChosenGallery = 1;}	if(y == 2){currentTotal = GalleryTotal2; ChosenGallery = 2;}		if(currentImage == currentTotal){			currentImage = 1;		}else{			currentImage = currentImage + 1;		}		if(y == 1){			gallery1Current = currentImage;			document.galleryImage1.src = "images/gallery/" + currentImage + ".jpg";			document.gallery1.desc.value = "Image " + currentImage + " of " + GalleryTotal1;		}else if(y == 2){			gallery2Current = currentImage;			document.galleryImage2.src = "images/gallery/ba/" + currentImage + ".jpg";			document.gallery2.desc2.value = "Image " + currentImage + " of " + GalleryTotal2;		}}function Choose(a,z){	if(a == 1){		document.galleryImage1.src = "images/gallery/" + z + ".jpg";		currentImage = z;		gallery1Current = z;		document.gallery1.desc.value = "Image " + currentImage + " of " + GalleryTotal1;	}else if(a == 2){		document.galleryImage2.src = "images/gallery/ba/" + z + ".jpg";		currentImage = z;		gallery2Current = z;		document.gallery2.desc2.value = "Image " + currentImage + " of " + GalleryTotal2;	}}