Effect.Scroll = Class.create();
Object.extend(Object.extend(Effect.Scroll.prototype, Effect.Base.prototype), {
  initialize: function(element) {
    this.element = $(element);
    var options = Object.extend({
      x:    0,
      y:    0,
      mode: 'absolute'
    } , arguments[1] || {}  );
    this.start(options);
  },
  setup: function() {
    if (this.options.continuous && !this.element._ext ) {
      this.element.cleanWhitespace();
      this.element._ext=true;
      this.element.appendChild(this.element.firstChild);
    }
   
    this.originalLeft=this.element.scrollLeft;
    this.originalTop=this.element.scrollTop;
   
    if(this.options.mode == 'absolute') {
      this.options.x -= this.originalLeft;
      this.options.y -= this.originalTop;
    } else {
   
    }
  },
  update: function(position) {   
    this.element.scrollLeft = this.options.x * position + this.originalLeft;
    this.element.scrollTop  = this.options.y * position + this.originalTop;
  }
});

function moveTo(container, element) {
	Position.prepare();
	container_x = Position.cumulativeOffset($(container))[0]
	element_x = Position.cumulativeOffset($(element))[0]
	new Effect.Scroll(container, {x:(element_x-container_x), y:0, duration: 0.5});
	return;
}

function showHideContent(showId) {
	var divs = ['content_one', 'content_two', 'content_three', 'content_four', 'content_five'];

	for (i=0; i<divs.length; ++i) {
		div = $(divs[i]);
		div.style.display = 'none';
	}

	div = $(showId);
	div.style.display = 'block';
}

