function createAjaxObj(){var httprequest=false
if(window.XMLHttpRequest){httprequest=new XMLHttpRequest()
if(httprequest.overrideMimeType)
httprequest.overrideMimeType('text/xml')}
else if(window.ActiveXObject){try{httprequest=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{httprequest=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e){}}}
return httprequest}
function rss_ticker(RSS_id,cachetime,divId,divClass,delay,optionalswitch){this.RSS_id=RSS_id
this.cachetime=cachetime
this.tickerid=divId
this.delay=delay
this.logicswitch=(typeof optionalswitch!="undefined")?optionalswitch:-1
this.mouseoverBol=0
this.pointer=0
this.ajaxobj=createAjaxObj()
document.write('<div id="'+divId+'" class="'+divClass+'">Initializing ticker...</div>')
this.getAjaxcontent()}
rss_ticker.prototype.getAjaxcontent=function(){if(this.ajaxobj){var instanceOfTicker=this
var parameters="id="+encodeURIComponent(this.RSS_id)+"&cachetime="+this.cachetime+"&bustcache="+new Date().getTime()
this.ajaxobj.onreadystatechange=function(){instanceOfTicker.initialize()}
this.ajaxobj.open('GET',"rssfetch.php?"+parameters,true)
this.ajaxobj.send(null)}}
rss_ticker.prototype.initialize=function(){if(this.ajaxobj.readyState==4){if(this.ajaxobj.status==200){var xmldata=this.ajaxobj.responseXML
if(xmldata.getElementsByTagName("item").length==0){document.getElementById(this.tickerid).innerHTML="<b>Error</b> fetching remote RSS feed!<br />"+this.ajaxobj.responseText
return}
var instanceOfTicker=this
this.feeditems=xmldata.getElementsByTagName("item")
for(var i=0;i<this.feeditems.length;i++){this.feeditems[i].setAttribute("ctitle",this.feeditems[i].getElementsByTagName("title")[0].firstChild.nodeValue)
this.feeditems[i].setAttribute("clink",this.feeditems[i].getElementsByTagName("link")[0].firstChild.nodeValue)
this.feeditems[i].setAttribute("cdescription",this.feeditems[i].getElementsByTagName("description")[0].firstChild.nodeValue)}
document.getElementById(this.tickerid).onmouseover=function(){instanceOfTicker.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){instanceOfTicker.mouseoverBol=0}
this.rotatemsg()}}}
rss_ticker.prototype.rotatemsg=function(){var instanceOfTicker=this
if(this.mouseoverBol==1)
setTimeout(function(){instanceOfTicker.rotatemsg()},100)
else{var tickerDiv=document.getElementById(this.tickerid)
var tickercontent='<a href="'+this.feeditems[this.pointer].getAttribute("clink")+'">'+this.feeditems[this.pointer].getAttribute("ctitle")+'</a>'
if(this.logicswitch=="showdescription")
tickercontent+="<br />"+this.feeditems[this.pointer].getAttribute("cdescription")
tickerDiv.innerHTML=tickercontent
this.pointer=(this.pointer<this.feeditems.length-1)?this.pointer+1:0
setTimeout(function(){instanceOfTicker.rotatemsg()},this.delay)}}
