function AscDesc(productid, ascdesc, spanid, packageid, orderkey) {
    var AscDescDo = parseInt(document.getElementById("AscDescDo").innerHTML);
    if (AscDescDo == 1) {
        var nstock = parseInt(document.getElementById("quantity" + spanid).innerHTML);
        var flg = true;
        if (nstock == 1 && parseInt(ascdesc) == -1) {
            flg = false;
        }
        if (flg == true && parseInt(productid) != 0 && (parseInt(ascdesc) == -1 || parseInt(ascdesc) == 1) && parseInt(spanid) != -1 && orderkey != "" && parseInt(nstock) != 0) {

            var _UserClick = parseInt(document.getElementById("UserClick").innerHTML);
            _UserClick = _UserClick + 1;
            document.getElementById("UserClick").innerHTML = _UserClick;
            send_request("/admin/getorder.aspx?productid=" + productid + "&ascdesc=" + ascdesc + "&packageid=" + packageid + "&orderkey=" + orderkey + "&nstock=" + nstock + "&spanid=" + spanid + "&guid=" + _UserClick);
        }
    }
    else {
        alert("您没有足够的积分可以使用！");
    }
}
var http_request = false;
function send_request(url) {
    http_request = false;
    if (window.XMLHttpRequest) {
        http_request = new XMLHttpRequest();
        if (http_request.overrideMimeType) {
            http_request.overrideMimeType("text/html");
        }
    }
    else if (window.ActiveXObject) {
        try {
            http_request = new ActiveXObject("Xsxml2.XMLHTTP");
            http_request.setRequestHeader("Content-Type", "text/xml");
        }
        catch (e) {
            try {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
                http_request.setRequestHeader("Content-Type", "text/xml");
            } catch (e) { }
        }
    }
    if (!http_request) { return false; alert('false.'); }
    http_request.onreadystatechange = processRequest;
    http_request.open("get", url, true); http_request.send(null);
}
function processRequest() {
    if (http_request.readyState == 4) {
        if (http_request.status == 200) {
            var arrayAsJSONText = http_request.responseText;
            var arrmp = arrayAsJSONText.split("|");
            if (arrmp[0] != "") {
                document.getElementById("price" + arrmp[3]).innerHTML = arrmp[0];
                document.getElementById("cent" + arrmp[3]).innerHTML = arrmp[1];
                document.getElementById("quantity" + arrmp[3]).innerHTML = arrmp[2];
                if (parseInt(arrmp[4]) == 1) {
                    document.getElementById("price" + arrmp[3]).style.display = "none";
                }
                document.getElementById("ct_quantity").innerHTML = arrmp[5];
                var _PriceCentCheck = parseInt(document.getElementById("PriceCentCheck").innerHTML);
                if (_PriceCentCheck == 2) {
                    document.getElementById("ct_price").innerHTML = arrmp[6];
                    document.getElementById("ct_cent").innerHTML = arrmp[7];
                    document.getElementById("cartdivView").innerHTML = "共<span id=\"ctotalnumber\">" + arrmp[5] + "</span>件;￥<span id=\"ctotalprice\">" + arrmp[6] + "</span>;<span id=\"ctotalcent\">" + arrmp[7] + "</span>分&nbsp;";
                }
                else if (_PriceCentCheck == 1) {
                    document.getElementById("ct_cent").innerHTML = arrmp[7];
                    document.getElementById("cartdivView").innerHTML = "共<span id=\"ctotalnumber\">" + arrmp[5] + "</span>件;<span id=\"ctotalprice\"></span><span id=\"ctotalcent\">" + arrmp[7] + "</span>分&nbsp;";
                }
                else {
                    document.getElementById("ct_price").innerHTML = arrmp[6];
                    document.getElementById("cartdivView").innerHTML = "共<span id=\"ctotalnumber\">" + arrmp[5] + "</span>件;￥<span id=\"ctotalprice\">" + arrmp[6] + "</span><span id=\"ctotalcent\"></span>&nbsp;";
                }
            }
            else {
                alert("商品库存已经达到上限！");
            }
        }
        else {
            //alert("程序调用失败!");
        }
    }
}