function notExists(formName,fieldName,Description)
{
	var strCont;
	strCont = document.forms[formName].elements[fieldName].value;
	strCont = strCont.match(/^\s*$/);
	if(strCont != null)
	{
		alert(Description + " is a required field.");
		document.forms[formName].elements[fieldName].focus();
		return true;
	} else {return false;}
}
	
function notSelected(formName,fieldName,Description)
{
	var intValue;
	intValue = document.forms[formName].elements[fieldName].value;
	if(intValue < 1)
	{
		alert("A selection must be made for " + Description + ".");
		document.forms[formName].elements[fieldName].focus();
		return true;
	} 
	else {return false;}
}
	
function notNumeric(formName,fieldName,Description)
{
	if(notExists(formName,fieldName,Description)) return true;
	var strCont;
	strCont = document.forms[formName].elements[fieldName].value;
	if(isNaN(strCont))
	{
		alert(Description + " must be a numeric value.");
		document.forms[formName].elements[fieldName].focus();
		return true;
	} else {return false;}
}

function notLength(formName,fieldName,Description,Length)
{
	if(notExists(formName,fieldName,Description)) return true;
	var strCont;
	strCont = document.forms[formName].elements[fieldName].value;
	if(strCont.length < Length)
	{
		alert(Description + " must be at least " + Length + " characters long.");
		document.forms[formName].elements[fieldName].focus();
		return true;
	} else {return false;}
}

function notPhone(formName,fieldName,Description)
{
	if(notExists(formName,fieldName,Description)) return true;
	var strCont;
	strCont = document.forms[formName].elements[fieldName].value;
	for(var i = 0;i <= strCont.length-1;i++)
	{
		if(isNaN(strCont.charAt(i)) && strCont.charAt(i) != "-" || strCont.charAt(i) == " ")
		{
			alert(Description + " can only contain numbers and dashes.");
			document.forms[formName].elements[fieldName].focus();
			return true;
		}
	}
	return false;
}

function IsEmail(emailAddressToTest)
{
	var strCont	 = emailAddressToTest.value;
	var re		 = /[\w\.]+@[\-\w\.]+\.[\w\.]+/;
	var aryMatch = strCont.match(re);
	
	if(!aryMatch)
	{
		return(false);
	} 
	else 
	{
		return(true);
	}
}