var canShow = new Array(5)
for(var i = 0; i < canShow.length; i ++){
	canShow[i] = true;
}

function setCanShow(no){
	canShow[no] = true;
}
function displayImage(sectionNo, imageNo){

	var url = "../graphics/history/" + imageNo + ".jpg";
	var caption = captions[imageNo];
	var photoElementName = 'photo' + sectionNo;
	if(canShow[sectionNo]){
		canShow[sectionNo] = false;
		var myAjax = new Ajax.Request(url ,{method: 'get',
			onComplete: function() {
				Effect.Fade(photoElementName,
					{to: 0.01, queue: {position:'front', scope: 'imagescope'},
						afterFinish: function(){
							$(photoElementName).setAttribute('src', url);
							$(photoElementName).setAttribute('title', caption);
							Element.update($('caption' + sectionNo), caption);
							Effect.Appear(photoElementName,{from: 0.01, queue: {position:'end', scope: 'imagescope'} });
							setTimeout("setCanShow('" + sectionNo + "')", 800);
						}
					}
				);
			}
		});
	}
}

