function swapPhoto(image,caption) {
   document['largePhoto'].src = "/hotelphotos/" + image;
   document['largePhoto'].alt = caption;
   document.getElementById('imageCaption').innerHTML=caption;
   return;
}

function backNextPhoto(photos,currentPhoto,totalPhotos) {

   var next = (currentPhoto < totalPhotos) ? true : false;
   var back = (currentPhoto > 1) ? true : false;
   var nextElem = document.getElementById('nextHref');
   var backElem = document.getElementById('backHref');
   var tableElem = document.getElementById('backNextTable'); 

   if(back) {
      backElem.style.cssText =  tableElem.style.display + " text-decoration: none;";  
      backElem.setAttribute("href","javascript:backNextPhoto(photos," + (currentPhoto - 1) + "," + totalPhotos + ")");
   }
   else {
      backElem.style.cssText =  "display: none;";  
      backElem.setAttribute("href", "");
      
   }
   
   if(next) {
      nextElem.style.cssText = tableElem.style.display + " text-decoration: none;";  
      nextElem.setAttribute("href","javascript:backNextPhoto(photos," + (currentPhoto + 1) + "," + totalPhotos + ")");
   }
   else {
      nextElem.style.cssText = "display: none;";  
      nextElem.setAttribute("href", "");
   }

   swapPhoto(photos[currentPhoto - 1][0],photos[currentPhoto - 1][1]);

   return; 
}




