//======================================================================
//	FUNCTION:  	IsAlpha
//
//	INPUT:		str (string) - the string to be tested
//
//	RETURN:  	true, if the string contains only alphabetic characters 
//						false, otherwise.
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//======================================================================
	function IsAlpha(str)
	{
		// Return immediately if an invalid value was passed in
		if (str+"" == "undefined" || str+"" == "null" || str+"" == "")
		{
			return false;
		}
		
		var isValid = true;
		// Convert to a string for performing string comparisons.
		str += "";

		// Loop through string one character at time,  breaking out of for
		// loop when an non Alpha character is found.
  		for (i = 0; i < str.length; i++)
		{
			// Alpha must be between "A"-"Z", or "a"-"z"
			if ( !( ((str.charAt(i) >= "a") && (str.charAt(i) <= "z")) ||
      			((str.charAt(i) >= "A") && (str.charAt(i) <= "Z")) ) )
			{
         		isValid = false;
         		break;
      		}
		}
   
		return isValid;
	}  //  IsAlpha

//======================================================================
//	FUNCTION:	IsAlphaNum
// 
//	INPUT:		str (string) - a string that will be tested to ensure that
//      					   each character is a digit or a letter.
//
//	RETURN:  	true, if all characters in the string are a character from 0-9
//     							or a-z or A-Z;  
//						false, otherwise
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//======================================================================
	function IsAlphaNum(str)
	{
		// Return immediately if an invalid value was passed in
		if (str+"" == "undefined" || str+"" == "null" || str+"" == "")
		{
			return false;
		}

		var isValid = true;
		// Convert to a string for performing string comparisons.
   		str += "";	

		// Loop through length of string and test for any alpha numeric 
		// characters
   		for (i = 0; i < str.length; i++)
   		{
			// Alphanumeric must be between "0"-"9", "A"-"Z", or "a"-"z"
      		if (!(((str.charAt(i) >= "0") && (str.charAt(i) <= "9")) || 
      			((str.charAt(i) >= "a") && (str.charAt(i) <= "z")) ||
      			((str.charAt(i) >= "A") && (str.charAt(i) <= "Z"))))
			{
				isValid = false;
				break;
			}	
   		}
   
   		return isValid;
	}  //  IsAlphaNum

//======================================================================
//	FUNCTION:	IsAlphaNumOrUnderscore
//
//	INPUT:		str (string) - the string to be tested
//
//	RETURN:  	true, if the string contains only alphanumeric characters or underscores.
//						false, otherwise.
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//======================================================================
	function IsAlphaNumOrUnderscore(str)
	{
		// Return immediately if an invalid value was passed in
		if (str+"" == "undefined" || str+"" == "null" || str+"" == "")	
		{
			return false;
		}

		var isValid = true;
		// Convert to a string for performing string comparisons.
		str += "";
		// Loop through string one character at a time. If non-alpha numeric
		// is found then, break out of loop and return a false result

		for (i = 0; i < str.length; i++)
   		{
			// Alphanumeric must be between "0"-"9", "A"-"Z", or "a"-"z"
      		if ( !( ((str.charAt(i) >= "0") && (str.charAt(i) <= "9")) || 
      			((str.charAt(i) >= "a") && (str.charAt(i) <= "z")) ||
      			((str.charAt(i) >= "A") && (str.charAt(i) <= "Z")) ||
      			(str.charAt(i) == "_") ) )
      		{
   				isValid = false;
         		break;
      		}
		}
   
		return isValid;
	}  //  IsAlphaNumOrUnderscore

//======================================================================
//	FUNCTION:	IsBlank
// 
//	INPUT:		val - the value to be tested
//
//	RETURN:  	true, if the string is null, undefined or an empty string, ""
//      				false, otherwise.
//
//	CALLS:		IsNull(), IsUndef() which are defined elsewhere in the Script Library.
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//======================================================================
	function IsBlank(str)
	{
		var isValid = false;

 		if ( IsNull(str) || IsUndef(str) || (str+"" == ""))
 		{
 			isValid = true;
		}
		
		return isValid;
	}  //  IsBlank

//======================================================================
//	FUNCTION:  	IsInt
// 
//	INPUT:  	numstr (string/number) 				- the string that will be tested  to ensure that each character
//																		   is a digit
//						allowNegatives (boolean)		- (optional) when true, allows  numstr to be negative (contain a '-').
//																			When false, any negative number or a
//																			string starting with a '-' will be  considered invalid.
//
//	RETURN:  	true, if all characters in the string are a character from 0-9,
//								regardless of value for allowNegatives 
//						true, if allowNegatives is true and the string starts with a '-', and all other
//								characters are 0-9.
//   					false, otherwise.
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//======================================================================
	function IsInt(numstr, allowNegatives)
	{
		// Return immediately if an invalid value was passed in
		if (numstr+"" == "undefined" || numstr+"" == "null" || numstr+"" == "")
		{
			return false;
		}
		
		// Default allowNegatives to true when undefined or null
		if (allowNegatives+"" == "undefined" || allowNegatives+"" == "null")
		{
			allowNegatives = true;
		}
		
		var isValid = true;
		// Convert to a string for performing string comparisons.
		numstr += "";	

		// Loop through string and test each character. If any
		// character is not a number, return a false result.
 		// Include special case for negative numbers (first char == '-').   
		for (i = 0; i < numstr.length; i++)
		{
    		if (!((numstr.charAt(i) >= "0") && (numstr.charAt(i) <= "9") || (numstr.charAt(i) == "-")))
			{
       			isValid = false;
       			break;
			}
			else if ((numstr.charAt(i) == "-" && i != 0) || 
				(numstr.charAt(i) == "-" && !allowNegatives))
			{
       			isValid = false;
		       	break;
			}
         	         	       
		}
   
   		return isValid;
	}  //  IsInt

