/* Diverses fonctions JS */

function checkMessages(id_membre)
{
	
	// requete
	$.get("ajax/check_message.php?id="+id_membre,function(datax)
		{
			if(datax!=0)
			{
				$('#fenetre_modale').jqm({ajax: 'ajax/new_message.php?id='+id_membre, overlay: '70', ajaxText: '<div style=\"width:100%; padding-top:80px;padding-bottom:80px;text-align:center\" align=\"center\"><img src=\"images_base/loader.gif\" alt=\"Chargement !\" />' });
				$('#fenetre_modale').jqmShow();
			}
			
		});
		
}

function oubli_pass()
{
	var identifiant=document.getElementById("id_oublipass_identifiant").value;
	var email=document.getElementById("id_oublipass_email").value;
	
	$.get("ajax/oubli_mot_de_passe.php?identifiant="+identifiant+"&email="+email,function(datax)
		{


			$('#fenetre_modale').html(datax);
		});
	
}

// mise à jour du lastlog
function update_lastlog(id)
{
	$.get("ajax/ajax_update_lastlog.php?id="+id,function(data)
		{
		});
}

$(function(){

				$('#cropbox').Jcrop({
					aspectRatio: 1,
					onSelect: updateCoords
				});

			});

			function updateCoords(c)
			{
				$('#x').val(c.x);
				$('#y').val(c.y);
				$('#w').val(c.w);
				$('#h').val(c.h);
			};

			function checkCoords()
			{
				if (parseInt($('#x').val())) return true;
				alert('Dessine la zone a recadrer d\'abord !');
				return false;
			};