<!--
var countryUSA = 'USA';
function CheckInteger(stringValue)
{
	var isValid = true;
	stringValue = parseInt(stringValue);
	if (isNaN(stringValue))
	{
		isValid = false;
	}
	return isValid;
}
function CheckNumber(stringValue)
{
	var isValid = true;
	stringValue = parseFloat(stringValue);
	if (isNaN(stringValue))
	{
		isValid = false;
	}
	return isValid;
}
function CheckRequiredSelect(fieldObject)
{
	var isValid = true;
	var indexValue = fieldObject.selectedIndex;
	var fieldValue = Trim(fieldObject[indexValue].value);
	if (fieldValue.length == 0 || fieldValue == '-1')
	{
		isValid = false;	
	}
	return isValid;
}
function CheckRequiredValue(stringValue)
{
	var isValid = true;
	var stringValue = Trim(stringValue);
	if (stringValue.length == 0)
	{
		isValid = false;	
	}
	return isValid;
}
function CheckRequiredValueOther(SelectField, OtherField)
{
	var otherValue = "other";
	var isValid = CheckRequiredSelect(SelectField);
	if (isValid == true)
	{
		if (SelectField[SelectField.selectedIndex].text.toLowerCase() == otherValue.toLowerCase())
		{
			isValid = CheckRequiredValue(OtherField.value);
		}
	}
	return isValid;
}
function CheckRequiredOption(fieldObject)
{
	var fieldLength = fieldObject.length;
	var isValid = true;
	var isSelected = false;
	var counter = 0;
	if (fieldLength == 1)
	{
		if (fieldObject.checked)
		{
			isSelected = true;
		}
	}
	else
	{
		for (counter = 0; counter < fieldLength; counter++)
		{
			if (fieldObject[counter].checked)
			{
				isSelected = true;
				break;
			}
		}
	}
	if (isSelected == false)
	{
		isValid = false;
	}	
	return isValid;
}
function CheckValidCharacters(stringValue)
{
	var isValid = true;
	var stringLength = stringValue.length;						
	var subString = '';
	var characterCode = 0;
	if (stringLength == 0)
	{
		return isValid;
	}
	else
	{
		for (var i=0; i < stringLength; i++)
		{
			subString = stringValue.charAt(i);
			characterCode = subString.charCodeAt(0);
			if (characterCode == 60 || characterCode == 62)
			{
				isValid = false;
				break;
			}
		}
		return isValid;
	}
}
function CheckValidEmail(email) 
{
	var atPos;
	var periodPos;
	var isValid;
	
	// check for @ sign
	atPos = email.indexOf("@");
	isValid = ((atPos != -1) && 
			   (atPos != 0) &&
			   (atPos != (email.length - 1)) &&
			   (email.indexOf("@", atPos + 1) == -1)
			  );
			  
	// check for period
	if (isValid == true) 
	{
		periodPos = email.lastIndexOf(".");
		isValid = ((periodPos != -1) && (periodPos != (periodPos.length - 1)) && (periodPos > atPos));
	}
	
	return isValid;
}
function LTrim(str)
{
   var whitespace = new String(" \t\n\r");

   var s = new String(str);

   if (whitespace.indexOf(s.charAt(0)) != -1) 
   {
      // We have a string with leading blank(s)...
      var j=0, i = s.length;

      // Iterate from the far left of string until we
      // don't have any more whitespace...
      while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
         j++;

      // Get the substring from the first non-whitespace
      // character to the end of the string...
      s = s.substring(j, i);
   }
   return s;
}
function RTrim(str)
{
   // We don't want to trip JUST spaces, but also tabs,
   // line feeds, etc.  Add anything else you want to
   // "trim" here in Whitespace
   var whitespace = new String(" \t\n\r");

   var s = new String(str);

   if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
      // We have a string with trailing blank(s)...

      var i = s.length - 1;       // Get length of string

      // Iterate from the far right of string until we
      // don't have any more whitespace...
      while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
         i--;


      // Get the substring from the front of the string to
      // where the last non-whitespace character is...
      s = s.substring(0, i+1);
   }

   return s;
}
function Trim(str)
{
   return RTrim(LTrim(str));
}
//-->

