
  /**
   * to switch between background photos
   */
  function BGSwitch() {
    this.iCurrentPhoto = 0;
    this.aPhotos = [];
  }
  
  
  /**
   * adds a photo to this class
   * @return void
   */
  BGSwitch.prototype.addPhoto = function(sPhotoURL) {
    this.aPhotos.push(sPhotoURL);
  };
    
  
  /**
   * shows next background photo
   * @return void
   */
  BGSwitch.prototype.nextPhoto = function() {
    this.iCurrentPhoto++;
    if ( this.iCurrentPhoto >= this.aPhotos.length )
      this.iCurrentPhoto = 0;
    
    YSCSS.setStyle('wrapper', 'backgroundImage', 
      'url('+this.aPhotos[this.iCurrentPhoto]+')');    
  };
  
  
  /**
   * starts the interval timer
   * @return void
   */
  BGSwitch.prototype.start = function() {
    if ( this.aPhotos.length > 1 )
      new YSTimeout(7000, BGSwitch.nextPhoto, this, null, true);    
  };
  
  
  var BGSwitch = new BGSwitch();
