var Ticker = {
  text: '',
  start: 0,
  stop: 0,
  speed: 120,
  width: 0,
		
  go: function()
  {
	test = "Ich habe ein Auto.";
	/*alert(test.replace(/ /, '+'));*/
	var a   = this.go.arguments;
	
	if(a.length >= 4)
	{
	  this.width = a[3];
	}
	
    this.text = this.initText(a[1]);
	
	this.stop = this.text.length;
	
	if(a.length >= 3)
	{
	  this.speed = a[2];
	}
	
	var obj = this.findObj(a[0]);
	obj.value = "" + this.text.substring(this.start, this.stop) + " " + this.text.substring(0, this.start);
	this.start++;
	
	if(this.start >= this.stop)
	{
	  this.start = 0;
	}
	setTimeout("Ticker.go('"+a[0]+"', '"+this.text+"', '"+this.speed+"', 0)", this.speed);
  },

  findObj: function(element)
  {
    return document.getElementById(element);
  },
  
  initText: function(text)
  {
    for(i=0; i < (this.width - text.length); i++)
	{
      text += " ";	
	}
    return text;
  }
}