<!--
function checkrequired(which) {
	var pass = true;
	for (var j=0, k=which.elements.length; j<k; j++) {
		var tempobj = which.elements[j];
			if (tempobj.id.substring(0,37) == "requiredE-mail") {
			// ---------------------------------------------------------------------------------------
				emailStr = tempobj.value;
				var checkTLD=1;
				var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
				var emailPat=/^(.+)@(.+)$/;
				var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
				var validChars="\[^\\s" + specialChars + "\]";
				var quotedUser="(\"[^\"]*\")";
				var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
				var atom=validChars + '+';
				var word="(" + atom + "|" + quotedUser + ")";
				var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
				var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
				var matchArray=emailStr.match(emailPat);

					if (matchArray==null) {
						alert("E-mail field appears to be invalid (verify @ and .)");
						tempobj.focus();
						tempobj.blur();
						tempobj.select();
						return false;
					}

				var user = matchArray[1];
				var domain = matchArray[2];

					for (i=0; i<user.length; i++) {
						if (user.charCodeAt(i)>127) {
							alert("E-mail's username contains invalid characters.");
							tempobj.focus();
							tempobj.blur();
							tempobj.select();
							return false;
						}
					}

					for (i=0; i<domain.length; i++) {
						if (domain.charCodeAt(i)>127) {
							alert("E-mail's domain name contains invalid characters.");
							tempobj.focus();
							tempobj.blur();
							tempobj.select();
							return false;
						}
					}

					if (user.match(userPat)==null) {
						alert("E-mail's username appears to be invalid.");
						tempobj.focus();
						tempobj.blur();
						tempobj.select();
						return false;
					}

				var IPArray=domain.match(ipDomainPat);

					if (IPArray!=null) {
						for (var i=1;i<=4;i++) {
							if (IPArray[i]>255) {
								alert("Destination's IP address appears to be invalid.");
								tempobj.focus();
								tempobj.blur();
								tempobj.select();
								return false;
							}
						}
					}

				var atomPat = new RegExp("^" + atom + "$");
				var domArr = domain.split(".");
				var len = domArr.length;

					for (i=0;i<len;i++) {
						if (domArr[i].search(atomPat)==-1) {
							alert("E-mail's domain name appears to be invalid.");
							tempobj.focus();
							tempobj.blur();
							tempobj.select();
							return false;
						}
					}
					
					if (checkTLD && domArr[domArr.length-1].length!=2 && 
					domArr[domArr.length-1].search(knownDomsPat)==-1) {
						alert("E-mail address has to be terminated by a known extension or a 2 letters " + " country code.");
						tempobj.focus();
						tempobj.blur();
						tempobj.select();
						return false;
					}
					
					if (len<2) {
						alert("E-mail's domain name is missing!");
						tempobj.focus();
						tempobj.blur();
						tempobj.select();
						return false;
					}
			// ---------------------------------------------------------------------------------------
			} else if (tempobj.id.substring(0,19) == "requiredevalutating") {
				if (tempobj.value == 1) {
					if (which.elements[j+1].value == "") {
					alert("Please fill in description field");
					which.elements[j+1].focus();
					which.elements[j+1].focus();
					return false;
					}
				}
			// ---------------------------------------------------------------------------------------
			} else if (tempobj.id.substring(0,16) == "requireddecision") {
				if (tempobj.value == 0) {
					if (which.elements[j+1].value == "" && which.elements[j+2].value == "" && which.elements[j+3].value == "" && which.elements[j+4].value == "") {
					alert("Please provide some information about the decision maker");
					which.elements[j+1].focus();
					return false;
					}
				}
			// ---------------------------------------------------------------------------------------
			} else {
				if (tempobj.id.substring(0,8) == "required") {
					if (((tempobj.type == "text" || tempobj.type == "textarea")&&
						(tempobj.value == tempobj.defaultValue || tempobj.value == '' || tempobj.value == "")) || (tempobj.type.toString().charAt(0) == "s")&&
							(tempobj.selectedIndex == 0)) {
						pass = false;
						break;
					}
				}
			// ---------------------------------------------------------------------------------------
			}
	} //for

	if (!pass) {
		shortFieldName=tempobj.id.substring(8,50).toUpperCase();
		shortFieldName=shortFieldName.replace(/_/g," ");
		alert("Please provide field "+shortFieldName+".");
		if (tempobj.type.toString().charAt(0) != "s") {
		  tempobj.focus();
		  tempobj.blur();
		  tempobj.select();
		} else {
		  tempobj.focus();
		}
		return false;
	} else {
		return true;
	}

}
//-->
