var xmlhttp;
var container;

function loadXMLDoc(uri, tmpcontainer) {
    container = tmpcontainer;
    xmlhttp = null;
    if (window.XMLHttpRequest) {   
        xmlhttp = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    if (xmlhttp != null) {
        xmlhttp.onreadystatechange = stateChange;
        xmlhttp.open("GET", uri, true);
        xmlhttp.send(null);
    }
    else {
        alert("XMLHTTP not supported by this browser.");
    }
}

function stateChange() {
    if (xmlhttp.readyState == 4) {
        if (xmlhttp.status == 200) {
            document.getElementById(container).innerHTML = xmlhttp.responseText;
        }
        else {
            alert("stateChange Error:" + xmlhttp.statusText);
        }
    }
}
