function doValidation(robjForm) {

	var blnGoodField, strType, blnRequired, intLoopValidate;

	for (intLoopValidate = 0; intLoopValidate < robjForm.length; intLoopValidate++) {
		blnGoodField = true;
//		alert("The name is: " + robjForm[intLoopValidate].name + "\nThe value is: " + robjForm[intLoopValidate].value);

		if ((robjForm[intLoopValidate].type == "button") ||
			(robjForm[intLoopValidate].type == "submit"))
			{ continue; }

		strType = robjForm[intLoopValidate].name.substring(robjForm[intLoopValidate].name.length-4,robjForm[intLoopValidate].name.length);

		if (robjForm[intLoopValidate].name.substring(robjForm[intLoopValidate].name.length-6,robjForm[intLoopValidate].name.length-4) == "_R") {
			blnRequired = true;
		} else {
			blnRequired = false;
		}

		if (strType == "_phn") {
			if (blnRequired) {
				blnGoodField = isPhoneNumber(robjForm[intLoopValidate]);
			} else {
				if (robjForm[intLoopValidate].value != "") {
					blnGoodField = isPhoneNumber(robjForm[intLoopValidate]);
				}
			}
		}

		if (strType == "_dat") {
			if (blnRequired) {
				blnGoodField = isValidDate(robjForm[intLoopValidate]);
			} else {
				if (robjForm[intLoopValidate].value != "") {
					blnGoodField = isValidDate(robjForm[intLoopValidate]);
				}
			}
		}

		if (strType == "_num") {
			if (blnRequired) {
				if (robjForm[intLoopValidate].value == "") {
					blnGoodField = false;
				} else {
					blnGoodField = isNumber(robjForm[intLoopValidate].value);
				}
			} else {
				if (robjForm[intLoopValidate].value != "") {
					blnGoodField = isNumber(robjForm[intLoopValidate].value);
				}
			}
			if (!blnGoodField) {
				alert("Not a valid number");
				robjForm[intLoopValidate].focus();
			}
		}

		if (strType == "_int") {
			if (blnRequired) {
				if (robjForm[intLoopValidate].value == "") {
					blnGoodField = false;
				} else {
					blnGoodField = isInteger(robjForm[intLoopValidate].value);
				}
			} else {
				if (robjForm[intLoopValidate].value != "") {
					blnGoodField = isInteger(robjForm[intLoopValidate].value);
				}
			}
			if (!blnGoodField) {
				alert("Not a valid integer");
				robjForm[intLoopValidate].focus();
			}
		}

		if (strType == '_cur') {
			if (blnRequired) {
				if (robjForm[intLoopValidate].value == '') {
					blnGoodField = false;
				} else {
					blnGoodField = ForceCurrency(robjForm[intLoopValidate]);
				}
			} else {
				if (robjForm[intLoopValidate].value != '') {
					blnGoodField = ForceCurrency(robjForm[intLoopValidate]);
				}
			}
			if (!blnGoodField) {
				alert('Not a valid currency entry');
				robjForm[intLoopValidate].focus();
			}
		}

		if (strType == "_eml") {
			if (blnRequired) {
				blnGoodField = isValidEmail(robjForm[intLoopValidate]);
			} else {
				if (robjForm[intLoopValidate].value != "") {
					blnGoodField = isValidEmail(robjForm[intLoopValidate]);
				}
			}
		}

		if (strType == "_url") {
			if (blnRequired) {
				blnGoodField = isValidURL(robjForm[intLoopValidate]);
			} else {
				if (robjForm[intLoopValidate].value != "") {
					blnGoodField = isValidURL(robjForm[intLoopValidate]);
				}
			}
		}

		if (strType == "_txt") {
			if ((blnRequired) && (robjForm[intLoopValidate].value == "")) {
				alert("Please enter the Required Information");
				robjForm[intLoopValidate].focus();
				blnGoodField = false;
			}
		}

		if (strType == "_zip") {
			if (blnRequired) {
				blnGoodField = isValidZip(robjForm[intLoopValidate]);
			} else {
				if (robjForm[intLoopValidate].value != "") {
					blnGoodField = isValidZip(robjForm[intLoopValidate]);
				}
			}
		}

		if (strType == "_zp5") {
			if (blnRequired) {
				blnGoodField = isValidZip5(robjForm[intLoopValidate]);
			} else {
				if (robjForm[intLoopValidate].value != "") {
					blnGoodField = isValidZip5(robjForm[intLoopValidate]);
				}
			}
		}

		if (strType == "_zp4") {
			if (blnRequired) {
				blnGoodField = isValidZip4(robjForm[intLoopValidate]);
			} else {
				if (robjForm[intLoopValidate].value != "") {
					blnGoodField = isValidZip4(robjForm[intLoopValidate]);
				}
			}
		}
	
		if (robjForm[intLoopValidate].name == "txtLogLastName_txt") {
			if (robjForm[intLoopValidate].value == "") {
				if (robjForm.txtEmail_eml.value != "") {
					alert("Last Name is required");
					robjForm[intLoopValidate].focus();
					blnGoodField = false;
			}
			}
		}
		
		if (robjForm[intLoopValidate].name == "txtEmail_eml") {
			if (robjForm[intLoopValidate].value == "") {
				if (robjForm.txtLogLastName_txt.value != "") {
					alert("Email is required");
					robjForm[intLoopValidate].focus();
					blnGoodField = false;
			}
			}
		}

		if (!blnGoodField) {
			return false;
		}
	}
	return true;
}

/* ============================================================= */

// --- GARY M, 9 Sept 2008. --- 15F25EB5-314A-4157-B60A-A808F4BE637B
// --- Cross-browser compatible
function HideElementById(ElementID, myBool) {
	
		if (myBool) {
			// HIDE:
			if (navigator.appName=="Netscape") {
				document.getElementById(ElementID).style.visibility='collapse';
			} else if (navigator.appName=="Microsoft Internet Explorer") {
				document.getElementById(ElementID).style.display='none';
			}
		} else {
			// SHOW:
			if (navigator.appName=="Netscape") {
				document.getElementById(ElementID).style.visibility='visible';
			} else if (navigator.appName=="Microsoft Internet Explorer") {
				document.getElementById(ElementID).style.display='block';
			}
		}
		
	}
// --- END GARY M, 19 Dec 2007. ---


