function doGallery(){// this code makes the gallery thumbs, and a div & span for the big image
	var k=0;
	gal=('<div id="showImage" ><span id="bigImage"></span></div>');
	gal+=('<div id="thumblock"><h5>Thumbnails</h5>');
	  for(i=0;i<images.length;i++){// for every thum - do this
		k++;
		var imgname =images[i].path + 'thumbs/'+ images[i].file;
		var title = images[i].title; 
		
		gal+=('<a  href="javascript:showImage('+i+')">');
		gal+=('<img src="'+ imgname +'" alt="'+ images[i].caption+'">');
		gal+=('</a>');
	}
gal+=('<div class="clear"><br></div></div>');
document.write(gal);
}
/************  show the chosen picture  ***********/
function showImage(arraypos){
	this.arraypos=arraypos;
	if(arraypos<=0)arraypos=images.length;
	if(arraypos>=images.length)arraypos=0;
	imgname =images[arraypos].path + images[arraypos].file;
	title = images[arraypos].title;
	caption = images[arraypos].caption;
	if(!caption){caption =artcaption;}// catch a no caption situation
	// write the big picture and some forward & back links
	var data = '<div id="showImageText"><a href="javascript:showImage(arraypos-1);">previous</a> | <a href="javascript:showImage(arraypos+1);">next</a> '+caption+'</div><img src="'+imgname+'" id="currentimage"><div id="showImageText"></div>';
	//
	update('bigImage',data);
}

/*update the chosen area - a useful multi-purpose function*/
function update(target,data) { 
var ie4=Boolean(document.all && !document.getElementById);
var td=(ie4)?document.all[target]:document.getElementById(target);
td.innerHTML=data;
}
