/*var listeId = 0;
var size = 0;
var height = 0;

function wait(){
  setTimeout(fill_search, 2000);
}
function appear_list(doIt ) {
  if (doIt) {
    // Start the timer
    t_blur('input_suche', 'blur');
    var suche_bottom = document.getElementById('suche_bottom');
    var suche_ergebnis = document.getElementById('suche_ergebnis');
    var suche_list = document.getElementById('suche_list');
    height = parseInt(suche_list.clientHeight);
    // alert( suche_list.style.height + "#" + suche_list.clientHeight);
    //alert(height + ":" + suche_ergebnis.style.height);
    size = parseInt(suche_list.clientHeight) % 20;
    suche_ergebnis.className= "suche_ergebnis_2"; 
    listeId = setInterval("get_bigger()", 5);
  }
  else {
    var suche_list = document.getElementById('suche_list');
    suche_list.className= "suche_list_2"; 
    clearInterval(listeId);
    t_blur('input_suche', 'focus');
  }
}

function get_bigger() {
  var suche_bottom = document.getElementById('suche_bottom');
  var suche_ergebnis = document.getElementById('suche_ergebnis');
  if (size < height) {
    size = size + 5;
    suche_bottom.style.top = size;
    suche_ergebnis.style.height = size;
  }
  else {
    appear_list(false);
  }
}

function disappear_list(doIt) {
  if (doIt) {
    t_blur('input_suche', 'blur');
    var suche_ergebnis = document.getElementById('suche_ergebnis');
    suche_ergebnis.className= "suche_ergebnis_2"; 
    var suche_list = document.getElementById('suche_list');
    suche_list.className= "suche_list"; 
    // Start the timer
    listeId = setInterval("get_smaller()", 5);
  }
  else {
    var suche_list = document.getElementById('suche_list');
    //suche_list.className= "suche_list"; 
    clearInterval(listeId);
    size = 0;
    height = 0;
    t_blur('input_suche', 'focus');
  }
}

function get_smaller() {
  var suche_bottom = document.getElementById('suche_bottom');
  var suche_ergebnis = document.getElementById('suche_ergebnis');
  if (size >= 5) {
    size = size - 5;
    suche_bottom.style.top = size;
    suche_ergebnis.style.height = size;
  }
  else {
    disappear_list(false);
  }
}

function clean_value(value) {
  return value;
}

function disappear_appear(doIt) {
  if (doIt) {
    t_blur('input_suche', 'blur');
    var suche_ergebnis = document.getElementById('suche_ergebnis');
    suche_ergebnis.className= "suche_ergebnis_2"; 
    var suche_list = document.getElementById('suche_list');
    suche_list.className= "suche_list"; 
    // Start the timer
    listeId = setInterval("get_smaller_2()", 5);
  }
  else {
    var suche_list = document.getElementById('suche_list');
    clearInterval(listeId);
    size = 0;
    height = 0;
    fill_search();
  }
}

function get_smaller_2() {

  var suche_bottom = document.getElementById('suche_bottom');
  var suche_ergebnis = document.getElementById('suche_ergebnis');
  if (size >= 5) {
    size = size - 5;
    suche_bottom.style.top = size;
    suche_ergebnis.style.height = size;
  }
  else {
   disappear_appear(false);
  }
}*/

function fill_search() {
	var cJust = new Date();
	var cDate = cJust.getSeconds() + cJust.getMinutes();
	var pValue = document.getElementById("input_suche").value;
	
	var xmlUrl = "http://www.karl-may.de/relaunch/modules/rapid_search.php?searchIndex=list";
	xmlUrl += "&searchValue=" + pValue;
	xmlUrl += "&searchDate=" + cDate;

	if(pValue.length < 2) {
		return;
	}
	
	if(document.getElementById('suche_container').style.display == 'block') {
	  t_block('suche_container', 'none');
	  return;
	}
	  
	x_request();

	if(!xmlHttp)
	  return(0);

	xmlHttp.open("GET", xmlUrl, true);
	xmlHttp.onreadystatechange = show_result_search;
	xmlHttp.send(null);
	return;
}

function show_result_search() {
	if(xmlHttp.readyState == 4 && xmlHttp.status == 200) {
		pResult = xmlHttp.responseText;
		if(pResult == "") {
			t_block('suche_container', 'none');
			return;
		}
    t_block('suche_container', 'block');
		t_html('suche_container', pResult);
	}
}


