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/Antarctica/Antarctic-Ice.jpg",
								"../images/Antarctica/Antarctica-Gentoo-Egg-Useful-Island.jpg",
								"../images/Antarctica/antarctica-Nesting-Albatross-Diego-Ramirez-Island.jpg",
								"../images/Antarctica/Antarctica-Useful-Island-view.jpg");
								 
								
var myCaption = new Array("Blue Antarctice Ice",
								"Gentoo Bird and Egg",
								"Nesting Albatross",
								"Useful Island");
																		

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


  







		
