function is_not_empty(_val){
  if(typeof _val == 'undefined') return false;
	var re = /^.*\S+.*$/m;
	return re.test(_val);
}

function is_positive_integer(_val){
  if(typeof _val == 'undefined') return false;
  var re = /^\d+$/;
  return re.test(_val);
}

function is_integer(_val){
  if(typeof _val == 'undefined') return false;
  var re = /^-?\d+$/;
  return re.test(_val);
}

function is_positive_float(_val){
  if(typeof _val == 'undefined') return false;
  var re = /^\d+(?:\.\d+)*$/;
  return re.test(_val);
}

function is_float(_val){
  if(typeof _val == 'undefined') return false;
  var re = /^-?\d+(?:\.\d+)*$/;
  return re.test(_val);
}

function is_email(_email){
  if(typeof _email == 'undefined') return false;
	//re = /^(?:\w+(-+\w+|\.\w+)*?)+@(?:\w+(-+\w+)*\.?)*\w+$/;
	re = /^[^\.](?:\S+(-+\S+|\.\S+)*?)+@(?:\S+(-+\S+)*\.?)*\S+$/;
	return re.test(_email);
}

function is_phone_number(phone){
	if(!phone){
		return false;
	}
	var re = /^\d+-?(\d+(-| ))*\d+$/;
	return re.test(phone);
}

function is_YesNo(_val){
	return (_val == 'Y' || _val == 'N');
}

function is_url(_url){
  if(typeof _url== 'undefined') return false;
	re = /^(http(?:s)?|ftp(?:s)?){1}:\/\/[-\w]+(\.\w[-\w]*)+(\/\S*)*$/;
	return re.test(_url);
}
function v_trim(_str){
  if(typeof _str == 'string'){
	_str = _str.replace(/^\s*/g, '');
	_str = _str.replace(/\s*$/g, '');
  }
  return _str;
}

function strip_spaces(_str){
  if(typeof _str == 'string'){
    _str = _str.replace(/\s+/g, '');
  }
  return _str;
}

