function submitContactRequest() {
	var form = document.ContactUsForm;
	var fullName = getInput (form, "FullName");
	var company = getInput (form, "Company");
	var phone = getInput (form, "PhoneNumber");
	var email = getInput (form, "EmailAddr");
	var reason = form.Reason.options[form.Reason.selectedIndex].text;
	var comment = form.Comment.value;

	if (fullName == "") {
		showError ("You must enter a Full Name value");
		return;
	}
	if (company == "") {
		showError ("You must enter a Company value");
		return;
	}
	if (phone == "" && email == "") {
		showError ("You must enter either a Phone Number or Email Address");
		return;
	}
	var params = "";
	params += "FullName="+fullName;
	params += "&Company="+company;
	params += "&PhoneNumber="+phone;
	params += "&EmailAddr="+email;
	params += "&Reason="+reason;
	params += "&Comment="+comment;

/*
	var http = new XMLHttpRequest();
	http.open ("POST", "/uploads/contact/contact.php", true);
	http.onreadystatechange = function() {
		if (http.readyState == 4) {
			if (http.status == 200) {
				if (http.responseText == "OK") {
					doSuccess();
				} else {
					showError (http.responseText);
				}
			} else {
				showError ("SERVER ERROR: Unable to submit your contact request");
			}
		}
	}
	http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	http.send(params);
*/
	form.submit();
}
function doSuccess(msg) {
	showMsg ("Thank you.\nYour contact request has been successfully submitted\n"
		+ "and a DfR representative will be contacting you shortly.");

	form.FullName.value	= "";
	form.Company.value	= "";
	form.PhoneNumber.value	= "";
	form.EmailAddr.value	= "";
	form.Reason.selectedIndex = 0;
	form.Comment.value	= "";
	form.FullName.focus();
}
function getInput (form, name) {
	var str = form[name].value;
	str = str.replace(/^\s+/,"");
	str = str.replace(/\s+$/,"");
	form[name].value = str;
	return str;
}
function showError (msg) {
	alert("ERROR: "+msg);
}
function showMsg (msg) {
	alert(msg);
}
/*
function loadList() {
	var http = new XMLHttpRequest();
	http.open ("GET", "/uploads/contact/contact.php?cmd=LIST", true);
	http.onreadystatechange = function() {
		if (http.readyState == 4) {
			if (http.status == 200) {
				var list = http.responseText.split("\n");
				var s = document.ContactForm.Reason;
				s.options.length = 0;
				for (var i in list) {
					if (list[i] == "") continue;
					s.options[s.options.length] = new Option(list[i]);
				}
			} else {
				showError ("SERVER ERROR: Unable to load contact list");
			}
		}
	}
	http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	http.send("");
}
setTimeout("loadList()", 100);
*/

