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

var VPwdEdit = window.getElementByName("VirutalPwd");
var WizardManager = new IWizardManager();

function OnClick(obj) {
    if (obj.getName() == "SkipNext") {
        window.closeWnd();
    }
    else if (obj.getName() == "PwdOK") {
        var nRet = WizardManager.doSaveVirtualDiskPassword(VPwdEdit.getText());
        if (nRet == SaveVDiskPwdFail_ErrorPwd) {
            var nRetID = window.messageBox("ÐéÄâÅÌÃÜÂë´íÎó£¬ÇëÖØÐÂÊäÈë¡£", "ÐéÄâ´ÅÅÌ", MB_OK);
        }
        else if (nRet == SaveVDiskPwdFail_Load) {
            window.messageBox("ÐéÄâÅÌ¼ÓÔØÊ§°Ü£¬ÇëÖØ×°¿Í»§¶Ë¡£", "ÐéÄâ´ÅÅÌ", MB_OK);
        }
        else
        {
            window.closeWnd();
        }
    }
}
