$(document).ready(
	function()
	{
		$('.photoDrop').Draggable(
			{
				zIndex: 	1000,
				ghosting:	false,
				opacity: 	0.5,
				revert:		true
			}
		);
		$('.photo').Droppable(
			{
				accept :	'photoDrop',
				hoverclass:	'hover',
				tolerance:	'pointer',
				ondrop:	function (drag){
				    array = drag.id.split(";");
				    id = array[0];
				    place = array[1];
				    url = array[2];
				    //alert('place : '+place + ' ; id : '+ id+' ; url : '+url+' ; this.id : '+this.id);
					if(place!=this.id){
						window.location.replace('index.php?page='+url+'&action=place&id='+id+'&place='+this.id);
					}
					},
				fit: true
			}
		);
	}
);

function verif_press(textarea,max,count) // vérifie que le nombre maxi n'a pas été atteint pendant que l'utilisateur reste appuyé sur la touche
{
if (textarea.value.length > max -1){ //s'il dépasse la taille requise, on sort
return false;
}
else { 
count.value = textarea.value.length +1 ; 
return true;
}
}

function verif_change(textarea,max) 
{
if (textarea.value.length > max ){ 
alert('Vous ne pouvez rentrer que '+ max +' caractères maximum pour ce champs');
return false;
}
else return true; 
}

function show_nb_car(textarea,count)
{
count.value = textarea.value.length;
return true;
} 
