// global flag
var isIE = false;

// global request and XML document objects
var req;

// retrieve XML document (reusable generic function);
// parameter is URL string (relative or complete) to
// an .xml file whose Content-Type is a valid XML
// type, such as text/xml; XML source must be from
// same domain as HTML file
function loadXMLDoc(url) {
    // branch for native XMLHttpRequest object
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        req.onreadystatechange = processReqChange;
        req.open("GET", url, true);
        req.send(null);
    // branch for IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
        isIE = true;
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if (req) {
            req.onreadystatechange = processReqChange;
            req.open("GET", url, true);
            req.send();
        }
    }
}

// handle onreadystatechange event of req object
function processReqChange() {
    // only if req shows "loaded"
    if (req.readyState == 4) {
        // only if "OK"
        if (req.status == 200) {
            alert(req.responseText);
         } else {
            alert("There was a problem retrieving the XML data:\n" + req.statusText);
         }
    }
}

//try {
//    loadXMLDoc('http://10.0.2.2/cgi-bin/WebObjects/FrontApp.woa/-3000/wa/XMLRequest?item=274107');
//    }
//catch(e) {
//  var msg = (typeof e == "string") ? e : ((e.message) ? e.message : "Unknown Error");
//  alert("Unable to get XML data:\n" + msg);
//}
