function frmValidate() {
	if (checkFName() == false)
		return false;	
	if (checkLName() == false)
		return false;	
	var sphone, semail
	sphone = trim(document.forms[0].txtPhone.value);
	semail= trim(document.forms[0].txtEmail.value);
	if ((sphone == '') && (semail == '')) {
		alert("Please enter either your Phone Number or Email.");
		document.forms[0].txtPhone.focus();
		return false;
	}
	if (checkComments() == false)
		return false;
	if (checkChanllengeKey() == false)
		return false;
}
function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}

function checkFName() {
	if (trim(document.forms[0].txtFName.value) == '') {
		alert("Please enter your first name.");
		document.forms[0].txtFName.focus();
		return false;
	}
}

function checkLName() {
	if (trim(document.forms[0].txtLName.value) == '') {
		alert("Please enter your last name.");
		document.forms[0].txtLName.focus();
		return false;
	}
}


function checkComments() {
	if (trim(document.forms[0].txtComments.value) == '') {
		alert("Please enter your comments.");
		document.forms[0].txtComments.focus();
		return false;
	}
}

function checkChanllengeKey() {
	if (document.forms[0].txtChanllengeKey.value != document.forms[0].hidChanllengeKey.value) {
		alert("Invalid chanllenge key.\nPlease try again.");
		document.forms[0].txtChanllengeKey.focus();
		return false;
	}
}
