function imageSelect( id, imagesrc, caption, width, height )
{
	if( document.getElementById("caption") != null )
	{
		document.getElementById("caption").innerHTML = ( caption.length > 0 ) ? unescape( caption ) + '<br />' : ''; 
	}
	document.getElementById("mainimage").src = imagesrc;
	//document.getElementById("mainimage").alt = caption;
	document.getElementById("mainimage").width = width;
	document.getElementById("mainimage").height = height;
	//flag new image thumbnail
	var lis = document.getElementsByTagName('li');
	for (var i=0;i<lis.length;i++)
	{
		if (lis[i].className.indexOf("currentImage") > -1)
		{
			lis[i].className = '';
		}
	}
	document.getElementById("image"+id).className = "currentImage";
}