var req;
window.onload = function () {
};
function Change_Select() {
    var zhi = document.getElementById("ptypeone_id").value;
    var url = "/servlet/SelectPtypeServlet?id=" + escape(zhi);
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
    } else {
        if (window.ActiveXObject) {
            req = new ActiveXObject("Microsoft.XMLHTTP");
        }
    }
    if (req) {
        req.open("GET", url, true);
        req.onreadystatechange = callback;
        req.send(null);
    }
}
function callback() {
    if (req.readyState == 4) {
        if (req.status == 200) {
            parseMessage();
        } else {
            alert("Not able to retrieve description" + req.statusText);
        }
    }
}
function parseMessage() {
    var xmlDoc = req.responseXML.documentElement;
    var xSel = xmlDoc.getElementsByTagName("select");
    var select_root = document.getElementById("ptypetwo_id");
       select_root.options.length = 0;
   
    for (var i = 0; i < xSel.length; i++) {
        var xValue = xSel[i].childNodes[0].firstChild.nodeValue;
        var xText = xSel[i].childNodes[1].firstChild.nodeValue;
        var option = new Option(xText, xValue);
        try {
            select_root.add(option);
        }
        catch (e) {
            select_root.appendChild(option);
        }
    }
    var defalt = new Option("\u8bf7\u9009\u62e9", 0);
   
}
