var Galerie = Class.create({
  
  step: 200,
  
  size: 750,
  
  pos: 0,
  
  width: 0,
  
  duration: 0.6,
  
  div: null,

  left: function() {
    var check=this.pos+this.step;
    if(check>0) {
      this.pos=0;
    }
    else {
      this.pos=this.pos+this.step;
    }
    this.move();
  },
  
  right: function() {
    var check=this.width-this.size+this.pos;
    if(check<this.step) {
      this.pos=this.pos-check; 
    }
    else {
      this.pos=this.pos-this.step;
    }
    this.move();
  },
  
  move: function() {
    new Effect.Move(this.div,
      { 
        x: this.pos, 
        y: 0, 
        mode: 'absolute', 
        duration: this.duration
      }
    );
  }
  
});

var Preview=new Galerie();

Event.observe(window,'load',function() {
  Preview.div=$('galerie-in');
  Preview.width=Preview.div.getWidth();
});
