

function getHTTPObject() {
	var xmlhttp = false;
	if (typeof XMLHttpRequest != 'undefined') {
		try {
			xmlhttp = new XMLHttpRequest();
		} catch (e) {
			xmlhttp = false;
		}
	} else {
        /*@cc_on
        @if (@_jscript_version >= 5)
            try {
                xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (E) {
                    xmlhttp = false;
                }
            }
        @end @*/
    }
	return xmlhttp;
}

function login(naam, url)
{
    var username = document.getElementById(naam + "-username").value;
    var password = document.getElementById(naam + "-password").value;
    
    var http = getHTTPObject();
    http.open("get", url, false, username, password);
    http.send(null);
	if (http.status == 200) {
		parent.location = url;
	} else {
        alert("Incorrect username and/or password!");
    }
    return false;
}
