var req;
var name;
function loadXMLDocEM(url) {
    // branch for native XMLHttpRequest object
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        req.onreadystatechange = processReqChangeEm;
        req.open("GET", url, true);
        req.send(null);
    // branch for IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if (req) {
            req.onreadystatechange = processReqChangeEm;
            req.open("GET", url, true);
            req.send();
        }
    }
}
function processReqChangeEm() {
    if (req.readyState == 4) {
        if (req.status == 200) {
	      hideProgress('progress');
	      document.getElementById('foobar').innerHTML = req.responseText;
        } else {
        }
    }
}

function check_results(input)
{
     url  = 'signup.php?check=1&username=' + input;
     showProgress('progress');
     loadXMLDocEM(url);
}
function showProgress(name) {
    prg = "<IMG SRC='http://www.themaxgxlsystem.com/admin/images/icon_animated_busy.gif'>";
    document.getElementById('progress').innerHTML = prg;
}

function hideProgress(name) {
    progressViewer = document.getElementById('progress');
    progressViewer.innerHTML = "";
}
//-->
