function Show_SichtPoiAnzeige(id,Was) {
	Waswo = 1;
	get_innerhtml("AnzeigePosition", "AnzeigeListe", "ajax_sichtpoianzeige.asp?id="+id+"&Was="+Was)
}

function Show_SichtPoiNGAnzeige(id,Was) {
	Waswo = 1;
	get_innerhtml("AnzeigePosition", "AnzeigeListe", "ajax_sichtpoinganzeige.asp?id="+id+"&Was="+Was)
}

function Show_SichtPlzSuche(plz) {
	Waswo = 2;
	get_innerhtml("AnzeigePosition", "AnzeigeListe", "ajax_sichtplzsuche.asp?Plz="+plz)
}

function Show_SichtOrtSuche(ort) {
	Waswo = 2;
	get_innerhtml("AnzeigePosition", "AnzeigeListe", "ajax_sichtortsuche.asp?Ort="+ort)
}

function Show_SichtPlzAuswahl(plz) {
	Waswo = 3;
	get_innerhtml("AnzeigePosition", "AnzeigeListe", "ajax_sichtplzauswahl.asp?Plz="+plz)
}

function Show_SichtOrtAuswahl(ort) {
	Waswo = 2;
	get_innerhtml("AnzeigePosition", "AnzeigeListe", "ajax_sichtortauswahl.asp?Ort="+ort)
}

function Show_POIInfo() {
	get_innerhtml("AngebotPosition", "AngebotListe", "ajax_poiinfo.asp")
}
function Show_Mitarbeit() {
	get_innerhtml("AngebotPosition", "AngebotListe", "ajax_mitarbeit.asp")
}

function Show_Kunden() {
	get_innerhtml("KundenPosition", "KundenWerte", "ajax_kunden_liste.asp")
}
function Show_News() {
	get_innerhtml("NewsPosition", "NewsWerte", "ajax_news_liste.asp")
}
function Show_Lieferanten() {
	get_innerhtml("LieferantenPosition", "LieferantenWerte", "ajax_lieferanten_liste.asp")
}

function Show_HKategorie() {
	get_innerhtml("HKPosition", "HKWerte", "ajax_hauptkategorie_liste.asp")
}
function Show_UKategorie(id) {
	get_innerhtml("UKPosition", "UKWerte", "ajax_unterkategorie_liste.asp?ID="+id)
}
function Show_KKategorie(id) {
	get_innerhtml("KKPosition", "KKWerte", "ajax_kategorie_liste.asp?ID="+id)
}
function Show_BKategorie(id,Bild) {
	get_innerhtml("BEPosition", "BEWerte", "ajax_besitzer_liste.asp?ID="+id+"&Bild="+Bild)
}

function Show_Kontaktart(id,poi) {
	get_innerhtml("KontaktartPosition", "KontaktartWerte", "ajax_kontaktart_liste.asp?ID="+id+"&poi="+poi)
}
function Show_Kontakt(id,poi) {
	get_innerhtml("KontaktPosition", "KontaktWerte", "ajax_kontakt_wert.asp?ID="+id+"&poi="+poi)
}
function Show_Merkmalart(id,poi) {
	get_innerhtml("MerkmalartPosition", "MerkmalartWerte", "ajax_merkmalart_liste.asp?ID="+id+"&poi="+poi)
}
function Show_Merkmal(id,poi) {
	get_innerhtml("MerkmalPosition", "MerkmalWerte", "ajax_merkmal_wert.asp?ID="+id+"&poi="+poi)
}
function Show_Angebotart(id,poi) {
	get_innerhtml("AngebotartPosition", "AngebotartWerte", "ajax_angebotart_liste.asp?ID="+id+"&poi="+poi)
}
function Show_Angebot(id,poi) {
	get_innerhtml("AngebotPosition", "AngebotWerte", "ajax_angebot_wert.asp?ID="+id+"&poi="+poi)
}
function Show_Zeitart(id,poi) {
	get_innerhtml("ZeitenartPosition", "ZeitenartWerte", "ajax_zeitart_liste.asp?ID="+id+"&poi="+poi)
}
function Show_Zeit(id,poi) {
	get_innerhtml("ZeitenPosition", "ZeitenWerte", "ajax_zeit_wert.asp?ID="+id+"&poi="+poi)
}
function Show_Zahlungsart(id,poi) {
	get_innerhtml("ZahlungsartPosition", "ZahlungsartWerte", "ajax_zahlungsart_liste.asp?ID="+id+"&poi="+poi)
}

