вот сам скрипт (narod_chat.js)
var script = "
http://narod.yandex.ru/cgi-bin/GetCom";
var optionurl = "
http://narod.yandex.ru/chat/chat_ent...F_Chat=";
var cid = 0;
var uid = 0;
var status = 0;
var MessageCount = 40;
var RefreshTime = 15;
var Status = 0;
var text =new Array();
var GetOk = true;
var MesBuf = "";
var toid = 0;
var OptionsSet = false;
//--------------------------------------------------------------------------
function Options(){
OptionsSet = true;
Exit();
return false;
}
//--------------------------------------------------------------------------
function Refresh(){
send_command(3, 0);
return false;
}
//--------------------------------------------------------------------------
function ChatStart(){
cid = get_val("chatid"

;
uid = get_val("userid"

;
send_command(0, ""

;
}
//--------------------------------------------------------------------------
function Exit(){
send_command(1, ""

;
return false;
}
//--------------------------------------------------------------------------
function SendMessage(){
Data = top.document.ChatForm.Message.value;
if(Data != ""

{
if(top.MesBuf == ""

{
if(GetOk){
send_command(2, Data);
top.document.ChatForm.Message.value = "";
}else{
top.MesBuf = Data;
}
}
}
return false;
}
//----------------------------------------------------------------------
function add_nick_to_message (nick)
{
var s =" " + nick;
if(top.document.ChatForm.Message !="undefined"

top.document.ChatForm.Message.value += s;
setTimeout("focus_messager()",200);
return false;
}
//============================================
function SetUserList(ulist, culist, nulist){
var s, ends, elforma;
if(Status == 2){
s = "<form action=\"
http://narod.yandex.ru/chat/shtraf.xhtml\" METHOD=\"get\" name='userlist' target='_top'>";
s += "<INPUT Type=hidden name=userid value="+uid+">";
s += "<INPUT Type=hidden name=chatid value="+cid+">";
s += "<INPUT Type=hidden name=backurl value="+top.document.URL+">";
ends = "<BR><INPUT TYPE=SUBMIT name=deluser value=\"Удалить\">&nbsp;&q uot;
+"<INPUT TYPE=SUBMIT name=\"shtrafuser\" value=\"Штраф\">"
+"</form>";
}else{
s = "";
ends = "";
}
for(i=0; i< ulist.length; i++){
if(ulist[i] != "undefined"

{
if (Status==2) s+="<INPUT TYPE=\"Checkbox\" NAME=\"DelList[]\" VALUE=\""+nulist[i]+"\">";
else s +="<LI style=color:"+culist[i]+">";
s += "<a style=\"text-decoration: none\" href='' onclick=\" return top.add_nick_to_message(\'"+ulist[i]+": \'

\"><FONT color="+culist[i]+">";
s += ulist[i]+"</FONT></a>";
if(Status == 2) s+="<BR>";
}
}
top.Chat_UserList.document.body.innerHTML = s+ends;
focus_messager();
return false;
}
//--------------------------------------------------------------------------
function SM(){
if(top.MesBuf != ""

{
send_command(2, top.MesBuf);
top.MesBuf = "";
top.document.ChatForm.Message.value = "";
}
return 0;
}
//--------------------------------------------------------------------------
function AddMessage(Data){
for(i = Data.length-1; i>= 0; i--){
Message = Data[i].split("<Q>"

;
if (Message[1].substring(0,4)=="<QA>"

{
Message[1]=Message[1].substring(4);
adm="<i>";
admc="</i>";
}else {
adm="<b>";
admc="</b>";
}
text[text.length] = "<font size=3 color=#808080>"+Message[0]+" </font><a style=\"text-decoration: none\" href='' onclick=\" return top.add_nick_to_message(\'"+Message[1]+": \'

\"><font size=3 color=black>"+adm+Message[1]+": "+admc+"</font></a><a style=\"text-decoration: none\" href='' onclick=\"return top.add_nick_to_message(\'"+Message[3]+" \'

;\"><font size=3 color="+Message[2]+" >"+Message[3]+"</font> </a>\r\n";
}
if(text.length >= MessageCount){
text.reverse();
text.length = MessageCount;
text.reverse();
}
//--- ---
if(Data.length > 0){
top.Chat_Messages.document.body.innerHTML = text.join("<br>"

;
top.Chat_Messages.scrollBy(0,65534);
top.Chat_Messages.scrollBy(0,65534);
}
// focus_messager();
return false;
}
//--------------------------------------------------------------------------
function unauthorize(){
clearTimeout(toid);
if(top.SDMess){
top.document.location = top.SDMess;
}
else if(top.unAuthorize){
top.unAuthorize();
}
else{
top.document.location = "
http://narod.yandex.ru/chat/error.xhtml";
// str = document.URL;
// top.document.location = str.substring(0, str.indexOf("/", 8)+1);
}
return true;
}
//--------------------------------------------------------------------------
function logout(chatid){
clearTimeout(toid);
top.Chat_Messages.document.body.innerHTML = "";
top.Chat_UserList.document.body.innerHTML = "";
if(top.Logout){
top.Logout();
}
else{
if (top.OptionsSet) {
top.document.location=optionurl+chatid+"& random_nocache="+Math.random();
} else {
if (top.chat_ref)
top.document.location = top.chat_ref;
else {
str = document.URL;
top.document.location = str.substring(0, str.indexOf("/", 8)+1);
}
}
}
return true;
}
//============================================
function get_val(name){
var end;
var s = document.URL;
var start = s.indexOf(name+"="

;
if(start != -1){
start += name.length+1;
if(!(end = s.indexOf("&", start)+1)) end = s.length+1;
return s.substring(start, end-1);
}
return "";
}
//--------------------------------------------------------------------------
function send_command(command, data){
clearTimeout(toid);
if(GetOk){
GetOk = false;
data= escape(data);
top.Chat_Command.document.location = script+"?chatid="+cid+"&userid= "+uid+"&command="+command+" ;&data="+data+"&wrapper=1&ne w="+Math.round(Math.random(100)*100000);
}
if(RefreshTime != 0) toid = setTimeout("send_command(3,0)", RefreshTime*1000);
}
//--------------------------------------------------------------------------
function focus_messager()
{
if (top.Foc) {
if (top.document.ChatForm.Message != "undefined"

top.document.ChatForm.Message.focus();
}
}
//--------------------------------------------------------------------------
function Init(iLines, iStatus, iRefresh){
MessageCount = iLines;
RefreshTime = iRefresh;
Status = iStatus;
if (Status == 2) top.document.getElementById("ah"

.innerH TML = "&nbsp;&nbsp;<a href=/help/10.html target=popuphelp onclick='window.open(\"/help/10.html\", \"popuphelp\",\"alwaysRaised=yes,de pendent=no,resizable=yes,height=250,width=500\&quo t

;return false;'><img src=/pics/m16.gif width=11 height=11 border=0></a>";
}
//--------------------------------------------------------------------------
function shtraf(chatid){
top.SDMess = "
http://narod.yandex.ru/chat/error.xh..."+chatid;
}
//--------------------------------------------------------------------------
function rshtraf(chatid){
top.SDMess = "
http://narod.yandex.ru/chat/error.xh..."+chatid;
}
//============================================
у меня вопрос как скрипт генерит userid