function storeCaret (textEl) {
    if (textEl.createTextRange)
        textEl.caretPos = document.selection.createRange().duplicate();
    }
function emoticon(text) {
        var txtarea = document.forms[1].message;
        text = ' ' + text + ' '
        if (txtarea.createTextRange && txtarea.caretPos) {
                var caretPos = txtarea.caretPos;
                caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
                txtarea.focus();
        } else {
                txtarea.value  += text;
                txtarea.focus();
        }
}

function makeTag(start,end,text) {
	
        var txtarea = document.getElementById('message');
        txtarea.value  += start + text + end;
        txtarea.focus();
        
}
