<!-- Paste this code into an external JavaScript file named: nextPrevious.js  -->

/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Solomon, the Sleuth :: http://www.freewebs.com/thesleuth/scripts/ */

var i = 0;
var count = 1;

// List image names without extension
var myImg= new Array(count)
 myImg[0]= "High_Needs_Low_01";
 myImg[1]= "High_Needs_Low_02";
// ImageNumbers:
var myNr= new Array(count)
  myNr[0]= "1/2";
  myNr[1]= "2/2";

// Imagetexts:
var myText= new Array(count)
 myText[0]= "High Needs Low - Visual for Brussels based party<br>Photo: Filip Vanzieleghem";
 myText[1]= "High Needs Low - Visual for Brussels based party - Detail<br>Photo: Filip Vanzieleghem";

// Tell browser where to find the image
myImgSrc = "images/2009/";

// Tell browser the type of file
myImgEnd = ".jpg"

// Create function to load image
function loadImg(){
  document.imgSrc.src = myImgSrc + myImg[i] + myImgEnd;
  document.getElementById("numbers").innerHTML = myNr[i];
  document.getElementById("imgtxt").innerHTML = myText[i];
  document.getElementById("highneedslow").innerHTML = "<u>High Needs Low</u>";

}

// Create link function to switch image backward
function prev(){
  if(i>0){
  i = i-=1;
  document.imgSrc.src = myImgSrc + myImg[i] + myImgEnd;
  document.getElementById("numbers").innerHTML = myNr[i];
  document.getElementById("imgtxt").innerHTML = myText[i];
}
}

// Create link function to switch image forward
function next(){
  if(i<count){
  i = i+=1;
  document.imgSrc.src = myImgSrc + myImg[i] + myImgEnd;
  document.getElementById("numbers").innerHTML = myNr[i];
  document.getElementById("imgtxt").innerHTML = myText[i];
}  
}

// Load function after page loads
window.onload=loadImg;
