function overBox() {
	var move_droit = true;
	var move_bas = true;

	var depleft;
	var depvert;
	var sxzone = $(this).parent().width();
	var syzone = $(this).parent().height();
	
	var arrdeplacement = new Array();
	var arrboitecour = new Array();
	var arrtaille = new Array();
	var idboite = $(this).attr('id');
	$.each(arrboites, function() {
		if(this['id'] == idboite) {
			arrboitecour = this;
		}
	});
	
	// Étape 1 - Déterminer l'animation de la boîte courante
	if((arrboitecour['x'] + arrboitecour['sx'] )+taille > sxzone) {
		move_droit = false;
	}
	
	if((arrboitecour['y'] + arrboitecour['sy'] )+taille > syzone) {
		move_bas = false;
	}
	
	arrtaille['id'] = arrboitecour['id'];
	arrtaille['sx'] = arrboitecour['sx'] + taille;
	arrtaille['sy'] = arrboitecour['sy'] + taille;
	arrtaille['x'] = arrboitecour['x'];
	arrtaille['y'] = arrboitecour['y'];
	if(!move_droit){
		arrtaille['x'] = arrboitecour['x'] - taille;
	}
	if(!move_bas){
		arrtaille['y'] = arrboitecour['y'] - taille;
	}
	$(this).css('z-index',100);
	arrdeplacement.push(arrtaille);
	
	
	$.each(arrboites, function()  {
		var bolanim = false;
		var boldataanim = false;
		var arrmove = new Array();
		var nx = this['x'];
		var ny = this['y'];
		var nsx = this['sx'];
		var nsy = this['sy'];
		if(idboite != this['id']) {
			// Détection des contacts
			if ((arrtaille['x'] <= (this['x'] + this['sx']) && this['x'] <= (arrtaille['sx'] + arrtaille['x'])) && (arrtaille['y']  <= (this['y'] + this['sy']) && this['y'] <= (arrtaille['sy'] + arrtaille['y']))) {
				bolanim = true;
				if(move_droit) {
					if(((arrtaille['x'] + arrtaille['sx']) - taille) < this['x']) {
						boldataanim = true;
						if(this['sx'] < taille) {
							// Déplacement à droite
							nx+= taille;
						}
						else {
							// Compression à droite
							nx+= taille;
							nsx-= taille;
						}
					}
				}
				else {
					if((arrtaille['x'] + taille) > (this['x'] + this['sx'])) {
					boldataanim = true;
						if(this['sx'] < taille) {
							// Déplacement à gauche
							nx-= taille;
						}
						else {
							// Compression à gauche
							nsx-= taille;
						}
					}				
				}
				if(!boldataanim) {
					if(move_bas) {
						if(((arrtaille['y'] + arrtaille['sy']) - taille) < this['y']) {
							if(this['sy'] < taille) {
								// Déplacement  en bas
								ny+= taille;
							}
							else {
								// Compression en bas
								ny+= taille;
								nsy-= taille;
							}
						}				
					}
					else {
						if((arrtaille['y'] + taille) > (this['y'] + this['sy'])) {
							if(this['sy'] < taille) {
								// Déplacement  en haut
								ny-= taille;
							}
							else {
								// Compression en haut
								nsy-= taille;
							}					
							
						}					
					}
				}
			}
		}
		
		if(bolanim) {
			arrmove['id'] = this['id'];
			arrmove['x'] = nx;
			arrmove['y'] = ny;
			arrmove['sx'] = nsx;
			arrmove['sy'] = nsy;		
			arrdeplacement.push(arrmove);
		}
	});
	/*
	 * Détection de ceux qui s'empilent!
	 *
	 */
	$.each(arrdeplacement, function()  {
		var refid = this['id'];  
		var refy = this['y'];
		var refx = this['x'];
		var refsx = this['sx'];
		var refsy = this['sy'];
		var typedep = null;
		if(idboite != refid) {
			$.each(arrboites, function()  { 
				if(refid == this['id']) {
					if(refx < this['x']) {
						typedep= 'xg';
					}
					else if(refy < this['y']) {
						typedep= 'yh';
					}				
					else if(refx > this['x']) {
						typedep= 'xd';
					}
					else if(refy > this['y']) {
						typedep= 'yb';
					}
				}
			});
			$.each(arrboites, function()  { 
				var arrmove = new Array();
				var nx = this['x'];
				var ny = this['y'];
				var nsx = this['sx'];
				var nsy = this['sy'];			
				if(refid != this['id']) {
					if(refx <= (this['x'] +this['sx']) && refx >= this['x'] ) {
						if((refy <= (this['y'] +this['sy']) && refy >= this['y']) || ((refy + refsy) <= (this['y'] +this['sy']) && (refy + refsy) >= this['y']))  {
							/*Déterminer le sens du mouvemment à affecter*/
							switch(typedep) {
								case 'xg':
									nsx-= taille;
									break;
								case 'yh':
									nsy-= taille;
									break;
								case 'xd':
									nsx-= taille;
									nx+= taille;
									break;
								case 'yb':
									nsy-= taille;
									ny+= taille;
									break;
							}
							arrmove['id'] = this['id'];
							arrmove['x'] = nx;
							arrmove['y'] = ny;
							arrmove['sx'] = nsx;
							arrmove['sy'] = nsy;		
							arrdeplacement.push(arrmove);
						}
					}
				}
			}); 
		}
	});




	
	$.each(arrdeplacement, function()  {
		$('#' + this['id']).animate({
			top: this['y'],
			left: this['x'],
			width: this['sx'],
			height: this['sy']
		},delai);
	});
	
}		
function outBox() {
	$('a:animated').stop(true);
	$.each(arrboites, function()  {
		$('#' + this['id']).animate({
			top: this['y'],
			left: this['x'],
			width: this['sx'],
			height: this['sy']
		},delai);
	});
	$(this).css('z-index',10);
}