// JavaScript Document

var xmlPhoto

function getPhoto(currentPhoto,totalPhotos)
{ 	
	document.getElementById("gallery_loader").innerHTML='<img src="images/blank.gif" height="200" width="300">'
	xmlPhoto=GetXmlHttpObject()
	if (xmlPhoto==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
	var url="includes/getPhoto.php"
	url=url+"?pageNum_currentphoto="+currentPhoto+"&totalRows_currentphoto="+totalPhotos
	xmlPhoto.onreadystatechange=PhotoStateChanged 
	xmlPhoto.open("GET",url,true)
	xmlPhoto.send(null)
}

function PhotoStateChanged() 
{ 
	if (xmlPhoto.readyState==4 || xmlPhoto.readyState=="complete") { 
	 	document.getElementById("gallery_loader").innerHTML=xmlPhoto.responseText 
	 }
}

function GetXmlHttpObject()
{
	var xmlRequest=null;
	try
	 {
	 // Firefox, Opera 8.0+, Safari
	 xmlRequest=new XMLHttpRequest();
	 }
	catch (e)
	 {
	 //Internet Explorer
	 try
	  {
	  xmlRequest=new ActiveXObject("Msxml2.XMLHTTP");
	  }
	 catch (e)
	  {
	  xmlRequest=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	 }
	return xmlRequest;
}