var searchTimeout;
var lastQuery;
var minSearchStringLength = 3;

function showResult(catalog_id, manufacturer, category, selectionflag, shopuser_id) {
        window.clearTimeout(searchTimeout);
	searchTimeout = window.setTimeout("AJAXSearch(document.getElementById('livesearch_input').value"+",'"+catalog_id+"','"+manufacturer+"','"+category+"','"+selectionflag+"','"+shopuser_id+"')", 200);
}
 

function AJAXSearch(str, catalog_id, manufacturer, category, selectionflag, shopuser_id)
{

if (str.length==0)
  {
  document.getElementById("livesearch_output").innerHTML="";
  document.getElementById("livesearch_output").style.border="0px";
  lastQuery='';
  return;
  }

if (str.length >= minSearchStringLength && lastQuery != str)
{
  if (lastQuery == '') 
  {
     document.getElementById("livesearch_output").innerHTML='<div style="border: 1px solid #A5ACB2"><table width=100% bgcolor=#FFFFFF><tr><td align="center"><BR><BR>bitte warten ...<BR><BR><BR></td></td></table></div>'; 
  }

  if (window.XMLHttpRequest) 
  {// code for IE7+, Firefox, Chrome, Opera, Safari
     xmlhttp=new XMLHttpRequest();
  }
  else
  {// code for IE6, IE5
     xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
  
  xmlhttp.open("GET","/eshop.php?action=livesearch&q="+str+"&m="+manufacturer+"&p="+catalog_id+"&c="+category+"&s="+selectionflag+"&u="+shopuser_id,true);
  
  xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("livesearch_output").innerHTML=xmlhttp.responseText;
    document.getElementById("livesearch_output").style.border="";
    }
  }
  
  xmlhttp.send(null);
}

lastQuery=str;
}


<!--powersearch mit Multi-Select-Box-->
  function gotoLink(){
    var ALink;
    var AOptionList = document.getElementsByName("fieldname_external")[0];
    var AOption = AOptionList.selectedIndex;
    ALink = AOptionList.options[AOption].getAttribute("power_link");
    window.location.href=ALink;
  }
  function init() {
  }


