this.photoQueue = {
  _imageNodes: new Array(),
  _currentIndex: 0,
  _parentNode: null,
  _URLPrefix: null,
  
  initialize: function(parentNode, photoURLS, properties, URLPrefix){
    this._URLPrefix = URLPrefix;
    this._parentNode = parentNode;
    
    this.createImageNodes(photoURLS, properties);
  },
    
  jump: function(photoIndex){
    this._imageNodes[this._currentIndex].style.display = 'none';
    this._currentIndex = photoIndex;
    this._imageNodes[this._currentIndex].style.display = 'block';
  },
  
  advance: function(){
    this._imageNodes[this._currentIndex].style.display = 'none';
    this._currentIndex = (this._currentIndex + 1) % this._imageNodes.length;
    this._imageNodes[this._currentIndex].style.display = 'block';
  },
  
  rewind: function(){
    this._imageNodes[this._currentIndex].style.display = 'none';
    this._currentIndex = (this._currentIndex || this._imageNodes.length) - 1;
    this._imageNodes[this._currentIndex].style.display = 'block';
  },
  
  createImageNodes: function( photoURLS, properties ){
    for(i=0;i<photoURLS.length;i++){
      this._imageNodes.push( document.createElement("img") );
      
      properties.id = 'photoQueue['+i+']';
      properties.src = this._URLPrefix + photoURLS[i];
      properties.style = {
        display: "none"
      };
      
      this._setProperties(this._imageNodes[i], properties);
    
      this._parentNode.appendChild(this._imageNodes[i]);
    
    }  
  },
  
  _setProperties: function(object, properties){
    for(var j in properties){
      if (typeof(eval("properties."+j)) == "object" || !eval("properties."+j) instanceof Array){
        this._setProperties(eval("object."+j), eval("properties."+j));
      } else {
        eval("object." + j + "=" + "properties."+j);
      }
    }
  },
  
  getCount: function(){
    return this._imageNodes.length;
  },
  
  getCurrentIndex: function(){
    return this._currentIndex; 
  }

};
