function SimpleTicker(_id,_speed,_separator,_moretext){this.id=_id;this.speed=_speed;this.separator="+++";if(_separator!==undefined){this.separator=_separator}this.moretext="mehr";if(_moretext!==undefined){this.moretext=_moretext}this.xmlHttpObject=false;var that=this;this.startWithURL=function(url){if(typeof XMLHttpRequest!="undefined"){this.xmlHttpObject=new XMLHttpRequest()}if(!this.xmlHttpObject){try{this.xmlHttpObject=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{this.xmlHttpObject=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){this.xmlHttpObject=null}}}this.xmlHttpObject.open("GET",url);this.xmlHttpObject.onreadystatechange=this.handleStateChanged;this.xmlHttpObject.send(null)};this.handleStateChanged=function(){if(that.xmlHttpObject.readyState==4&&that.xmlHttpObject.status==200){that.dataReceived(eval("("+that.xmlHttpObject.responseText+")"))}};this.dataReceived=function(data){var channelName=data[0].channel;var channelLink=data[0].link;var items=data[0].items;var lastTimeoutId;var tickerText="";for(var i=0;i<items.length;i++){if(i==0){tickerText+="<span class='separator'>"+this.separator+"</span>"}tickerText+="<span class='tickerlabel'>";if(items[i].link!=null){tickerText+="<a href='"+items[i].link+"'>"}tickerText+=items[i].label;if(items[i].link!=null){tickerText+="</a>"}tickerText+="</span>";if(items[i].value!=null){tickerText+=": <span class='tickervalue'>"+items[i].value+"</span>"}tickerText+="<span class='separator'>"+this.separator+"</span>"}this.text="<span>"+tickerText+"</span>";if(this.moretext!="ignore"){this.text+=" <p class='tickermore'><a href='"+channelLink+"'>"+this.moretext+"</a></p>"}this.getTickerElement().innerHTML=this.text;this.ticken()};this.start=function(){var element=this.getTickerElement();this.text="<span>"+element.innerHTML+"</span>";element.innerHTML=this.text;this.ticken()};this.ticken=function(){var element=this.getTickerElement();var content=String(element.firstChild.innerHTML);var isTag=false;var isTxt=false;for(var i=0;i<content.length;++i){if(content.charAt(i)==">"){isTag=false;continue}if(content.charAt(i)=="<"){isTag=true;continue}if(!isTag){element.firstChild.innerHTML=content.substring(0,i)+content.substring(i+1,content.length);isTxt=true;break}}if(!isTxt){element.innerHTML=this.text}lastTimeoutId=setTimeout("ticker"+this.id+".ticken()",this.speed)};this.pause=function(){if(lastTimeoutId!==undefined){clearTimeout(lastTimeoutId)}};this.play=function(){this.ticken()};this.getTickerElement=function(){return document.getElementById("ticker"+this.id)}};
