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(target)
{
    //var username = document.getElementById(this.id + "-username").value;
    //var password = document.getElementById(this.id + "-password").value;
    var username = document.getElementById("clientusername").value;
    var password = document.getElementById("clientpassword").value;
    
    var http = getHTTPObject();
	//var url = "http://" + username + ":" + password + "@" + this.action.substr(7);
	var url = target //this.action;
    http.open("get", url, false, username, password);
    http.send("");
	if (http.status == 200) {
		document.location = url;
	} else {
        //alert(http.status);
        alert("Incorrect username and/or password!");
    }
    return false;
}