function trim(arg)
{
  return arg.replace(/(^\s+)|(\s+$)/g, "");
}

function ValidEmailAddress(pAddress)
{
	if  (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(pAddress))
		{	
			return true;
		}
	return false;
}

function Is0to9(pString) {
	//  check for valid numeric strings	
	var strValidChars = "0123456789";
	var strChar;
	var blnResult = true;

	//  test strString consists of valid characters listed above
	if (trim(pString)==="")
		{
			return false;
		}
	for (i = 0; i < pString.length && blnResult === true; i = i + 1)	
	{
		strChar = pString.charAt(i);
		if (strValidChars.indexOf(strChar) == -1) 
		{
			blnResult = false;
		}
	}
	return blnResult;
}