//======================================================================
//	FUNCTION:	IsNull
// 
//	INPUT:		val - the value to be tested
//
//	RETURN:  	true, if the value is null;
//      				false, otherwise.
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//======================================================================
	function IsNull(val)
	{
		var isValid = false;

 		if (val+"" == "null")
 			isValid = true;
		
		return isValid;
	}  //  IsNull

///======================================================================
//	FUNCTION:  	IsNum
// 
//	INPUT:  	numstr (string/number) - the string that will be tested to ensure 
//      								 that the value is a number (int or float)
//
//	RETURN:  	true, if all characters represent a valid integer or float
//     					false, otherwise.
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//======================================================================
	function IsNum(numstr)
	{
		// Return immediately if an invalid value was passed in
		if (numstr+"" == "undefined" || numstr+"" == "null" || numstr+"" == "")
		{
			return false;
		}
	
		var isValid = true;
		// Number of decimal points in the string
		var decCount = 0;

		// Convert to a string for performing string comparisons.
		numstr += "";	

		// Loop through string and test each character. If any
		// character is not a number, return a false result.
 		// Include special cases for negative numbers (first char == '-')
		// and a single decimal point (any one char in string == '.').   
		for (i = 0; i < numstr.length; i++)
		{
			// track number of decimal points
			if (numstr.charAt(i) == ".") decCount++;

    		if (!(((numstr.charAt(i) >= "0") && (numstr.charAt(i) <= "9")) || 
				  ((numstr.charAt(i) == "-") || (numstr.charAt(i) == "."))))
			{
       			isValid = false;
       			break;
			}
			else if ((numstr.charAt(i) == "-" && i != 0) ||
				(numstr.charAt(i) == "." && numstr.length == 1) ||
			  (numstr.charAt(i) == "." && decCount > 1))
			{
   				isValid = false;
     			break;
			}         	         	       
			//if (!((numstr.charAt(i) >= "0") && (numstr.charAt(i) <= "9")) || 
		}
   
   		return isValid;
	}  //  IsNum

//======================================================================
//	FUNCTION:	IsUndef
// 
//	INPUT:		val - the value to be tested
//
//	RETURN:  	true, if the value is undefined
//      				false, otherwise.
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//======================================================================
	function IsUndef(val)
	{
		var isValid = false;

 		if (val+"" == "undefined")
 		{
 			isValid = true;
		}
		
		return isValid;
	}  //  IsUndef

//======================================================================
//	FUNCTION:  	IsValid5DigitZip
// 
//	INPUT:    	str (string) - a 5-digit zip code to be tested
//
//	RETURN:  	true, if the string is 5-digits long
//						false, otherwise
//
//	CALLS:		IsBlank(), IsInt() which are defined elsewhere in the Script Library
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//======================================================================
	function IsValid5DigitZip( str )
	{
		// Return immediately if an invalid value was passed in
		if (str+"" == "undefined" || str+"" == "null" || str+"" == "")
		{
			return false;
		}
		
		var isValid = true;
		// Convert to a string for performing string comparisons.
		str += "";

		// Rules: zipstr must be 5 characters long, and can only contain numbers from
		// 0 through 9
		if (IsBlank(str) || (str.length != 5) || !IsInt(str, false))
		{
			isValid = false;
		}
		
		return isValid;
	}  //  IsValid5DigitZip

//======================================================================
//	FUNCTION:  	IsValid5Plus4DigitZip
// 
//	INPUT:    	str (string) - a 5+4 digit zip code to be tested
//
//	RETURN:  	true, if the string contains 5-digits followed by a dash followed by 4 digits
//						false, otherwise
//
//	CALLS:		IsBlank(), IsInt() which are defined elsewhere in the Script Library
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//======================================================================
	function IsValid5Plus4DigitZip(str)
	{
		// Return immediately if an invalid value was passed in
		if (str+"" == "undefined" || str+"" == "null" || str+"" == "")
		{
			return false;
		}
		
		var isValid = true;
		// Convert to a string for performing string comparisons.
		str += "";

		// Rules: The first five characters may contain only digits 0-9,
		// the 6th character must be a dash, '-', and 
		// the last four characters may contain only digits 0-9.
		// The total string length must be 10 characters.
   		if (IsBlank(str) || (str.length != 10) || 
			!IsInt(str.substring(0,5), false) || str.charAt(5) != '-' ||
			!IsInt(str.substring(6,10), false))
		{	
			isValid = false;
		}
		
   		return isValid;
	}

//======================================================================
//	FUNCTION:  	IsValidEmail
// 
//	INPUT:    	str (string) - an e-mail address to be tested
//
//	RETURN:  	true, if the string contains a valid e-mail address which
//					  is a string plus an '@' character followed by another
//					  string containing at least one '.' and ending in an
//					  alpha (non-punctuation) character.
//				false, otherwise
//
//	CALLS:		IsBlank(), IsAlpha() which are defined elsewhere in the Script Library
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  	Microsoft Internet Explorer 3.02 and higher,
//			  	Netscape Enterprise Server 3.0,
//			  	Microsoft IIS/ASP 3.0.
//======================================================================
	function IsValidEmail(str)
	{
		// Return immediately if an invalid value was passed in
		if (str+"" == "undefined" || str+"" == "null" || str+"" == "")
		{
			return false;
		}
		
		var isValid = true;
		// Convert to a string for performing string comparisons.
		str += "";

		namestr = str.substring(0, str.indexOf("@"));  // everything before the '@'
		domainstr = str.substring(str.indexOf("@")+1, str.length); // everything after the '@'

		// Rules: namestr cannot be empty, or that would indicate no characters before the '@',
		// domainstr must contain a period that is not the first character (i.e. right after
		// the '@').  The last character must be an alpha.
   		if (IsBlank(str) || (namestr.length == 0) || 
			(domainstr.indexOf(".") <= 0) ||
			(domainstr.indexOf("@") != -1) ||
			!IsAlpha(str.charAt(str.length-1)))
		{	
			isValid = false;
		}
		
   		return isValid;
	}

