var allGood =true;
var formName = "document.forms[1].";

//BUGBUG: There is an error involving textDesc having a ' in it...
//		So don't use them until this is solved...

//Types of checks used for text checks
function voidCheck(formField, textDesc) {return "";}
function nameCheck(formField, textDesc)	{if(strStrip(eval(""+formName+formField).value, sCharsAlpha+sCharsNumeric+"- ") != ""){ allGood=false; return"\n\t"+textDesc+" is an Invalid Name";} else return "";}
function ccCheck(formField, textDesc) {if(!isCC(eval(""+formName+formField).value)){allGood=false; return"\n\t"+textDesc+" is an Invalid Credit Card Number";}else return "";}
function ssnCheck(formField, textDesc) {if(!isSSN(eval(""+formName+formField).value)){allGood=false; return"\n\t"+textDesc+" is an Invalid Social Security Number";}else return "";}
function emailCheck(formField, textDesc) {if(formatEmail(eval(""+formName+formField).value) == null){allGood=false; return"\n\t"+textDesc+" is an Invalid Email";}else return "";}
function numberCheck(formField, textDesc) {if(!isDecimal(eval(""+formName+formField).value)){allGood=false; return"\n\t"+textDesc+" must be a number";}else return "";}
function dateCheck(formField, textDesc) {if(formatDate(eval(""+formName+formField).value) == null){allGood=false; return"\n\t"+textDesc+" is an invalid date";} else return "";}
function phoneCheck(formField, textDesc){if(formatPhone(eval(""+formName+formField).value) == null){allGood=false;return "\n\t"+textDesc+" is an Invalid Phone Number";} else return "";}


//Requred or not
function textRequired(formField, textDesc, type)
{
	
	if(eval(""+formName+formField).value == "")
	{
		allGood=false;
		return "\n\t"+textDesc+" is required";
	}
	else
		return eval(type+"Check('"+formField+"','"+textDesc+"')");
}

function textNonRequired(formField, textDesc, type)
{	
	if(eval(""+formName+formField).value != "")
	{
		return eval(type+"Check('"+formField+"','"+textDesc+"')");
	}
	else
		return "";
}

////////////////////////////////////
// EXAMPLE USE
///////////////////////////////////
// 	alertMessage += textNonRequired("Applicant2Birth", "Applicant 2 Birthdate","date");

//	alertMessage += textNonRequired("Applicant3Name", "Applicant 3 Name","name");
