var xmlHttp

function showHint(str,db,query_type) {
 if (str.length==0) { 
   document.getElementById("txtHint1").innerHTML="";
   document.getElementById("txtHint2").innerHTML="";
   document.getElementById("txtHint3").innerHTML="";
   document.getElementById("txtHint4").innerHTML="";
   document.getElementById("txtHint5").innerHTML="";
   document.getElementById("txtHint6").innerHTML="";
   document.getElementById("txtHint7").innerHTML="";
   document.getElementById("txtHint8").innerHTML="";
   return;
 }
 xmlHttp=GetXmlHttpObject()
 if (xmlHttp==null) {
   alert ("Your browser does not support AJAX!");
   return;
 } 
 var url="http://orygenesdb.cirad.fr/cgi-bin/choose_go.pl";
 url=url+"?go_id="+str+";db="+db+";type="+query_type;
 if (query_type == "go") {
   if (db == "os") {
     xmlHttp.onreadystatechange=stateChanged1;
     xmlHttp.open("GET",url,true);
     xmlHttp.send(null);
   } else if (db == "at") {
     xmlHttp.onreadystatechange=stateChanged2;
     xmlHttp.open("GET",url,true);
     xmlHttp.send(null);
   } else if (db == "sb") {
     xmlHttp.onreadystatechange=stateChanged3;
     xmlHttp.open("GET",url,true);
     xmlHttp.send(null);
   } else {
     xmlHttp.onreadystatechange=stateChanged4;
     xmlHttp.open("GET",url,true);
     xmlHttp.send(null);
   }
 } else {
   if (db == "os") {
     xmlHttp.onreadystatechange=stateChanged5;
     xmlHttp.open("GET",url,true);
     xmlHttp.send(null);
   }else if (db == "at") {
     xmlHttp.onreadystatechange=stateChanged6;
     xmlHttp.open("GET",url,true);
     xmlHttp.send(null);
   }else if (db == "sb") {
     xmlHttp.onreadystatechange=stateChanged7;
     xmlHttp.open("GET",url,true);
     xmlHttp.send(null);
   } else {
     xmlHttp.onreadystatechange=stateChanged8;
     xmlHttp.open("GET",url,true);
     xmlHttp.send(null);
   }
 }
} 

function stateChanged1()  { 
 if (xmlHttp.readyState==3) { 
   document.getElementById("txtHint1").innerHTML=xmlHttp.responseText;
 }
}

function stateChanged2()  { 
 if (xmlHttp.readyState==3) { 
   document.getElementById("txtHint2").innerHTML=xmlHttp.responseText;
 }
}

function stateChanged3()  { 
 if (xmlHttp.readyState==3) { 
   document.getElementById("txtHint7").innerHTML=xmlHttp.responseText;
 }
}
function stateChanged4()  { 
 if (xmlHttp.readyState==3) { 
   document.getElementById("txtHint8").innerHTML=xmlHttp.responseText;
 }
}
function stateChanged5()  { 
 if (xmlHttp.readyState==3) { 
   document.getElementById("txtHint3").innerHTML=xmlHttp.responseText;
 }
}

function stateChanged6()  { 
 if (xmlHttp.readyState==3) { 
   document.getElementById("txtHint4").innerHTML=xmlHttp.responseText;
 }
}

function stateChanged7()  { 
 if (xmlHttp.readyState==3) { 
   document.getElementById("txtHint5").innerHTML=xmlHttp.responseText;
 }
}

function stateChanged8()  { 
 if (xmlHttp.readyState==3) { 
   document.getElementById("txtHint6").innerHTML=xmlHttp.responseText;
 }
}

function GetXmlHttpObject() {
 var xmlHttp=null;
 try {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
 }
 catch (e) {
  // Internet Explorer
  try  {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
  catch (e)  {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
 return xmlHttp;
}
