function set_names(so,ea,ne,nw,we)
{
// alert("SET NAME");
- $("name").innerHTML = italizer(so);
- $("name").title = unescapeHTML(so[1]);
- $("name_ea").innerHTML = italizer(ea);
+ $("name").innerHTML = user_decorator(so);
+ $("name").title = unescapeHTML(so[1]);
+ $("name_ea").innerHTML = user_decorator(ea);
$("name_ea").title = unescapeHTML(ea[1]);
- $("name_ne").innerHTML = italizer(ne);
+ $("name_ne").innerHTML = user_decorator(ne);
$("name_ne").title = unescapeHTML(ne[1]);
- $("name_nw").innerHTML = italizer(nw);
+ $("name_nw").innerHTML = user_decorator(nw);
$("name_nw").title = unescapeHTML(nw[1]);
- $("name_we").innerHTML = italizer(we);
+ $("name_we").innerHTML = user_decorator(we);
$("name_we").title = unescapeHTML(we[1]);
for (i = 0 ; i < PLAYERS_N ; i++)
var CHATT_MAXLINES = 40;
+function user_decorator(user)
+{
+ var name;
+ var flags = user[0];
+ if ((flags & 0x03) != 0)
+ name = "<span class='au" + (flags & 0x03) + "'>"+user[1]+"</span>";
+ else
+ name = user[1];
+
+ return (name);
+}
+
+function user_dec_and_state(el)
+{
+ var content = "";
+ var val_el;
+
+ content = user_decorator(el);
+ content += state_add(el[0]);
+
+ return (content);
+}
+
+
/* PRO CHATT */
function chatt_sub(dt,data,str)
{
var flags;
var isauth;
- flags = data[0];
- if (flags & 0x02)
- name = "<i>"+data[1]+"</i>";
- else
- name = data[1];
- // alert ($("txt").scrollTop + parseInt(getStyle($("txt"),"height", "height")) - $("txt").scrollHeight);
-
- if ($("txt").scrollTop + parseInt(getStyle($("txt"),"height", "height")) - $("txt").scrollHeight >= 0)
- must_scroll = true;
-
- // alert("ARRIVA NAME: "+ name + " STR:"+str);
- if (chatt_lines_n == CHATT_MAXLINES) {
- $("txt").innerHTML = "";
- for (i = 0 ; i < (CHATT_MAXLINES - 1) ; i++) {
- chatt_lines[i] = chatt_lines[i+1];
- $("txt").innerHTML += chatt_lines[i];
+ name = user_decorator(data)
+
+ if ($("txt").scrollTop + parseInt(getStyle($("txt"),"height", "height")) - $("txt").scrollHeight >= 0)
+ must_scroll = true;
+
+ // alert("ARRIVA NAME: "+ name + " STR:"+str);
+ if (chatt_lines_n == CHATT_MAXLINES) {
+ $("txt").innerHTML = "";
+ for (i = 0 ; i < (CHATT_MAXLINES - 1) ; i++) {
+ chatt_lines[i] = chatt_lines[i+1];
+ $("txt").innerHTML += chatt_lines[i];
+ }
+ chatt_lines[i] = dt+name+str+ "<br>";
+ $("txt").innerHTML += chatt_lines[i];
+ }
+ else {
+ chatt_lines[chatt_lines_n] = dt+"<b>"+name+"</b> "+str+ "<br>";
+ $("txt").innerHTML += chatt_lines[chatt_lines_n];
+ chatt_lines_n++;
+ }
+ // $("txt").innerHTML;
+
+
+ if (must_scroll) {
+ $("txt").scrollTop = 10000000;
}
- chatt_lines[i] = dt+"<b>"+name+"</b> "+str+ "<br>";
- $("txt").innerHTML += chatt_lines[i];
- }
- else {
- chatt_lines[chatt_lines_n] = dt+"<b>"+name+"</b> "+str+ "<br>";
- $("txt").innerHTML += chatt_lines[chatt_lines_n];
- chatt_lines_n++;
- }
- // $("txt").innerHTML;
-
-
- if (must_scroll) {
- $("txt").scrollTop = 10000000;
- }
- // alert("scTOP "+$("txt").scrollTop+" scHEIGHT: "+$("txt").scrollHeight+" HEIGHT: "+getStyle($("txt"),"height", "height") );
+ // alert("scTOP "+$("txt").scrollTop+" scHEIGHT: "+$("txt").scrollHeight+" HEIGHT: "+getStyle($("txt"),"height", "height") );
}
/*
function j_stand_tdcont(el)
{
- var content = "";
- var val_el;
-
- val_el = el[0] & 0x03;
-
- if (val_el > 0)
- content += '<span class="au'+val_el+'">';
-
- content += el[1];
-
- if (val_el > 0)
- content += '</span>';
-
- content += state_add(el[0]);
-
- return (content);
+ return (user_dec_and_state(el));
}
function j_stand_cont(ddata)
var content = '';
for (i = 0 ; i < data.length ; i++) {
- var val_el;
-
- val_el = data[i][0] & 0x03;
-
- if (val_el > 0)
- content += '<span class="au'+val_el+'">';
-
- content += data[i][1];
-
- if (val_el > 0)
- content += '</span>';
-
- content += state_add(data[i][0]);
+ // content += user_decorator(data[i]);
+ // content += state_add(data[i][0]);
+ content += j_stand_tdcont(data[i]);
content += '<br>';
}