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

var AccountNameText = window.getElementByName("accountnametext");
var TotalSizeText = window.getElementByName("totalsizetext");
var VolumeProg = window.getElementByName("volumeprog");
var IosBtn = window.getElementByName("iosbtn");
var WpBtn = window.getElementByName("wpbtn");
var AndroidBtn = window.getElementByName("androidbtn");
var LogoutBtn = window.getElementByName("logoutbtn");
var ExitBtn = window.getElementByName("exitbtn");

function OnClick(obj) {
    if (obj.getName() == "closebtn") 
    {
        window.closeWnd();
    }
    else if (obj.getName() == "iosbtn") 
    {
        var str = "http://cloud.189.cn/download_client.jsp?sel=ios";
        window.shellExecute("open", str, "", "", SW_SHOWNOACTIVATE);
    }
    else if (obj.getName() == "wpbtn") 
    {
        var str = "http://cloud.189.cn/download_client.jsp?sel=wp";
        window.shellExecute("open", str, "", "", SW_SHOWNOACTIVATE);
    }
    else if (obj.getName() == "androidbtn") 
    {
        var str = "http://cloud.189.cn/download_client.jsp?sel=android";
        window.shellExecute("open", str, "", "", SW_SHOWNOACTIVATE);
    }
//     else if ((obj.getName() == "vip_0") || (obj.getName() == "vip_5") || (obj.getName() == "vip_10") || (obj.getName() == "vip_20")) 
//     {
//        var strPay = "http://epay.21cn.com/initOrder.do?productID=P20130116121717796";
//        window.shellExecute("open", strPay, "", "", SW_SHOWNOACTIVATE);
//     }
}