updateComment = function (id) {
	alert('commentaire enregistre !');
	window.location = window.location;	
}

initComment = function () {
	var comment = $$('.comment');
	if (comment)
		comment.each (function (el, i) {
		el.style.cursor = 'pointer';
		el.addEvent('click', function (e) {
			var id = this.id.toString().substr(7, 2);
			var text = $('comment' + id).value;
			var elid = this.id;
			var req = new Request({
                	method: 'post',
			url : 'ajax/save_comment.php',
               		onComplete : function (reponse) {
	                       	if (reponse != -1)
                        	    updateComment(elid);
                        	}                       	
	                }).send('id=' + id + '&text=' + text);		
		});
	});
}

aFunctions.push(initComment);

