Function ajax (url, vars, callbackFunction ){
Var request = window. XMLHttpRequest? New XMLHttpRequest (): new ActiveXObject ("MSXML2.XMLHTTP. 3.0 ");
Request. open ("GET", url, true );
Request. onreadystatechange = function (){
If (request. readyState = 4 & request. status = 200 ){
If (request. responseText ){
CallbackFunction (request. responseText );
}
}
};
Request. send (vars );
}
Function getinfo (){
State. innerHTML = "(loading ...)";
// Ajax ("online/ajax. php? Code = custList "," ", writedoc );
SetTimeout ('ajax ("online/ajax. php? Code = custList "," ", writedoc) ', 1000 );
}
Function writedoc (str ){
State. innerHTML = "& nbsp ;";
Dline = str. split ("'");
If (dline [1] = "getInfo "){
BallArr = dline [2]. split ("@");
For (j = 0; j <ballArr. length; j ++ ){
If (j> = 10) break;
If (ballArr [j] = '') continue;
Sline = ballArr [j]. split ("| ");
Showdata (j, sline [0], sline [1], sline [2], sline [3], sline [4], sline [5]);
}
}
}
Function showdata (index, aa, bb, cc, dd, ee, ff ){
Eval ("om_add_date _" + index). innerHTML = aa;
Eval ("om_client_id _" + index). innerHTML = bb;
Eval ("om_name _" + index). innerHTML = cc;
Eval ("om_rate _" + index). innerHTML = dd;
Eval ("om_amt _" + index). innerHTML = ee;
If (ff = 0) eval ("om_state _" + index). innerHTML = "<font color = blue> A </font> ";
Else if (ff = 1) eval ("om_state _" + index). innerHTML = "<font color = red> T </font> ";
Else if (ff = 2) eval ("om_state _" + index). innerHTML = "<font color = red> J </font> ";
}