<!--
function isCurrency(f)

{
	var nNum = 0;			// Total numbers for currency value.
	var nDollarSign = 0;	// Total times a dollar sign occurs.
	var nDecimal = 0;		// Total times a decimal point occurs.
	var txtLen;				// Length of string passed.
	var xTxt;				// Assigned object passed.
	var sDollarVal;			// Assigned dollar amount with or without commas.
	var decPos;				// Assigned value of numbers or positions after decimal point.
	var nNumCount = 0;		// Total number between commas.
	var i;					// For forloop indexing.
	var x;					// Assigned each indivual character in string.
	
	// Set the xTxt variable to the object passed to this function.
	// Assign the length of the string to txtLen.
	xTxt = f;
	txtLen = xTxt.length
	if(txtLen == 0)
	{
		alert("Please enter an amount for the gift certificate.");
		return false;
	} // end if
	
	for(i = 0; i < txtLen; i++)
	{

		// Assign charater in substring to x.
		x = xTxt.substr(i, 1);

		if(x == "$")
			nDollarSign = nDollarSign + 1; // Sum total times dollar sign occurs.
		else if(x == ".")
			nDecimal = nDecimal + 1; // Sum total times decimal point occurs.
		else if(parseInt(x) >= 0 || parseInt(x) <= 9)
			nNum = nNum + 1; // If the character is a number sum total times a number occurs.
		else
		{
			// Error occurs if any other character value is in the string
			// other than the valid characters.
			alert("You have entered an illegal value.\nPlease enter only dollar" +
				  " signs, decimal points and numbers between 0...9");
			return false;
		} // end else
	} // end for

	if(nDollarSign > 1)
	{
		alert("You have entered more then one dollar sign.\nPlease only enter one.");
		return false;
	} // end if

	if(nDecimal > 1)
	{
		alert("You have entered more then one decimal point.\nPlease only enter one.");
		return false;
	} // end if

	if(nDollarSign == 1)
	{
		// Make sure dollar sign in the first character in string
		// if there is a dollar sign present.
		if(xTxt.indexOf("$") != 0)
		{
			alert("The dollar sign you entered is not in the correct position.");
			return false;
		} // end if
	}// end if

	if(nDecimal == 1)
	{
		// Get the number of numbers after the decimal point in
		// the string if there is a decimal point present
		decPos = (txtLen - 1) - xTxt.indexOf(".");

		// Floating point cannot be more then two.
		// Valid format after decimal point.

		/**********************************/
		/*   $#.##, $#.#, $.#, $#., $.##  */
		/**********************************/
		if(decPos > 2)
		{
			alert("There are too many characters after the decimal point.");
			return false;
		} // end if

	} // end if

	// Get total number of dollar number(s), removing
	// floating point numbers or cents.
	nNum = nNum - decPos;

	// Determine if dollar sign is in string so to be 
	// removed.
	// After determining dollar sign, assign sDollarVal
	// numbers and comma(s)

	if(xTxt.indexOf("$", 0) == 0)
		sDollarVal = xTxt.substr(1, nNum);
	else
		sDollarVal = xTxt.substr(0, nNum);

	// Determine if a zero is the first number or if a
	// comma is the first or last character in the string.
	if(sDollarVal.lastIndexOf("0", 0) == 0 )
	{
		alert("You cannot start the dollar amount with a zero.");
		return false;
	}

	// Return true indicating that the value is a valid
	// currency.
	return true;
}

//-->