function storeCaret (textEl) {
	if (textEl.createTextRange)
		textEl.caretPos = document.selection.createRange().duplicate();
}

function emoticon (text) {
	if (document.addform.message.createTextRange && document.addform.message.caretPos) {
		var caretPos = document.addform.message.caretPos;
		caretPos.text =
			caretPos.text.charAt(caretPos.text.length - 1) == ' ' ?
			text + ' ' : text;
	}
	else
		document.addform.message.value  = document.addform.message.value + text;
		document.addform.message.focus();
}

