var xmlhttp=false;

/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/

if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
  xmlhttp = new XMLHttpRequest();
}

var timer = 4000; 

function update()
{
	xmlhttp.open("GET", "songtitel.php?random="+Math.round(9000*Math.random()),true);//method, target, async (set always true!)

	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4) {
			document.getElementById('play').innerHTML = xmlhttp.responseText;
		}
	}

	xmlhttp.send(null);
	timer = 3000;
	counter();
}

function counter()
{
	if(timer == 0)
	{
		update();
	}
	else
	{
		timer = timer - 3000;
		setTimeout("counter()", 3000);
	}
}
