$(".CBHeader").live('click', function () {
    var checkvalue = $(this).attr("checked");
    if (checkvalue == 'checked')
        $(".chck").attr("checked", checkvalue);
    else
        $(".chck").removeAttr("checked");
});
$(".MuliteAction").live('click', function () {
    var attrtype = $(this).attr("attrtype");
    var selitems = '';
    $(".chck").each(function () {
        if (!$(this).hasClass("CBHeader") && $(this).is(':checked')) {
            var item = $(this).attr("attrid");
            if (item != undefined && item != '') {
                selitems += item;
                selitems += ",";
            }
        }
    });

    if (selitems != '') {
        selitems = selitems.substring(0, selitems.length - 1);

        if (confirm('确定要删除选择的项么?')) {
            $.ajax({
                url: '/Member/MuliteAction/',
                type: "POST",
                dataType: "json",
                timeout: "10000",
                data: {
                    "attrtype": attrtype,
                    "selitems": selitems
                },
                success: function (data) {
                    if (data.ErrorCode == 0) {
                        $(".chck").each(function () {
                            if (!$(this).hasClass("CBHeader") && $(this).is(':checked')) {
                                $(this).parent().parent().parent().parent().remove();
                            }
                        });
                    }
                    _alert(data.ErrorStr);
                }
            });
        }
    }
});