
try {
	document.execCommand('BackgroundImageCache', false, true);
} 
catch (e) {
}

function storeCaret(textArea) {
	if (textArea.createTextRange) 
		textArea.caretPos = document.selection.createRange().duplicate();
}

function insertHTML(textArea, html) {
	if (textArea.createTextRange && textArea.caretPos) {
		var caretPos = textArea.caretPos;
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? html + ' ' : html;
	} 
	else {
		textArea.value += html;
	}
	textArea.focus();
}


