function FFSuggest(){var d;var D;var s=false;var F="";var w="";var p="";var B="";var l="";var r;var A;var t;var u=0;var k=0;var f="#E9EAEE";var i="#303A63";var C="#FCFCFC";var b="#303A63";var c=0;this.init=function(L,I,K,H,G,J){w=L;B=I;p=K;l=H;F=G;s=J;if(w==""){if(s){alert("no searchurl defined")}return null}else{if(F==""){if(s){alert("no instancename defined")}return null}else{if(B==""){if(s){alert("no formname defined")}return null}else{if(p==""){if(s){alert("no queryparamname defined")}return null}else{if(l==""){if(s){alert("need a layer for output")}}}}}}r=document[B][p];r.onkeyup=j;document.forms[B].onsubmit=o};this.setHighlightColors=function(H,G){f=H;i=G};this.setStandardColors=function(G,H){C=G;b=H};this.setCellspacing=function(G){k=G};function o(){if(A[u]!=undefined){if(A[u].split("###")[1]=="Kategorie"){document[B]["filterkategorie"].value="__"+A[u].split("###")[0]+"__";document[B][p].value=""}else{document[B][p].value=A[u].split("###")[0]}}changeSearchFormAction()}this.handleClick=function(H){var G=n(H);if(G!=null){y(G);u=H}if(A[u]!=undefined){if(A[u].split("###")[1]=="Kategorie"){document[B]["filterkategorie"].value="__"+A[u].split("###")[0]+"__";document[B][p].value="";document[B].submit()}else{document[B][p].value=A[u].split("###")[0];document[B].submit()}}};this.handleMouseOver=function(H){var G=n(H);e();if(G!=null){y(G);u=H}};this.handleMouseOut=function(H){var G=n(H);if(G!=null){m(G);u=-1}};function j(G){G=(G)?G:((event)?event:null);if(G.timeStamp-c<10){return}else{c=G.timeStamp}var H=G.keyCode;if(H==38){h("up");x()}else{if(H==40){h("down");x()}else{if(H==13){o();document[B].submit()}else{if(r.value==""){q();if(D!=null){D.innerHTML=""}return null}if(t!=r.value){v()}t=r.value}}}}function a(G){G=(G)?G:((event)?event:null);var H=G.keyCode;if(H==38){h("up")}else{if(H==40){h("down")}else{if(r.value==""){q();if(D!=null){D.innerHTML=""}return null}if(t!=r.value){v()}t=r.value}}}function h(I){var J=u;if(I=="up"){J--}else{J+=1}if(J<0){e();r.focus();u=-1}else{var H=n(J);if(H!=null){e();y(H);u=J}}var G=r.value;r.value="";r.focus();r.value=G}function v(){var I=r.value;var H=w+"&"+p+"="+I+"&ajax=1";try{if(window.XMLHttpRequest){d=new XMLHttpRequest()}else{if(window.ActiveXObject){d=new ActiveXObject("Microsoft.XMLHTTP")}else{if(s){alert("")}}}D=document.getElementById(l);if(D!=null){if(I!=""){d.open("GET",H,true);d.onreadystatechange=E;d.send(null)}else{q()}}else{if(s){alert("no layer for output found")}}}catch(G){q();if(G==undefined){if(s){alert("Error: "+G.getmessage)}}else{if(s){alert("Error: "+G)}}}}function q(){if(D!=null){D.style.display="none"}}this.hideLayerOutsideCall=function(){if(D!=null){D.style.display="none"}};function g(){if(D!=null&&A.length>=1){D.style.display="block"}}function E(){if(d.readyState==4){if(d.status!=200){q();if(s){alert("Error ("+d.status+"): "+d.statusText)}}else{z(d.responseText)}}}function z(M){var J=new RegExp("("+document.getElementById("SearchInput").value+")","gi");u=-1;A=new Array();A=M.split("\n");var H='<table id="suggestionList" cellpadding="'+k+'" cellspacing="0" class="'+l+'" width="100%" border="0">';var L=new Array();for(var I in A){var K=A[I].charCodeAt(0);if(K!=13&&K!=10&&A[I].length>=1){L.push(A[I])}}H+='<tr><td colspan="2" id="suggestionHeader"><span style="float: left;">Unsere Vorschl&auml;ge zu Ihrer Suche:</span><a href="javascript:;" id="suggestionLink"><img src="/intershoproot/eCS/Store/ch/images/factfinder/icon_schliessen.gif" alt="" title=""></a></td></tr>';A=L;for(var I in A){pSuggestParts=new Array();pSuggestParts=A[I].split("###");var G=pSuggestParts[0];if(G.length>24){G=G.substr(0,24)+"..."}G=G.replace(J,"<b>$1</b>");H+='<tr id="'+l+"_"+I+'" onMouseDown="'+F+".handleClick("+I+');" onMouseOver="javascript:'+F+".handleMouseOver("+I+');" onMouseOut="javascript:'+F+".handleMouseOut("+I+');"><td class="suggestionList" nowrap="nowrap"><nobr>'+G+'</nobr></td><td class="shopList" nowrap="nowrap" align="right">'+pSuggestParts[2]+"</td></tr>"}H+="</table>";if(A.length>=1){g();D.innerHTML=H}else{q();D.innerHTML=""}}function y(G){G.style.backgroundColor=f;G.style.color=i}function m(G){G.style.backgroundColor=C;G.style.color=b}function e(){var H;for(var G in A){H=n(G);if(H!=null){m(H)}}}function n(H){var G;G=document.getElementById(l+"_"+H);return G}function x(){if(A[u]!=undefined){if(A[u].split("###")[1]=="Kategorie"){document[B]["filterkategorie"].value="__"+A[u].split("###")[0]+"__";document[B][p].value=""}else{document[B][p].value=A[u].split("###")[0]}}}};