﻿function swapPhoto(photoSRC,theCaption,theLink) {

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

	var theImage = document.getElementById("mainPhoto");
	var displayedCaption = document.getElementById("caption");
	var displayedLink = document.getElementById("link");
	var imgFolder = "p/";
	var linkFormat = "http://";
	displayedCaption.firstChild.nodeValue = theCaption;
	displayedLink.firstChild.nodeValue = theLink;
	displayedLink.setAttribute("href", linkFormat+theLink);	
	theImage.setAttribute("src", imgFolder+photoSRC);	
    }
  }
  
 function swapPhoto1(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/";
	displayedCaption.firstChild.nodeValue = theCaption;
	displayedCredit.firstChild.nodeValue = theCredit;
	theImage.setAttribute("src", imgFolder+photoSRC);

    }
  }  
function swapPhoto2(photoSRC,theCaption) {

if (document.getElementById("caption")) {
	var theImage = document.getElementById("mainPhoto");
	var displayedCaption = document.getElementById("caption");	
	var imgFolder = "p/";
	displayedCaption.firstChild.nodeValue = theCaption;	
	theImage.setAttribute("src", imgFolder+photoSRC);	
    }
  }
