function initSearchBox(){
    $('loadingSearchBlock').hide();
     new Event.observe(
         'productname',
         'keyup',
         function(event){
		if(document.getElementById("productname").value.length>2){
             $('loadingSearchBlock').show();

              new Ajax.Request('/ajax/ajax.jsp?productname='+document.getElementById("productname").value,
              {
                method:'get',
                parameters: {translate: $('productname').value},
                onSuccess: function(nom){
                    //nom ist der nomale response text
                        xml = nom.responseXML;
                        anzeige="";
                        for(i=0;i<xml.getElementsByTagName("Product").length;i++){
				search_resp = xml.getElementsByTagName("Product")[i];
				var sessionId=document.getElementById('sessionAkt').value;
				anzeige += "<a href='/"+search_resp.getElementsByTagName("oid")[0].firstChild.nodeValue+".html"+sessionId+"'>"+search_resp.getElementsByTagName("name")[0].firstChild.nodeValue+"</a>";
				anzeige += "<br>";
			}
                        $('loadingSearchBlock').innerHTML = anzeige;
                },
                   onFailure: function(){ alert('Fehler bei Ajax Request') }
              });
             }

         },
         false
     );
}



