function empty(text) {
	return (typeof text == 'undefined') || (text == null) || (text.length == 0);
}

function htmlentities(text) {
	var ret = '';
	if ((typeof text != 'undefined') && (text != null)) {
		ret = $('<div/>').text(text).html();
	}
	return ret;
}
