(function(b){redux.field_objects=redux.field_objects||{};redux.field_objects.sortable=redux.field_objects.sortable||{};var a="";redux.field_objects.sortable.init=function(c){if(!c){c=b(document).find(".redux-group-tab:visible").find(".redux-container-sortable:visible")}b(c).each(function(){var e=b(this);var d=e;if(!e.hasClass("redux-field-container")){d=e.parents(".redux-field-container:first")}if(d.is(":hidden")){return}if(d.hasClass("redux-field-init")){d.removeClass("redux-field-init")}else{return}e.find(".redux-sortable").sortable({handle:".drag",placeholder:"placeholder",opacity:0.7,scroll:false,out:function(f,g){if(!g.helper){return}if(g.offset.top>0){a="down"}else{a="up"}redux.field_objects.sortable.scrolling(b(this).parents(".redux-field-container:first"))},over:function(f,g){a=""},deactivate:function(f,g){a=""},update:function(f,g){redux_change(b(this))}});e.find(".checkbox_sortable").on("click",function(){if(b(this).is(":checked")){e.find("#"+b(this).attr("rel")).val(1)}else{e.find("#"+b(this).attr("rel")).val("")}})})};redux.field_objects.sortable.scrolling=function(c){if(c===undefined){return}var d=c.find(".redux-sorter");if(a=="up"){d.scrollTop(d.scrollTop()-20);setTimeout(redux.field_objects.sortable.scrolling,50)}else{if(a=="down"){d.scrollTop(d.scrollTop()+20);setTimeout(redux.field_objects.sortable.scrolling,50)}}}})(jQuery);