var RAppear = Class.create({

  initialize: function(id) {
    this.target = $(id);
    this.duration = 500;
    this.wait = 10000;
    this.shown = 0;
    this.startAppear();
  },

  swapFade: function() {
      //console.log(this.shown);
      if(this.shown) {
        //console.log('fade');
        Effect.Fade(this.target, { 
          duration:1, from:1.0, to:0.0, fps: 24,
          afterFinish: function() { this.shown = 0; }.bind(this)
        });
      } else {
        Effect.Appear(this.target, { 
          duration:1, from:0.0, to:1.0, fps: 24,
          afterFinish: function() { this.shown = 1; }.bind(this)
        });      
      }

    },

    startAppear: function () {
      //console.log('test');
      new PeriodicalExecuter(function() {
        this.swapFade();
      }.bind(this), this.wait/1000);
    }    

  });


