/*
DOM XML ticker- © Dynamic Drive (www.dynamicdrive.com)
For full source code, 100's more DHTML scripts, and Terms Of Use, visit http://www.dynamicdrive.com
Credit MUST stay intact
*/


////No need to edit beyond here////////////

var wq_ticker_content;

function init_ticker(){
//Cache "messages" element of xml file
tickerobj=xmlDoc.getElementsByTagName("xmlticker")[0]

//REMOVE white spaces in XML file. Intended mainly for NS6/Mozilla
for (i=0;i<tickerobj.childNodes.length;i++){
	if ((tickerobj.childNodes[i].nodeType == 3)&&(!notWhitespace.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=1
//setInterval("rotatemsg()",tickerobj.childNodes[0].firstChild.nodeValue)
//setInterval("displaymsg()",tickerobj.childNodes[0].firstChild.nodeValue)
//displaymsg()
wq_ticker_content = displaymsg();

}

function displaymsg(){
	themessage=tickerobj.childNodes[1].firstChild.nodeValue
	if (tickerobj.childNodes.length >1){
	  for (i=2;i<tickerobj.childNodes.length;i++) {
		msgsobj= tickerobj.childNodes[i]
		themessage += '... '
		//themessage +=msgsobj.firstChild.nodeValue
		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("tips_ticker").innerHTML= themessage
	 return themessage
	}
}


/*
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>'

//display in DIV:
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)
}

