// JavaScript Document
function img(id){
//	if (document.getElementById("imgholder").style.display=="none"){
		document.getElementById("imgholder").style.display="";
		ajaxFunction('displayImage',id);
//	} else document.getElementById("imgholder").style.display="none"

}
function close_imgholder(){
	document.getElementById("imgholder").style.display="none"
}
function ajaxFunction(todo,id){
	var ajaxReq;  // The variable that makes Ajax possible!
//	document.getElementById('imgholder'+imageid).innerHTML="imgholder";
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxReq = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxReq = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxReq = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	if (todo=="displayImage"){
		ajaxReq.onreadystatechange = function(){
			if(ajaxReq.readyState == 1 || ajaxReq.readyState == 2 || ajaxReq.readyState == 3){
				document.getElementById('imgholder').innerHTML="<p style=\"color:green; font-weight:bold\">Loading image</p>";
			}
			if(ajaxReq.readyState == 4){
				var ajaxDisplay = document.getElementById('imgholder');
				ajaxDisplay.innerHTML = ajaxReq.responseText;
			}		
		}
		var str="?imageid="+id
		ajaxReq.open("GET","imageDisplay.php"+str, true)
		ajaxReq.send(null)
	}
}