function swapPhoto(photoSRC,theCaption,theCredit) {

if (document.getElementById("caption")) {

	var theImage = document.getElementById("mainPhoto");
	var displayedCaption = document.getElementById("caption");
	var displayedCredit = document.getElementById("credit");
	var imgFolder = "images/gallery/";
	displayedCaption.firstChild.nodeValue = theCaption;
	displayedCredit.firstChild.nodeValue = theCredit;
	theImage.setAttribute("src", imgFolder+photoSRC);

    }
  }

