// Spezifische Funktionen für Bürgersuche in D

function DoLink_Buergersuche1(obj)
{
	var wcEdit;
	var ok=true;
	
	// Prüfen ob PLZ oder Mandant vorhanden sind
	if (document.SubmitForm.Mdt.value == "" && document.SubmitForm.PLZ.value == "") {
		CtrlMsg(document.SubmitForm.Plz,'Bitte wählen Sie einen Ort aus der Gemeindeliste aus oder geben Sie eine Postleitzahl an!');
		ok=false;
	}

	if (!isNumeric(document.SubmitForm.Plz.value) && ok==true) {
		CtrlMsg(document.SubmitForm.Plz,'Es muß eine Zahl eingegeben werden!');
		ok=false;
	}

	if (document.SubmitForm.Plz.value.length < 3 && ok==true) {
		CtrlMsg(document.SubmitForm.Plz,'Es müssen mindestens 3 Ziffern der Postleitzahl eingegeben werden!');
		ok=false;
	}

	if (document.SubmitForm.Plz.value.length > 5 && ok==true) {
		CtrlMsg(document.SubmitForm.Plz,'Es dürfen höchstens 5 Ziffern der Postleitzahl eingegeben werden!');
		ok=false;
	}

	if (!isDate(document.SubmitForm.VermisstSeit.value,"d.M.y") && ok==true) {
		CtrlMsg(document.SubmitForm.VermisstSeit,"Bitte geben Sie ein gültiges Datum ein!");
		ok=false;
	}

  //P01 Adam Ledochowski 150210
  if  (obj=="Volltextsuche")  {

  	wcEdit="MyApp.asp?wci=Suche4&Mdt=" + escape(document.SubmitForm.Mdt.value) + "&format=" + escape(document.SubmitForm.Format.value) + "&PLZ=" + escape(document.SubmitForm.Plz.value);
	  wcEdit=wcEdit + "&KM=" + escape(document.SubmitForm.Radius.options[document.SubmitForm.Radius.selectedIndex].value) +  "&KATEGORIE=" + escape(obj) + "&DATUM=" + escape(document.SubmitForm.VermisstSeit.value);
		self.location = wcEdit;
		
		return;
  }

	if (ok==true) {
		wcEdit="MyApp.asp?wci=Suche2&Mdt=" + escape(document.SubmitForm.Mdt.value) + "&format=" + escape(document.SubmitForm.Format.value) + "&PLZ=" + escape(document.SubmitForm.Plz.value);
		wcEdit=wcEdit + "&KM=" + escape(document.SubmitForm.Radius.options[document.SubmitForm.Radius.selectedIndex].value) +  "&KATEGORIE=" + escape(obj) + "&DATUM=" + escape(document.SubmitForm.VermisstSeit.value);
		self.location = wcEdit;
	}
}

function DoLink_Tuebingen_Raeder()
// zeigt bei der Kategrie Fahrräder für Tübingen ein Infofenster an
{
if (BrowserTyp() == "NS4")
		window.open(document.SubmitForm.Mdt.value + "Tuebingen/Fahrraeder.html","Info");
	else
  		window.open("./Tuebingen/Fahrraeder.html","Info","dependent=yes,location=no,menubar=no,resizable=yes,status=no,toolbar=no,scrollbars=no");
}

function DoLink_Tuebingen_Tiere()
// zeigt bei der Kategrie Tiere für Tübingen ein Infofenster an
{
if (BrowserTyp() == "NS4")
		window.open(document.SubmitForm.Mdt.value + "Tuebingen/Tiere.html","Info");
	else
  		window.open("./Tuebingen/Tiere.html","Info","dependent=yes,location=no,menubar=no,resizable=yes,status=no,toolbar=no,scrollbars=no");
}

//P01 Adam Ledochowski 160210
function GoToNewSearch ()  {
var loc = unescape(location.search.replace("?","&"));
location.replace("MyApp.asp?wci=Suche1" + loc);
}

//P01 Adam Ledochowski 250810
function GoToNewAuswahl ()  {
var loc = unescape(location.search.replace("?","&"));
location.replace("MyApp.asp?wci=Verkaufsanzeige1" + loc);
}
