
if( typeof XMLHttpRequest == "undefined" ) XMLHttpRequest = function() {
  try { return new ActiveXObject("Msxml2.XMLHTTP.6.0") } catch(e) {}
  try { return new ActiveXObject("Msxml2.XMLHTTP.3.0") } catch(e) {}
  try { return new ActiveXObject("Msxml2.XMLHTTP") } catch(e) {}
  try { return new ActiveXObject("Microsoft.XMLHTTP") } catch(e) {}
  throw new Error( "This browser does not support XMLHttpRequest." )
};

var xmlhttp = false;
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
if (!xmlhttp && window.createRequest) {
	try {
		xmlhttp = window.createRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
  xmlhttp = new XMLHttpRequest();
}
   
function show_pn(id) {
    
    document.getElementById(id).style.display = 'inline';
    document.getElementById("table_"+id).style.display = 'none';

	// DATENFETCH
	var pn_id = id;

	// URL
	var url = "phplib/member/change_status.php?pn_id=" + pn_id; 

 	// ÖFFNE VERBINDUNG
 	xmlhttp.open("GET", url,true);
	xmlhttp.onreadystatechange=function() {
  	
	// RÜCKGABE  
	if (xmlhttp.readyState==4) {
   		document.getElementById(pn_status).value = xmlhttp.responseText;
  	}
 }
 xmlhttp.send(null)
}   

function count_reload() {
	// ZEIGE UPDATING
	document.searchform.count.value = "Updating...";

	// DATENFETCH
	var aircraft_id = document.searchform.aircraft_id.value;
	var airport_id = document.searchform.airport_id.value;
	var airline_id = document.searchform.airline_id.value;
	var search_category = document.searchform.search_category.value;
	var suchwort = document.searchform.suchwort.value;

	// URL
	var url = "phplib/search/count_reload.php?aircraft_id=" + aircraft_id + "&airport_id=" + airport_id + "&airline_id=" + airline_id + "&search_category=" + search_category + "&suchwort=" + suchwort; 

 	// ÖFFNE VERBINDUNG
 	xmlhttp.open("GET", url,true);
	xmlhttp.onreadystatechange=function() {
  	
	// RÜCKGABE  
	if (xmlhttp.readyState==4) {
   		document.searchform.count.value = xmlhttp.responseText;
  	}
 }
 xmlhttp.send(null)
}

function insert_kontakt_mail() {
	// FELDER CHECK	
	 if(document.kontaktform.name.value == "")
	  {
	   alert("Bitte geben Sie Ihren Namen ein!");
	   document.kontaktform.name.focus();
	   return false;
	  }
	
	 if(document.kontaktform.email.value == "")
	  {
	   alert("Bitte geben Sie Ihre E-Mail-Adresse ein!");
	   document.kontaktform.email.focus();
	   return false;
	  }
	      if(document.kontaktform.email.value.indexOf('@') == -1)
	  {
	   alert("Keine gueltige E-Mail-Adresse!");
	   document.kontaktform.email.focus();
	   return false;
	  }
	
	 if(document.kontaktform.text.value == "")
	  {
	   alert("Bitte geben Sie einen Text ein!");
	   document.kontaktform.text.focus();
	   return false;
	  }
	 	
	// FELD SICHTBAR / UNSICHTBAR
	document.getElementById('kontakt').style.display = 'none';
	document.getElementById('kontakt_send').style.display = 'inline';
 	
	// ZEIGE UPDATING
	document.kontaktform.send_input.value = "Sende Daten...";

	// DATENFETCH
	var name = document.kontaktform.name.value;
	var email = document.kontaktform.email.value;
	var betreff = document.kontaktform.betreff.value;
	var text = document.kontaktform.text.value;


	// URL
	var url = "phplib/member/send_kontakt_mail.php?name=" + name + "&email=" + email + "&betreff=" + betreff + "&text=" + text; 

 	// ÖFFNE VERBINDUNG
 	xmlhttp.open("GET", url,true);
	xmlhttp.onreadystatechange=function() {
  	
	// RÜCKGABE  
	if (xmlhttp.readyState==4) {
   		document.kontaktform.send_input.value = xmlhttp.responseText;
  	}
 }
 xmlhttp.send(null)
}