  var http = getHTTPObject(); //  the HTTP Object
  var div; var glob; var txt; var tmpspan;

  //called by the user/page
  function updateList(url,lst,itm,divid){
    if(http){
      div=document.getElementById(divid);

      if(itm.value=='') hideDIV();
			else{
        txt=itm;

        div.style.width=(txt.clientWidth-5)+'px';
        div.style.visibility='visible';

        div.innerHTML = itm.value+'...';

        uri = url + "page=ajax&lst=" + lst + "&val=" + itm.value + "&itm=" + itm.name;
        http.open("POST",uri,true); http.onreadystatechange=handleHttpResponse; http.send(null);
      }
    }
  }

  //catches the returned data
  function handleHttpResponse(){
    if (http.readyState == 4){  result = http.responseText; div.innerHTML=result; }
  }

  // declare http
  function getHTTPObject(){
    if (window.ActiveXObject) var http = new ActiveXObject("Microsoft.XMLHTTP");
    else{ if (window.XMLHttpRequest){ http = new XMLHttpRequest(); }}
    return http;
  }

  function hideDIV(){
    if(tmpspan!='' && tmpspan) txt.value=remHTMLbold(tmpspan); // fill in value in textbox
		//if(tmpid!='' && tmpid) glob.value=tmpid; // fill in ID in hidden (globid)
    div.style.visibility='hidden';
  }

  function remHTMLbold(txt){
		txt=txt.replace('<b>',''); txt=txt.replace('<B>','');
    txt=txt.replace('</b>','"'); txt=txt.replace('</B>','"');
		txt=txt.replace(':',' "'); txt=txt.replace('...','');
		txt=txt.replace('&nbsp;','');
		return '"'+txt+'"';
  }

