$(function () {
    PageLoadTrees();
    $("#myPageAlert").hide();
    manageObj.getcustomizesystem();
});

// 初始化绑定回调
function AsyncGetCustomizeSystemResult(jsonResult) {
	$("#chkCloseRemindBatch").attr('checked', jsonResult.biscloseremindbatch); //提醒群消息
	$("#chkBissound").attr('checked', jsonResult.bissoundprompt);//播放消息提醒声音
	$("#chkBismsg").attr('checked', jsonResult.bismsgprompt); //显示消息提醒气泡
	$("#chkOpenWindow").attr('checked', jsonResult.bisopenwindow);//收到新消息时弹出窗体
	$("#bismsgverification").attr('checked', jsonResult.bismsgverification);//过滤好友验证和拒收消息
	$("#chkCloseReceptionGroupMessage").attr('checked', jsonResult.bisreceivebatchmsg); //接收群消息
    $(".loadingcover").hide();
    $(".loading").hide();
}

//修改
function Update() {
    $(".loading").show();
    $(".loadingcover").show();
    var strParaJson = $.toJSON({
    	biscloseremindbatch: $("#chkCloseRemindBatch").is(':checked'),
        bissoundprompt: $("#chkBissound").is(':checked'),
        bismsgprompt: $("#chkBismsg").is(':checked'),
        bisopenwindow: $("#chkOpenWindow").is(':checked'),
        bismsgverification: $("#bismsgverification").is(':checked'),
        bisreceivebatchmsg: $("#chkCloseReceptionGroupMessage").is(':checked')
    });
    manageObj.savecustomizesystem(strParaJson);
}

function AsyncSaveCustomizeSystemResult(jsonResult) {
    if (jsonResult.success) {
        ShowMsg("myPageAlert", "保存成功！");
    } else {
        ShowError("myPageAlert", "获取数据异常：" + jsonResult.error);
    }
    $(".loadingcover").hide();
    $(".loading").hide();
}

function PageLoadTrees() {
    $(".left-list-l").css({
        height: $(window).height() - 40
    });

    $(".talklist-m").css({
        height: $(window).height() - 130
    });
    $("#right").css({
        height: $(window).height() - 40
    });
    $("#left").css({
        height: $(window).height() - 40
    });

    initTree();
}
$(window).resize(function () {
    PageLoadTrees();
});