<!--

var countImage;
var imageNumber;
var returnString;
var nav;
var navLast;
var navNext;
var imageArray;
var imageArray = new Array();
imageArray[0] = ["blackandpecker.jpg", "Evolution"]
imageArray[1] = ["blenderpool.jpg", "Not the best place to put a blender..."]
imageArray[2] = ["tightrope.jpg", "Must be one strong tightrope..."]
imageArray[3] = ["button.jpg", "Jenson Button's mechanics play a joke on him"]
imageArray[4] = ["schadenfreude.jpg", "Schadenfreude"]
imageArray[5] = ["coldairballoon.gif", "Cold air balloon"]
imageArray[6] = ["comet.jpg", "What a serve!"]
imageArray[7] = ["gnome_secretary_small.jpg", "The former Gnome Secretary"]
imageArray[8] = ["gowers.jpg", "Say it with Gowers"]
imageArray[9] = ["happiness.jpg", "Bill Clinton gets a new monument installed"]
imageArray[10] = ["houses_of_polomint.jpg", "The Houses of Polomint"]
imageArray[11] = ["london_pie.jpg", "The London Pie"]
imageArray[12] = ["st_pears_cathedral.jpg", "St. Pear's Cathedral"]
imageArray[13] = ["planet.jpg", "Planet Of The Humans"]
imageArray[14] = ["pongis.jpg", "Real life Pong"]
imageArray[15] = ["richsod.jpg", "Rich Sod biscuits"]
imageArray[16] = ["earthstatue.jpg", "A 1:1 scale statue of the Earth"]
imageArray[17] = ["optimisation.jpg", "The Department of Optimisation (JPEG branch)"]


function startUp() {
countImage = 0;
imageNumber = imageArray.length - 1;
returnImages();
}

function advance(){
countImage++;
returnImages();
}

function retreat(){
countImage--;
returnImages();
}

function createNav(){
createLast();
createNext();
nav = navLast + navNext;
}

function createLast() {
if (countImage == 0) {
navLast = "<img src='si/back-fade.gif' alt='back'/>";
} 
else 
{
navLast = "<img src='si/back.gif' alt='back' onClick='retreat()' style='cursor:hand'/>";
}
}

function createNext() {
if (countImage == imageNumber) {
navNext = "<img src='si/next-fade.gif' alt='next'/>";
} 
else
{
navNext = "<img src='si/next.gif' alt='next' onClick='advance()' style='cursor:hand'/>";
}
}

function getImage() {
imageHold = "<img src='images/" + imageArray[countImage][0] + "' alt='" + imageArray[countImage][1] + "'>"
}

function returnImages() {
getImage();
createNav();
imageHold = nav + "<br/><br/><i>Image " + (countImage + 1) + " of " + (imageNumber + 1) + ": <b>" + imageArray[countImage][1] + "</b></i><br/>" + imageHold + "<br/><br/>" + nav;
document.getElementById("images").innerHTML = imageHold;
}

// -->
