Special characters replacement function
<p>I have a JavaScript function that replaces special characters with normal characters.</p>

<p>When I type a period <code>.</code> it's changed to <code>a</code></p>

<p>Example : <code>info@example.com</code> is changed to <code>info@exampleacom</code></p>

<p>What am I doing wrong?</p>



<pre><code>function retiraAcento(palavra, obj) {
   com_acento = 'áàãâäéèêëíìîïóòõôöúùûüçÁÀÃÂÄÉÈÊËÍÌÎÏÓÒÕÖÔÚÙÛÜÇ';
   sem_acento = 'aaaaaeeeeiiiiooooouuuucAAAAAEEEEIIIIOOOOOUUUUC';
   nova = '';
   for (i = 0; i &lt; palavra.length; i++) {
       if (com_acento.search(palavra.substr(i, 1)) &gt;= 0) {
           nova += sem_acento.substr(com_acento.search(palavra.substr(i, 1)), 1);
       } else {
           nova += palavra.substr(i, 1);
       }
   }
   //obj.value = nova.toUpperCase();
   obj.value = nova
}
$(document).ready(function () {
   $(":input").live('blur', function () {
       retiraAcento(this.value, this);
   });
});
</code></pre>
