window.addEvent('domready', function(){
	var fx = [];
	
	$$('#draggables div').each(function(drag){
		new Drag.Move(drag, {
			droppables: $$('#droppables div')
		});
		
		drag.addEvent('emptydrop', function(){
			this.setStyle('background-color', '#071f79');
		});
	});
	
	$$('#droppables div').each(function(drop, index){
		fx[index] = drop.effects({transition:Fx.Transitions.Back.easeOut});
		drop.addEvents({
			'over': function(el, obj){
				this.setStyle('background-color', '#071f79');
			},
			'leave': function(el, obj){
				this.setStyle('background-color', '#071f79');
			},
			'drop': function(el, obj){
				el.remove();
				fx[index].start({
					'height': this.getStyle('height').toInt() + 30,
					'background-color' : ['#071f79', '#071f79']
				});
			}
		});
	});
	
	
}); 