


// ***** Sample scroller #1
var scroll1 = new scrollObject("testimonial", 290, 60, "right", 7000, 1.15);
    scroll1.block[0] = "Sie haben nicht zuviel versprochen - das Bild ist wirklich wundersch&ouml;n. Vielen Dank f&uuml;r die sehr schnelle Lieferung.";
    scroll1.block[1] = "Ich bin ganz begeistert von den leuchtenden Farben und der detailreichen Darstellung - ein umwerfendes Bild.";
	scroll1.block[2] = "Ihr Bild l&auml;sst unser Wohnzimmer in neuem Glanz erstrahlen. Unglaublich wie sch&ouml;n sich unser Raum ver&auml;ndert hat.";
    scroll1.block[3] = "Das Leinwandbild als Geburtstagsgeschenk war ein voller Erfolg. Danke f&uuml;r die kurzfristige Lieferung.";
    scroll1.block[4] = "Toll. Toll. Toll. Mehr kann ich zu meinem neuen Wandbild garnicht sagen :)";
    scroll1.block[5] = "Mit Ihren Wandbilder wirken unsere B&uuml;ror&auml;ume viel freundlicher und gem&uuml;tlicher. Unsere Mitarbeiter danken es Ihnen.";
	scroll1.block[6] = "Unsere G&auml;ste waren wie verzaubert von unseren neuen Bildern. Wir haben Sie nat&uuml;rlich weiterempfohlen. ";
	scroll1.block[7] = "Die strahlenden Farben der Blumen erfreuen mich jeden Morgen aufs neue. Vielen Dank f&uuml;r das tolle K&uuml;chenbild.";
	scroll1.block[8] = "Unser Badezimmer wirkt wie renoviert durch die gro&szlig;fl&auml;chigen Kunstdrucke von Ihnen. Wundersch&ouml;n! Wir sind begeistert. ";
	scroll1.block[9] = "Tolle Farben, perfekter Druck, wundersch&ouml;nes Bild - mehr brauche ich wohl nicht zu sagen. Ich werde Sie weiterempfehlen!";
    

// ***** Sample scroller #2
var scroll2 = new scrollObject("name", 290, 20, "right", 7000, 1.15);
    scroll2.block[0] = "Johanna Siemers | Marquartstein";
    scroll2.block[1] = "Otto von Lamprecht | M&uuml;nchen";
	scroll2.block[2] = "Stefanie M&uuml;ller | Hannover";
    scroll2.block[3] = "Stefan Selbiger | Biberach";
    scroll2.block[4] = "Jessica Anonov | Weiler";
    scroll2.block[5] = "Sebastienne Mertesacker | Berlin";
	scroll2.block[6] = "Dr. Anita Solventares | Dresden";
	scroll2.block[7] = "Jochen Pietrozalla | Weidenfelde";
	scroll2.block[8] = "Familie Berger | Prien am Chiemsee";
	scroll2.block[9] = "Selena Kowarschick | Fulda";


/* *****
 * Instead of using the onload attribute of the <body> tag, you can
 * also start your scrollers this way.
 *
 */
window.onload = function() {
  scroll1.scroll();
  scroll2.scroll();
}




/* ********************************************************************
 * The Mighty ScrollObject
 *   - Don't edit this if you know what's good for ya!
 *
 */
function scrollObject(main, width, height, direct, pause, speed) {
  var self = this;
  this.main = main;
  this.width = width;
  this.height = height;
  this.direct = direct;
  this.pause = pause;
  this.speed = Math.max(1.001, Math.min((direct == "up" || direct == "down") ? height : width, speed));
  this.block = new Array();
  this.blockprev = this.offset = 0;
  this.blockcurr = 1;
  this.mouse = false;
  this.scroll = function() {
    if (!document.getElementById) return false;
    this.main = document.getElementById(this.main);
    while (this.main.firstChild) this.main.removeChild(this.main.firstChild);
    this.main.style.overflow = "hidden";
    this.main.style.position = "relative";
    this.main.style.width = this.width + "px";
    this.main.style.height = this.height + "px";
    for (var x = 0; x < this.block.length; x++) {
      var table = document.createElement('table');
          table.cellPadding = table.cellSpacing = table.border = "0";
          table.style.position = "absolute";
          table.style.left = table.style.top = "0px";
          table.style.width = this.width + "px";
          table.style.height = this.height + "px";
          table.style.overflow = table.style.visibility = "hidden";
        var tbody = document.createElement('tbody');
          var tr = document.createElement('tr');
            var td = document.createElement('td');
                td.innerHTML = this.block[x];
              tr.appendChild(td);
            tbody.appendChild(tr);
          table.appendChild(tbody);
      this.main.appendChild(this.block[x] = table);
    }
    if (this.block.length > 1) {
      this.main.onmouseover = function() { self.mouse = false; }
      this.main.onmouseout = function() { self.mouse = false; }
      setInterval(function() {
        if (!self.offset && self.scrollLoop()) self.block[self.blockcurr].style.visibility = "visible";
      }, this.pause);
    } this.block[this.blockprev].style.visibility = "visible";
  }
  this.scrollLoop = function() {
    if (!this.offset) {
      if (this.mouse) return false;
      this.offset = (this.direct == "up" || this.direct == "down") ? this.height : this.width;
    } else this.offset = Math.floor(this.offset / this.speed);
    if (this.direct == "up" || this.direct == "down") {
      this.block[this.blockcurr].style.top = ((this.direct == "up") ? this.offset : -this.offset) + "px";
      this.block[this.blockprev].style.top = ((this.direct == "up") ? this.offset - this.height : this.height - this.offset) + "px";
    } else {
      this.block[this.blockcurr].style.left = ((this.direct == "left") ? this.offset : -this.offset) + "px";
      this.block[this.blockprev].style.left = ((this.direct == "left") ? this.offset - this.width : this.width - this.offset) + "px";
    }
    if (!this.offset) {
      this.block[this.blockprev].style.visibility = "hidden";
      this.blockprev = this.blockcurr;
      if (++this.blockcurr >= this.block.length) this.blockcurr = 0;
    } else setTimeout(function() { self.scrollLoop(); }, 30);
    return true;
  }
}
