
function GetUserPanel(){
	$("#invitation").toggle("slow");
}



$(function() {
		$("#close").click(function(){
			$("#aide").hide({queue:false,duration:500});
			$.post("perso/mAide.php");
		});
		
		
	
		$(".case").click(function(){
		
		var ttt = "";
		if ($("#r01").val()){
		ttt = ttt + "1" ;
		}else{
		ttt = ttt + "0" ;
		}
				
		if ($("#r02").val()){
		ttt = ttt + "1" ;
		}else{
		ttt = ttt + "0" ;
		}	
		if ($("#r03").val()){
		ttt = ttt + "1" ;
		}else{
		ttt = ttt + "0" ;
		}		
		if ($("#r04").val()){
		ttt = ttt + "1" ;
		}else{
		ttt = ttt + "0" ;
		}		
		if ($("#r05").val()){
		ttt = ttt + "1" ;
		}else{
		ttt = ttt + "0" ;
		}			
		if ($("#r06").val()){
		ttt = ttt + "1" ;
		}else{
		ttt = ttt + "0" ;
		}		
		if ($("#r07").val()){
		ttt = ttt + "1" ;
		}else{
		ttt = ttt + "0" ;
		}		
		if ($("#r08").val()){
		ttt = ttt + "1" ;
		}else{
		ttt = ttt + "0" ;
		}		
		if ($("#r09").val()){
		ttt = ttt + "1" ;
		}else{
		ttt = ttt + "0" ;
		}		
		if ($("#r10").val()){
		ttt = ttt + "1" ;
		}else{
		ttt = ttt + "0" ;
		}		
		if ($("#r11").val()){
		ttt = ttt + "1" ;
		}else{
		ttt = ttt + "0" ;
		}		
		if ($("#r12").val()){
		ttt = ttt + "1" ;
		}else{
		ttt = ttt + "0" ;
		}	
		if ($("#r13").val()){
		ttt = ttt + "1" ;
		}else{
		ttt = ttt + "0" ;
		}	
		if ($("#r14").val()){
		ttt = ttt + "1" ;
		}else{
		ttt = ttt + "0" ;
		}				
			$("#strrights").val(ttt);
		
		});
	
		$("#nposition").click(function() {
			var pppp = $("#nposition").val();
			
			if (pppp == 1 ) {
				$("#aideCompte").replaceWith("<div id=\"aideCompte\">Le compte <b>Invité</b> :<br><br>Permet d'associer des utilisateurs externes au projet. Ils pourront visualiser les tâches et commentaires mais ne pourront rien éditer ou créer.</div>");
			}else if (pppp == 2 ){
				$("#aideCompte").replaceWith("<div id=\"aideCompte\">Le compte <b>Officiel</b> : <br><br>Ce profil est le premier niveau de participation active. L'utilisateur ne peut éditer ou créer de tâches mais il peut ajouter des commentaires sur les tâches.</div>");
			}else if (pppp == 3 ){
				$("#aideCompte").replaceWith("<div id=\"aideCompte\">Le compte <b>Membre</b> :<br><br>Compte utilisateur actif standard habilité à créer des tâches et des commentaires. Il ne peut éditer en revanche que les tâches qu'il a lui-même créer.</div>");
			}else if (pppp == 4 ){
				$("#aideCompte").replaceWith("<div id=\"aideCompte\">Le compte <b>Modérateur</b> :<br><br>Coordinateur de l'activité, le modérateur peut tout voir, tout éditer, faire évoluer le statut des tâches...</div>");
			}else if (pppp == 5 ){
				$("#aideCompte").replaceWith("<div id=\"aideCompte\">Le compte <b>Responsable</b> :<br><br> Peut tout faire, notamment éditer les infos sur le projets lui-même, changer le statut du projet, etc...</div>");
			}

			
		});
		
		$("#level").click(function() {
			var pppp = $("#level").val();
			
			if (pppp == 1 ) {
				$("#aideCompte").replaceWith("<div id=\"aideCompte\">Le profil <b>Invité</b> :<br><br>Ne voit que les tâches \"publiques\" du projet auquel il est associé. Il ne voit rien d'autre et ne peut rien éditer.</div>");
			}else if (pppp == 2 ){
				$("#aideCompte").replaceWith("<div id=\"aideCompte\">Le profil <b>Participant</b> : <br><br>Il peut créer ses propres tâches et voir les autres, \"publiques\" ou \"internes\", du projet auquel il est associé.</div>");
			}else if (pppp == 3 ){
				$("#aideCompte").replaceWith("<div id=\"aideCompte\">Le compte <b>Chef de projet</b> :<br><br>En tant que responsable projet, ce profil peut gérer le statut des tâches et créer ses propres projets.</div>");
			}else if (pppp == 4 ){
				$("#aideCompte").replaceWith("<div id=\"aideCompte\">Le compte <b>Administrateur</b> :<br><br>Profil non limité, l'administrateur peut tout faire, en création et en suppression.</div>");
			}

			
		});
		
		
		$("#c_affichageAide").click(function() {
		var tata = $("#c_affichageAide").attr("checked")?1:0;
			if (tata == 1) {
			$("#affichageAide").val("1");		
			}else{
			$("#affichageAide").val("0");
			}
		
		});
		
		
});
