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

function smiley(text) {
        AddTxt=text;
        AddText(AddTxt);
}

