function insertAtCursor(a,b){var d=a.selectionStart;var c=a.scrollTop;if(document.selection){if(!a.focus()){a.focus()}document.selection.createRange().text=b}else{a.value=a.value.substr(0,d)+b+a.value.substr(d);a.selectionStart=d+b.length;a.selectionEnd=d+b.length}a.scrollTop=c}function addEmoticon(a,b){var c=document.getElementById(a);c.focus();clearField(document.getElementById(a));insertAtCursor(c," "+b+" ")};
