function comment(morceau)
{
		var xhr=null;

		if (window.XMLHttpRequest) { 
			xhr = new XMLHttpRequest();
		}
		else if (window.ActiveXObject) 
		{
				xhr = new ActiveXObject("Microsoft.XMLHTTP");
		}
		//on définit l'appel de la fonction au retour serveur
		xhr.onreadystatechange = function() { alert_ajax_goto_comment(xhr); };
		
		lien="../../includes/commentaires.php?morceau=".concat(morceau).concat("&v=").concat(Math.random());
		xhr.open("GET", lien, true);
		
		xhr.send(null);
}


function alert_ajax_goto_comment(xhr)
{
    if (xhr.readyState==4) 
    {    	
		if (document.getElementById)
		{
			reponse = xhr.responseText;
			document.getElementById("comment_zone").innerHTML = reponse;
		}
		else if (document.all) 
		{
			reponse = xhr.responseText;
			document.all["comment_zone"].innerHTML = reponse;
		}		
    }
	else {
		var aff = '<br/><br/><center>Chargement <img src="../../img/loader.gif"/></center>';
		if (document.getElementById)
		{
			document.getElementById("comment_zone").innerHTML = aff;
		}
		else if (document.all) 
		{
			document.all["comment_zone"].innerHTML = aff;
		}		
	}
}

function add_comment(morceau,commentaire)
{		
		var xhr=null;

		if (window.XMLHttpRequest) { 
			xhr = new XMLHttpRequest();
		}
		else if (window.ActiveXObject) 
		{
				xhr = new ActiveXObject("Microsoft.XMLHTTP");
		}
		//on définit l'appel de la fonction au retour serveur
		xhr.onreadystatechange = function() { alert_ajax_goto_add_comment(xhr); };
		
		lien="../../includes/comment_ajax.php?v=".concat(Math.random());
		xhr.open("POST", lien, true);
		
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded;charset=UTF-8');
		xhr.send('morceau='+morceau+'&commentaire='+commentaire);		
}

function alert_ajax_goto_add_comment(xhr)
{
    if (xhr.readyState==4) 
    {    	
		if (document.getElementById)
		{
			reponse = xhr.responseText;
			document.getElementById("comment_zone").innerHTML = reponse;
		}
		else if (document.all) 
		{
			reponse = xhr.responseText;
			document.all["comment_zone"].innerHTML = reponse;
		}		
    }
	else {
		var aff = '<br/><br/><center>Chargement <img src="../../img/loader.gif"/></center>';
		if (document.getElementById)
		{
			document.getElementById("comment_zone").innerHTML = aff;
		}
		else if (document.all) 
		{
			document.all["comment_zone"].innerHTML = aff;
		}		
	}
}