/*
	
	File:		Function Sets for all Online Transactions
	Author:		Chong Xiang
	
				Copyright Chong Xiang  cxiang@mmgusa.com 2006. Please give 
				credit where credit is due.
				
	Update History:
	
				12/21/2006 - Chong Xiang	
*/

// Trims the beginning and trailing white space from a string.
function trim(strText){
	return( strText.replace(new RegExp("^([\\s]+)|([\\s]+)$", "gm"), "") );
}
	
// Trims the beinning white space from a string.
function leftTrim(strText){
	return( strText.replace(new RegExp("^[\\s]+", "gm"), "") );
}
		
// Trims the trailing white space from a string.
function rightTrim(strText){
	return( strText.replace(new RegExp("[\\s]+$", "gm"), "") );
}

//Is number
function IsNumeric(sText)
{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
}