   var request = false;
   try {
     request = new XMLHttpRequest();
   } catch (trymicrosoft) {
     try {
       request = new ActiveXObject("Msxml2.XMLHTTP");
     } catch (othermicrosoft) {
       try {
         request = new ActiveXObject("Microsoft.XMLHTTP");
       } catch (failed) {
         request = false;
       }  
     }
   }
   if (!request)
     alert("Error initializing XMLHttpRequest!");

   function getOldSearch() {
     var qstr = document.getElementById("qstr").value;
     var url = "prompt.phtml?qstr=" + escape(qstr);
     request.open("GET", url, true);
     request.onreadystatechange = updatePage;
     request.send(null);
   }

   function updatePage() {
     if (request.readyState == 4) {
       if (request.status == 200) {
         var response = request.responseText.split("|");
	 if (response[0].length<=6) { hide_bar(); } else { show_bar(); }
	 obj = document.getElementById("win");
	 if(navigator.userAgent.indexOf('Firefox',0)>0) {
  	   var i=0;
	   var j=0;
	   var a=response[0].indexOf('<br>',j);
	   while (a>0) {
	     i++;
	     j=a+4;
	     if(a>0) { a=response[0].indexOf('<br>',j) }
	   }
	   obj.style.height=i*15+10;
	 }
	 if(navigator.userAgent.indexOf('Opera',0)>=0) {
  	   var i=0;
	   var j=0;
	   var a=response[0].indexOf('<br>',j);
	   while (a>0) {
	     i++;
	     j=a+4;
	     if(a>0) { a=response[0].indexOf('<br>',j) }
	   }
	   obj.style.height=(i-1)*15;
	 }
         obj.innerHTML =
	    '<p align=left>' + response[0].replace(/\n/g, "") + '</p>';
       }
     }
    }
    
    function getbounds(element) {
      function bounds(left, top, width, height){
        this.left=left;
	this.top=top;
	this.width=width;
	this.height=height;
      }
      var left=element.offsetLeft;
      var top=element.offsetTop;
      for(var parent=element.offsetParent; parent; parent=parent.offsetParent) {
        left+=parent.offsetLeft-parent.scrollLeft;
	top+=parent.offsetTop-parent.scrollTop;
      }
      a=new bounds(left, top, element.offsetWidth, element.offsetHeight);
      return a;
    }
    
    function show_bar() {
        var element=document.getElementById('qstr');
        var bounds=getbounds(element);
        obj = document.getElementById("win");
        obj.style.top = bounds.top + bounds.height;
        obj.style.left = bounds.left;
        obj.style.visibility = "visible";
    }
    
    function hide_bar() {
      document.getElementById("win").style.visibility="hidden"
    }


