// JavaScript Document

//var xmlHttp

function LoadPhoto(gal_id,image_pos)
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
	  alert ("Your browser does not support AJAX!");
	  return;
	 }

	var url="ajax/loadphoto.php";
	url=url+"?gal_id="+gal_id;
	if (image_pos) {
		url=url+"&image_pos="+image_pos;
	}
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange = function() {
		
		if ((xmlHttp.readyState==1) || (xmlHttp.readyState==2) || (xmlHttp.readyState==3)) {
			document.getElementById("picturepreview").innerHTML="<img src='./include/loading.png' width='920' height='610' />";
		} else if (xmlHttp.readyState==4) {
			document.getElementById("picturepreview").innerHTML=xmlHttp.responseText;
		}
	
	}
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);

}
