/* sortable_list.js (77%) */
$(document).ready(function(){$(".sortable-list").sortable({revert:true,update:saveSorting});});function saveSorting(e){var ord=$(".sortable-list").sortable("serialize");$(".sortable-list").sortable("disable");$(".sortable-list").fadeTo("fast",0.3);}
function orderSaved(data,textStatus){if(data=="OK"){$(".sortable-list").fadeTo("fast",1);$(".sortable-list").sortable("enable");}else{alert("problem updating the order");$(".sortable-list").sortable("refresh");}}

/* admin_autosort.js (60%) */
;$(function(){var $autosortable=$('.autosortable');$autosortable.sortable({items:'tr',helper:function(e,ui){ui.children().each(function(){$(this).width($(this).width());});return ui;},axis:'y',tolerance:'intersect',forceHelperSize:false,handle:'.sortable_handle',update:function(event,ui){$autosortable.sortable('option','items','.sortable_handle');newOrder=$autosortable.sortable('serialize');var $loader=$('<div></div>').css({opacity:0,background:'url(/img/ajax-loader.gif) center center no-repeat',position:'absolute',width:'100%',height:'100%',top:0,left:0,margin:' 0 auto '});$autosortable.parent().css({position:'relative'}).append($loader);$loader.animate({opacity:0.6});$autosortable.animate({opacity:0.5});window.location+="?sortList=1&"+newOrder;},start:function(event,ui){try{ui.helper.width($('.sortable_list').parent().width());}catch(exception){try{ui.helper.width($('.autosortable').width());}catch(exception){ui.helper.width('800px');}}}});});
