Проверка орфографии в постах

Код:
<!-- Проверка орфографии в сообщении (начало) -->
<style type="text/css">
td#button-speller {background:url('https://uploads.ru/i/p/I/V/pIViu.gif') no-repeat center !important;}
</style>


<script type="text/javascript">
FORUM.set('editor.speller', {name:'Проверить орфографию',onclick:function(){orfo_test()}});

function orfo_test(){
var txt=$('#main-reply').val();
if(txt=='') return false;
 $.ajax({
   type: "GET",
   url: "https://speller.yandex.net/services/spellservice.json/checkText",
   dataType: "jsonp",
   data: "text="+encodeURIComponent(txt)+"&lang=ru",
   success: function(msg){
     var i=msg.length;
     while(i--)if(msg[i].s!='')txt=txt.replace(msg[i].word,msg[i].s);
     $('#main-reply').val(txt);
   }
 });
}
</script>
<!-- Проверка орфографии в сообщении (конец) -->