var buttons = window.getElementsByClassName("ButtonUI");
for (var i = 0; i < buttons.length; i++) {
    buttons[i].OnClick = "OnClick";
}

var OpenBackupBtn = window.getElementByName("backup_open");
var CloseBackupBtn = window.getElementByName("backup_close");
var V4Text = window.getElementByName("v4text");

function OnClick(obj) {
//     if (obj.getName() == "closebtn") 
//     {
//         window.closeWnd();
//     }
//     else if (obj.getName() == "backup_close") 
//     {
//         OpenBackupBtn.setVisible(true);
//         CloseBackupBtn.setVisible(false);
//         V4Text.setText(_T("自动备份已开启，当有数据更新时将自动为您备份到云端。"));
//     }
}

function WndNotify(a, b) 
{
     if (b == "selectchanged") 
     {
        if (OpenBackupBtn.getName() == a)     //选中列表项
        {
            OpenBackupBtn.setVisible(false);
            CloseBackupBtn.setVisible(true);
            //V4Text.setText("自动备份已关闭");   
        }
        if (CloseBackupBtn.getName() == a)
        {
            OpenBackupBtn.setVisible(true);
            CloseBackupBtn.setVisible(false);
            //V4Text.setText("自动备份已开启，当有数据更新时将自动为您备份到云端。");
        }
     }
}