(function($) {
	$.tablesorter.addParser({
		id: "text-digit",
		is: function(s) {
			return false;
		},
		format: function(s) {
			s = $.trim(s.toLowerCase());
			s = FHConvert.ftoh(s);
			s = s.replace(new RegExp(/(^[0-9]+|[0-9]+$)/g), function(match) {
				var digit = "";
				for (i = 0; i < 10-match.length; i++) digit += "0";
				digit += match;
				return digit;
			});
			return s;
		},
		type: "text"
	});
	$.tablesorter.addParser({
		id: "text-digit-length",
		is: function(s) {
			return false;
		},
		format: function(s) {
			s = $.trim(s.toLowerCase());
			s = FHConvert.ftoh(s);
			s = s.replace(new RegExp(/(^[0-9]+|[^0-9]+|[0-9]+$)/g), function(match) {
				var digit = "";
				for (i = 0; i < 10-match.length; i++) digit += "0";
				digit += match;
				return digit;
			});
			return s;
		},
		type: "text"
	});
	$.tablesorter.addParser({
		id: "digit-jp",
		is: function(s) {
			return false;
		},
		format: function(s) {
			s = FHConvert.ftoh(s);
			return $.tablesorter.formatFloat(s);
		},
		type: "numeric"
	});
	$.tablesorter.addParser({
		id: "currency-jp",
		is: function(s) {
			return false;
		},
		format: function(s) {
			s = FHConvert.ftoh(s);
			return $.tablesorter.formatFloat(s.replace(new RegExp(/[^0-9.]/g),""));
		},
		type: "numeric"
	});
})(jQuery);

