function IsNumeric(sText, sdot){
	var ValidChars = "0123456789" + sdot;
	var IsNumber=true;
	var Char;
	var isDot = false;

	for (i = 0; i < sText.length && IsNumber == true; i++) { 
		Char = sText.charAt(i); 
		if (ValidChars.indexOf(Char) == -1 && (isDot && Char == sdot )) {
			IsNumber = false;
		}
		if(Char == sdot){
			isDot = true;
		}
	}
	return IsNumber;
}


function trim(str, chars) {
    return ltrim(rtrim(str, chars), chars);
}

function ltrim(str, chars) {
    chars = chars || "\\s";
    return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}

function rtrim(str, chars) {
    chars = chars || "\\s";
    return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}