function Show_Kategorie(Switch,ID) {
	document.getElementById("bild").src = "../images/info.gif";
	document.getElementById("bild").alt = "Info";
	if(Switch == 1) {
  	get_innerhtml("HauptgruppePosition", "HauptgruppeListe", "ajax_kategorie_liste.asp?Switch="+Switch+"&ID="+ID)
  }
 	if(Switch == 2) {  
    get_innerhtml("MittelgruppePosition", "MittelgruppeListe", "ajax_kategorie_liste.asp?Switch="+Switch+"&ID="+ID)
	}
 	if(Switch == 3) {
    get_innerhtml("UntergruppePosition", "UntergruppeListe", "ajax_kategorie_liste.asp?Switch="+Switch+"&ID="+ID)
  }
}
function Show_Bezirk(Switch,ID) {
	document.getElementById("bild").src = "../images/info.gif";
	document.getElementById("bild").alt = "Info";
	get_innerhtml("BezirkPosition", "BezirkListe", "ajax_bezirk_liste.asp?Switch="+Switch+"&ID="+ID)
}
function Show_Anzahl(Wert,id) {
	document.getElementById("bild").src = "../images/info.gif";
	document.getElementById("bild").alt = "Info";
	get_innerhtml("AngebotPosition", "AngebotListe", "ajax_anzahl.asp?ID="+id+"&Switch="+Wert+"&Land="+document.Form4.Land.value+"&Bezirk="+document.Form5.Bezirk.value)
}
function Show_LandInfo(id) {
	get_innerhtml("AngebotPosition", "AngebotListe", "ajax_land_info.asp?ID="+id)
}
function Show_Poi(Wert,id) {
	document.getElementById("bild").src = "../images/info.gif";
	document.getElementById("bild").alt = "Info";
	get_innerhtml("AngebotPosition", "AngebotListe", "ajax_poi.asp?ID="+id+"&Switch="+Wert+"&Land="+document.Form4.Land.value+"&Bezirk="+document.Form5.Bezirk.value)
}

function Show_POIFormat(Besitzer) {
	get_innerhtml("AngebotPosition", "AngebotListe", "ajax_poi_format.asp?Besitzer="+Besitzer)
}
function Show_POINGFormat(Kategorie) {
	get_innerhtml("AngebotPosition", "AngebotListe", "ajax_poi_format_ng.asp?Kategorie="+Kategorie)
}

