function ajoutAlerteReponse(id_membre, id_question){
	$('question'+id_question).innerhtml = "<img src=\"/images/ajax-petit.gif\" />";
	var url = '/ajax/ajoutAlerteReponse.php';
	var myAjax = new Ajax.Request(
      url,
      {
        method: 'post',
        postBody: 'id_membre=' + id_membre + '&id_question=' + id_question,
        onComplete: function (xhr){
		        		if (xhr.status == 200)
					    {
					        $('question'+id_question).innerHTML = xhr.responseText;
					    }
		        	}
      });	
}

function supprimerAlerteReponse(id_membre, id_question){
	$('question'+id_question).innerhtml = "<img src=\"/images/ajax-petit.gif\" />";
	var url = '/ajax/supprimerAlerteReponse.php';
	var myAjax = new Ajax.Request(
      url,
      {
        method: 'post',
        postBody: 'id_membre=' + id_membre + '&id_question=' + id_question,
        onComplete: function(xhr){
        				if (xhr.status == 200)
					    {
					        $('question'+id_question).innerHTML = xhr.responseText;
					    }
        			}
      });
}

function supprimerAlerteDocument(id_alerte_document){
	if (window.confirm("Êtes-vous sûr de vouloir le supprimer ?")){
		var url = '/ajax/supprimerAlerteDocument.php';
		var myAjax = new Ajax.Request(
	      url,
	      {
	        method: 'post',
	        postBody: 'id_alerte_document=' + id_alerte_document,
	        onComplete: function(xhr){
	        				if (xhr.status == 200)
						    {
						        //$('question'+id_question).innerHTML = xhr.responseText;
						        if (xhr.responseText=="OK"){
						        	$('alerte_doc_'+id_alerte_document).style.display = "none";
						        }else{
						        	alert("Erreur dans la suppression.");
						        }
						    }
	        			}
	      });
	}else{
		return 0;
	}
}

function supprimerAlerteQuestion(id_alerte_question){
	if (window.confirm("Êtes-vous sûr de vouloir le supprimer ?")){
		var url = '/ajax/supprimerAlerteQuestion.php';
		var myAjax = new Ajax.Request(
	      url,
	      {
	        method: 'post',
	        postBody: 'id_alerte_question=' + id_alerte_question,
	        onComplete: function(xhr){
	        				if (xhr.status == 200)
						    {
						        //$('question'+id_question).innerHTML = xhr.responseText;
						        if (xhr.responseText=="OK"){
						        	$('alerte_question_'+id_alerte_question).style.display = "none";
						        }else{
						        	alert("Erreur dans la suppression.");
						        }
						    }
	        			}
	      });
	}else{
		return 0;
	}
}

function showAttente(){
	Dialog.alert($('zone_attente').innerHTML, {
		className:"alphacube", 
		width:400,
		okLabel: "Fermer"
	}); 
}

function showAlerte(){
	Dialog.alert($('zone_alerte').innerHTML, {
		className:"alphacube", 
		width:400,
		okLabel: "Fermer"
	}); 
}
