var rusChars = new Array('А','Б','В','Г','Д','Е','Ё','Ж','З',
'И','Й','К','Л','М','Н','О','П',
'Р','С','Т','У','Ф','Х','Ч','Ц',
'Ш','Щ','Э','Ю','Я','Ы','Ъ','Ь');
var transChars = new Array('a','b','v','g','d','e','jo','zh','z',
'i','y','k','l','m','n','o','p',
'r','s','t','u','f','h','ch','ts',
'sh','csh','e','u','ya','i','','');
function convert(the_form, conv_froms, conv_to)
{
var nameForm = document.forms[the_form][conv_froms].value;
var from = nameForm;
var to = "";
var len = from.length;
var character, isRus;
for ( var i = 0; i < len; i++ )
{
character = from.substr(i,1);
isRus = false;
for ( var j = 0; j < rusChars.length; j++ )
{
if ( character == rusChars[j] )
{
isRus = true;
break;
}
}
to += (isRus) ? transChars[j] : character;
}
document.forms[the_form][conv_to].value = to;
}