function preloadAlbum(inputAlbum, caller) {
   this.caller = caller;

   this.albumName = inputAlbum;
   //this.page = page;

   this.currentAlbum;
   this.currentPhoto;

   var strScript = "Requests/submitRequest.php";
   strScript = strScript + "?album=" + this.albumName;
   strScript = strScript + "&mode=navigation";

   // Make AJAX/JSON call to get the ablum OR get it from the cache
   var json1 = new jsChe(strScript, this);

   this.cacheAlbum = function() {
      this.currentAlbum = gContext[this.albumName];
      this.preloadDiv = document.createElement("div");
      this.preloadDiv.style.display = "none";
   
      for (this.currentPhoto = 0 ; this.currentPhoto < this.currentAlbum.length ; this.currentPhoto ++ ) {
         //alert("album:" + this.currentAlbum[this.currentPhoto].source); 
         var image = document.createElement("img");
         image.src = this.currentAlbum[this.currentPhoto].source;
         this.preloadDiv.appendChild(image);
      }
      document.body.appendChild(this.preloadDiv);
      setTimeout('this.caller.drawAlbum()', 3000);
      //setTimeout('alert("hi")', 6000);
   }

   this.drawPage = function() {
      this.cacheAlbum();
   }

}

