function currentsong(){
startcs();
if (document.all||document.getElementById)
setInterval("startcs()",15000)       //Refresh iedere 15 seconden
}

function startcs(){
	xmlHttp = GetXmlHttpObjectcs();
	getCurrentSong();
}	

function GetXmlHttpObjectcs(){ 
	var objXMLHttp;
	if (window.XMLHttpRequest)
	{
		objXMLHttp=new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	return objXMLHttp;
}

function getCurrentSong(){
	var url = "/scripts/currentsong.php";
	url += "?bustCache=" + Math.random(); 
	xmlHttp.open("GET",url,true);
	xmlHttp.onreadystatechange=stateChangedcs;
	xmlHttp.send(null);
}

function stateChangedcs() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
		document.getElementById("currentsong").innerHTML=xmlHttp.responseText;
	} 
}

currentsong();