//======================================================================
//	FUNCTION:  	IsValidPhone
// 
//	INPUT:    	str (string)		  - an phone number to be tested
//													incAreaCode (boolean) - if true, area code is included
//													(10-digits);
//													if false or undefined, area code
//													not included
//
//	RETURN:		true, if the string contains a 7-digit phone number and
//									incAreaCode == false or is undefined
//							true, if the string contains a 10-digit phone number and
//									incAreaCode == true
//							false, otherwise
//
//	CALLS:		StripNonNumeric(), which is defined elsewhere in the Script Library
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//======================================================================
	function IsValidPhone(str, incAreaCode)
	{
		// Return immediately if an invalid value was passed in
		if (str+"" == "undefined" || str+"" == "null" || str+"" == "")
		{
			return false;
		}
		
		// Set default value for incAreaCode to false, if undefined or null
		if (incAreaCode+"" == "undefined" || incAreaCode+"" == "null")
		{
			incAreaCode = false;
		}
		
		var isValid = true;
		// Convert to a string for performing string comparisons.
		str += "";

		// After stripping out non-numeric characters, such as dashes, the
		// phone number should contain 7 digits (no area code) or 10 digits (area code)
		str = StripNonNumeric(str+"");
		if (incAreaCode && str.length != 10)
		{
			isValid = false;
		}	
		if (!incAreaCode && str.length != 7)
		{
			isValid = false;
		}
		
   		return isValid;
	}  //  IsValidPhone

//======================================================================
//	FUNCTION:  	IsValidSSN
// 
//	INPUT:    	str (string)						- an phone number to be tested
//						incDashes (boolean)	 - if true, str includes dashes
//																	(e.g. 111-12-3456);
//																	if false, str contains only digits
//				
//	RETURN:  	true, if the string contains digits and dashes in the form  111-12-3456;
//						true, if the string contains a 9-digit number and incDashes	is false;
//						false, otherwise
//
//	CALLS:		IsInt(), which is defined elsewhere in the Script Library
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//======================================================================
	function IsValidSSN(str, incDashes)
	{
		// Return immediately if an invalid value was passed in
		if (str+"" == "undefined" || str+"" == "null" || str+"" == "")
		{
			return false;
		}
		
		var isValid = true;
		// Set default value for incDashes to true, if undefined or null
		if (incDashes+"" == "undefined" || incDashes+"" == "null")
		{
			incDashes = true;
		}
			
		// Make sure it's a string
		str += "";

		if (!incDashes && (!IsNum(str) || str.length != 9))
		{
			isValid = false;
		}
		
		var part1 = str.substring(0,3);
		var part2 = str.substring(4,6);
		var part3 = str.substring(7,str.length);

		// Ensure that the first part is a number and 3 digits long,
		// the second part is a number and 2 digits long,
		// the third part is a number and 4 digits long, e.g. 111-22-3333
		if (incDashes && ((!IsInt(part1, false) || part1.length != 3) ||
		   (!IsInt(part2, false) || part2.length != 2) || 
		   (!IsInt(part3, false) || part3.length != 4)) )
		{   
			isValid = false;
		}
		
   		return isValid;
	}  //  IsValidSSN

