$("#list2 .drop-container").sortable({
beforeStop: function(event, ui) {
itemContext = ui.item.context;
if (removeIntent == true) {
disp($("#list2").sortable('toArray'));
receive: function(event, ui) {
var this_id = $(ui.item).attr("id");
var preview = $(itemContext).html().replace(/<!--/g, '').replace(/-->/g, '');
$(itemContext).attr("id", this_id);
$(itemContext).css("width", $('#list2').width() - 20).addClass("ui-state-default").height('auto');
$(itemContext).html(preview);
beforeStop: function(event, ui) {
itemContext = ui.item.context;
if (removeIntent == true) {
disp($("#list2").sortable('toArray'));
receive: function(event, ui) {
var this_id = $(ui.item).attr("id");
var preview = $(itemContext).html().replace(/<!--/g, '').replace(/-->/g, '');
$(itemContext).attr("id", this_id);
$(itemContext).css("width", $('#list2').width() - 20).addClass("ui-state-default").height('auto');
$(itemContext).html(preview);
$("#list2 .drop-container").sortable({
beforeStop: function(event, ui) {
itemContext = ui.item.context;
if (removeIntent == true) {
disp($("#list2").sortable('toArray'));
receive: function(event, ui) {
var this_id = $(ui.item).attr("id");
var preview = $(itemContext).html().replace(/<!--/g, '').replace(/-->/g, '');
$(itemContext).attr("id", this_id);
$(itemContext).css("width", $('#list2').width() - 20).addClass("ui-state-default").height('auto');
$(itemContext).html(preview);
$("#list2").bind("sortupdate", function(event, ui) {
var result = $('#list2').sortable('toArray');
for (var i = 0; i < result.length; i++) {
var tmp = "#" + result[i] + " .drop-container";
if ($(this).children("li").length) {
str += $(this).parent()[0].id + "|";
$(this).children("li").each(function() {
for (var i=0;i<list.length;i++){
$( 'input' ).val(a.join('|'));