//Specify image paths and optional link (set link to "" for no link):

var dynimages=new Array()
dynimages[0]=["../images/gallery/03.jpg", "Melaque beach."]
dynimages[1]=["../images/gallery/02.jpg", "View from Melaque beach."]
dynimages[2]=["../images/gallery/01.jpg", "Hotel in Melaque."]
dynimages[3]=["../images/gallery/04.jpg", "Islands off Melaque."]
dynimages[4]=["../images/gallery/06.jpg", "Isla de Navidad, seen from Melaque."]
dynimages[5]=["../images/gallery/07.jpg", "Beach at Cuastecomate."]
dynimages[6]=["../images/gallery/09.jpg", "Calechosa at center left with roads visible, seen from Cuastecomate."]
dynimages[7]=["../images/gallery/10.jpg", "Cuastecomate."]
dynimages[8]=["../images/gallery/11.jpg", "Beach at Cuastecomate."]
dynimages[9]=["../images/gallery/12.jpg", "Health clinic at El Ranchito – to be expanded with help from Calechosa Bay."]
dynimages[10]=["../images/gallery/13.jpg", "Road into Calechosa, about 1 km from ocean."]
dynimages[11]=["../images/gallery/15.jpg", "Beach at Calechosa."]
dynimages[12]=["../images/gallery/16.jpg", "Calechosa beach. The headland is part of the Federal Zone and cannot be developed."]
dynimages[13]=["../images/gallery/17.jpg", "Overlooking Calechosa beach."]
dynimages[14]=["../images/gallery/20.jpg", "View from Calechosa across to Cuastecomate."]
dynimages[15]=["../images/gallery/21.jpg", "Sandy beaches to the east of Calechosa."]
dynimages[16]=["../images/gallery/22.jpg", "Beach at Calechosa."]
dynimages[17]=["../images/gallery/23.jpg", "Neighbour’s house, the only one at the beach."]
dynimages[18]=["../images/gallery/24.jpg", "View from upper part of Calechosa development."]
dynimages[19]=["../images/gallery/25.jpg", "View near top."]
dynimages[20]=["../images/gallery/26.jpg", "View halfway up."]
dynimages[21]=["../images/gallery/27.jpg", "Road and sewer construction at Calechosa, August 2007."]
dynimages[22]=["../images/gallery/29.jpg", "Waves off Calechosa."]
dynimages[23]=["../images/gallery/30.jpg", "Surfers and island with pelicans and cormorants."]
dynimages[24]=["../images/gallery/31.jpg", "120,000 litre water tank under construction, October 2007."]
dynimages[25]=["../images/gallery/32.jpg", "Water tank construction."]
dynimages[26]=["../images/gallery/33.jpg", "Construction begins, partner's house on lot 5, January 2008."]
dynimages[27]=["../images/gallery/34.jpg", "Construction begins, partner's house on lot 5, January 2008."]
dynimages[28]=["../images/gallery/35.jpg", "Construction of caretaker's house, January 2008."]
dynimages[29]=["../images/gallery/36.JPG", "Construction on lot 5, April 2008."]
dynimages[30]=["../images/gallery/37.JPG", "Construction on lot 5, April 2008."]
dynimages[31]=["../images/gallery/38.jpg", "Construction on front wall and entrance, November 2008."]
dynimages[32]=["../images/gallery/39.jpg", "Construction on front wall and entrance, November 2008."]
dynimages[33]=["../images/gallery/40.jpg", "Construction on front wall and entrance, November 2008."]

//Preload images ("yes" or "no"):
var preloadimg="yes"

//Set optional link target to be added to all images with a link:
var optlinktarget=""

//Set image border width
var imgborderwidth=0

//Optionally, change 1.0 and 0.7 below to affect Wipe gradient size and duration in seconds in IE5.5+:
var filterstring="progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=100.0 Duration=1.0)"

///////No need to edit beyond here/////

if (preloadimg=="yes"){
for (x=0; x<dynimages.length; x++){
var myimage=new Image()
myimage.src=dynimages[x][0]
}
}

function returnimgcode(theimg){
var imghtml=""
if (theimg[1]!="")
imghtml='<a href="'+theimg[1]+'" target="'+optlinktarget+'">'
imghtml+='<img src="'+theimg[0]+'" border="'+imgborderwidth+'">'
if (theimg[1]!="")
imghtml+='</a>'
return imghtml
}

function modifyimage(loadarea, imgindex){
if (document.getElementById){
  // remove current image text, 11-oct-2007: jwillmott
	removeEvent("imgDiv");
  // rebuild image text iv output per corresponding array value, 11-oct-2007: jwillmott
	addEvent(dynimages[imgindex][1]);

var imgobj=document.getElementById(loadarea)
if (imgobj.filters && window.createPopup){
imgobj.style.filter=filterstring
imgobj.filters[0].Apply()
}
imgobj.innerHTML=returnimgcode(dynimages[imgindex])
if (imgobj.filters && window.createPopup)
imgobj.filters[0].Play()
return false
}
}


// image text output functions, 11-oct-2007: jwillmott
function addEvent(txt) {
	var ni = document.getElementById('txtDiv');
	var divIdName = "imgDiv";
	var newdiv = document.createElement('div');
	newdiv.setAttribute("id",divIdName);
	newdiv.innerHTML = txt;
	ni.appendChild(newdiv);
 }
function removeEvent(divNum) {
	var d = document.getElementById('txtDiv');
	var olddiv = document.getElementById(divNum);
	d.removeChild(document.getElementById("imgDiv"));
 }