


var FLOW = {
  initialize: function() {
    this.element = $('flow_ads');
    this.element.setStyle({
        position:'absolute'
      });
    
    Event.observe(window, 'scroll', this.move.bindAsEventListener(this));
    Event.observe(window, 'resize', this.move.bindAsEventListener(this));
    this.move();
  },
  move: function() {
    this.windowSize = Position.getWindowSize();
    this.offset = document.viewport.getScrollOffsets();
    this.dimension = this.element.getDimensions();
    this.timer = window.setTimeout(function() {
          var xPos = this.windowSize.width - this.dimension.width-20;
          var yPos = this.offset.top + this.windowSize.height - this.dimension.height-20;
          new Effect.Move(this.element, {x: xPos, y: yPos, mode: 'absolute'});
          this.timer = null;
      }.bind(this), 200);
  }
};


//Event.observe(window, 'load', FLOW.initialize.bindAsEventListener(FLOW));
