/*DOM XML ticker-Dynamic Drive(www.dynamicdrive.com)For full source code, and Terms Of Use, visit http://www.dynamicdrive.com*/
var tc='<div id="container" style="width:180px;height:100px;font:normal 13px Verdana;color:#777;"></div>'
var xmlsource="ticker.xml"
if (window.ActiveXObject)
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
else if (document.implementation && document.implementation.createDocument)
var xmlDoc= document.implementation.createDocument("","doc",null);
if (typeof xmlDoc!="undefined"){
document.write(tc)
xmlDoc.load(xmlsource)
var nts = /\S/
function init_ticker(){
tickerobj=xmlDoc.getElementsByTagName("xmlticker")[0]
for (i=0;i<tickerobj.childNodes.length;i++){
if ((tickerobj.childNodes[i].nodeType == 3)&&(!nts.test(tickerobj.childNodes[i].nodeValue))) {
tickerobj.removeChild(tickerobj.childNodes[i])
i--}
}
document.getElementById("container").innerHTML=tickerobj.childNodes[1].firstChild.nodeValue
msglength=tickerobj.childNodes.length
currentmsg=2
themessage=''
setInterval("rotatemsg()",tickerobj.childNodes[0].firstChild.nodeValue)
}}
function rotatemsg(){
var msgsobj=tickerobj.childNodes[currentmsg]
if (msgsobj.getAttribute("url")!=null){
themessage='<a href="'+msgsobj.getAttribute("url")+'"'
if (msgsobj.getAttribute("target")!=null)
themessage+=' target="'+msgsobj.getAttribute("target")+'"'
themessage+='>'
}
themessage+=msgsobj.firstChild.nodeValue
if (msgsobj.getAttribute("url")!=null)
themessage+='</a>'

document.getElementById("container").innerHTML=themessage
currentmsg=(currentmsg<msglength-1)? currentmsg+1 : 1
themessage=''
}

function fetchxml(){
if (xmlDoc.readyState==4)
init_ticker()
else
setTimeout("fetchxml()",10)
}

if (window.ActiveXObject)
fetchxml()
else if (typeof xmlDoc!="undefined")
xmlDoc.onload=init_ticker

