/* Функции добавления и удаления пользователей в массиве никлиста */ var uc = 0; var uwc = 0; var umc = 0; var unc = 0; var us = new Array(); if(parent.users) { var uf=parent.users.document; /* users frame */ uf.getElementById('users').innerHTML="<table id=ul width=100%><tr id=uw><td colspan=5 class=he>Деффки</td><td id=uwc>0</td> </tr><tr id=um><td colspan=5 class=he>Пацаны</td> <td id=umc>0</td> </tr><tr id=un><td colspan=5 class=he>Нечто</td><td id=unc>0</td> </tr></table>"; /* users div (clear) */ var ul = uf.getElementById('ul'); /* users list */ } function add(nick,colornick,st,mw,icon,status,inchat,time){ if(inchat=='0') ma(nick, colornick, time); if(loaded==1) { var l=us.length; for(var i = 0;i<l;i++ ) if(us[i]!=null && us[i][0]==nick)break; us[i]=new Array(nick,colornick,st,mw,icon,status); nickid="!"+nick; obj=uf.getElementById(nickid); if(obj) ul.deleteRow(obj.rowIndex); index=ul.rows.length; if(mw=='1') index=uf.getElementById("uw").rowIndex+1; if(mw=='0') index=uf.getElementById("um").rowIndex+1; if(mw=='') index=uf.getElementById("un").rowIndex+1; var obj=ul.insertRow(index); obj.id=nickid; format(i,obj); if (i==l) {uc+=1; if(mw=='1') {uwc++;uf.getElementById("uwc").innerHTML=uwc;} if(mw=='0') {umc++;uf.getElementById("umc").innerHTML=umc;} if(mw=='') {unc++;uf.getElementById("unc").innerHTML=unc;} } }} function del(nick,colornick,st,mw,icon,status,inchat,time) { if(inchat=='1') md(nick, colornick, time); if(loaded==1) { for( var i=0; i<us.length; i++ ) if( us[i] != null && us[i][0] == nick ) {us[i] = null; uc+=-1; break;} nickid="!"+nick; obj=uf.getElementById(nickid); ul.deleteRow(obj.rowIndex); if(mw=='1') {uwc--;uf.getElementById("uwc").innerHTML=uwc;} if(mw=='0') {umc--;uf.getElementById("umc").innerHTML=umc;} if(mw=='') {unc--;uf.getElementById("unc").innerHTML=unc;} }}