
function validateUser() {
	var f = document.user;
	var st = "Please fix the following errors:\n";
	var strName = f.strName.value != "";
	var strCompany = f.strCompany.value != "";
	var strEmail = f.strEmail.value != "";
	var strState = f.strState.value != "";
	var strComments = f.strComments.value != "";
	
	if(strName && strCompany && strEmail && strState && strComments) {
		return true;
	} else {
		if(!strName) { st += " - A name is required\n"; }
		if(!strCompany) { st += " - A company is required\n"; }
		if(!strEmail) { st += " - An email address is required\n"; }
		if(!strState) { st += " - A state is required\n"; }
		if(!strComments) { st += " - Please provide some information about the areas you are interested in\n"; }
		alert(st);
		return false;
	}
}

// XMLHttpRequest function to initiate request object
function AJAX() {
	var o = false;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	try {
		o = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			o = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			o = false;
		}
	}
	@end @*/
	if (!o && typeof XMLHttpRequest!='undefined') {
		o = new XMLHttpRequest();
	}
	return o;
}

var xmlhttp = AJAX();

function doLogin() {
	var errorCount = 0;
	if(xmlhttp) {
		var url = "login_without_password.asp";
		var strEmail = document.getElementById('strEmail_1').value;
		strEmail = strEmail.replace(/^\s*|\s*$/g,"");
		//statusResults = document.getElementById("statusResults"); - color me crazy, but this doesn't work in IE
		var postString = "strEmail=" + strEmail;
		if(strEmail.length > 0) {
			// post our html stream and set content type to urlencoded
			xmlhttp.open("POST", url ,false);
			xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	
			// write some text to the status DIV and then send the request
			xmlhttp.send(postString);
			if(xmlhttp.readyState == 4) {
				//statusResults.innerHTML = ""; - likewise, this is ineffective
				document.getElementById("statusResults").innerHTML = ""; // but this works
				var response = xmlhttp.responseText;
				document.getElementById('form_1').style.display = "none";
				document.getElementById('form_2').style.display = "inline";
				document.getElementById('form_2').innerHTML = response;
			} else{
				errorCount ++;
				//statusResults.innerHTML = "<strong class=\"error\">ERRORS OCCURRED</strong><br />"; - same here
				document.getElementById("statusResults").innerHTML = "<strong class=\"error\">ERRORS OCCURRED</strong><br />";
				// let's just throw out error response from the ASP page
				// statusResults.innerHTML += errorCount + " - " + xmlhttp.responseText + "<br/>"; - sand again
				document.getElementById("statusResults").innerHTML += errorCount + " - " + xmlhttp.responseText + "<br/>";
			}
			xmlhttp = null;
		} else {
			//statusResults.innerHTML = "<strong class=\"error\">REQUIRED: EMAIL ADDRESS</strong>"; - and same here
			document.getElementById("statusResults").innerHTML = "<strong class=\"error\">REQUIRED: EMAIL ADDRESS</strong>"; //- and same here
			document.getElementById("strEmail_1").value = "your email address";
			document.getElementById("submit_1").disabled = true;
		}
	} else {
		// fallback to non-capable stuff - for which there is none.
	}
}