/*
// +----------------------------------------------------------------------+
// | Copyright (c) 2004 Bitflux GmbH                                      |
// +----------------------------------------------------------------------+
// | Licensed under the Apache License, Version 2.0 (the "License");      |
// | you may not use this file except in compliance with the License.     |
// | You may obtain a copy of the License at                              |
// | http://www.apache.org/licenses/LICENSE-2.0                           |
// | Unless required by applicable law or agreed to in writing, software  |
// | distributed under the License is distributed on an "AS IS" BASIS,    |
// | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or      |
// | implied. See the License for the specific language governing         |
// | permissions and limitations under the License.                       |
// +----------------------------------------------------------------------+
// | Author: Bitflux GmbH <devel@bitflux.ch>                              |
// +----------------------------------------------------------------------+

*/

//Änderungen zum Original: stark gekürzt

var liveSearchReq_main = false;
var t_main = null;
var liveSearchLast_main = "";
	

function liveSearchHideDelayed_main() {
  window.setTimeout("liveSearchHide_main()",400);
}

function liveSearchHide_main() {
	document.getElementById("LSResult_main").style.display = "none";
//	if (navigator.appName == "Konqueror") {
		var banner2 = document.getElementById("bigsize_banner");
		if (banner2 != null) {banner2.style.visibility = "visible"};
//	}
	var hm = document.getElementById("hidemely1");
	if (hm != null) {hm.style.visibility = "visible"};
	var hm = document.getElementById("cgiad");
	if (hm != null) {hm.style.visibility = "visible"};
}

function liveSearchStart_main() {
        if (t_main) {
		window.clearTimeout(t_main);
	}
	t_main = window.setTimeout("liveSearchDoSearch_main()",0); // vorher 200
}

function liveSearchDoSearch_main() {
        if (liveSearchLast_main != document.forms.megasuche_main.searchname.value) {
	if (liveSearchReq_main && liveSearchReq_main.readyState < 4) {
//		if (navigator.appName == "Konqueror") {
			var banner3 = document.getElementById("bigsize_banner");
	        	if (banner3 != null) {banner3.style.visibility = "visible"};
//		}
		liveSearchReq_main.abort();
	}
	if ( document.forms.megasuche_main.searchname.value == "") {
		liveSearchHide_main();
		return false;
	}
//	if (window.XMLHttpRequest) {
//	// branch for IE/Windows ActiveX version
//	  liveSearchReq_main = new XMLHttpRequest();
//	} else if (window.ActiveXObject) {
//          liveSearchReq_main = new ActiveXObject("Microsoft.XMLHTTP");
//	}

  try{
    liveSearchReq_main=new ActiveXObject("Msxml2.XMLHTTP")
  }catch(e){
    try{
      liveSearchReq_main=new ActiveXObject("Microsoft.XMLHTTP")
    } catch(oc){
      liveSearchReq_main=null
    }
  }
  if(!liveSearchReq_main && typeof XMLHttpRequest != "undefined") {
    liveSearchReq_main=new XMLHttpRequest()
  }
  if(!liveSearchReq_main) {return}

        liveSearchReq_main.onreadystatechange= liveSearchProcessReqChange_main;
        liveSearchReq_main.open("GET", "/search/livesearch.m?searchname=" + document.forms.megasuche_main.searchname.value);
        liveSearchLast_main = document.forms.megasuche_main.searchname.value;
        liveSearchReq_main.send(null);
        }
}

function liveSearchProcessReqChange_main() {
	
	if (liveSearchReq_main.readyState == 4) {
	//        var hm = document.getElementById("hidemely1");
	//	if (hm != null) {hm.style.visibility = "hidden"};
	//        var hm = document.getElementById("cgiad");
	//	if (hm != null) {hm.style.visibility = "hidden"};
//		if (navigator.appName == "Konqueror") {
		      	var banner = document.getElementById("bigsize_banner");
		 	if (banner != null) {banner.style.visibility = "hidden"};
//		}
		var  res = document.getElementById("LSResult_main");
		res.style.visibility="visible";
		res.style.display = "block";
//		res.innerHTML = '<table border="0" cellspacing="0" cellpadding="0" width="100%" bgcolor="#eeeeee"><tr><td style="line-height:19px" class="arhead" colspan="2">&nbsp;<b>Suchhilfe</b></td></tr>' + liveSearchReq_main.responseText ;
		res.innerHTML = '<table class="shilfe"><tr><td class="shilfe1">Suchhilfe</td></tr>' + liveSearchReq_main.responseText ;
		window.status = "Fertig";
	}
}


