﻿//检查字符串是否为数值
function isNumber( str ){
 	if( str.length == 0 ) return false;
 	for( var loc=0; loc<str.length; loc++ )
 		if( (str.charAt(loc) < '0') || (str.charAt(loc) > '9') ) return false;
 	return true;	
}
 	
//删除字符串前后的空白
function trim(strText){ 
  while (strText.substring(0,1) == ' ') 
    strText = strText.substring(1, strText.length);
  while (strText.substring(strText.length-1,strText.length) == ' ')
    strText = strText.substring(0, strText.length-1);
  return strText;
} 

