function setSort(obj){
               var sortInput = $(obj).siblings(":text");
               sortInput.val($(obj).text());
               sortInput.show();
               sortInput.get(0).focus()
               $(obj).hide();
               
}
function sendSort(id,obj,type){
            var value = parseInt(obj.value);
            var span = $(obj).siblings("span");
            if(!isNaN(value)){
                var old = parseInt(span.text());
                if(old!=value){
                    $.ajax({
                           type: "POST",
                           dataType:"text",
                           processData:false,
                           async:false,
                           url: "../ashx/Sort.ashx",
                           data: "cid="+id+"&value="+value+"&type="+type,
                           success: function(msg){
                                if(msg=="1"){
                                    var span = $(obj).siblings("span");
                                    span.show();
                                    span.text(value);
                                    $(obj).hide();
                                    
                                }else{
                                    alert("排序设置失败！");
                                }
                           },
                           error:function (XMLHttpRequest, textStatus, errorThrown) { 
                            alert("设置操作失败 "+textStatus +" "+errorThrown+" "+XMLHttpRequest);
                           }
                        }); 
                 }else{
                   span.show();
                   $(obj).hide();
                 }
              }
}
