/* Code écrit par Jean-Baptiste Dominguez */

			// !
			// !
			// !
			// Mise à disposition de cocaine dans le clan !
			// !
			// !
			// !
			
			function mise_a_dispo(action,i){
				if(action=="up"){
					$("#loading_page_centrale").ajaxStart(function(){
						$('#loading_page_centrale').show();
					});
					$.ajax({
						url: "jeux/clan/verif/cocaine_up.php",
						cache: false,  
						type: "GET",
						success: function (msg){
								if(msg==9998){
									$('#loading_page_centrale').fadeOut();
									$('.message_placement_homme').slideDown("fast");
									$('#fermer_message_placement_homme_de_main').fadeIn("slow");
									$('#message_placement_homme_de_main').html('Le Clan n\'a plus de cocaine en Stock !');
								}
								else if(msg==9999){
									$('#loading_page_centrale').fadeOut();
									$('.message_placement_homme').slideDown("fast");
									$('#fermer_message_placement_homme_de_main').fadeIn("slow");
									$('#message_placement_homme_de_main').html('Tu ne peux pas d&eacute;passer la limite que les admins t\'ont impos&eacute; !');
								}
								else{
									$('#modif_mise_a_dispo_'+i).fadeOut("slow");
									$('#modif_mise_a_dispo_'+i).html(msg);
									$('#modif_mise_a_dispo_'+i).fadeIn("slow");
									$('#loading_page_centrale').fadeOut();
									$.ajax({
										url: "jeux/mise_a_jour/mise_a_jour_cocaine.php",
										cache: false,  
										type: "GET",
										success: function (msg_1){
											$("#mise_a_jour_cocaine").html(msg_1);
										},
										error: function(){
										alert('erreur');
										}
									});	
								}
							
						},
						error: function(){
						alert('erreur');
						}
					});				
				}
				else if(action=="down"){
					$("#loading_page_centrale").ajaxStart(function(){
						$('#loading_page_centrale').show();
					});
					$.ajax({
						url: "jeux/clan/verif/cocaine_down.php",
						cache: false,  
						type: "GET",
						success: function (msg){
							$('#modif_mise_a_dispo_'+i).fadeOut("slow");
							$('#modif_mise_a_dispo_'+i).html(msg);
							$('#modif_mise_a_dispo_'+i).fadeIn("slow");
							$('#loading_page_centrale').fadeOut();
							$.ajax({
								url: "jeux/mise_a_jour/mise_a_jour_cocaine.php",
								cache: false,  
								type: "GET",
								success: function (msg_2){
									$("#mise_a_jour_cocaine").html(msg_2);
								},
								error: function(){
									alert('erreur');
								}
							});	
						},
						error: function(){
						alert('erreur');
						}
					});	
				}
			}
			
				
