//*************************************************
// gallery.js
//
//Summary: Main gallery class
//
//Author:      Jeff Buhr
//
//Created:     16 Spt 08
//Summary of Modifications:
//       none
//*************************************************

// Game glass - controls game
function gallery(galName) {
   // get "GET" variables
   this.name      = galName;
   this.user      = "rbc";
   this.album     = "Citivision06";
   this.pictureID = 0;

   this.display  = new display(this.name,this.user, this.album, this.pictureID);

   this.run = function() {
      this.display.initialize();
   }

   // is called when user hits the key while viewing the gallery
   this.keyPress = function(e) {
      var key = e.keyCode? e.keyCode : e.charCode; // firefox (gecko) uses charcode, ie uses keycode

      // do action according to key pressed
      switch(key) {
      case 13: // Enter
      case 32: // Space bar
      case 39: // right arrow
      case 40: // down arrow
         this.display.displayNextImage();
         break;
      case 38: // up arrow
      case 37: // left arrow
         this.display.displayPrevImage();
         break;
      default:
         break;
      }
   }
}


