var http = getHTTPObject();	
var url;
	
function submitForm() {
	var name = document.getElementById('name').value;
	if (name=='' || name==' ') return;
	getUrl(name);
	http.open('HEAD', url, true, name, document.getElementById('passwd').value);
	http.onreadystatechange = handleHttpResponse;
	http.send(null);
}
	
function getUrl(name) {
	url = '/members/'+name+'/';
}	
	
function handleHttpResponse() {
  	if (http.readyState == 4) {
		if (http.status == 200) {
			window.location = url;
		} else {
			document.getElementById('error').innerHTML='<p><font color=\'red\'>This username and password combination are not allowed to access the member\'s area.</font></p>';
		}
 	}
}
	
function getHTTPObject() {
	var xmlhttp;
	  /*@cc_on
	  @if (@_jscript_version >= 5)
		try {
		  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
		  try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		  } catch (E) {
			xmlhttp = false;
		  }
		}
	  @else
	  xmlhttp = false;
	  @end @*/
		if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
			try {
			  xmlhttp = new XMLHttpRequest();
			} catch (e) {
			  xmlhttp = false;
			}
	}
	return xmlhttp;
}