
function openPop(types) {
    url = "Pop.aspx";
    popWin.showWin("320", "500", "", url);
}


 


function setPopAttend(result) {
    var oldValue = $("#sel_attend").select2("data");
    var newValue = processArray(oldValue, result);
    $("#sel_attend").select2("data", newValue);
}


function processArray(arrSource, strResult) {
    strResults = strResult.split('!');
    var users = "";
    var loginname = "";
    var displayname = "";
    var text = "";

    for (var i = 0; i < strResults.length; i++) {
        if (strResults[i] != "") {
            users = strResults[i].split('$');
            loginname = users["1"];
            displayname = users["2"];
            text = displayname + "(" + loginname + ")";
            arrSource.push({ id: loginname, text: text });
        }
    }

    return arrSource;

}


function getSelect(arrSource) {
    var result = "";
    for (var i = 0; i < arrSource.length; i++) {
        if (arrSource[i] != "") {
            result += arrSource[i].id + ";";
        }
    }
    return result;
}


function getSelectText(arrSource) {
    var result = "";
    for (var i = 0; i < arrSource.length; i++) {
        if (arrSource[i] != "") {
            result += arrSource[i].text + ";";
        }
    }
    return result;
}

 