//======================================================================
//	FUNCTION:  	IsValidDate
// 
//	INPUT:    	str (string) - a date to be tested
//				
//	RETURN:  	true, if the string contains digits and slashes in the form
//								MM/DD/YYYY MM-DD-YYYY;
//						alse, otherwise
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//======================================================================
	function IsValidDate(str)
	{		var bRtrn = true;
		var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{4})$/;		// validate the format
		var matchArray = str.match(datePat);		if (matchArray == null)
		{			bRtrn = false;
//			alert("Date is not in a valid format.")		}
		else
		{					// - Correct month ??
			month = matchArray[1]; // parse date into variables			day = matchArray[3];			year = matchArray[4];			if (month < 1 || month > 12)
			{//				alert("Month must be between 1 and 12.");				bRtrn = false;			}
			else
			{				// - Correct day ??
				if (day < 1 || day > 31)
				{//					alert("Day must be between 1 and 31.");					bRtrn = false;				}
				if ((month==4 || month==6 ||
					 month==9 || month==11) && day==31)
				{//					alert("Month "+month+" doesn't have 31 days!")					bRtrn = false;				}				if (month == 2)
				{					var bIsLeap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));					if (day > 29 || (day==29 && !bIsLeap))
					{//						alert("February " + year + " doesn't have " + day + " days!");						bRtrn = false;					}				}
			}		
		}		
						return (bRtrn);	}  //  IsValidDate
//======================================================================
//	FUNCTION:  	IsQuarterEndDate
// 
//	INPUT:    	str (string) - a date to be tested
//				
//	RETURN:  	true, if the string contains digits and slashes in the form
//								MM/DD/YYYY MM-DD-YYYY;
//						alse, otherwise
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//======================================================================
	function IsQuarterEndDate(str)
	{		var bRtrn = true;
		var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{4})$/;		// validate the format
		var matchArray = str.match(datePat);		if (matchArray == null)
		{			bRtrn = false;
//			alert("Date is not in a valid format.")		}
		else
		{					// - Correct month ??
			month = matchArray[1]; // parse date into variables			day = matchArray[3];			year = matchArray[4];			if (month < 1 || month > 12)
			{//				alert("Month must be between 1 and 12.");				bRtrn = false;			}
			else
			{				
				if (month!=3 && month!=6 &&
					 month!=9 && month!=12)
				{//					alert("Month "+month+" isn't a quarterend month!")					bRtrn = false;				}				else				{				    if ((month==3 || month==12) && day!=31)
				    {    //					alert("Quarter End Month "+month+" must have 31 days!")					    bRtrn = false;				    }				    else				    {				        if ((month==6 || month==9) && day!=30)
				        {        //					alert("Quarter End Month "+month+" must have 30 days!")					        bRtrn = false;				        }				    }				}			}		
		}		
						return (bRtrn);	}  //  IsQuarterEndDate
	
//======================================================================
//	FUNCTION:  	IsWithinQtrRange
// 
//	INPUT:    	str (string) - a date to be tested
//				
//	RETURN:  	true, if the string contains digits and slashes in the form
//								MM/DD/YYYY MM-DD-YYYY;
//						alse, otherwise
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//======================================================================
	function IsWithinQtrRange(str)
	{
	    var bRtrn = true;
	    var currDate  = new Date();
        var currDay   = currDate.getDate();
        var currMonth = currDate.getMonth();
        var currYear  = currDate.getYear();
        var ModMonth = currMonth + 3;
        var ModMonth2 = currMonth - 3;
        var ModYear = currYear;
        var ModYear2 = currYear;
              
		var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{4})$/;		// validate the format
		var matchArray = str.match(datePat);		if (matchArray == null)
		{			bRtrn = false;
//			alert("Date is not in a valid format.")		}
		else
		{					// - Correct Range??
			month = matchArray[1]; // parse date into variables			day = matchArray[3];			year = matchArray[4];						// Check date future            if (ModMonth > 12)
            { 
                ModMonth = ModMonth - 12;
                ModYear = currYear + 1;
                if ((year==ModYear) && (month > ModMonth))
                {        			alert("AsofDate -  must be no greater than 1 Qtr past1 most recent past Qtr!")                    bRtrn = false;                }       		
            }
            else
            {
                if ((year == ModYear) && (month > ModMonth))
                {        			alert("AsofDate -  must be no greater than 1 Qtr past2 most recent past Qtr!")                   bRtrn = false;                } 
            }
           
            // Check date past
            if (ModMonth2 < 1)
            { 
                ModMonth2 = ModMonth2 + 12;
                ModYear2 = currYear - 1;
                if ((year <= ModYear2) && (month<ModMonth2))
                {        			alert("AsofDate -  must be no greater than 1 Qtr before1 most recent past Qtr!")                    bRtrn = false;                }            }    		
            else
            {
                if ((year == ModYear2) && (month<ModMonth2))
                {        			alert("AsofDate -  must be no greater than 1 Qtr befire2 most recent past Qtr!")                    bRtrn = false;                }            }
           
        }						return (bRtrn);	}  //  IsWithinQtrRange
	
// Validation helpers
	function Validate_Selection(aField, sValue)
	{
		var bRtrn = true;

		if (!IsInt(sValue, false))
		{
			bRtrn = false;
		}
		else
		{
			if (aField.options.length > 0)
			{
				bRtrn = false;
				for (var nOptions = 0; nOptions < aField.options.length; nOptions++)
				{
					if (sValue == aField.options[nOptions].value)
					{
						bRtrn = true;
						break;	
					}					
				}
			}
		}
		
		return (bRtrn);
	}
//======================================================================
//	FUNCTION:  	Validate_Decimals
// 
//	INPUT:   	sValue (string)			- a supposed numeric value.
//					nDecimals (int)			- a value representing the number of decimals that are valid.
//					nMinValue (single)	- a value representing the minimum value that will be accepted.
//					nMaxValue (single)	- a value representing the maximum value
//														   that will be accepted.
//				
//	RETURN:  	string, if the value does not meet the value validation
//					    a string representing the error will be passed.
//						null, otherwise
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//======================================================================
	function Validate_Decimals(sValue, nDecimals, nMinValue, nMaxValue)
	{		var sRtrn = null;
				// Validate		// - Is this even a number
		if ((sValue.length == 0) || !IsNum(sValue))
		{			sRtrn = "Please enter a valid number (" + Format_DecimalAmount(nMinValue, nDecimals, true) +
					" - " + Format_DecimalAmount(nMaxValue, nDecimals, true) + ").";		}		else
		{			// - Test decimal points//			var nDecValue = parseFloat(sValue) * Math.pow(10, nDecimals);//			var nIntValue = parseInt(parseFloat(sValue) * Math.pow(10, nDecimals));//			if (nDecValue != nIntValue)			var nDecLoc = sValue.indexOf(".");
			if ((nDecimals > 0) &&
				(nDecLoc != -1) && 				((sValue.length - nDecLoc) > (nDecimals+1)))
			{				sRtrn = "Please enter a number with " + nDecimals + " decimal places only.";			}
			else
			{
				// - Test range values				if (nMinValue < nMaxValue)
				{
					if ((sValue < nMinValue) || (sValue > nMaxValue))
					{
						sRtrn = "Please enter a valid number (" + Format_DecimalAmount(nMinValue, nDecimals, true) +
								" - " + Format_DecimalAmount(nMaxValue, nDecimals, true) + ").";					}				}
			}		}
		
		return (sRtrn);	}
	
//====================================================================================
//	FUNCTION:	Validate_CheckboxArray
// 
//	INPUT:		nFormNumber (Integer)		- The form number that this control resides.
//						strFormIDPrefix (String)		- The 'Prefix' of the controlID for form[nFormNumber].
//						nCheckboxCount (Integer)	- The number of checkBox controls in the array.
//						nValidAmount (Integer)			- The number of checkboxes required
//
//	RETURN:  	<true>; If valid params, & form[nFormNumber] & checkboc checked >= nValidAmount
//						<false>; None of the above have been meet.
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//====================================================================================
	function Validate_CheckboxArray(nFormNumber, strControlIDPrefix, nCheckboxCount, nValidAmount)
	{
		// Setup return value
		var bRtrn = false;

		// Validate parameters
		if (IsInt(nFormNumber, false) &&
			IsInt(nCheckboxCount, false) &&
			IsInt(nValidAmount, false) &&
			!IsUndef(document.forms[nFormNumber]))
		{
			// - Construct the 'control' array
			var aCheckBoxes = new Array(nCheckboxCount);
			for (var nItem = 0; nItem < aCheckBoxes.length; nItem++)
			{
				aCheckBoxes[nItem] = strControlIDPrefix + (nItem+1);
			}

			// - Validate at least one is selected
			var nCount = 0;
			for (nItem = 0; nItem < aCheckBoxes.length; nItem++)
			{
				// - Does this control even exist ?
				if (!IsNull(document.forms[nFormNumber].item(aCheckBoxes[nItem])))
				{
					// - If it's checked then, count
					if (document.forms[nFormNumber].item(aCheckBoxes[nItem]).checked)
						nCount++
				}
			}

			//	- Have any items been selected
			if (nCount >= nValidAmount) bRtrn = true;
		}
		
		// - Return value
		return (bRtrn);
	}

//====================================================================================
//	FUNCTION:	Validate_CheckboxArrayRequired
// 
//	INPUT:		nFormNumber (Integer)		- The form number that this control resides.
//						strFormIDPrefix (String)		- The 'Prefix' of the controlID for form[nFormNumber].
//						nCheckboxCount (Integer)	- The number of checkBox controls in the array.
//						nValidAmount (Integer)			- The number of checkboxes required
//
//	RETURN:  	<true>; If valid params, & form[nFormNumber] & checkboc checked >= nValidAmount
//						<false>; None of the above have been meet.
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//====================================================================================
	function Validate_CheckboxArrayRequired(nFormNumber, strControlIDPrefix, nCheckboxCount, nValidAmount, nMaxAmount)
	{
		// Setup return value
		var bRtrn = false;

		// Validate parameters
		if (IsInt(nFormNumber, false) &&
			IsInt(nCheckboxCount, false) &&
			IsInt(nValidAmount, false) &&
			IsInt(nMaxAmount, false) &&
			!IsUndef(document.forms[nFormNumber]))
		{
			// - Construct the 'control' array
			var aCheckBoxes = new Array(nCheckboxCount);
			for (var nItem = 0; nItem < aCheckBoxes.length; nItem++)
			{
				aCheckBoxes[nItem] = strControlIDPrefix + (nItem+1);
			}

			// - Validate at least one is selected
			var nCount = 0;
			for (nItem = 0; nItem < aCheckBoxes.length; nItem++)
			{
				// - Does this control even exist ?
				if (!IsNull(document.forms[nFormNumber].item(aCheckBoxes[nItem])))
				{
					// - If it's checked then, count
					if (document.forms[nFormNumber].item(aCheckBoxes[nItem]).checked)
						nCount++
				}
			}

			//	- Have any items been selected
			if (nCount >= nValidAmount && nCount <= nMaxAmount) bRtrn = true;
		}
		
		// - Return value
		return (bRtrn);
	}

//====================================================================================
//	FUNCTION:	Validate_SelectionArray
// 
//	INPUT:		nFormNumber (Integer)	- The form number that this control resides.
//						strControlID (String)			- The controlID for form[nFormNumber].item(strControlID)
//						nValidAmount (Integer)		- The number of listbox selections required
//
//	RETURN:  	<true>; If valid params, & form[nFormNumber] & listbox items selected >= nValidAmount
//						<false>; None of the above have been meet.
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//====================================================================================
	function Validate_SelectionArray(nFormNumber, strControlID, nValidAmount)
	{
		// Setup return value
		var bRtrn = false;
		
		// Validate parameters
		if (IsInt(nFormNumber, false) &&
			IsInt(nValidAmount, false) &&
			!IsUndef(document.forms[nFormNumber]))
		{
			// - Does this control even exist ?
			if (!IsNull(document.forms[nFormNumber].item(strControlID)))
			{
				var nCount = 0;
				var nMax = document.forms[nFormNumber].item(strControlID).length;

				// - Validate at least one is selected
				for (var nItem = 0; nItem < nMax; nItem++)
				{
					// - Does this control even exist ?
					if (!IsNull(document.forms[nFormNumber].item(strControlID)[nItem]))
					{
						// - Don't validate if the selection value is 'NA'
						if (document.forms[nFormNumber].item(strControlID)[nItem].value != "-1")
						{
							// - If it's selected then, count
							if (document.forms[nFormNumber].item(strControlID)[nItem].selected)
								nCount++;
						}
					}
				}
			
				//	- Have any items been selected
				if (nCount >= nValidAmount) bRtrn = true;
			}
		}

		// - Return value
		return (bRtrn);
	}

//====================================================================================
//	FUNCTION:	Validate_CheckboxArray_One
// 
//	INPUT:		nFormNumber (Integer)		- The form number that this control resides.
//						strControlIDPrefix (String)	- The 'Prefix' of the controlID for form[nFormNumber].
//						nCheckboxCount (Integer)	- The number of checkBox controls in the array.
//						objThis (Control)					- The checkbox 'control' that is to be validated against.
//
//	RETURN:  	<nothing>
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//====================================================================================
	function Validate_CheckboxArray_One(nFormNumber, strControlIDPrefix, nCheckboxCount, objThis)
	{
		// Validate parameters
		if (IsInt(nFormNumber, false) &&
			IsInt(nCheckboxCount, false) &&
			!IsUndef(document.forms[nFormNumber]) &&
			!IsUndef(objThis))
		{
			// - Does this control even exist ?
			if (!IsNull(document.forms[nFormNumber].item(objThis.name)))
			{
				// - If this is unchecked the don't decheck others
				if (document.forms[nFormNumber].item(objThis.name).checked)
				{
					// - Construct the 'control' array
					var strWork1 = "";
					var aCheckBoxes = new Array(nCheckboxCount);
					for (var nItem = 1; nItem <= aCheckBoxes.length; nItem++)
					{
						strWork1 = strControlIDPrefix + nItem;
						if (strWork1 != objThis.name)
						{
							// - Does this control even exist ?
							if (!IsNull(document.forms[nFormNumber].item(strWork1)))
								aCheckBoxes[aCheckBoxes.length] = strWork1;
						}	
					}

					// - Validate at least one is selected
					for (nItem = 0; nItem < aCheckBoxes.length; nItem++)
					{
						// - If it's checked then, count
						if (document.forms[nFormNumber].item(aCheckBoxes[nItem]).checked)
							document.forms[nFormNumber].item(aCheckBoxes[nItem]).checked = false;					
					}
				}
			}
		}
	}  //  Validate_CheckboxArray_One

//====================================================================================
//	FUNCTION:	Spec_CheckboxArray_MakeValue
// 
//	INPUT:		nFormNumber (Integer)		- The form number that this control resides.
//						strControlIDPrefix (String)	- The 'Prefix' of the controlID for form[nFormNumber].
//						nCheckboxCount (Integer)	- The number of checkBox controls in the array.
//						strControlID (String)				- The checkbox 'control' that is to be validated against.
//
//	RETURN:  	<nothing>
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//====================================================================================
	function Spec_CheckboxArray_MakeValue(nFormNumber, strControlIDPrefix, nCheckboxCount, strControlID)
	{
		// Validate parameters
		if (IsInt(nFormNumber, false) &&
			IsInt(nCheckboxCount, false) &&
			!IsUndef(document.forms[nFormNumber]) &&
			!IsNull(document.forms[nFormNumber].item(strControlID)))
		{
			// - Construct the 'control' array
			var strWork1 = "";
			var aCheckBoxes = new Array();
			for (var nItem = 1; nItem <= nCheckboxCount; nItem++)
			{
				strWork1 = strControlIDPrefix + nItem;
				// - Does this control even exist ?
				if (!IsNull(document.forms[nFormNumber].item(strWork1)))
					aCheckBoxes[aCheckBoxes.length] = strWork1;
			}

			// - Validate at least one is selected
			strWork1 = new String();
			for (nItem = 0; nItem < aCheckBoxes.length; nItem++)
			{
				// - If it's checked then, count
				if (document.forms[nFormNumber].item(aCheckBoxes[nItem]).checked)
				{
					if (strWork1.length > 0) strWork1 += ", ";
					strWork1 += document.forms[nFormNumber].item(aCheckBoxes[nItem]).value;
				}	
			}
				
			// - Set the 'Value' field
			document.forms[nFormNumber].item(strControlID).value = strWork1;
		}
	}  //  Spec_CheckboxArray_MakeValue

//====================================================================================
//	FUNCTION:	Validate_RadioChecked
// 
//	INPUT:		nFormNumber (Integer)	- The form number that this control resides.
//						strControlID (String)			- The radio button 'control' that is to be validated against.
//
//	RETURN:  	<nothing>
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//====================================================================================
	function Validate_RadioChecked(nFormNumber, strControlID)
	{
		var bRtrn = false;

		// Validate parameters
		if (IsInt(nFormNumber, false) &&
			!IsUndef(document.forms[nFormNumber]) &&
			!IsNull(document.forms[nFormNumber].item(strControlID)))
		{
			for (var nItem = 0; nItem < document.forms[nFormNumber].item(strControlID).length; nItem++)
			{
				if (document.forms[nFormNumber].item(strControlID)[nItem].checked)
				{
					bRtrn = true;
					break;
				}
			}
		}
				
		return (bRtrn);
	}  //  Validate_RadioChecked

//====================================================================================
//	FUNCTION:	Disable_RadioGroup
// 
//	INPUT:		nFormNumber (Integer)	- The form number that this control resides.
//						strControlID (String)			- The radio button 'control' that is to be disabled/enabled.
//						bEnable (Boolean)			- Value to use for the '.disabled' property.
//						bClear (Boolean)				- Clear any 'checked' values.
//
//	RETURN:  	<nothing>
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//====================================================================================
	function Disable_RadioGroup(nFormNumber, strControlID, bEnabled, bClear)
	{
		var bRtrn = false;

		// Validate parameters
		if (IsInt(nFormNumber, false) &&
			!IsUndef(document.forms[nFormNumber]) &&
			!IsNull(document.forms[nFormNumber].item(strControlID)))
		{
			bRtrn = true;

			for (var nItem = 0; nItem < document.forms[nFormNumber].item(strControlID).length; nItem++)
			{
				document.forms[nFormNumber].item(strControlID)[nItem].disabled = !bEnabled;
				if ((bClear) && (document.forms[nFormNumber].item(strControlID)[nItem].checked))
				{
					document.forms[nFormNumber].item(strControlID)[nItem].checked = false;
				}
			}
		}
				
		return (bRtrn);
	}  //  Disable_RadioGroup

//====================================================================================
//	FUNCTION:	Spec_CheckboxArray_SetControls
// 
//	INPUT:		nFormNumber (Integer)		- The form number that this control resides.
//						strControlIDPrefix (String)	- The 'Prefix' of the controlID for form[nFormNumber].
//						nCheckboxCount (Integer)	- The number of checkBox controls in the array.
//						strControlID (String)				- The checkbox 'control' that is to be validated against.
//
//	RETURN:  	<nothing>
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//====================================================================================
	function Spec_CheckboxArray_SetControls(nFormNumber, strControlIDPrefix, nCheckboxCount, strControlID)
	{
		// Validate parameters
		if (IsInt(nFormNumber, false) &&
			IsInt(nCheckboxCount, false) &&
			!IsUndef(document.forms[nFormNumber]) &&
			!IsNull(document.forms[nFormNumber].item(strControlID)))
		{
			// - Get the 'Control' value
			var strControlValue = new String(document.forms[nFormNumber].item(strControlID).value);
			if (strControlValue.length > 0)
			{
				// - Add the 'lookup' control
				strControlValue = new String(", " + strControlValue + ",");
			
				// - Construct the 'control' array
				var strWork1 = "";
				var aCheckBoxes = new Array(nCheckboxCount);
				for (var nItem = 1; nItem <= aCheckBoxes.length; nItem++)
				{
					strWork1 = strControlIDPrefix + nItem;
					// - Does this control even exist ?
					if (!IsNull(document.forms[nFormNumber].item(strWork1)))
						aCheckBoxes[aCheckBoxes.length] = strWork1;
				}

				// - Set the 'Checkbox' if the 'Value' exists in the list
				strWork1 = "";
				var bFlag = false;
				for (nItem = 0; nItem < aCheckBoxes.length; nItem++)
				{
					// - Does this controls value exist in the 'list'
					bFlag = false;
					strWork1 = ", " + document.forms[nFormNumber].item(aCheckBoxes[nItem]).value + ",";
					if (strControlValue.indexOf(strWork1) != -1) bFlag = true;
					document.forms[nFormNumber].item(aCheckBoxes[nItem]).checked = bFlag;
				}
			}
		}
	}  //  Spec_CheckboxArray_SetControls

//====================================================================================
//	FUNCTION:	Spec_RadioButton_SetControl
// 
//	INPUT:		nFormNumber (Integer)	- The form number that this control resides.
//						strControlID (String)			- The radio 'control' that is to be validated against.
//						strValue (String)				- The 'value' that is the control offset to set.
//
//	RETURN:  	<nothing>
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//====================================================================================
	function Spec_RadioButton_SetControl(nFormNumber, strControlID, strValue)
	{
		// Validate parameters
		if (IsInt(nFormNumber, false) &&
			!IsUndef(document.forms[nFormNumber]) &&
			!IsNull(document.forms[nFormNumber].item(strControlID)))
		{
			// - Get the 'Control'
			var objControl = document.forms[nFormNumber].item(strControlID);
			// - Set the 'Radio' if the 'Value' exists in the list
			for (var nItem = 0; nItem < objControl.length; nItem++)
			{
				// - Does this controls value exist in the 'list'
				if (objControl[nItem].value == strValue)
				{
					objControl[nItem].checked = true;
					break;
				}	
			}
		}
	}  //  Spec_RadioButton_SetControl

//======================================================================
//	FUNCTION:  	Validate_DisplayErrors
// 
//	INPUT:    	asErrors (Array of strings) - an array of error strings. 
//				
//	RETURN:  	true, if the param was an array & contained errors
//						false, otherwise
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//======================================================================
	function Validate_DisplayErrors(asErrors)
	{
		var bRtrn = false;
		
		// Validate params
		if ((typeof(asErrors) == "object") &&
			(asErrors.length > 0))
		{
			bRtrn = true;
		
			var sPrefix = new String();
			var sPostfix = new String();
			sPrefix = "------------------------------------------------------------------------------------------------\n";
			sPrefix += "The form was not submitted because of the following error(s).\n"; 
			sPrefix += "Please correct these error(s) to continue.\n"; 
			sPrefix += "------------------------------------------------------------------------------------------------\n";
			sPrefix += "\n";

//			sPostfix += "\n";
			sPostfix += "------------------------------------------------------------------------------------------------\n";

			// - If the screen size is to small then we must parse the errors
			var bMultiDisplay = false;
			var nMultiBreak = 6;
			if ((screen.height <= 600) && (asErrors.length > nMultiBreak)) bMultiDisplay = true;
			if ((!bMultiDisplay) && (asErrors.length > nMultiBreak))
			{
				bMultiDisplay = true;
				nMultiBreak = 10;
			}

			var nMultiLoop = (bMultiDisplay ? (asErrors.length / nMultiBreak) : 0);
			var sOutput = new String();
			for (var nMultiItem = 0; nMultiItem <= nMultiLoop; nMultiItem++)
			{
				// - Segment as needed based on screen size & options
				var nStartItem = 0;
				var nEndItem = asErrors.length;
				if (bMultiDisplay)
				{
					nStartItem = nMultiItem * nMultiBreak;
					nEndItem = nStartItem + nMultiBreak;
					if (nEndItem > asErrors.length) nEndItem = asErrors.length;
				}

				// - Accumulate the output
				sOutput = "";
				for (var nErrItem = nStartItem; nErrItem < nEndItem; nErrItem++)
				{
					sOutput += asErrors[nErrItem];
					sOutput += "\n\n";
				}  //  for (var nErrItem = nStartItem; nErrItem < nEndItem; nErrItem++)
				if (sOutput.length > 0) alert(sPrefix + sOutput + sPostfix);
				
			}  //  for (var nMultiItem = 0; nMultiItem <= nMultiLoop; nMultiItem++)
		}  //  if ((typeof(asErrors) == "object") && (asErrors.length > 0))
	
		return (bRtrn);	
	}  //  Validate_DisplayErrors
//===============================================================================
//	FUNCTION:	FSS_LimitTextArea
// 
//	INPUT: 		objField (textarea object)	- The field to limit the text.
//						nMaxLimit (number)			- The maximum limit for text entry.
//
//	RETURN:		<nothing>
//
//	DESC:		This function is used with client-side code to limit the amount of text
//
//	PLATFORMS:	IIS & Apache, w/Chilisoft.
//===============================================================================
	function FSS_LimitTextArea(objfield, nMaxlimit)
	{
		if (objfield.value.length > nMaxlimit)
		{
			objfield.value = objfield.value.substring(0, nMaxlimit);
			alert("You have reached the limit allowed for entering text. (" + nMaxlimit + " chracters)");
		}
	}  //  FSS_LimitTextArea

//===============================================================================
//	FUNCTION:	IsValidCreditCardNumber
// 
//	INPUT: 		ccNum (string)	- The credit card number to use for validation
//						ccType (string)	- The 'Type' of credit card to validate against
//
//	RETURN:	(boolean)			- <true>; It passed the checks,
//													  <false>; It didn't.
//
//	DESC:		This function is used with client-side code to validate a passed credit card number.
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//===============================================================================
	function IsValidCreditCardNumber(ccNum,  ccType)
	{
 		return (!LuhnCheck(ccNum) || !validateCCNum(ccType, ccNum));
	}  //  isValidCreditCardNumber

	function LuhnCheck(str) 
	{
		var bRtrn = true;

		var sum = 0; 
		var mul = 1; 
		var strLen = str.length;
		
		for (i = 0; i < strLen; i++) 
		{
			var digit = str.substring(strLen-i-1,strLen-i);
			var tproduct = parseInt(digit ,10)*mul;
			if (tproduct >= 10)
				sum += (tproduct % 10) + 1;
			else
				sum += tproduct;
				if (mul == 1)
					mul++;
				else
					mul--;
		}
		if ((sum % 10) != 0) bRtrn = false;
		
		return (bRtrn);
	}  //  LuhnCheck

	function validateCCNum(cardType, cardNum)
	{
		var bRtrn = false;
		cardType = cardType.toUpperCase();

		var cardLen = cardNum.length;
		var firstdig = cardNum.substring(0,1);
		var seconddig = cardNum.substring(1,2);
		var first4digs = cardNum.substring(0,4);

		switch (cardType)
		{
			case "VISA":
				bRtrn = ((cardLen == 16) || (cardLen == 13)) && (firstdig == "4");
				break;
			case "AMEX":
				var validNums = "47";
				bRtrn = (cardLen == 15) && (firstdig == "3") && (validNums.indexOf(seconddig)>=0);
				break;
			case "MASTERCARD":
				var validNums = "12345";
				bRtrn = (cardLen == 16) && (firstdig == "5") && (validNums.indexOf(seconddig)>=0);
				break;
			case "DISCOVER":
				bRtrn = (cardLen == 16) && (first4digs == "6011");
				break;
			case "DINERS":
				var validNums = "068";
				bRtrn = (cardLen == 14) && (firstdig == "3") && (validNums.indexOf(seconddig)>=0);
				break;
		}  //  switch (cardType)
		
		return (bRtrn);
	}  //  validateCCNum

//===============================================================================
//	FUNCTION:	DisableClear_Section
// 
//	INPUT: 		objControl (control)	-	Control name to use as a control set. "_" is used to get the 'Prefix' code.
//						bDisable (bool)			-	Enable or Disable control set.
//						bClearData (bool)		-	Clear existing data in controls, when we disable them ?
//						sClearValue (string)	-	What value is 'Clear' ?
//
//	RETURN:	<nothing>
//
//	DESC:		This function is used with client-side code to disable/enable control blocks.
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//===============================================================================
	function DisableClear_Section(objControl, bDisable, bClearData, sClearValue)
	{
		// Validate
		if (!objControl) return (false);
		if (!objControl.form) return (false);
		var objForm = objControl.form;

		var sName = new String(objControl.name);
		sName = sName.toUpperCase();	
		var sPrefix = sName;	
		var nPos = new Number(sName.indexOf("_", 0));
		if (nPos != -1)
		{
			sPrefix = new String(sName.slice(0, nPos));
		}

		// - Iterate & process
		for (var nIndex = 0; nIndex < objControl.form.elements.length; nIndex++)
		{
			if (objControl.form.elements[nIndex].name != objControl.name)
			{
				var sLookName = new String(objControl.form.elements[nIndex].name);
				sLookName = sLookName.toUpperCase();
				if (sLookName.indexOf(sPrefix, 0) != -1)
				{
					if (bClearData) objControl.form.elements[nIndex].value = sClearValue;
					objControl.form.elements[nIndex].disabled = bDisable;
				}		
			}		
		}	
	}  //  DisableClear_Section

//===============================================================================
//	FUNCTION:	Get_RadioValue
// 
//	INPUT: 		objForml (form)			-	Form object used to get the 'Control' from.
//						sControlID (string)		-	Name of control group in the prior passed form object.
//
//	RETURN:	(string)						- Represents the 'Value' from a selected radio group item.
//
//	DESC:		This function is used with client-side code to get a value from the selected radio group.
//
//	PLATFORMS:	Netscape Navigator 3.01 and higher,
//			  					Microsoft Internet Explorer 3.02 and higher,
//			  					Netscape Enterprise Server 3.0,
//			  					Microsoft IIS/ASP 3.0.
//===============================================================================
	function Get_RadioValue(objForm, sControlID)
	{
		var sRtrn = "";
	
		// Validate
		if (!objForm) return (sRtrn);
		if (!objForm.elements[sControlID]) return (sRtrn);
		// - Are we a single or multiple
		if (!objForm.elements[sControlID].length)
		{
			sRtrn = Trim(objForm.elements[sControlID].value);
		}
		else
		{		
			// - Loop & process
			for (var nIndex = 0; nIndex < objForm.elements[sControlID].length; nIndex++)
			{
				if (objForm.elements[sControlID][nIndex].checked)
				{
					sRtrn = Trim(objForm.elements[sControlID][nIndex].value);
					break;
				}  //  if (objForm.elements[sControlID][nIndex].checked)
			}  //  for (var nIndex = 0; nIndex < objForm.elements[sControlID].length; nIndex++)
		}			
		// - Fell through
		return (sRtrn);
		
	}  //  Get_RadioValue

	function IsBlank_FormField(objForm, sControlID)
	{
		// Validate
		if (!objForm) return (false);
		if (!objForm.elements[sControlID]) return (false);

		return (Trim(objForm.elements[sControlID].value) == '');
	}  //  IsBlank_FormField
