/*
* Copyright 2006 Ronny Engelmann
* This code is free; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation
* Contact Ronny Engelmann at ronny.engelmann [at] knoxmic [dot] net
*
* Description: scrolling content with javascript
*/

/*function scroll(objElement, intWidth) {
  var self = this;
  this._x = -180;
  objElement.style.left  = "-180px";

  this.setPosition = function(intPos, x) {
    if (intPos > 0) intPos = 0;
    if (intPos < intWidth - objElement.offsetWidth)
      intPos = intWidth - objElement.offsetWidth;
    this._x = intPos;
    objElement.style.left  = this._x +"px";
  };

  this.scrollX = function(x) { this.setPosition(this._x + x, x); };

  this.start = function(x) {
    this.scrollTimer = window.setInterval(
      function() { self.scrollX(x); }, 25 );
  };
  this.stop = function() {
    if (this.scrollTimer) window.clearInterval(this.scrollTimer); };
};
*/
/*vertikal*/

function scroll(objElement, intHeight) {
  var self = this;
  this._y = 0;
  objElement.style.top  = "0px";

  this.setPosition = function(intPos, y) {
    if (intPos > 0) intPos = 0;
    if (intPos < intHeight - objElement.offsetHeight)
      intPos = intHeight - objElement.offsetHeight;
    this._y = intPos;
    objElement.style.top  = this._y +"px";
  };

  this.scrollY = function(y) { this.setPosition(this._y + y, y); };

  this.start = function(y) {
    this.scrollTimer = window.setInterval(
      function() { self.scrollY(y); }, 25 );
  };
  this.stop = function() {
    if (this.scrollTimer) window.clearInterval(this.scrollTimer); };
};

/*var srollObject = null;

function initPage() {
  var objElement = document.getElementById('bildleiste-kl-inhalt');
  srollObject = new scroll(objElement, 10);
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
*/
