var isIE = false;
function getXML() {
	if(window.XMLHttpRequest) {
		// real browser
		req = new XMLHttpRequest();
		req.open("GET", "nowplaying.xml", true);
		req.onreadystatechange = processReqChange;
		req.send(null);
	} else {
		// Intersuck Exploder
		isIE = true;
		req = new ActiveXObject("Microsoft.XMLHTTP");
		if(req) {
			req.open("GET", "nowplaying.xml", true);
			req.onreadystatechange = processReqChange;
			req.send();
		}
	}
}
function processReqChange() {
	if(req.readyState == 4) {
		if(req.status == 200) {
			div = document.getElementById("nowPlaying");
			content = req.responseXML.getElementsByTagName("htmlcontent")[0];
			div.innerHTML = "";
			div.innerHTML = content.firstChild.nodeValue;
			timeout = req.responseXML.getElementsByTagName("nextrack")[0];
			milli = timeout.firstChild.nodeValue;
			countDown(milli);
		}
	}
}
function countDown(millisecs) {
	setTimeout(getXML, millisecs);
}
