function loadXMLDoc(url)
{
	var xmlhttp;
	var status,x,xx,i, artist, song;
	if (window.XMLHttpRequest)
	{// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp = new XMLHttpRequest();
	}
	else
	{// code for IE6, IE5
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange = function()
	{
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
		{
			status = xmlhttp.responseXML.getElementsByTagName("now_playing")[0].getAttribute("playing");
			if (status == 1)
			{
				x = xmlhttp.responseXML.documentElement.getElementsByTagName("song");

				for (i=0; i<x.length; i++)
				{
					//txt=txt + "<tr>";
					xx=x[i].getElementsByTagName("artist");
					artist=xx[0].firstChild.nodeValue;
					xx=x[i].getElementsByTagName("title");
					song=xx[0].firstChild.nodeValue;
				}
				
				document.getElementById('nowplaying').innerHTML = "&#9835; " + artist + " - " + song + " &#9835;";

			}

		  else
		  {
		  	document.getElementById('nowplaying').innerHTML = "Mon iTunes n'est pas ouvert en ce moment.";
		  }
		  }
		}


		xmlhttp.open("GET",url,true);
		xmlhttp.send();
	}
