/* Функции добавления и удаления пользователей в массиве никлиста */ var uc = 0; var us = new Array(); var ucc=new Array(); var index=0; function separate(obj,c) { if(ucc[obj+"c"]==null) ucc[obj+"c"]=c; else ucc[obj+"c"]+=c; parent.users.document.getElementById(obj+"c").innerHTML=ucc[obj+"c"]; if(c==1) return parent.users.document.getElementById(obj).rowIndex+1; } function seprules(type,st,mw) { if(mw=='0') index=separate("man",type); else if(mw=='1') index=separate("woman",type); else if(mw=='') index=separate("noman",type); } function add(nick,colornick,st,mw,icon,status,inchat,time,room,love,clan){ if(loaded==0) return; 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,room,love,clan); if (i==l) {uc++; update(room,1);} if(room==myroom) { nickid="!"+nick; obj=document.getElementById(nickid); var ul=document.getElementById('ul'); if(obj) ul.deleteRow(obj.rowIndex); index=ul.rows.length; seprules(1,st,mw); var obj=ul.insertRow(index); obj.id=nickid; format(i,obj); }} function del(nick,colornick,st,mw,icon,status,inchat,time,room) { if(loaded==0) return; for(var i=0; i<us.length; i++) if( us[i] != null && us[i][0] == nick ) {uc--; update(us[i][6],-1); us[i] = null; break;} if(room==myroom) { nickid="!"+nick; obj=document.getElementById(nickid); var ul=document.getElementById('ul'); ul.deleteRow(obj.rowIndex); seprules(-1,st,mw); }}
userlist="<table id=ul width=100%></table>";
userlist="<table id=ul width=100%>"+ "<tr id=woman><td colspan=5>Деффки</td><td id=womanc>0</td></tr>"+ "<tr id=man><td colspan=5>Пацаны</td><td id=manc>0</td></tr>"+ "<tr id=noman><td colspan=5>Нечто</td><td id=nomanc>0</td></tr>"+ "</table>";
parent.users.document.getElementById(obj+"c").innerHTML=ucc[obj+"c"];