function swapPhoto(photoSRC,theCaption,theCredit,theOriginal,originalSRC) {

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

	var theImage = document.getElementById("mainPhoto");
	var displayedCaption = document.getElementById("caption");
	var displayedCredit = document.getElementById("credit");
	var displayedOriginal = document.getElementById("original");
	var theOriginalPhoto = document.getElementById("originalPhoto");
	var imgFolder = "images/";
	displayedCaption.firstChild.nodeValue = theCaption;
	displayedCredit.firstChild.nodeValue = theCredit;
	displayedOriginal.firstChild.nodeValue = theOriginal;
	theImage.setAttribute("src", imgFolder+photoSRC);
	theOriginalPhoto.setAttribute("src", imgFolder+originalSRC);

    }
  }
