// JavaScript Document
function clrTxt(src) {
	clr = document.getElementById(src)
	clr.value="";
	return false;
}

<!-- FIND EMPTY FIELDS -->
function chkEmpt(src) {
var chkLen = document.getElementById(src)
	if (chkLen.value.length == 0) {
		chkLen.select();
		chkLen.focus();
		alert(chkLen.id + " is a required field");
		return false;
	}
}

<!-- VALIDATE E-MAIL ENTRIES -->
function valEnt(src) {
	var chkLen = document.getElementById(src)
	if (chkLen.value.length == 0) {
		chkLen.select();
		chkLen.focus();
		alert("You must enter an e-mail address");
		return false;
	} else if (chkLen.value.length > 0) {
		apos=chkLen.value.indexOf("@");
		dotpos=chkLen.value.lastIndexOf(".");
		if (apos == -1 || apos == 0) {
			//do nothing
		} else {
			postAt=chkLen.value.split("@");
			if (postAt.length = 2) {
				postDot=postAt[1];
				if (postDot == null || postDot=="") {
					//do nothing
				} else {
					postCk=postDot.split(".");
				}
			} else {
				chkLen.select();
				chkLen.focus();
				alert("Please enter a valid e-mail address.");
				return false;
			}
		}
		if (apos < 1 || dotpos - apos < 2) {
			chkLen.select();
			chkLen.focus();
			alert("Please enter a valid e-mail address.");
			return false;
		} else if (postCk[1].length < 2 || postCk[1].length > 3 || postAt[1].match(/\./g).length > 1){
			alert("Please enter a valid e-mail address.");
			chkLen.select();
			chkLen.focus();
			return false;
		} else {
			return true;
		}
	}
}
