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/Europe/Amalfi-Coast-Road.jpg",
								"../images/Europe/Barcelona-Harbor-Walkway.jpg",
								"../images/Europe/Canals-of-Brugges.jpg",
								"../images/Europe/Dublin.jpg",
								"../images/Europe/Edinburgh-castle-entrance.jpg",
								"../images/Europe/Haarlem-canals.jpg",
								"../images/Europe/Keukenhof-Gardens.jpg",
								"../images/Europe/Neuschwanstein-Castle-Marys-Bridge.jpg",
								"../images/Europe/Notre-Dame-at-dusk.jpg",
								"../images/Europe/Stockholm-harbor-tour-boats.jpg",
								"../images/Europe/The-Eye.jpg",
								"../images/Europe/The-Millennium-Bridge.jpg",
								"../images/Europe/Tintern-Abbey.jpg",
								"../images/Europe/Tivoli-Gardens-Lakes.jpg",
								"../images/Europe/Venice-Burano-lace-making.jpg",
								"../images/Europe/Viking-ship-museum.jpg",
								"../images/Europe/Zurich-and-Limatt-River.jpg");
								 
								
var myCaption = new Array("Amalfi Coast Road, Italy",
								"Barcelona Harbor Walkway, Spain",
								"Canals of Bruges, Belgium",
								"Dublin, Ireland",
								"Castle Entrance, Edinburgh, Scotland",
								"Canals of Haarlem, Holland, Netherlands",
								"Keukenhof Gardens, Holland, Netherlands",
								"Neuschwanstein Castle from Mary's Bridge, Germany",
								"Notre Dame at Dusk, Paris, France",
								"Stockholm Harbor Tour Boats, Sweden",
								"The London Eye, England",
								"The Millennium Bridge, London, England",
								"Tinturn Abbey, England",
								"Lakes at Tivoli Gardens, Copenhagen, Denmark",
								"Making Burano Lace, Venice, Italy",
								"Viking Ship in the Viking Ship Museum, Oslo, Norway",
								"Limatt River, Zurich, Switzerland");
																		

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;
}


  







		
