window.onload = initLinks;

/* topic-slide.js contains the images and their captions for the rotating image gallery. */

/* */

/* Filesnames are relative to location of the calling HTML file, not to the location of this JavaScript file.  */

var myPix = new Array("../images/NAmerica/Sun-Dial-Bridge-Redding-CA.jpg",
								"../images/NAmerica/1-Durango-Silverton-railway.jpg",
								"../images/NAmerica/1-Sunrise-Monterey-Bay.jpg",
								"../images/NAmerica/166-132-totem-Kake-Alaska.jpg",
								"../images/NAmerica/1999-Napa-crafts-Cat-in-the-Hat.jpg",
								"../images/NAmerica/61-Old-North-Church-from-Beacon-Hill.jpg",
								"../images/NAmerica/Quebec-City-upper-old-town.jpg",
								"../images/NAmerica/California-fruit-orchards-in-bloom.jpg",
								"../images/NAmerica/Capitola.jpg",
								"../images/NAmerica/Halifax-on-Canada-Day.jpg",
								"../images/NAmerica/Jellies-Monterey-Bay-Aquarium.jpg",
								"../images/NAmerica/LaBrea-Tar-Pits-Los-Angeles-CA.jpg",
								"../images/NAmerica/Pacific-Grove-CA.jpg",
								"../images/NAmerica/Riverside-Mission-Inn-CA.jpg",
								"../images/NAmerica/San-Francisco-Golden-Gate.jpg",
								"../images/NAmerica/Santa-Barbara-Mission.jpg",
								"../images/NAmerica/Vancouver-West-Thumb-from-Stanley-Park-1986.jpg",
								"../images/NAmerica/tiles-of-Tlaquepaque.jpg");
						 
								 
								
var myCaption = new Array("Sun Dial Bridge, Redding, California",
								"Durango-Silverton Railway, Colorado",
								"Sunrise, Monrerey Bay, California",
								"Totem at Kake, Alaska",
								"Crafts Fair, Napa, California",
								"Old North Church from Beacon Hill, Boston, Massachusetts",
								"Upper Old Town, Quebec, Canada",
								"Fruit Orchards in Bloom, California",
								"Capitola, California",
								"Canada Day, Halifax, Nova Scotia, Canada",
								"Jellyfish, Monterey Bay Aquarium, California",
								"La Brea Tar Pits, Los Angeles, California",
								"Pacific Grove, California",
								"Mission Inn, Riverside, California",
								"Golden Gate Bridge, San Francisco, California",
								"Mission Santa Barbara, California",
								"Vancouver, Canada",
								"Tiled Arches, Tlaquepaque, Mexico");
																		

var thisPic = 0;
								


function initLinks() {
	document.getElementById("prevLink").onclick = processPrevious;
	
  document.getElementById("nextLink").onclick = processNext;
  
}

<!-- element ids for the getElementById and other ids must agree with calling file, otherwise you get msg about html file not found for prev.html and next.html, even though these are just virtual placeholder files for this clever bit to work.  -->

function processPrevious() {
  if (thisPic == 0) {
  	thisPic = myPix.length;
    }
  thisPic--;  
  document.getElementById("pictureArea2").src= myPix[thisPic];
  document.getElementById("caption").innerHTML=myCaption[thisPic];
  return false;
}

function processNext() {
  thisPic++;  
  if (thisPic == myPix.length) {
  	thisPic = 0;
    }
  document.getElementById("pictureArea2").src= myPix[thisPic];
  document.getElementById("caption").innerHTML=myCaption[thisPic];
  return false;
}


  







		
