var timer="";
function ajF() {
//  if (timer != "")
//    clearTimeout(timer);
//  timer = setTimeout("doIt()",500); 
  doIt();
}
function aj(keepOn,opt,parm)
{ 
  if (timer != "")
    timer="";
  var xmlHttp;
  if (window.XMLHttpRequest) { // Mozilla, Safari, ...
    xmlHttp = new XMLHttpRequest();
    if (xmlHttp.overrideMimeType) {
      xmlHttp.overrideMimeType('text/xml');
      // See note below about this line
    }
  } 
  else {
  // Internet Explorer
  try {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
  catch (e) {
    try {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    catch (e) {
      return false;
      }
    }
  }
  var txt = "";
  if (opt==11) {
    var nbr = arguments[3];
    var patt1=/[0-9]+/;
    nbr = (nbr.match(patt1));
    txt = "Player"+nbr;
  }
  else if (opt==12) {
    txt = arguments[2];
  }
  if (!Gecko || keepOn) {
    xmlHttp.onreadystatechange=function() { processResponse(xmlHttp,opt,txt) }
  }
   var str="opt="+opt;
   for(i=2; i<arguments.length;){
     parm=arguments[i++];
     str+="&p"+(i-2)+"="+parm;
   } 
   xmlHttp.open("POST",("ajInfo.asp"),(keepOn?true:false));
   xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
   xmlHttp.send(str);
   if (Gecko && !keepOn)
     processResponse(xmlHttp,opt,txt)
}
function processResponse(xmlHttp,opt,txt) {
  if(xmlHttp.readyState==4) {
    if (xmlHttp.status == 200) {
/*      if (opt<3){
        document.getElementById('s1').innerHTML=xmlHttp.responseText;
      } else if (opt<5){
        document.getElementById('s2').innerHTML=xmlHttp.responseText;
      } else */ 
     if (opt<8){
        Tip(xmlHttp.responseText,STICKY,true,CLICKCLOSE,true,OFFSETX,150);
      } else if (opt==8){ 
        document.getElementById('o5').innerHTML=xmlHttp.responseText;
      } else if (opt==9){ 
        Tip(xmlHttp.responseText,OFFSETX,150);
      }
      else if (opt==10){
      }
      else if (opt==11){
        document.getElementById(txt).innerHTML=xmlHttp.responseText;
      }
      else if (opt==12){
        var data=xmlHttp.responseText.split("^");
        var table=document.getElementById(data[0]);
        var row = table.rows[1];
        row.cells[0].innerHTML="&nbsp;";
        if (xmlHttp.responseText.length > 0) {
          var idx=1;
          while (data[idx]+"" != "undefined") {
            row=table.insertRow(-1);
            var cell1=row.insertCell(0);
            var cell2=row.insertCell(1);
            var cell3=row.insertCell(2);
            var cell4=row.insertCell(3);
            var cell5=row.insertCell(4);
            var cell6=row.insertCell(5);
            var cell7=row.insertCell(6);
            var cell8=row.insertCell(7);
            cell1.innerHTML=data[idx++];
            cell1.className="p20";
            cell2.innerHTML=data[idx++];
            cell2.className="p40";
            cell3.innerHTML=data[idx++];
            cell3.className="p100L";
            cell4.innerHTML=data[idx++];
            cell4.className="p100";
            cell5.innerHTML=data[idx++];
            cell5.className="p150";
            cell6.innerHTML=data[idx++];
            cell6.className="p40";
            cell7.innerHTML=data[idx++];
            cell7.className="p100R";
            cell8.innerHTML=data[idx++];
            cell8.className="p100R";
          }
        }
      }
      else {
        var x = mkTbl("<font face='Arial' style='font-size: 8"+xmlHttp.responseText+"</font>");
        Tip(x); // requires PopupToolTip.js
      }
    }
    else
      alert ("AJAX malfunction\nxmlHttp.status="+xmlHttp.status);
   }
}

