У нас на форуме вот здесь: http://s42.radikal.ru/i098/1106/68/6e4ff9f7b123.jpg вместо "Вход, выход, администрация" и т.п. стоят картинки. Проблема в том, что когда приходит новое личное сообщение смотрится это мягко говоря не особо. Стоит вся эта красота благодаря этому коду:
HTML низ
<script> <!-- indexof="<img src='http://s59.radikal.ru/i164/1007/f4/58f89c79529d.png' />" str = document.getElementById("navindex").innerHTML pos = str.indexOf("Форум") document.getElementById("navindex").innerHTML=str.substring(0,pos)+indexof+str.substring(pos+5,str.length-1) --> </script> <script> <!-- userof="<img src='http://s006.radikal.ru/i215/1007/3a/afb41542dec4.png' />" str = document.getElementById("navuserlist").innerHTML if( (pos=str.indexOf("Участники")) != -1 ) document.getElementById("navuserlist").innerHTML=str.substring(0,pos)+userof+str.substring(pos+9,str.length-1) --> </script> <script> <!-- pravilof="<img src='http://s56.radikal.ru/i152/1007/bb/8b20e2834395.png' />" str = document.getElementById("navrules").innerHTML pos = str.indexOf("Правила") document.getElementById("navrules").innerHTML=str.substring(0,pos)+pravilof+str.substring(pos+14,str.length-1) --> </script> <script> <!-- findof="<img src='http://i065.radikal.ru/1007/02/74818e8cf9d5.png' />" str = document.getElementById("navsearch").innerHTML pos = str.indexOf("Поиск") document.getElementById("navsearch").innerHTML=str.substring(0,pos)+findof+str.substring(pos+5,str.length-1) --> </script> <script> <!-- faseof="<img src='http://s47.radikal.ru/i117/1007/0b/18a69038a129.png' />" str = document.getElementById("navprofile").innerHTML pos = str.indexOf("Профиль") document.getElementById("navprofile").innerHTML=str.substring(0,pos)+faseof+str.substring(pos+14,str.length-1) --> </script> <script> <!-- pismaof="<img src='http://s54.radikal.ru/i146/1007/73/9b899b5563c1.png' />" str = document.getElementById("navpm").innerHTML pos = str.indexOf("Сообщения") document.getElementById("navpm").innerHTML=str.substring(0,pos)+pismaof+str.substring(pos+9,str.length-1) --> </script> <script> <!-- godof="<img src='http://i065.radikal.ru/1007/5e/10ec647867c0.png' />" str = document.getElementById("navadmin").innerHTML pos = str.indexOf("Администрирование") document.getElementById("navadmin").innerHTML=str.substring(0,pos)+godof+str.substring(pos+17,str.length-1) --> </script> <script> <!-- valiof="<img src='http://i067.radikal.ru/1007/4a/79a99cc019c9.png' />" str = document.getElementById("navlogout").innerHTML pos = str.indexOf("Выход") document.getElementById("navlogout").innerHTML=str.substring(0,pos)+valiof+str.substring(pos+5,str.length-1) --> </script> <script> <!-- vxodiof="<img src='http://s58.radikal.ru/i160/1007/ef/5053c8066f78.png' />" str = document.getElementById("navlogin").innerHTML pos = str.indexOf("Войти") document.getElementById("navlogin").innerHTML=str.substring(0,pos)+vxodiof+str.substring(pos+5,str.length-1) --> </script> <script> <!-- regof="<img src='http://s05.radikal.ru/i178/1007/c1/cccfbf6d0da2.png' />" str = document.getElementById("navregister").innerHTML pos = str.indexOf("Регистрация") document.getElementById("navregister").innerHTML=str.substring(0,pos)+regof+str.substring(pos+18,str.length-1) --> </script>
Мне нужно, что бы это оповещение о новых сообщениях отражалось сменой другой картинки. Как это можно сделать?