function NewsTicker(objectName,id){
	this.objectName = objectName;
	this.el = document.getElementById(id);
	this.links = new Array();
	this.index = 0;
	this.character = 0;
	this.currentLink = false;
	this.prefix = "Weitere News: ";
}
NewsTicker.prototype.el;
NewsTicker.prototype.index;
NewsTicker.prototype.links;
NewsTicker.prototype.objectName;
NewsTicker.prototype.currentLink;
NewsTicker.prototype.prefix;
NewsTicker.prototype.character;
NewsTicker.prototype.add = function(href,body){
	a = document.createElement("A");
	a.href = href;
	a.innerHTML = body;
	this.links[this.links.length] = a;
}
NewsTicker.prototype.run = function(){
	if(this.links.length > 0){
		if(this.currentLink != false)this.el.removeChild(this.currentLink);
		this.currentLink = this.links[this.index].cloneNode(true);
		this.currentLink.innerHTML = this.prefix;
		this.el.appendChild(this.currentLink);
		this.type();
	}
}
NewsTicker.prototype.write = function(c){
	this.currentLink.innerHTML += c;
}
NewsTicker.prototype.overwrite = function(c){
	this.currentLink.innerHTML = this.currentLink.innerHTML.substr(0,this.currentLink.innerHTML.length-1)+c;
}
NewsTicker.prototype.type = function(){
	setTimeout(this.objectName+".write('_');",13);
	setTimeout(this.objectName+".overwrite('-');",25);
	setTimeout(this.objectName+".overwrite('"+this.links[this.index].innerHTML.replace("&amp;", "&").charAt(this.character).replace("'","&#039;").replace(" ", "&nbsp;")+"');",38);
	this.character++;
	if(this.character < this.links[this.index].innerHTML.length)
		setTimeout(this.objectName+".type()",50);
	else{
		this.character = 0;
		this.index++;
		if(this.index > (this.links.length-1))
			this.index = 0;
		setTimeout(this.objectName+".run()",2500);
	}
}

