function comments() {
	if($('loading')) {
		// Icone de chargement
		document.getElementById('loading').style.visibility='hidden';	// Cache l'icone de chargement
		// Emplacement des commentaires
		comments = new fx.Height('commentsfull');
		comments.toggle();
		
		// Action du lien
		$('showcommentsfull').onclick = function() {
			show();
			return false;
		};
	}
}

function show() {
	document.getElementById('loading').style.visibility='visible';	// Affiche l'icone de chargement
	
	$('showcommentsfull').onclick = function() {
		hide();
		return false;
	};
	
	// Détermine l'auteur du mini-site et la page
	var path=window.location.pathname.split('/');
	if(path.length<3 || path[2]=='') path[2]=1;
	else {	
		var reg = RegExp("^page(.*).html$");
		path[2] = path[2].replace(reg,'$1');
	}
	
	new ajax('../../sites/mini_sites/ajax/getcomments.php', {postBody: 'membre='+path[1]+'&page='+path[2], update: $('commentsfull'), onComplete: showHideIt});	// Réception des données
}

function hide() {
	showHideIt();
	$('showcommentsfull').onclick = function() {
		show();
		return false;
	};
}

function showHideIt(request){
	document.getElementById('loading').style.visibility='hidden';	// Cache l'icone de chargement
	
	setTimeout("comments.toggle()",3);
	if(typeof(admin)=='function') admin();
	
	// Change le texte du lien
	if($('showcommentsfull').innerHTML.search('Voir')!=-1) $('showcommentsfull').innerHTML=$('showcommentsfull').innerHTML.replace('Voir','Cacher');
	else $('showcommentsfull').innerHTML=$('showcommentsfull').innerHTML.replace('Cacher','Voir');
}
