function GetHttpResult(dept, branch, url, elementName, elementBodyName) {
    var Params = "dept=" + dept + "&branch=" + branch;
    var oRequest;
    try {
        oRequest = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch (e) {
        try {
            if (window.XMLHttpRequest) {   //   Mozilla,   Safari,   ...
                oRequest = new XMLHttpRequest();
            }
            else if (window.ActiveXObject) {   //   IE
                oRequest = new ActiveXObject("Microsoft.XMLHTTP");
            }
        }
        catch (e) {
            try { oRequest = new XMLHttpRequest(); }
            catch (e) { oRequest = false; }
        }
    }
    oRequest.open("post", url, false);
    oRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    oRequest.setRequestHeader("Content-Length", Params.length);
    oRequest.send(Params);
    //alert(oRequest.status + "--" + oRequest.statusText + "---" + oRequest.responseXML.childNodes[1].text);
    //alert(oRequest.responseXML.childNodes[1].text);
    var element = window.document.getElementById(elementName);
    element.style.display = '';
    var element = window.document.getElementById(elementBodyName);
    if (element != null)
        element.innerHTML = oRequest.responseXML.childNodes[1].text;

}

function GetHttpReminder(user, dept, branch, url) {
    var Params = "username=" + user + "&dept=" + dept + "&branch=" + branch;
    var oRequest;
    try {
        oRequest = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch (e) {
        try {
            if (window.XMLHttpRequest) {   //   Mozilla,   Safari,   ...
                oRequest = new XMLHttpRequest();
            }
            else if (window.ActiveXObject) {   //   IE
                oRequest = new ActiveXObject("Microsoft.XMLHTTP");
            }
        }
        catch (e) {
            try { oRequest = new XMLHttpRequest(); }
            catch (e) { oRequest = false; }
        }
    }
    oRequest.open("post", url, false);
    oRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    oRequest.setRequestHeader("Content-Length", Params.length);
    oRequest.send(Params);
}

function GetHttpResultUser(user, url, elementName, elementBodyName) {
    var Params = "username=" + user ;
    var oRequest;
    try {
        oRequest = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch (e) {
        try {
            if (window.XMLHttpRequest) {   //   Mozilla,   Safari,   ...
                oRequest = new XMLHttpRequest();
            }
            else if (window.ActiveXObject) {   //   IE
                oRequest = new ActiveXObject("Microsoft.XMLHTTP");
            }
        }
        catch (e) {
            try { oRequest = new XMLHttpRequest(); }
            catch (e) { oRequest = false; }
        }
    }
    oRequest.open("post", url, false);
    oRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    oRequest.setRequestHeader("Content-Length", Params.length);
    oRequest.send(Params);
    //alert(oRequest.status + "--" + oRequest.statusText + "---" + oRequest.responseXML.childNodes[1].text);
    //alert(oRequest.responseXML.childNodes[1].text);
    var element = window.document.getElementById(elementName);
    element.style.display = '';
    var element = window.document.getElementById(elementBodyName);
    if (element != null)
        element.innerHTML = oRequest.responseXML.childNodes[1].text;

}



var HiddenID;
function checkSelect() {
    HiddenID = $('<%=HiddenID.ClientID %>').value;
    if (isNull(HiddenID)) {
        alert("请选择一条记录!");
    }
    return !isNull(HiddenID);
}

function CheckAll(spanChk)//CheckBox全选
{
    var oItem = spanChk.children;
    var theBox = (spanChk.type == "checkbox") ? spanChk : spanChk.children.item[0];
    xState = theBox.checked;
    elm = theBox.form.elements;
    for (i = 0; i < elm.length; i++)
        if (elm[i].type == "checkbox" && elm[i].id != theBox.id) {
        if (elm[i].checked != xState)
            elm[i].click();
    }
}