function changePhoto(id, photo, ind) {
 advAJAX.get({
  url: "gallery.php",
  parameters: {
   "show" : "Galleries",
   "id" : id,
   "photo" : photo,
   "ind" : ind
  },
  onSuccess : function(obj) {
   next = obj.responseXML.getElementsByTagName('next').item(0).childNodes[0].nodeValue;
   nind = obj.responseXML.getElementsByTagName('nind').item(0).childNodes[0].nodeValue;
   prev = obj.responseXML.getElementsByTagName('prev').item(0).childNodes[0].nodeValue;
   pind = obj.responseXML.getElementsByTagName('pind').item(0).childNodes[0].nodeValue;
   document.getElementById('albumPhoto').src = 'images/gallery/'+id+'/album'+photo+'.jpg';
   document.getElementById('next').href = 'index.php?show=Galleries&id='+id+'&photo='+next+'&ind='+nind;
   document.getElementById('next').onclick = function() {changePhoto(id, next, nind); return false;};
   document.getElementById('prev').href = 'index.php?show=Galleries&id='+id+'&photo='+prev+'&ind='+pind;
   document.getElementById('prev').onclick = function() {changePhoto(id, prev, pind); return false;};
   document.getElementById('ind').innerHTML = parseInt(ind)+1;
   document.getElementById('album').href = 'images/gallery/'+id+'/orginal'+photo+'.jpg';
  },
  onError : function(obj) { alert("Error: " + obj.status); }
 });

}
