		//PHOTO GALLERY
		var openFlag = 0;
		var transFlag = 0;
		var transTimer;


		function swapWithNext(galleryName) {

			var nextPhotoNumber = 0;
			var currentPhoto = parseInt($("div.current_photo." + galleryName).html());
			var totalPhotos = parseInt($("div.number_of_photos." + galleryName).html());

			if (currentPhoto == totalPhotos) { nextPhotoNumber = 0; } else { nextPhotoNumber = currentPhoto + 1; };

			swapPhoto(nextPhotoNumber,galleryName);
		};


		function swapWithPrev(galleryName) {

			var nextPhotoNumber = 0;
			var currentPhoto = parseInt($("div.current_photo." + galleryName).html());
			var totalPhotos = parseInt($("div.number_of_photos." + galleryName).html());

			if (currentPhoto == 0) { nextPhotoNumber = totalPhotos; } else { nextPhotoNumber = currentPhoto - 1; };

			swapPhoto(nextPhotoNumber,galleryName);
		};

		function swapPhoto(photoNumber,galleryName) {

			var currentPhoto = parseInt($("div.current_photo." + galleryName).html());

			if (transFlag == 0) {
				transFlag = 1;
				$("table.photo_box." + galleryName).eq(currentPhoto).fadeOut(200);

				var photoTimer = setTimeout(function() {
					$("table.photo_box." + galleryName).eq(photoNumber).fadeIn(300);
					$("div.current_photo." + galleryName).html(photoNumber.toString(10));
					transTimer = setTimeout(function() { transFlag = 0; }, 300);

				}, 300);
			};
		};