 /**
*
* NewsTicker JavaScript
* (c) 2007-08 by Michael Loesler - http://derletztekick.com
* LGPL
*
**/

function br()

{

document.write("<br>");

}

function Ticker(id, tagName){

document.getElementById("derletztekick").style.color="green";
document.getElementById("derletztekick").style.fontSize = "14px"; 
document.getElementById("derletztekick").style.fontWeight = 'bold';


	var parEl = null;
	if (!(parEl = document.getElementById(id))) {
		window.alert("Konnte Ticker nicht initialisieren!");
		return;
	}
	var msg = [];
 
	for (var i=0; i<parEl.getElementsByTagName(tagName).length; i++)
		msg.push(parEl.getElementsByTagName(tagName)[i].firstChild.nodeValue);
 
 
	while (parEl.childNodes.length > 0) 
		parEl.removeChild(parEl.childNodes[0]);
 
	parEl.appendChild( document.createTextNode( String.fromCharCode(160) ) );	
 
	this.respell = function(k,i) {
		parEl.firstChild.nodeValue = msg[k].substring(0,i)+"";
		if (i++ == msg[k].length) {
			i = 0;
			window.setTimeout(function() { this.respell(k,i); }, 20000);
			k = (k+1) == msg.length?0:k+1;
		} else
			window.setTimeout(function() { this.respell(k,i); }, 50);
 
	}
	window.respell = this.respell;
	this.respell(0,0);
}

window.onload = function() {
	new Ticker("derletztekick", "li");
}
