var IB_Blab; 
function IB_processReqChange() 
{
 if(req.readyState == 4) 
 {
   if(req.status == 200)
   {
     document.getElementById(IB_Blab).innerHTML = req.responseText;
   }
   else
     document.getElementById(IB_Blab).innerHTML = '<font color=red>Error 11 Failed to reach server.</font>';
 }
}
// ===============================
// this just submits the form as a link
function getd_sb()
{
  document.mainfm.newblk.value=1;
  document.mainfm.submit();
}
// --------------------------------
function getd(Ba,wid,ww,dd)
{
  IB_Blab = Ba;

  if(ww==2) {
    var stid = document.mainfm.tbdb_status_id[document.mainfm.tbdb_status_id.selectedIndex].value;

  //alert("EE:"+stid);

    //dd="\""+document.mainfm.Analysis_PDB.value+"\",\""+document.mainfm.TmH.value+"\",\""+document.mainfm.Metab_related_targets.value+"\",\""+document.mainfm.Inhibitor.value+"\",\""+document.mainfm.Pathway.value+"\",\""+document.mainfm.Gateway_clone.value+"\",\""+document.mainfm.comments.value+"\","+stid;
    dd="xx"+document.mainfm.Analysis_PDB.value+"xx,xx"+document.mainfm.TmH.value+"xx,xx"+document.mainfm.Metab_related_targets.value+"xx,xx"+document.mainfm.Inhibitor.value+"xx,xx"+document.mainfm.Pathway.value+"xx,xx"+document.mainfm.Gateway_clone.value+"xx,xx"+document.mainfm.comments.value+"xx,"+stid;

  }


  url = "/TALK/Pt/WIKI_get_data.php?loc="+Ba+"&wid="+wid+"&ww="+ww+"&dd="+dd;

  //alert("url:"+furl);
  
  document.getElementById(IB_Blab).innerHTML = '<i>working</i>';

  if(window.XMLHttpRequest) 
  {
    req = new XMLHttpRequest();
    req.onreadystatechange = IB_processReqChange;
    req.open("GET", url, true);
    req.send(null);
  } 
  else if(window.ActiveXObject) 
  {
    req = new ActiveXObject("Microsoft.XMLHTTP");
    if(req) 
    {
      req.onreadystatechange = IB_processReqChange;
      req.open("GET", url, true);
      req.send();
    }
  }
}

