norvegino
Уберите ваш скрипт транслита, и поставьте этот, и все будет очень аккуратно))
<SCRIPT language=JavaScript>
<!--
var rus_lr2 = ('Е-е-О-о-Ё-Ё-Ё-Ё-Ж-Ж-Ч-Ч-Ш-Ш-Щ-Щ-Ъ-Ь-Э-Э-Ю-Ю-Я-Я-Я-Я-ё-ё-ж-ч-ш-щ-э-ю-я-я').split('-');
var lat_lr2 = ('/E-/e-/O-/o-ЫO-Ыo-ЙO-Йo-ЗH-Зh-ЦH-Цh-СH-Сh-ШH-Шh-ъ'+String.fromCharCode(35)+'-ь'+String.fromCharCode(39)+'-ЙE-Йe-ЙU-Йu-ЙA-Йa-ЫA-Ыa-ыo-йo-зh-цh-сh-шh-йe-йu-йa-ыa').split('-');
var rus_lr1 = ('А-Б-В-Г-Д-Е-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Х-Ц-Щ-Ы-Я-а-б-в-г-д-е-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-х-ц-щ-ъ-ы-ь-ь-я').split('-');
var lat_lr1 = ('A-B-V-G-D-E-Z-I-J-K-L-M-N-O-P-R-S-T-U-F-H-X-C-W-Y-Q-a-b-v-g-d-e-z-i-j-k-l-m-n-o-p-r-s-t-u-f-h-x-c-w-'+String.fromCharCode(35)+'-y-'+String.fromCharCode(39)+'-'+String.fromCharCode(96)+'-q').split('-');
var rus_rl = ('А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я-а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я').split('-');
var lat_rl = ('A-B-V-G-D-E-JO-ZH-Z-I-J-K-L-M-N-O-P-R-S-T-U-F-H-C-CH-SH-SHH-'+String.fromCharCode(35)+String.fromCharCode(35)+'-Y-'+String.fromCharCode(39)+String.fromCharCode(39)+'-JE-JU-JA-a-b-v-g-d-e-jo-zh-z-i-j-k-l-m-n-o-p-r-s-t-u-f-h-c-ch-sh-shh-'+String.fromCharCode(35)+'-y-'+String.fromCharCode(39)+'-je-ju-ja').split('-');
var translitown=0;var language = 0;
if (document.images) {swrus_src = new Image; swrus_src = "pict/swrus.gif";swlat_src = new Image; swlat_src = "pict/swlat.gif";}
function setfoc(){document.post.message.focus();}
function compbelongs(isprivate)
{
translitown = isprivate;
if (translitown==1) {document.post.message.createTextRange().execCommand("Copy");}
document.cookie = "trowncomputer=" + escape(isprivate);
return true;
}
function upgradeclipboard()
{
if (translitown==1) {document.post.message.createTextRange().execCommand("Copy");}
return true;
}
function setlangpicture(){document.ruslat.src = swrus_src;}
function changelanguage(){if (language==1) {language=0; document.images['ruslat'].src = swrus_src; document.post.message.focus();return;}if (language==0) {language=1; document.images['ruslat'].src = swlat_src; document.post.message.focus();return;}}
function AkeyIsDown()
{
if (event.ctrlKey && event.altKey) changelanguage();
if (window.event.keyCode==27) event.returnValue=false;
return false;
}
function translate_letter()
{
if (language==1) return; //no transliteration necessary
//the entered character
var code = event.keyCode;
txt=String.fromCharCode(code);
//make selection
cursor_pos_selection = document.selection.createRange();
//delete something is selected before
cursor_pos_selection.text="";
//get the previous character
cursor_pos_selection.moveStart("character",-1);
pretxt = cursor_pos_selection.text;
if (pretxt.length>1) {pretxt="";}
event.keyCode = 0;
result = translatesymboltocyrillic(pretxt,txt)
//delete the previous symbol if it is exists (if the entered symbol is not the first one)
if (pretxt!="") { cursor_pos_selection.select(); cursor_pos_selection.collapse();}
with(document.selection.createRange()) {text = result; collapse(); select()}
return;
}
function translatesymboltocyrillic(pretxt,txt)
{
var doubletxt = pretxt+txt;
var code = txt.charCodeAt(0);
if (!(((code>=65) && (code<=123))||(code==35)||(code==39))) return doubletxt;
var ii;
for (ii=0; ii<lat_lr2.length; ii++)
{
if (lat_lr2[ii]==doubletxt) return rus_lr2[ii];
}
for (ii=0; ii<lat_lr1.length; ii++)
{
if (lat_lr1[ii]==txt) return pretxt+rus_lr1[ii];
}
return doubletxt;
}
function translatesymboltolatin(symb)
{
var ii;
for (ii=0; ii<rus_rl.length; ii++)
{
if (rus_rl[ii]==symb)
return lat_rl[ii];
}
return symb;
}
function translateAlltoCyrillic()
{
var is_selection_flag = 1;
var userselection = document.selection.createRange();
var txt = userselection.text;
if (userselection==null || userselection.text==null || userselection.parentElement==null || userselection.parentElement().type!="textarea")
{
// no text selected, all the text in the textarea is to be processed
is_selection_flag = 0;
txt = document.post.message.value;
}
var txtnew = translatesymboltocyrillic("",txt.substr(0,1));
var symb = "";
for (kk=1;kk<txt.length;kk++)
{
symb = translatesymboltocyrillic(txtnew.substr(txtnew.length-1,1),txt.substr(kk,1));
txtnew = txtnew.substr(0,txtnew.length-1) + symb;
}
if (is_selection_flag)
{
userselection.text = txtnew; userselection.collapse(); userselection.select();
}
else
{
document.post.message.value = txtnew;
document.post.message.focus();
}
return;
}
function translateAlltoLatin()
{
var is_selection_flag = 1;
var userselection = document.selection.createRange();
var txt = userselection.text;if (userselection==null || userselection.text==null || userselection.parentElement==null || userselection.parentElement().type!="textarea")
{
// no text selected, all the text in the textarea is to be processed
is_selection_flag = 0;
txt = document.post.message.value;
}
txtnew="";
var symb = "";
for (kk=0;kk<txt.length;kk++)
{
symb = translatesymboltolatin(txt.substr(kk,1));
txtnew = txtnew.substr(0,txtnew.length) + symb;
}
if (is_selection_flag)
{
userselection.text = txtnew; userselection.collapse(); userselection.select();
}
else
{
document.post.message.value = txtnew;
document.post.message.focus();
}
return;
}
//-->
</SCRIPT>
<br /> <INPUT class=button onclick=translateAlltoCyrillic();upgradeclipboard(); type=button value="в кириллицу">
<INPUT class=button onclick=translateAlltoLatin();upgradeclipboard(); type=button value="в латиницу"><br /><script type="text/javascript">
defaultPict = "http://s61.radikal.ru/i171/0812/c6/a94678b5f8e0.jpg"var arr=document.getElementsByTagName("ul")
i=1
while(arr[++i]){
str=arr[i].innerHTML
if(str.indexOf("pa-avatar")==-1) {
q=str.toLowerCase()
if((pos=q.indexOf("<li class=pa-from>"))!=-1 || (pos=q.indexOf("<li class=\"pa-from\">"))!=-1 || (pos=q.indexOf("<li class=pa-reg>"))!=-1 || (pos=q.indexOf("<li class=\"pa-reg\">"))!=-1){
nstr =str.substring(0,pos)
nstr+="<li class=\"pa-avatar item2\"><img src="+ defaultPict +" alt=\"Аватар\" /></li>"
nstr+=str.substring(pos)
arr[i].innerHTML=nstr
}}}
</script>