	  //validates that the transferType fields passed in is numeric

      function validateNumeric(formHandle, transferType)

      {

		var val = formHandle[transferType].value;	  

		var valLen = val.length;	  		

		var bad = false;	  



		for( var ii = 0; ii < valLen; ii++ )

		{

			var c = val.charAt( ii );

			if( c < '0' || c > '9' )

			{	bad = true; }

		}



		if( bad )

		{

			alert('Not a valid number.');

			formHandle[transferType].focus();   			

			return 0;

		}	  		 	

		return !bad;

	}

	

	//this function assumes three separate fields to the ssn!

	//transferType is the core field name, without the 1, 2 or 3 at the end

	function validateSSN(formHandle, transferType)

	{

		if(!(validateNumeric(formHandle,transferType+1))){	return 0;		}

		if(!(validateNumeric(formHandle,transferType+2))){	return 0;		}

		if(!(validateNumeric(formHandle,transferType+3))){	return 0;		}					

        var holderString1= new String(formHandle[transferType+1].value);

        var holderString2= new String(formHandle[transferType+2].value);

        var holderString3= new String(formHandle[transferType+3].value);

		if( holderString1.length!=3)

		{ alert("Social Security Number format is xxx-xx-xxxx."); formHandle[transferType+1].focus(); return 0; }

		if( holderString2.length!=2 )

		{ alert("Social Security Number format is xxx-xx-xxxx."); formHandle[transferType+2].focus(); return 0; }

		if( holderString3.length!=4 )

		{ alert("Social Security Number format is xxx-xx-xxxx."); formHandle[transferType+3].focus(); return 0; }

		

		return 1;

	}

	

	//commonly put in a loop that goes through an array of fields that need to be required

	function general_check_required(formHandle, transfer_type, section_type)

	{	//text fields only

		var stringHandler = formHandle[transfer_type].value

		var sh2 = stringHandler.substring(0,2)



		if( stringHandler == "")

		{		alert( "Please fill in the required " + section_type + " field.");		

				formHandle[transfer_type].focus();

				return 0;	

		}	

		return 1;

	}		



	//this is meant for the preview page

	//if it comes through as a ## variable, it gets replaced with a space

	function general_check_radio(formHandle, transfer_type)

	{	

		//var formHandle = document.forms[0];

		var stringHandler = formHandle[transfer_type].value

		var sh2 = stringHandler.substring(0,2)

		if( sh2 == "##")

		{		formHandle[transfer_type].value = " "	}	

	}		

	

	//validate the year's length(4) and if numeric

	function validateYear(formHandle, transferType)

	{

		if(!(validateNumeric(formHandle,transferType))){	return 0;		}

        var holderString= new String(formHandle[transferType].value);

		if( holderString.length!=4)

		{ alert("Please enter a 4-digit year."); formHandle[transferType].focus(); return 0; }

		return 1;

	}

	

      function validateEmailAt(formHandle, transferType)

      {

		var val = formHandle[transferType].value;	  

		var valLen = val.length;	  		

		var bad = true;	  



		for( var ii = 0; ii < valLen; ii++ )

		{

			var c = val.charAt( ii );

			if( c == "@" )

			{	

				//if it has more than one @ in it, do the alert

				if( bad == false )

				{ bad = true; }

				else

				{ bad = false; }

			}

		}



		if( bad )

		{

			alert('Email address must have one \@ symbol in it.');

			formHandle[transferType].focus();   			

			return 0;

		}	  		 	

		return !bad;

	}



	function validateEmailDot(formHandle, transferType)

      {

                var val = formHandle[transferType].value;         

                var valLen = val.length;                        

                var bad = true;   



                for( var ii = 0; ii < valLen; ii++ )

                {

                        var c = val.charAt( ii );

                        if( c == "." )

                        {       

                                 bad = false; 

                        }

                }



                if( bad )

                {

                        alert('Email address must have at least one period in it.');

                        formHandle[transferType].focus();                       

                        return 0;

                }                               

                return !bad;

        }

