function valContact() {
	objForm = document.myForm
	objDoc = document.all
	var bolErrFound = false;
	var bolErrTel1 = false;
	var strAlertMsg = "Please correct the following errors:\n";

	// First Name
	if (objForm.first_name.value == null || objForm.first_name.value == "") {
		bolErrFound = true;
		strAlertMsg = strAlertMsg + "   - First name cannot be blank\n";
	}

	// Last Name
	if (objForm.last_name.value == null || objForm.last_name.value == "") {
		bolErrFound = true;
		strAlertMsg = strAlertMsg + "   - Last name cannot be blank\n";
	}

	// Email1 Name
	if (objForm.first_email.value == null || objForm.first_email.value == "") {
		bolErrFound = true;
		strAlertMsg = strAlertMsg + "   - Email1 cannot be blank\n";
	}

	// Validate email format
	if (IsEmailValid(objForm.first_email.value) == false) {
		bolErrFound = true;
		strAlertMsg = strAlertMsg + "   - Email1 is invalid\n";
	}

	// Email2 Name
	if (objForm.second_email.value != objForm.first_email.value) {
		bolErrFound = true;
		strAlertMsg = strAlertMsg + "   - Email1 and Email2 are not the same\n";
	}

	
	// Tel1 Name
	strTemp = objForm.tel_1_area.value;
	if (strTemp.length != 3) {
		bolErrFound = true;
		bolErrTel1 = true;
		strAlertMsg = strAlertMsg + "   - Telephone Number 1 is invalid\n";
	}

	strTemp = objForm.tel_1_prefix.value;
	if (strTemp.length != 3 && !bolErrTel1) {
		bolErrFound = true;
		bolErrTel1 = true;
		strAlertMsg = strAlertMsg + "   - Telephone Number 1 is invalid\n";
	}

	strTemp = objForm.tel_1_suffix.value;
	if (strTemp.length != 4 && !bolErrTel1) {
		bolErrFound = true;
		bolErrTel1 = true;
		strAlertMsg = strAlertMsg + "   - Telephone Number 1 is invalid\n";
	}
	
	if (objForm.tel_1_type.value == "") {
		bolErrFound = true;
		strAlertMsg = strAlertMsg + "   - Please select a type for Telephone Number 1\n";
	}
	

	if (objForm.Subject.value == "") {
		bolErrFound = true;
		strAlertMsg = strAlertMsg + "   - Please select a subject\n";
	}

	if (bolErrFound) {	
		alert(strAlertMsg);
	}
	
	return !bolErrFound
}


function IsEmailValid(value) {
	apos=value.indexOf("@"); 
	dotpos=value.lastIndexOf(".");
	lastpos=value.length-1;
	if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2) {
		return false;
	}
	else {
		return true;
	}
} 

