
      function schriftrolle()
      {
        this.breite  = 150;
        this.hoehe   = 200;
        this.abstand = 15;
        this.tempo   = 20;
        this.pause   = 2000;

        this.id = "irgendwas"; // egal, wird überladen.
        this.geschwindigkeit = this.tempo;
        this.n = 0;
        this.zaehler = 1;
        this.x = 0;
        this.y = 0;
        this.timer = 0;
        this.stop = true;

        this.add =            function(inhalt)
                              {
                                this.n++;
                                document.writeln('<div id="'+this.id+'_'+this.n+'" style="overflow:hidden; visibility:hidden; position:absolute; width:'+this.breite+'px;" onmouseover="'+this.id+'.mausover()" onmouseout="'+this.id+'.mausout()">'+inhalt+'</div>');
                              }

        this.initialisieren = function()
                              {
                                document.writeln('<div id="'+this.id+'" style="visibility:hidden; position:absolute; width:50px; height:50px; z-index:3;"></div>');
                                document.writeln('<div id="'+this.id+'_haupt'+'" style="width:'+this.breite+'px; height:'+this.hoehe+'px; z-index:2;" onmouseover="'+this.id+'.mausover();" onmouseout="'+this.id+'.mausout();"></div>');
                              }

        this.scroll =         function()
                              {
                                var x = 0;
                                var y = 0;
                                var i;

                                if(document.getElementById(this.id+'_'+this.zaehler).offsetTop + document.getElementById(this.id+'_'+this.zaehler).offsetHeight < this.y)
                                {
                                  document.getElementById(this.id+'_'+this.zaehler).style.top = '-1200px';
                                  if(this.zaehler==this.n)
                                  {
                                    this.zaehler=1;
                                  }
                                  else
                                  {
                                    this.zaehler++;
                                  }
                                }

                                y = document.getElementById(this.id+'_'+this.zaehler).offsetTop;

                                this.geschwindigkeit = this.tempo;

                                for(i=this.zaehler; i<=this.n; i++)
                                {
                                  y = this.nachoben(this.id+'_'+i,i,y);
                                }
                                for(i=1; i<this.zaehler; i++)
                                {
                                  y = this.nachoben(this.id+'_'+i,i,y);
                                }

                                if(this.stop == false)
                                {
                                  this.timer = setTimeout(this.id+'.scroll()',this.geschwindigkeit);
                                }
                              }


        this.nachoben =       function(referenz,i,y)
                              {
                                var referenz_y = document.getElementById(referenz).offsetTop;
                                var referenz_h = document.getElementById(referenz).offsetHeight;
                                if(y < this.hoehe+this.y)
                                {
                                  if(referenz_y == this.y && this.pause>this.geschwindigkeit)
                                  {
                                    this.geschwindigkeit = this.pause;
                                  }

                                  if(referenz_y>-1200)
                                  {
                                    document.getElementById(referenz).style.top = referenz_y-1+'px';
                                  }
                                  else
                                  {
                                    document.getElementById(referenz).style.top = y+'px';
                                  }

                                  var o = Math.max(0,this.y-referenz_y);
                                  var r = this.breite;
                                  var u = Math.min(this.y+this.hoehe-referenz_y,referenz_h);
                                  var l = 0;
                                  document.getElementById(referenz).style.clip='rect('+o+'px, '+r+'px, '+u+'px, '+l+'px)';
                                  y += referenz_h+this.abstand;
                                  document.getElementById(referenz).style.visibility = "visible";
                                }
                                else
                                {
                                  document.getElementById(referenz).style.top = '-1200px';
                                }
                                return y;
                              }

        this.start =          function()
                              {
                                this.x = document.getElementById(this.id).offsetLeft;
                                this.y = document.getElementById(this.id).offsetTop;
                                this.zaehler=1;
                                y = this.y-1;
                                for(var i=this.zaehler; i<=this.n; i++)
                                {
                                  document.getElementById(this.id+'_'+i).style.left = this.x+'px';
                                  if(y < this.y+this.hoehe)
                                  {
                                    document.getElementById(this.id+'_'+i).style.top = y+'px';
                                    h = document.getElementById(this.id+'_'+i).offsetHeight;

                                    var o = Math.max(0,this.y-y);
                                    var r = this.breite;
                                    var u = Math.min(this.y+this.hoehe-y,h);
                                    var l = 0;
                                    document.getElementById(this.id+'_'+i).style.clip='rect('+o+'px, '+r+'px, '+u+'px, '+l+'px)';
                                    y += h+this.abstand;
                                    document.getElementById(this.id+'_'+i).style.visibility = "visible";
                                  }
                                  else
                                  {
                                    document.getElementById(this.id+'_'+i).style.top = '-1200px';
                                  }
                                }
                                if(this.stop == true)
                                {
                                  this.stop = false;
                                  this.timer = setTimeout(this.id+'.scroll()',1000);
                                }
                              }

        this.mausover =       function()
                              {
                                this.pausieren();
                              }

        this.mausout =        function()
                              {
                                this.timer = setTimeout(this.id+'.fortsetzen()',this.pause);
                              }

        this.pausieren =      function()
                              {
                                clearTimeout(this.timer);
                                this.stop = true;
                              }

        this.fortsetzen =     function()
                              {
                                if(this.stop == true)
                                {
                                  clearTimeout(this.timer);
                                  this.stop = false;
                                  this.scroll();
                                }
                              }

      }


