function autocompAjax(){this.params=this.url="";this.method="GET";this.onSuccess=null;this.onError=function(b){alert(b)}}
autocompAjax.prototype.doRequest=function(){function b(){if(d.readyState<4)return false;if(d.status==200||d.status==304)c.onSuccess&&c.onSuccess(d.responseText,d.responseXML);else c.onError&&c.onError("["+d.status+" "+d.statusText+"] Es trat ein Fehler bei der Datenbertragung auf.")}if(!this.url){this.onError("Es wurde kein URL angegeben. Der Request wird abgebrochen.");return false}this.method=this.method?this.method.toUpperCase():"GET";var c=this,d=getXMLHttpRequest();if(!d){this.onError("Es konnte kein XMLHttpRequest-Objekt erstellt werden.");
return false}switch(this.method){case "GET":d.open(this.method,this.url+"?"+this.params,true);d.onreadystatechange=b;d.send(null);break;case "POST":d.open(this.method,this.url,true);d.onreadystatechange=b;d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");d.send(this.params)}};
function getXMLHttpRequest(){if(window.XMLHttpRequest)return new XMLHttpRequest;else if(window.ActiveXObject)try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(c){return null}}return false}var key_navi=null;
function load(b,c,d,g,a){function f(h){document.getElementById(c).innerHTML=h;h=document.getElementById(c);document.getElementById(d);var l=document.getElementById(c).getElementsByTagName("li").length,k=document.getElementById("suggest_list");if(key_navi)key_navi.updateList(k);else key_navi=new keynavigation(k,c,d);if(l==0||j==""||j=="Suchbegriff")h.style.visibility="hidden";else if(h.innerHTML!="")h.style.visibility="visible"}function e(h){document.getElementById(c).innerHTML=h}var j=b.value;with(new autocompAjax){b=
g.keyCode?g.keyCode:g.charCode;if(!(b==37||b==38||b==39||b==40)){url="/suchen/suggest.php";method="POST";params="eingabe="+j+"&div_id="+c+"&txt_id="+d+"&sprache="+a;onSuccess=f;onError=e;doRequest()}}}
function abk(b,c,d){function g(e){document.getElementById(c).innerHTML=e}function a(e){document.getElementById(c).innerHTML=e}var f=b;b=document.getElementById(b).value;with(new autocompAjax){method="POST";if(c=="span_akronym"){url="/akronym/akronym.php";params="eingabe="+b}else if(c=="span_akronym_liste"){url="/akronym/tabelle_gefiltert.php";params="eingabe="+b+"&buchstabe="+d}else{url="/kontakt/check.php";params="eingabe="+b+"&input="+
f}onSuccess=g;onError=a;doRequest()}}function insert_eingabe(b,c,d){c=document.getElementById(c);d=document.getElementById(d);if(c&&d){c.value=b;d.style.visibility="hidden"}}function schliessen(b){document.getElementById(b).style.visibility="hidden"}function eingabe(b){document.getElementById(b).focus()}function div_close(b,c){if(document.getElementById(b))document.getElementById(b).style.visibility="hidden";if(document.getElementById(c))document.getElementById(c).style.visibility="hidden"}
function eventHandling(b,c,d,g){function a(f){f=f?f:window.event?window.event:"";if(f.stopPropagation)f.stopPropagation();else f.cancelBubble=true;d.call(d,f,f.srcElement||f.currentTarget,g?g:null)}g=g;if(document.addEventListener){if(c.match(/^on/))c=c.replace(/^on/,"");b.addEventListener(c,a,false)}else{c.match(/^on/)||(c="on"+c);b.attachEvent(c,a)}}
function keynavigation(b,c,d){function g(e){e=e.replace(/li>\s+/gm,"li>");e=e.replace(/\s+<li/gm,"<li");return e=e.replace(/li>\s+<li/gm,"li><li")}var a=null;b.innerHTML=g(b.innerHTML);var f=b;eventHandling(document,"keydown",function(e){switch(e.keyCode){case 38:if(a&&!a.previousSibling){a=f.lastChild.previousSibling;document.getElementById(d).value=a.firstChild.id;a.style.backgroundColor="#6990b6";a.firstChild.style.color="#FFF";firstElement=f.firstChild;e=f.firstChild.className=="lev"?"#900":"#000";
firstElement.style.backgroundColor="";firstElement.firstChild.style.color=e}else if(a&&a.previousSibling){a=a.previousSibling;document.getElementById(d).value=a.firstChild.id;a.style.backgroundColor="#6990b6";a.firstChild.style.color="#FFF";if(a.nextSibling){e=a.nextSibling.className=="lev"?"#900":"#000";a.nextSibling.firstChild.style.color=e;a.nextSibling.style.backgroundColor=""}}else if(!a){a=f.lastChild.previousSibling;document.getElementById(d).value=a.firstChild.id;a.style.backgroundColor="#6990b6";
a.firstChild.style.color="#FFF"}break;case 40:if(a)if(a.nextSibling){if(a.nextSibling){a=a.nextSibling;document.getElementById(d).value=a.firstChild.id;a.style.backgroundColor="#6990b6";a.firstChild.style.color="#FFF";if(a.previousSibling){e=a.previousSibling.className=="lev"?"#900":"#000";a.previousSibling.firstChild.style.color=e;a.previousSibling.style.backgroundColor=""}}}else{a=f.firstChild.nextSibling;document.getElementById(d).value=a.firstChild.id;a.style.backgroundColor="#6990b6";a.firstChild.style.color=
"#FFF";e=f.lastChild.className=="lev"?"#900":"#000";lastElement=f.lastChild;lastElement.style.backgroundColor="";lastElement.firstChild.style.color=e}else{a=f.firstChild.nextSibling;document.getElementById(d).value=a.firstChild.id;a.style.backgroundColor="#6990b6";a.firstChild.style.color="#FFF"}break;case 13:if(a)document.getElementById(c).style.visibility="hidden";break;case 9:if(a)document.getElementById(c).style.visibility="hidden"}});this.updateList=function(e){e.innerHTML=g(e.innerHTML);f=e;
a=null}}function farbe(b){as=document.getElementById(b).getElementsByTagName("a").length-1;for(i=0;i<=as;i++){document.getElementById(b).getElementsByTagName("a")[i].style.color="";document.getElementById(b).getElementsByTagName("li")[i].style.backgroundColor=""}};
