
function TasteGedrueckt (Ereignis) {
  
  var Tastencode;
  var obj;
  
  if (!Ereignis)
    Ereignis = window.event;
  if (Ereignis.which) {
  	Tastencode = Ereignis.which;
  } 
	else if (Ereignis.keyCode) {
    Tastencode = Ereignis.keyCode;
  }

	dynamicsearch('specialsearchinput', 'autocompletetarget1');

  // document.formular.ausgabe.value = "Taste mit Dezimalwert " + Tastencode + " gedrückt";
  
  //obj = document.getElementById('autocompletetarget1');
   
  //obj.firstChild?obj.firstChild.data+='txt':obj.appendChild(document.createTextNode('txt'));

}



function ReleaseButtonAJ(Ereignis) {
  
  var Tastencode;
  var obj;
  
	var temp = new Array;
	var calling_element = '';
	var calling_menu_entry = ''
	var actioncode = '';

  // obsolete for now: which key was pressed?
  
  if (!Ereignis) {
    Ereignis = window.event;
  }

  if (Ereignis) {

	  if (Ereignis.which) {
	  	Tastencode = Ereignis.which;
	  } 
		else if (Ereignis.keyCode) {
	    Tastencode = Ereignis.keyCode;
	  }
	}
	// no key pressed, emulate space bar
  else {
  	Tastencode = 32;
  }


	// get the current url
	
	temp['calling_menu_entry'] = location.href;
	temp['string_begin'] = temp['calling_menu_entry'].lastIndexOf("/");
	temp['calling_menu_entry'] = temp['calling_menu_entry'].substring(temp['string_begin']);

	

	temp['calling_url'] = location.href;
	temp['string_begin'] = temp['calling_url'].lastIndexOf("/");
	temp['string_end'] = temp['calling_url'].lastIndexOf(".html");

	
	if (temp['calling_url'].lastIndexOf(".html") != -1) {
		temp['calling_menu_entry2'] = temp['calling_url'].substring(temp['string_begin'], temp['string_end']);
	}
	else {
		temp['calling_menu_entry2'] = temp['calling_url'].substring(temp['string_begin']) + 'start';
	}


	// which input element is active (usually means: has the focus) - element is the source of the ajax call
		
	if (document.activeElement) {
		calling_element = document.activeElement.id;
	}


	// get the values to transmit to PHP
	
	temp['value'] = document.getElementById(calling_element).value;
	temp['value'] =	temp['value'].replace(/ü/g, "spec__ue");
	temp['value'] =	temp['value'].replace(/ö/g, "spec__oe");
	temp['value'] =	temp['value'].replace(/ä/g, "spec__ae");

	temp['value'] =	temp['value'].replace(/Ü/g, "spec__Ue");
	temp['value'] =	temp['value'].replace(/Ö/g, "spec__Oe");
	temp['value'] =	temp['value'].replace(/Ä/g, "spec__Ae");

	temp['value'] =	temp['value'].replace(/ß/g, "spec__ss");



	// what is the current action?
	
	if (calling_element == 'inputsearch1') {
		actioncode = '-searchdoctors';
	}

	temp['calling_menu_entry2']	= temp['calling_menu_entry2'] + actioncode + '.html';
	

	//temp['targeturl'] = '/ajax'+temp['calling_menu_entry']+'?inputfields[calling_menu_entry]='+temp['calling_menu_entry']+'&inputfields[value]='+temp['value']+'&inputfields[source]='+calling_element; 
	
	temp['targeturl'] = '/ajax'+temp['calling_menu_entry2']+'?inputfields[test]='+temp['calling_menu_entry2']+'&inputfields[value]='+temp['value']+'&inputfields[source]='+calling_element; 

	
	// encode special characters
	

	makeHttpRequest(temp['targeturl'], aj_handle_result, calling_element, false);



	//makeHttpRequest('/ajax/daten.html?inputfields[value]='+document.getElementById('inputsearch1').value, aj_handle_result);

	//makeHttpRequest('/ajax/index.php?inputfields[value]='+document.getElementById('inputsearch1').value, aj_handle_result);
	
	//dynamicsearch('specialsearchinput', 'autocompletetarget1');

  // document.formular.ausgabe.value = "Taste mit Dezimalwert " + Tastencode + " gedrückt";
  
  //obj = document.getElementById('autocompletetarget1');
   
  //obj.firstChild?obj.firstChild.data+='txt':obj.appendChild(document.createTextNode('txt'));
  
}



function ReleaseButtonFahrtBuchen(Ereignis) {
  
  var Tastencode;
  var obj;
  
  if (!Ereignis)
    Ereignis = window.event;
  if (Ereignis.which) {
  	Tastencode = Ereignis.which;
  } 
	else if (Ereignis.keyCode) {
    Tastencode = Ereignis.keyCode;
  }

	dynamicsearch('specialsearchinput', 'autocompletetarget1');

  // document.formular.ausgabe.value = "Taste mit Dezimalwert " + Tastencode + " gedrückt";
  
  //obj = document.getElementById('autocompletetarget1');
   
  //obj.firstChild?obj.firstChild.data+='txt':obj.appendChild(document.createTextNode('txt'));
  
}
