/*
Script from www.javascriptkit.com - JavaScript Kit
Amended by Richard Coltman 2005
*/

var img=new Array()
img[0] = ["pix/griffone1.jpg", "Villa Griffone and the mausoleum at Pontecchio near Bologna"]
img[1] = ["pix/griffone2.jpg", "The front elevation of Villa Griffone"]
img[2] = ["pix/griffone3.jpg", "The rear elevation of Villa Griffone"]
img[3] = ["pix/mausoleum.jpg", "The facade of the mausoleum beneath Villa Griffone"]
img[4] = ["pix/statue.jpg", "A statue of Marconi in front of Villa Griffone"]
img[5] = ["pix/antennae.jpg", "A replica radio antennae in the grounds of Villa Griffone"]
img[6] = ["pix/keel.jpg", "The remains of the keel of the yacht Elettra"]

var preloadit=new Array()
for (i=0;i<img.length;i++){
preloadit[i]=new Image()
preloadit[i].src=img[i][0]
}

var currentindex=""

function changeslides(which){
var imghtml=""
currentindex=(which=="initial")? 0 : parseInt(which)
var mode=(which=="initial")? "initial" : ""
var which=(mode=="initial")? img[0] : img[which]
if (which[1]!="")
imghtml='<div class="slideshow"><img src="'+which[0]+'" width="400" height="200" alt='
imghtml+='"Photograph of '+which[1]+'" border="" /></div>'
imghtml+='<div class="caption">'+which[1]+'</div>'
if (which[1]!="")
imghtml+=''

if (mode=="initial")
document.write('<div>'+imghtml+'</div>')
else{
document.getElementById("illustration").innerHTML=imghtml
}
}

function PreviousImage(){
if (currentindex!=0)
	changeslides(currentindex-1)
else
	changeslides(img.length-1)
}

function NextImage(){
if (currentindex<img.length-1)
	changeslides(currentindex+1)
else
	changeslides(0)
}
