jQuery.fn.delay = function(time,func){
	this.each(function(){
		setTimeout(func,time);
	});
	
	return this;
};

$(".ui-fabric-content").draggable({});
$("#dropbox").droppable({
  accept: ".ui-fabric-content",
  drop: function(ev, ui){
	if(!allow_dropbox)
	{
		return false;
	}
	allow_dropbox = false;
  	var fabric_id = $(ui.draggable).attr("id");
  	if(fabric_count<8)
  	{
  		$('#' + fabric_id).hide();
  	}
	$("#dropbox").load('/fabrics/add_fabric/' + fabric_id);
  }
});
