Извиняюсь, если не в тему... У меня возникла вопрос по Мини чату
Вклеил чат в дизайн форума, и обнаружил неприятную мелочь, как отсутсвие автоматического вставления имени в поле, где серым цветом висит текст "Имя" при условии, что я залогинен...
Вообщем то, если его не вставлять, оно все-равно автоматически отбразится верным уже в посте чата, но некрасиво это как то выглядит...
1. Как бы исправить? (что бы для залогиненных пользователей увтоматически было ввидено их имя в этом поле)
Стандартный Код Мини Чата (Основной вид)
Code
<html><head><link type="text/css" rel="StyleSheet" href="$CSS_URI$">
<script type="text/javascript" src="http://src.ucoz.ru/src/ajax.js"></script>
<script type="text/javascript">
function show_profile(uid){window.open('/index/8-'+uid,'user_details','scrollbars=1,top=0,left=0,resizable=1,width=680,height=350');return false;}
var wasclk=[];
var init_val=['$STR_NAME$','%IF($FIELDS_MASK$&1)%$STR_EMAIL$%ENDIF%%IF($FIELDS_MASK$&3=3)%/%ENDIF%%IF($FIELDS_MASK$&2)%$STR_URL$%ENDIF%','$STR_MESSAGE$','$STR_CUSTOM1$','$STR_CUSTOM2$'];
var fld_name=['uname','email','message','custom1','custom2'];
function ffoc(e,i){if(wasclk[i]==0){e.value='';wasclk[i]=1;e.style.color='#000000'}if(tAct){clearTimeout(tID);tAct=false;document.getElementById("mchatRSel").selectedIndex=0;}}
function fblur(e,i){if(e.value=='' && wasclk[i]==1){e.value=e.title;wasclk[i]=0;e.style.color='#808080';}}
function initform() {
f=document.forms['addform'];
for(var i=0;i<init_val.length;i++)
if(f[fld_name[i]])
{f[fld_name[i]].value=f[fld_name[i]].title=init_val[i];wasclk[i]=0;f[fld_name[i]].style.color='#808080';}
var res=document.cookie.match(/(\W|^)mcnm=([^ ;]+)/);if(res){ffoc(f.uname,0);f.uname.value=unescape(RegExp.$2);}
res=document.cookie.match(/(\W|^)mcem=([^ ;]+)/);if(res && f.email){ffoc(f.email,1);f.email.value=unescape(RegExp.$2);}
}
function checkform(f) {
for(var i=0;i<init_val.length;i++)if(f[fld_name[i]]){if(wasclk[i]==0)f[fld_name[i]].value='';wasclk[i]=2;f[fld_name[i]].style.color='#000000';}
var t=new Date((new Date()).getTime()+86400*90);
document.cookie="mcnm="+(f.uname.value.length>0?escape(f.uname.value):'')+"; path=/mchat; expires="+t.toGMTString();
document.cookie="mcem="+(f.email && f.email.value.length>0?escape(f.email.value):'')+"; path=/mchat; expires="+t.toGMTString();
%IF($FIELDS_MASK$&2)%if(f[fld_name[1]])if(f[fld_name[1]].value.length>0%IF($FIELDS_MASK$&1)% && !f[fld_name[1]].value.match(/^[a-z0-9_.-]+@[a-z0-9_.-]+$/i)%ENDIF%){f[fld_name[1]].name='url';}%ENDIF%
if (document.getElementById('ajaxFlag') && document.getElementById('ajaxFlag').value==1){
if (document.getElementById('mchatBtn')){document.getElementById('mchatBtn').disabled=true;}
uz.util.Connect.setForm('addform');var cObj=uz.util.Connect.asyncRequest('POST',document.addform.action,callback);
return false;
}
else {window.open('','mchatmsg','width=300,height=140,top=0,left=0');}
return true;
}
var tID=null;
var tAct=false;
function setT(s){
var v=parseInt(s.options[s.selectedIndex].value);
document.cookie="mcrt="+s.selectedIndex+"; path=/mchat";
if(tAct){clearTimeout(tID);tAct=false;}
if(v>0){tID=setTimeout("window.location.reload()",v*1000);tAct=true;}
}
function initSel() {
var res=document.cookie.match(/(\W|^)mcrt=([0-9]+)/);
if(res){s=document.getElementById("mchatRSel");s.selectedIndex=parseInt(RegExp.$2);setT(s);}
}
</script>
</head>
<body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" class="mchat" onload="initform();initSel();" style="background: transparent none;padding:2px;">
<table class="mchat" border="0" cellpadding="0" cellspacing="0" width="100%" height="100%" style="table-layout:fixed;height:100%">
<tfoot><tr><td height="%IF($FIELDS_MASK$&12)%100%ELSE%78%ENDIF%" style="padding:0" align="left">
<form style="margin:2px" name="addform" id="addform" action="$ACTION_URI$" method="post" class="mchat" target="mchatmsg">
<input type="text" maxlength="60" name="uname" size="8" class="mchat" id="mchatNmF" value="" onfocus="ffoc(this,0)" onblur="fblur(this,0)" title="$STR_NAME$" style="width:47%;margin:0;padding:1px;border:1px solid black;height:20px">
%IF($FIELDS_MASK$&3)%<input type="text" maxlength="60" name="email" size="9" class="mchat" id="mchatEmF" value="" onfocus="ffoc(this,1)" onblur="fblur(this,1)" title="$STR_EMAIL$" style="width:47%;margin:0;padding:1px;border:1px solid black;height:20px">%ENDIF%<br>
%IF($FIELDS_MASK$&4)%<input type="text" maxlength="60" name="custom1" size="9" class="mchat" id="mchatC1F" value="" onfocus="ffoc(this,3)" onblur="fblur(this,3)" title="$STR_CUSTOM1$" style="width:47%;margin:0;padding:1px;border:1px solid black;height:20px">%ENDIF%
%IF($FIELDS_MASK$&8)%<input type="text" maxlength="60" name="custom2" size="9" class="mchat" id="mchatC2F" value="" onfocus="ffoc(this,4)" onblur="fblur(this,4)" title="$STR_CUSTOM2$" style="width:47%;margin:0;padding:1px;border:1px solid black;height:20px">%ENDIF%
<input type="text" maxlength="$MAX_MESSAGE_LEN$" name="message" size="22" class="mchat" id="mchatMsgF" value="" onfocus="ffoc(this,2)" onblur="fblur(this,2)" title="$STR_MESSAGE$" style="width:70%;margin:0;padding:1px;border:1px solid black;height:20px">
<input type="submit" value="Ок" class="mchat" id="mchatBtn" style="width:40px;height:20px;margin:0;border:2px solid black" onclick="return checkform(this.form);">$HIDDEN_FIELDS$<input type="hidden" id="ajaxFlag" name="ajax" value="1" />
</p><table border="0" cellpadding="2" cellspacing="1" width="100%">
<tr><td><select id="mchatRSel" onchange="setT(this);" class="mchat" size="1" title="Автообновление" style="font-size:7pt;width:50px;margin:0;padding:0;border:1px solid black;height:18px"><option value="0">--<option value="15">15сек<option value="30">30сек<option value="60">1мин<option value="120">2мин</select></td>
<td width="70%" align="right">
<a class="noun" href="$ACTION_URL$" onclick="window.location.reload();return false;" title="Обновить"><img border="0" align="absmiddle" src="http://src.ucoz.ru/img/fr/mcr.gif" width="13" height="15"></a>
%IF($SMILES_URI$)% <a class="noun" href="javascript:void('smiles')" onclick="ffoc(document.forms.addform.message,2);wasclk[2]=2;window.open('$SMILES_URI$','csmiles','scrollbars=1,width=350,height=450,left=0,top=0');return false;" title="Вставить смайл"><img border="0" align="absmiddle" src="http://src.ucoz.ru/img/fr/mcs.gif" width="13" height="15"></a>%ENDIF%
%IF($BBCODES_URI$)% <a class="noun" target="cbbcodes" href="javascript:void('BB-codes')" onclick="window.open('$BBCODES_URI$','cbbcodes','scrollbars=1,width=550,height=450,left=0,top=0');return false;" title="BB-Коды"><img border="0" align="absmiddle" src="http://src.ucoz.ru/img/fr/mcb.gif" width="13" height="15"></a>%ENDIF%
<a class="noun" href="javascript:void('Message control')" onclick="window.open('$MSGCTRL_URI$','mchatCtrl','scrollbars=1,width=550,height=550,left=0,top=0');return false;" title="Управление сообщениями"><img border="0" align="absmiddle" src="http://src.ucoz.ru/img/fr/mcm.gif" width="15" height="15"></a>
</td></tr></table>
</form>
</td></tr></tfoot><tbody>
<tr><td valign="top" id="mchatTd">
<script type="text/javascript">var td=document.getElementById('mchatTd');if(td && td.offsetHeight>0) td.style.height=td.offsetHeight+'px';</script>
<div id="mchatDiv" class="mchat" style="overflow:auto;height:100%;width:100%">
<div id="newEntryT"></div>
<div style="white-space:normal">%IF($MESSAGES$)%$MESSAGES$%ELSE%Будешь первым...%ENDIF%</div>
<div id="newEntryB"></div>
</div>
</td></tr>
</table>
<script type="text/javascript">var td=document.getElementById('mchatTd');if(td && td.offsetHeight>0) td.style.height=td.offsetHeight+'px';</script>
</body></html>
Заранее благодарю за помощь 
Добавлено (2007-09-25, 17:20:31)
---------------------------------------------
Ах, да ссылка на сайт: http://my-shop.3dn.ru/forum/