<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<script type="text/javascript">
function alfa(){
var campo = document.getElementById('campo');
var ltr = ['à','á','â','ã','ä','ç','è','é','ê','ë','ì','í','î','ï','ñ','ò','ó','ô','õ','ö','ù','ú','û','ü','ý','ÿ','À','Á','Â','Ã','Ä','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ñ','Ò','Ó','Ô','Õ','Ö','Ù','Ú','Û','Ü','Ý',' ','-','_',',',':','"',"'",'&',';','@','.','>','<','|'];
var rpl = ['a','a','a','a','a','c','e','e','e','e','i','i','i','i','n','o','o','o','o','o','u','u','u','u','y','y','a','a','a','a','a','c','e','e','e','e','i','i','i','i','n','o','o','o','o','o','u','u','u','u','y','','','','','','','','','','','','','',''];
for (var i = 0, c = ltr.length, r = campo.value.toLowerCase(); i < c; i++)
{alert(c + "_"+ r +"_"+ i)
var rg = new RegExp(ltr[i],'g');alert(rg)
r = r.replace(rg,rpl[i]);alert(r)
};
alert(r);
};
</script>
</head>
<body>
<input id=campo value="éúáñÑìô"><input type=button onclick=alfa()>
</body>
</html>