function gotoPage(p,o,i)
{
	//alert('ok');
		var param = no_cache();
		xhr_object = AjaxObject();
		xhr_object.open('GET', 'http://annuaire.durable.com/ajax/ajax_commentaires.php?h=r&p=' + p + '&o=' + o + '&i=' + i + '&nocache=' + param, false);
		xhr_object.send(null);

		var reponse = xhr_object.responseText;
		
		document.getElementById('comments_content').innerHTML = reponse;
		
}

function delComment(p,o,i,d,ob)
{
		var param = no_cache();
		xhr_object = AjaxObject();
		xhr_object.open('GET', 'http://annuaire.durable.com/ajax/ajax_commentaires.php?h=r&p=' + p + '&o=' + o + '&i=' + i + '&del=' + d + '&object=' + ob + '&nocache=' + param, false);
		xhr_object.send(null);	
		
		var reponse = xhr_object.responseText;
		
		document.getElementById('comments_content').innerHTML = reponse;
		

		
}

function addComment(o,i,ong)
{
		prenom_com = document.getElementById('prenom').value;
		if(prenom_com=="" || prenom_com=="Votre nom")
		{
			alert('Vous devez indiquer votre nom !');
			return false;	
		}
		
		comment = document.getElementById('commentaire').value;
		if(comment=="" || comment=="Ecrire votre commentaire")
		{
			alert('Vous devez ecrire un commentaire !');
			return false;	
		}
		var param = no_cache();
		xhr_object = AjaxObject();
		
		xhr_object.open('POST', 'http://annuaire.durable.com/ajax/ajax_commentaires.php?nocache=' + param, false);
		xhr_object.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xhr_object.send('o=' + o + '&i=' + i + '&comment=' + comment+'&ong='+ong+'&prenom='+prenom_com);	
		var reponse = xhr_object.responseText;
		
		document.getElementById('comments_content').innerHTML = reponse;
		if(document.getElementById('nb_com').value>1)
		{
			document.getElementById('nb_comments').innerHTML = '(' + document.getElementById('nb_com').value + ' commentaires)';
			document.getElementById('nb_comments_haut').innerHTML = '(' + document.getElementById('nb_com').value + ' commentaires)';
		}
		else
		{
			document.getElementById('nb_comments').innerHTML = '(' + document.getElementById('nb_com').value + ' commentaire)';
			document.getElementById('nb_comments_haut').innerHTML = '(' + document.getElementById('nb_com').value + ' commentaire)';
		}		
}

function answerComment(id)
{
	document.getElementById('add_comment').value = "[rep] " + document.getElementById("cont"+id).value + " [/rep]";	
}