function get_innerhtml(parentId, targetId, requestUrl) {
	container = null
  ajax = false
  lade = false
 	container = document.getElementById(targetId);
 	if(container) container.parentNode.removeChild(container);
 	container = document.createElement("div");
 	container.id = targetId;
 	document.getElementById(parentId).appendChild(container);
 	lade = document.createElement("img");
  try {
    ajax = new XMLHttpRequest();
  } 
  catch(w3c) {
    try {
    	ajax = new ActiveXObject("Msxml2.XMLHTTP");
    } 
    catch(msie) {
    	try {
      	ajax = new ActiveXObject("Microsoft.XMLHTTP");
    	} 
    	catch(msie_alt) {
      	alert("Ihr Browser ist nicht web2.0 tauglich.");
    	}
    }
  }
 	container.appendChild(lade);
  Attribut1 = document.createAttribute("src");
  Attribut1.nodeValue = "../images/indicator.gif";  
  lade.setAttributeNode(Attribut1);
  Attribut2 = document.createAttribute("width");
  Attribut2.nodeValue = "16";  
  lade.setAttributeNode(Attribut2);
  Attribut3 = document.createAttribute("height");
  Attribut3.nodeValue = "16";  
  lade.setAttributeNode(Attribut3);
  Attribut4 = document.createAttribute("border");
  Attribut4.nodeValue = "0";  
  lade.setAttributeNode(Attribut4);

  ajax.open('GET', requestUrl, true);
  ajax.setRequestHeader('Content-Type', 'text/xml; charset=ISO-8859-1');
  ajax.setRequestHeader('If-Modified-Since', 'Sat, 1 Jan 2000 00:00:00 GMT');
  ajax.send(null);
  ajax.onreadystatechange = function() {
	  if (ajax.readyState == 4) {
	    if (ajax.status != 200 && ajax.status != 0) {
	     nodeValue = "Fussnoten-Datei konnte nicht gefunden werden!";
	     return false;
	    }
	    container.removeChild(lade);
	    lade = null;
	    container.innerHTML = ajax.responseText;
			ajax = null;
	    if(Waswo == 1){
	    	GoogleMap()
	    	Waswo = 0;	
	    }
			if(Waswo == 2) {
				WartenOrt()
				Waswo = 0;
			}
			if(Waswo == 3) {
				WartenPlz()
				Waswo = 0;
			}
			if(parentId == "BezirkPosition" || parentId == "MittelgruppePosition") {
				if(document.Form1.Hauptgruppe.value == -1 & document.Form2.Mittelgruppe.value == -1 & document.Form3.Untergruppe.value == -1) {
					Show_Anzahl(1,0)
				}
				if(document.Form1.Hauptgruppe.value != -1 & document.Form2.Mittelgruppe.value == -1 & document.Form3.Untergruppe.value == -1) {
					Show_Anzahl(2,document.Form1.Hauptgruppe.value)
				}
				if(document.Form1.Hauptgruppe.value != -1 & document.Form2.Mittelgruppe.value != -1 & document.Form3.Untergruppe.value == -1) {
					Show_Anzahl(3,document.Form2.Mittelgruppe.value)
				}
				if(document.Form1.Hauptgruppe.value != -1 & document.Form2.Mittelgruppe.value != -1 & document.Form3.Untergruppe.value != -1) {
					Show_Poi(4,document.Form3.Untergruppe.value)
				}
			}
      if(parentId == "UntergruppePosition") {
				if(document.Form3.Untergruppe.value == -1) { 
					Show_Anzahl(3,document.Form2.Mittelgruppe.value)
				}
      }
      if(parentId == "UKPosition") {
				get_innerhtml("KKPosition", "KKWerte", "ajax_kategorie_liste.asp?ID=0")
      }
      if(parentId == "HKPosition") {
				get_innerhtml("UKPosition", "UKWerte", "ajax_unterkategorie_liste.asp?ID=0")
      }
      if(parentId == "KKPosition") {
				get_innerhtml("BEPosition", "BEWerte", "ajax_besitzer_liste.asp?ID=0")
      }
	  }
	}
}

function Fenster(Weit,Hoch) {
  Weit = Weit + 10;
  Hoch = Hoch + 4;
  Hoehe = Hoch + 45
  while(document.body.offsetHeight < Hoch) {
	  Hoehe = Hoehe + 1;
    parent.window.resizeTo(Weit,Hoehe);
  }	
}

function Feldtest(Feldname,Fehlertext,Laenge) {
  Feldname.value = Trim(Feldname.value);
  if(StatusOK == true) {
    if(Feldname.value.length < Laenge && Feldname.value != "") {
      alert(Fehlertext + "\nDie Eingabe muss aus mindestens " + Laenge + " Zeichen bestehen!");
 	    Feldname.focus();
 	    StatusOK = false;
    }
    if(Feldname.value == "" || Feldname.value == "-1") {
 	    alert(Fehlertext);
 	    Feldname.focus();
 	    StatusOK = false;
  	} 
  }
}

function Trim(Wert) {
  while (Wert.substring(0,1) == ' ') {
    Wert = Wert.substring(1,Wert.length);
  }
  while (Wert.substring(Wert.length-1,Wert.length) == ' ') {
    Wert = Wert.substring(0,Wert.length-1);
  }
  return Wert;
}

function Emailtest(Feldname,Fehlertext) {
  Feldname.value = Trim(Feldname.value);
  if(StatusOK == true) {
    var x = Feldname.value;
  	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
  	if (filter.test(x)) {}
  	else {
      alert(Fehlertext);
      Feldname.focus();
      StatusOK = false;
  	}	
  }
}

Waswo = 0;