
/* -------- Funktionen für Kurzformular-Suchen (Regio) */
function CheckBuLand() {
var aktForm = null;
if(document.regioof) aktForm = document.regioof;
if(document.regiomak) aktForm = document.regiomak;
if (aktForm)
 if(aktForm.BULAND.selectedIndex > 0)
  if(aktForm.KLAND.selectedIndex > 1)
   aktForm.KLAND.selectedIndex = 0;
}

function CheckRegion() {
var aktForm = null;
if(document.regioof) aktForm = document.regioof;
if(document.regiomak) aktForm = document.regiomak;
if (aktForm)
 if(aktForm.REGION)
 if(aktForm.REGION.selectedIndex > 0) {
  iAkt = 0; 
  for (i = 0; i < aktForm.KLAND.length; ++i)
    if (aktForm.KLAND.options[i].value == "F")
     iAkt = i;
  if(aktForm.KLAND.selectedIndex != iAkt)
   aktForm.KLAND.selectedIndex = iAkt;
 }
}

function CheckKLand() {
var aktForm = null;
if(document.regioof) aktForm = document.regioof;
if(document.regiomak) aktForm = document.regiomak;
if (aktForm) {

  aktForm.Umkreis.value = "";
  aktForm.PLZVon.value = "";
  $('city').innerHTML = "";
  aktForm.PLZGeo.value = "";
  aktForm.cbIncludeFrontier.value = "";
  aktForm.ORTSel.value = "";
  
 if(aktForm.KLAND.selectedIndex > 1)  {
  if(aktForm.BULAND)
   aktForm.BULAND.selectedIndex = 0;
   /*
  aktForm.Umkreis.value = "";
  aktForm.PLZVon.value = "";
  //if(aktForm.ORTSel) aktForm.ORTSel.value = "";
	$('city').innerHTML = '';
	*/
  if(aktForm.BULAND) {
   aktForm.TKFZKenn.value = "";
   aktForm.KFZKenn.selectedIndex = 0;
  }
 }
 if(aktForm.KLAND.options[aktForm.KLAND.selectedIndex].value == "F") {
   if(aktForm.FormIst.value != "F") {
     aktForm.FormSoll.value = "F";
     aktForm.LisAbr.value="J";
     aktForm.submit();
   }
 } else {
   if(aktForm.REGION) {
    if(aktForm.REGION.selectedIndex > 0)
     aktForm.REGION.selectedIndex = 0;
    aktForm.DEPARTNR.value = "";
    aktForm.DEPART.selectedIndex = 0;
   } 
   if(aktForm.FormIst.value == "F") {
     aktForm.FormSoll.value = "D";
     aktForm.LisAbr.value="J";
     aktForm.submit();
   }
 }
} 
}

function CheckUmkreis() {
var aktForm = null;
if(document.regioof) aktForm = document.regioof;
if(document.regiomak) aktForm = document.regiomak;
if (aktForm)
 if(aktForm.Umkreis.value > "    " || aktForm.PLZVon.value > "     " || aktForm.ORTSel.value > " ")
  if(aktForm.KLAND.selectedIndex > 1) {
   aktForm.KLAND.selectedIndex = 0;
   if(aktForm.REGION) {
    if(aktForm.REGION.selectedIndex > 0)
     aktForm.REGION.selectedIndex = 0;
    aktForm.DEPARTNR.value = "";
    aktForm.DEPART.selectedIndex = 0;
   } 
   if(aktForm.FormIst.value == "F") {
     aktForm.FormSoll.value = "D";
     aktForm.LisAbr.value="J";
     aktForm.submit();
   }
  }
}

function SetzeBuLand(sidx) {
var aktForm = null;
if(document.Bulandof) aktForm = document.Bulandof;
if(document.BulandMak) aktForm = document.BulandMak;
if (aktForm) {
 aktForm.BULAND.selectedIndex = sidx;
 aktForm.BULAND.focus();
 }
}

function CheckROGruppe() {
var aktForm = null;
if(document.regioof) aktForm = document.regioof;
if(document.regiomak) aktForm = document.regiomak;
if(document.Bulandof) aktForm = document.Bulandof;
if(document.BulandMak) aktForm = document.BulandMak;
if (aktForm)
 if(aktForm.OGruppe) {
   aktForm.LisAbr.value="J";
   aktForm.submit();
 }
}

function CheckKFZ() {
var aktForm = null;
if(document.regioof) aktForm = document.regioof;
if(document.regiomak) aktForm = document.regiomak;
if(document.Bulandof) aktForm = document.Bulandof;
if(document.BulandMak) aktForm = document.BulandMak;
if (aktForm)
 if(aktForm.KFZKenn.selectedIndex > 0) aktForm.TKFZKenn.value = "";
}

function CheckTKFZ() {
var aktForm = null;
if(document.regioof) aktForm = document.regioof;
if(document.regiomak) aktForm = document.regiomak;
if(document.Bulandof) aktForm = document.Bulandof;
if(document.BulandMak) aktForm = document.BulandMak;
if (aktForm)
 if(aktForm.TKFZKenn.value > " ") aktForm.KFZKenn.selectedIndex = 0;
}

function CheckDepart() {
var aktForm = null;
if(document.regioof) aktForm = document.regioof;
if(document.regiomak) aktForm = document.regiomak;
if(document.Bulandof) aktForm = document.Bulandof;
if(document.BulandMak) aktForm = document.BulandMak;
if (aktForm)
 if(aktForm.DEPART) aktForm.DEPARTNR.value = "";
}

function CheckDepartNr() {
var aktForm = null;
if(document.regioof) aktForm = document.regioof;
if(document.regiomak) aktForm = document.regiomak;
if(document.Bulandof) aktForm = document.Bulandof;
if(document.BulandMak) aktForm = document.BulandMak;
if (aktForm)
 if(aktForm.DEPARTNR) aktForm.DEPART.selectedIndex = 0;
}
/* -------- 06.07.2005  ----*/
function LoadSuForm(form) {
 var aktForm = null;
 if(document.regioof) aktForm = document.regioof;
 if(document.regiomak) aktForm = document.regiomak;
 if(document.Bulandof) aktForm = document.Bulandof;
 if(document.BulandMak) aktForm = document.BulandMak;
 if(aktForm) {
  if(aktForm.SuZeige) {
/*    aktForm.LisAbr.value = "J";  */
    aktForm.SuZeige.value = "J";
    aktForm.submit();
  }
 }
 return false;
}

/* -------- Funktionen für Detailformular Suchen */
function CheDKLand() {
var aktForm = null;
if(document.detailof) aktForm = document.detailof;
if(document.detailmak) aktForm = document.detailmak;
if (aktForm) {
   aktForm.Umkreis.value = "";
   aktForm.PLZVon.value = "";
   aktForm.PLZGeo.value = "";
   aktForm.cbIncludeFrontier.value = "";
   $('city').innerHTML = '';
   aktForm.ORTSel.value = "";
      
 if(aktForm.KLAND.selectedIndex > 1) {
  /*if(aktForm.Umkreis.value > "0") {
   aktForm.Umkreis.value = "";
   aktForm.PLZVon.value = "";
   $('city').innerHTML = '';
   //aktForm.ORTSel.value = "";
  }*/
  if(aktForm.BULAND) {
   if(aktForm.BULAND.selectedIndex > 0)
    aktForm.BULAND.selectedIndex = 0;
   aktForm.TKFZKenn.value = "";
   aktForm.KFZKenn.selectedIndex = 0;
  }
 } 
 if(aktForm.KLAND.options[aktForm.KLAND.selectedIndex].value == "F") {
   if(aktForm.FormIst.value != "F") {
     aktForm.FormSoll.value = "F";
     aktForm.LisAbr.value="J";
     aktForm.submit();
   }
 } else {
   if(aktForm.REGION) {
    if(aktForm.REGION.selectedIndex > 0)
     aktForm.REGION.selectedIndex = 0;
    aktForm.DEPARTNR.value = "";
    aktForm.DEPART.selectedIndex = 0;
   } 
   if(aktForm.FormIst.value == "F") {
     aktForm.FormSoll.value = "D";
     aktForm.LisAbr.value="J";
     aktForm.submit();
   }
 }
}
}



function CheDUmkreis() {
var aktForm = null;
if(document.detailof) aktForm = document.detailof;
if(document.detailmak) aktForm = document.detailmak;
if (aktForm)
 if(aktForm.Umkreis.value > "    ")
   if(aktForm.KLAND.selectedIndex > 1) {
     aktForm.KLAND.selectedIndex = 0;
     if(aktForm.REGION) {
      if(aktForm.REGION.selectedIndex > 0)
       aktForm.REGION.selectedIndex = 0;
      aktForm.DEPARTNR.value = "";
      aktForm.DEPART.selectedIndex = 0;
     } 
     if(aktForm.FormIst.value == "F") {
       aktForm.FormSoll.value = "D";
       aktForm.LisAbr.value="J";
       aktForm.submit();
     }
   }
}

function CheckDBuLand() {
var aktForm = null;
if(document.detailof) aktForm = document.detailof;
if(document.detailmak) aktForm = document.detailmak;
if (aktForm)
 if(aktForm.BULAND)
 if(aktForm.BULAND.selectedIndex > 0)
  if(aktForm.KLAND.selectedIndex > 1)
   aktForm.KLAND.selectedIndex = 0;
}

function CheckRegion() {
var aktForm = null;
if(document.detailof) aktForm = document.detailof;
if(document.detailmak) aktForm = document.detailmak;
if (aktForm)
 if(aktForm.REGION)
 if(aktForm.REGION.selectedIndex > 0) {
  iAkt = 0; 
  for (i = 0; i < aktForm.KLAND.length; ++i)
    if (aktForm.KLAND.options[i].value == "F")
     iAkt = i;
  if(aktForm.KLAND.selectedIndex != iAkt)
   aktForm.KLAND.selectedIndex = iAkt;
 }
}

function CheckOGruppe() {
var aktForm = null;
if(document.detailof) aktForm = document.detailof;
if(document.detailmak) aktForm = document.detailmak;
if (aktForm)
 if(aktForm.OGruppe) {
   aktForm.LisAbr.value="J";
   aktForm.submit();
 }
}

function CheckKFZ() {
var aktForm = null;
if(document.detailof) aktForm = document.detailof;
if(document.detailmak) aktForm = document.detailmak;
if (aktForm)
 if(aktForm.KFZKenn)
  aktForm.TKFZKenn.value = "";
}

function CheckTKFZ() {
var aktForm = null;
if(document.detailof) aktForm = document.detailof;
if(document.detailmak) aktForm = document.detailmak;
if (aktForm)
 if(aktForm.TKFZKenn)
  aktForm.KFZKenn.selectedIndex = 0;
}

function CheckDepart() {
var aktForm = null;
if(document.detailof) aktForm = document.detailof;
if(document.detailmak) aktForm = document.detailmak;
if (aktForm)
 if(aktForm.DEPART)
  aktForm.DEPARTNR.value = "";
}

function CheckDepartNr() {
var aktForm = null;
if(document.detailof) aktForm = document.detailof;
if(document.detailmak) aktForm = document.detailmak;
if (aktForm)
 if(aktForm.DEPARTNR)
  aktForm.DEPART.selectedIndex = 0;
}

function CheckZiVon() {
var aktForm = null;
if(document.detailof) aktForm = document.detailof;
if(document.detailmak) aktForm = document.detailmak;
if (aktForm)
 if(aktForm.ZiVon.value > " ") 
  aktForm.ZiBis.value = aktForm.ZiVon.value;
}

function SetWohnung() {
var aktForm = null;
if(document.detailof) aktForm = document.detailof;
if(document.detailmak) aktForm = document.detailmak;
if (aktForm)
 if(aktForm.OGruppe[1].checked == true) {
   aktForm.Typ[2].checked = true;
   aktForm.Typ[3].checked = true;
   aktForm.Typ[4].checked = true;
   aktForm.Typ[5].checked = true;
  }
}

function SetHaus(detail) {
var aktForm = null;
if(document.detailof) aktForm = document.detailof;
if(document.detailmak) aktForm = document.detailmak;
if (aktForm) {
 if(aktForm.OGruppe[1].checked == true) {
  for (idx=6;idx<=20;idx++) {aktForm.Typ[idx].checked = true;}
 }
}
}

function SetHausGewerbe(detail) {
if(document.detailof) aktForm = document.detailof;
if(document.detailmak) aktForm = document.detailmak;

if (aktForm) {
	if(aktForm.OGruppe[2].checked == true) {		
  for (idx=8;idx<=12;idx++) {aktForm.GewTyp[idx].checked = true;}
 }
}
}

function SetTypenLeer() {
var aktForm = null;
if(document.detailof) aktForm = document.detailof;
if(document.detailmak) aktForm = document.detailmak;
if (aktForm)
 if(aktForm.OGruppe[1].checked == true) 
  for (idx=1;idx<=21;idx++) {aktForm.Typ[idx].checked = false;
  }
}

function SetTypenLeerGewerbe() {
var aktForm = null;
if(document.detailof) aktForm = document.detailof;
if(document.detailmak) aktForm = document.detailmak;
if (aktForm)
 if(aktForm.OGruppe[2].checked == true) 
  for (idx=1;idx<=13;idx++) {aktForm.GewTyp[idx].checked = false;}
}

/* -------- 06.07.2005  ----*/
function LoadSuForm(form) {
 var aktForm = null;
 if(document.detailof) aktForm = document.detailof;
 if(document.detailmak) aktForm = document.detailmak;
 if(aktForm) {
  if(aktForm.SuZeige) {
/*    aktForm.LisAbr.value = "J";  */
    aktForm.SuZeige.value = "J";
    aktForm.submit();
  }
 }
 return false;
}

/* -------- Funktion für Onload bei Standard-Formularen*/
function CheckOnload() {
var aktForm = null;
 window.focus();
 if(document.ObjVerw)
  if(document.ObjVerw.PosFok)
   if(document.ObjVerw.PosFok.value=="J") {
    document.ObjVerw.PosFok.value = "N";
    document.ObjVerw.WiPassw.value = document.ObjVerw.AnPassw.value;
    if(document.ObjLes) document.ObjLese.btObjLes.focus();
   }
 if(document.detailof) aktForm = document.detailof;
 if(document.detailmak) aktForm = document.detailmak;
 if(document.regioof) aktForm = document.regioof;
 if(document.regiomak) aktForm = document.regiomak;
 if(document.fGesuch) aktForm = document.fGesuch;
 if(aktForm)
  if(aktForm.PosFok)
   if(aktForm.PosFok.value=="J") {
    aktForm.PosFok.value = "N";
    aktForm.submit()
   }
}

function TestMnhId(form) {
  if(form.FRecCou)
   if(form.FRecCou.value <= " ") {
     alert("Bitte geben Sie zuerst eine gültige my-next-home-Id ein!");
     return false;
   }
}

var tmpfenster;
/*--- Funktionen zum Anzeigen neuer Fenster*/
function oeffnefenster( titel, name, attri ) {
 if(tmpfenster) {
   tmpfenster = window.open(titel, name, attri);
   tmpfenster.close();
 }
 tmpfenster = window.open(titel, name, attri);
 return tmpfenster;
}

function opfotos()
{
// oeffnefenster('','mnhfotos','width=800,height=540,toolbar=1,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1');

oeffnefenster('','mnhfotos','width=800,height=650,toolbar=1,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1');
}

function opfobig()
{oeffnefenster('','mnhfobig','width=700,height=540,toolbar=1,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1');}

function opempf()
{oeffnefenster('','mnhempfe','width=700,height=480,toolbar=1,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1');}

function opdank() {
  links = (screen.width - 400) / 2;
  oben = (screen.height - 120) / 2;
  oeffnefenster('','mnhdank','width=400,height=120,top='+oben+',left='+links+',toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
}

function opinfo() {
  links = (screen.width - 480) / 2;
  oben = (screen.height - 320) / 2;
  oeffnefenster('','mnhinfo','width=480,height=320,top='+oben+',left='+links+',toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
}

function ophilfe()
{oeffnefenster('','mnhhilfe','width=700,height=540,toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1');}

function opurltest()
{oeffnefenster('','mnhurltest','toolbar=1,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1');}

function setimmopark(recid) {
var ablauf = new Date();
var zwanzigTage = ablauf.getTime() + (20 * 86400000); 
  ablauf.setTime(zwanzigTage);
  if (document.cookie) {
    inhalt = document.cookie;
    if (inhalt.indexOf(recid) > -1) {
      alert('Fehler: Objekt befindet sich schon im Merkzettel (schon gemerkt)!');      
    } else {
    	cookies = inhalt.split(';');
    	
    	inhalt = "";
    	for(var iX = 0; iX < cookies.length; iX ++) {
    		keyvalue = cookies[iX].split('=');
    		if(keyvalue[0] == 'MNHPARK') {
    			inhalt = keyvalue[1];
    			break;
    		}	
    	}
    	
    	document.cookie = "MNHPARK="+inhalt + ","+recid + "; expires="+ablauf.toGMTString() ;
    	/*
      inhstart = inhalt.indexOf("MNHPARK=")+1;
      inhende = inhalt.indexOf(";");
      if (inhende == -1) inhende = inhalt.length;
      inhalt = document.cookie.substring(inhstart,inhende);
      
      if (inhalt == "MNHPARK")
        {document.cookie = "MNHPARK="+recid + "; expires="+ablauf.toGMTString();}
      else
        {document.cookie = "MNHPARK="+inhalt + ","+recid + "; expires="+ablauf.toGMTString() ;}
      */  
      alert('Objekt gemerkt !');
    }
  } else {
    document.cookie = "MNHPARK="+recid + "; expires="+ablauf.toGMTString();
    alert('Objekt gemerkt !');
  }
}

function delimmopark(recid) {
var ablauf = new Date();
var zwanzigTage = ablauf.getTime() + (20 * 86400000); 
  ablauf.setTime(zwanzigTage);
  if (document.cookie) {
    if (recid == 0) {
      ablauf = new Date();
      zwanzigTage = ablauf.getTime() + ((-1) * 86400000); 
      ablauf.setTime(zwanzigTage);
      document.cookie = "MNHPARK=; expires="+ablauf.toGMTString() ;
      alert('Der Merkzettel wird komplett geleert !');
    } else {
      inhstart = document.cookie.indexOf("=")+1;
      inhende = document.cookie.indexOf(";");
      if (inhende == -1)  inhende = document.cookie.length;
      inh = document.cookie.substring(inhstart,inhende);
      inh1 =  inh.substring(inh.indexOf(recid),inh.length);
      inhende = inh1.indexOf(",");
      if (inhende == -1)  inhende = inh1.length;    
      inhalt = inh.substring(0,inh.indexOf(recid)) + inh.substring(inh.indexOf(recid)+inhende+1,inh.length);
      iLen = inhalt.length;
      if (iLen > 0)
         if (inhalt.substring(iLen-1,iLen) == ",")
           inhalt = inhalt.substring(0,iLen - 1);
      document.cookie = "MNHPARK="+inhalt+"; expires="+ablauf.toGMTString() ;
      alert('Objekt wird vom Merkzettel entfernt !');
    }
  }
}

/* -------- Funktionen für alle Formulare (Makler) CheckFRefNr bei Onload */
function CheckFRefNr() {
	// (NOTES) 23.02.2008-mz
	// Dopplung der Navigation deaktiviert
	// CheckFRefNr wird jetzt nicht mehr gebraucht
/*
var aktForm = null;
 if(document.refnrgo) {
  ilen = document.forms.length - 1;
  if(document.forms[ilen])
    { 
		if(document.forms[ilen].elements[0])
		document.forms[0].elements[0].value = document.forms[ilen].elements[0].value;
    }
 }
 window.focus();
 if(document.regiomak) aktForm = document.regiomak;
  if(document.detailmak) aktForm = document.detailmak;
 if (aktForm)
  if(aktForm.PosFok)
   if(aktForm.PosFok.value=="J") {
    aktForm.PosFok.value = "N";
    aktForm.submit()
   }
   
  */
}

/* -------- Funktionen für Antragsformulare auf Partnerschaft*/
function UebernWeb() {
 if(document.PaAntrWeb && document.PaAntrag)
  if(document.PaAntrWeb.WebInd) {
    document.PaAntrag.WebInd.value = document.PaAntrWeb.WebInd.value;
    document.PaAntrag.WebIndDu.value = document.PaAntrWeb.WebInd.value;
    document.PaAntrMail.WebInd.value = document.PaAntrWeb.WebInd.value;
   }
}

function UebernEmail() {
 if(document.PaAntrMail && document.PaAntrag)
  if(document.PaAntrMail.WebInd) {
     document.PaAntrag.EmailInd.value = document.PaAntrMail.EmailInd.value;
     document.PaAntrWeb.EmailInd.value = document.PaAntrMail.EmailInd.value;
   }
}

function TestPassw() {
 if(document.PaAntrag)
  if(document.PaAntrag.WiPassw)
   if(document.PaAntrag.WiPassw.value != document.PaAntrag.AnPassw.value) {
     alert("Die beiden Passwort-Angaben stimmen nicht überein, bitte neu erfassen!");
     document.PaAntrag.AnPassw.value = "";
     document.PaAntrag.WiPassw.value = "";
     document.PaAntrag.AnPassw.focus();
     return false;
   }
}

function SetzeKennUpload() {
 if(document.ObjVerw)
  if(document.ObjVerw.OeFo)
   document.ObjVerw.OeFo.value = "F";
}

function TesteWTyp() {
 if(document.ObjVerw)
  if(document.ObjVerw.OeTyp)
   if (document.ObjVerw.OeTyp.selectedIndex > 0) {
     document.ObjVerw.OeGTyp.selectedIndex = 0;
     document.ObjVerw.OeFTyp.selectedIndex = 0;
   }
}

function TesteGTyp() {
 if(document.ObjVerw)
  if(document.ObjVerw.OeGTyp)
   if (document.ObjVerw.OeGTyp.selectedIndex > 0) {
     document.ObjVerw.OeTyp.selectedIndex = 0;
     document.ObjVerw.OeFTyp.selectedIndex = 0;
   }
}

function TesteFTyp() {
 if(document.ObjVerw)
  if(document.ObjVerw.OeFTyp)
   if (document.ObjVerw.OeFTyp.selectedIndex > 0) {
     document.ObjVerw.OeTyp.selectedIndex = 0;
     document.ObjVerw.OeGTyp.selectedIndex = 0;
   }
}

/* -------- Funktionen Objekterfassung / Objektänderung nur noch für die Inseratserfassung */
function UebernUpload() {

 if(document.ObjVerw)
  if(document.ObjVerw.OeB1Titel) {
   if (document.ObjVerw.OeObjTit.value > " "
   && (document.ObjVerw.OeTyp.value > " "
   ||  document.ObjVerw.OeGTyp.value > " "
   ||  document.ObjVerw.OeFTyp.value > " ")) {
      return true;
   } else {
      alert("Bitte die farblich abgesetzten bzw. mit * gekennzeichneten Felder erfassen!");
      document.ObjVerw.OeTyp.focus();
      return false;
   } 
  }
}

/* -------- Funktionen Objekterfassung / Objektänderung nur noch für die Inseratserfassung */
function UebernUploadInserent() {

 if(document.ObjVerw)
  if(document.ObjVerw.OeB1Titel) {
   if (document.ObjVerw.OeObjTit.value > " "
   && (document.ObjVerw.OeTyp.value > " "
   ||  document.ObjVerw.OeGTyp.value > " "
   ||  document.ObjVerw.OeFTyp.value > " ")) {
   		$('daten-senden').disabled = true;
			$('daten-senden').value = 'Senden...';			
      return true;
   } else {
      alert("Bitte die farblich abgesetzten bzw. mit * gekennzeichneten Felder erfassen!");
      document.ObjVerw.OeTyp.focus();
      return false;
   } 
  }
}

function SetzeKennUpload() {
 if(document.ObjVerw)
  if(document.ObjVerw.OeFo)
   document.ObjVerw.OeFo.value = "F";
}

function SetzeKennDel() {
 if(document.ObjVerw)
  if(document.ObjVerw.ObjErfKE)
   document.ObjVerw.ObjErfKE.value = "L";
}

function TesteWTyp() {
 if(document.ObjVerw)
  if(document.ObjVerw.OeTyp)
   if (document.ObjVerw.OeTyp.selectedIndex > 0) {
     document.ObjVerw.OeGTyp.selectedIndex = 0;
     document.ObjVerw.OeFTyp.selectedIndex = 0;
   }
}

function TesteGTyp() {
 if(document.ObjVerw)
  if(document.ObjVerw.OeGTyp)
   if (document.ObjVerw.OeGTyp.selectedIndex > 0) {
     document.ObjVerw.OeTyp.selectedIndex = 0;
     document.ObjVerw.OeFTyp.selectedIndex = 0;
   }
}

function TesteFTyp() {
 if(document.ObjVerw)
  if(document.ObjVerw.OeFTyp)
   if (document.ObjVerw.OeFTyp.selectedIndex > 0) {
     document.ObjVerw.OeTyp.selectedIndex = 0;
     document.ObjVerw.OeGTyp.selectedIndex = 0;
   }
}

/* -------- Funktionen Gesuch-Erfassungs-Form.*/
function PruefeGesuchSend() {
 if(document.ObjVerw)
  if (document.ObjVerw.WebIndDu.value > " "
   && document.ObjVerw.AnPassw.value > " "
   && document.ObjVerw.AnPassw.value == document.ObjVerw.WiPassw.value
   && document.ObjVerw.OeObjTit.value > " "
   && document.ObjVerw.Adress1.value > " "
   && document.ObjVerw.AnStr.value > " "
   && document.ObjVerw.AnPLZ.value > " "
   && document.ObjVerw.AnOrt.value > " "
   && document.ObjVerw.AnTel.value > " ") {
      return true;
   } else {
      alert("Bitte Benutzername, Passwort (mind. 4 Zeichen lang) und die farblich abgesetzten bzw. mit * gekennzeichneten Felder erfassen!");
      if (document.ObjVerw.WiPassw.value == document.ObjVerw.AnPassw.value ) {
        if (document.ObjVerw.AnPassw.value > " "
        && document.ObjVerw.WebIndDu.value > " ") {
          document.ObjVerw.OeObjTit.focus();
        } else {
          document.ObjVerw.WebIndDu.focus();
        }
      } else {
        document.ObjVerw.WiPassw.focus();
      }
      return false;
   } 
}

function PruefeGesuchLese() {
 if(document.ObjLese)
  if(document.ObjLese.AnPassw)
   if (document.ObjLese.WebIndDu.value > " "
   && document.ObjLese.AnPassw.value > " ") {
     if(document.ObjVerw) {
        document.ObjVerw.WebIndDu.value = document.ObjLese.WebIndDu.value;
        document.ObjVerw.AnPassw.value = document.ObjLese.AnPassw.value;
        document.ObjVerw.WiPassw.value = document.ObjLese.AnPassw.value;
     }
     return true;
   } else {
     alert("Bitte Benutzername und Passwort (mind. 4 Zeichen lang) erfassen!");
     document.ObjLese.WebIndDu.focus();
     return false;
   }
}

function SetzeKennDel() {
 if(document.ObjVerw)
  if(document.ObjVerw.ObjErfKE)
   document.ObjVerw.ObjErfKE.value = "L";
}

function CheckBuLand() {
if(document.ObjVerw)
 if(document.ObjVerw.OeBuLand.selectedIndex > 0)
  document.ObjVerw.OeLand.value = "D";
}

function CheckGsLand() {
if(document.ObjVerw)
 if(document.ObjVerw.OeLand.value > " " && document.ObjVerw.OeLand.value != "D") 
  document.ObjVerw.OeBuLand.selectedIndex = 0;
}

/* -------- Funktionen Int.-Bekund.-Form.*/
function PruefeIntEing() {
 if(document.IntBekun) {
   if (document.IntBekun.SendPer[0].checked == true || document.IntBekun.EMailPflicht.value == "J") {
     if ( ! checkmuemail(document.IntBekun.IREmail, true)) {
       document.IntBekun.IREmail.focus();
       return false;
     }
   }
   if (document.IntBekun.IREmail.value > " ") {
     if ( ! checknmemail(document.IntBekun.IREmail)) {
       document.IntBekun.IREmail.focus();
       return false;
     }
   }
   if (document.IntBekun.IRNachn.value <= " "
   || document.IntBekun.IRVorn.value <= " "
   || document.IntBekun.IRStr.value <= " "
   || document.IntBekun.IRPlz.value <= " "
   || document.IntBekun.IROrt.value <= " "
   || document.IntBekun.IRTel1.value <= " "
   || (document.IntBekun.IRFax1.value <= " " && document.IntBekun.SendPer[2].checked == true)
   || (document.IntBekun.IREmail.value <= " " && (document.IntBekun.SendPer[0].checked == true || document.IntBekun.EMailPflicht.value == "J"))) {
     alert("Bitte die farblich abgesetzten Felder und ggf. die Telefax-Nummer bzw. die EMail-Adresse erfassen,\n ansonsten kann Ihre Nachricht nicht weitergeleitet werden!");
     document.IntBekun.IREmail.focus();
     return false;
    } else if(document.IntBekun.OeDatenschutz.checked != true){
    	alert("Sie müssen Ihr Einverständnis zur Kontaktaufnahme geben. Der Text ist rot gekennzeichnet.");
    	return false;
    } else {
     opdank();
     return true;
    }
  }
}

function PruefeEmpfEing() {
 if(document.SeiteEmpf) {
   if ( ! checkmuemail(document.SeiteEmpf.EmEmail, false)) {
     document.SeiteEmpf.EmEmail.focus();
     return false;
   }
   if (document.SeiteEmpf.AbEmail.value > " ") {
     if ( ! checknmemail(document.SeiteEmpf.AbEmail)) {
       document.SeiteEmpf.AbEmail.focus();
       return false;
     }
   }
   
   if(document.SeiteEmpf.OeDatenschutz.checked != true){
    	alert("Sie müssen Ihr Einverständnis zur Speicherung Ihrer persönlichen Daten geben. Der Text ist rot gekennzeichnet.");
    	return false;
    } 
   if (document.SeiteEmpf.EmEmail.value > " ") {
     opdank();
     return true;
   } else {
     alert("Bitte die EMail-Adresse des Empfängers erfassen,\n ansonsten kann Ihre Nachricht nicht weitergeleitet werden!");
     document.SeiteEmpf.EmEmail.focus();
     return false;
   }
  }
}

/* -------- Funktionen Ang.Bewerten.-Form.*/
function PruefeWertenEing() {
 if(document.WertenObj) {
   if (document.WertenObj.AwEmail.value > " ") {
     if ( ! checknmemail(document.WertenObj.AwEmail)) {
       document.WertenObj.AwEmail.focus();
       return false;
     }
   }
   if (document.WertenObj.cbAWert1.checked == false
   && document.WertenObj.cbAWert2.checked == false
   && document.WertenObj.cbAWert3.checked == false
   && document.WertenObj.cbAWert4.checked == false
   && document.WertenObj.cbAWert5.checked == false
   && document.WertenObj.txtNachri.value <= " ") {
     alert("Sie haben keine Bewertung angegeben,\n Ihre Nachricht kann nicht weitergeleitet werden!");
     document.WertenObj.cbAWert1.focus();
     return false;
    } else if(document.WertenObj.OeDatenschutz.checked != true){
    	alert("Sie müssen Ihr Einverständnis zur Kontaktaufnahme geben. Der Text ist rot gekennzeichnet.");
    	return false;
    } else {
     opdank();
     return true;
    }
  }
}


/* -------- Funktionen Int.-Bekund.-Form.*/
function PruefeMailEing() {
 if(document.IntBekun) {
   if (document.IntBekun.SendPer[0].checked == true || document.IntBekun.EMailPflicht.value == "J") {
     if ( ! checkmuemail(document.IntBekun.IREmail, true)) {
       document.IntBekun.IREmail.focus();
       return false;
     }
   }
   if (document.IntBekun.IREmail.value > " ") {
     if ( ! checknmemail(document.IntBekun.IREmail)) {
       document.IntBekun.IREmail.focus();
       return false;
     }
   }
   if (document.IntBekun.IRNachn.value <= " "
   || document.IntBekun.IRVorn.value <= " "
   || document.IntBekun.IRStr.value <= " "
   || document.IntBekun.IRPlz.value <= " "
   || document.IntBekun.IROrt.value <= " "
   || document.IntBekun.IRTel1.value <= " "
   || (document.IntBekun.IRFax1.value <= " " && document.IntBekun.SendPer[2].checked == true)
   || (document.IntBekun.IREmail.value <= " " && (document.IntBekun.SendPer[0].checked == true || document.IntBekun.EMailPflicht.value == "J"))) {
     alert("Bitte die farblich abgesetzten bzw. mit * gekennzeichneten Felder\n und ggf. die Telefax-Nummer bzw. die EMail-Adresse erfassen,\n ansonsten kann Ihre Nachricht nicht weitergeleitet werden!");
     document.IntBekun.IREmail.focus();
     return false;
   } else if(document.IntBekun.OeDatenschutz.checked != true){
    	alert("Sie müssen Ihr Einverständnis zur Kontaktaufnahme geben. Der Text ist rot gekennzeichnet.");
    	return false;
    } else {
     opdank();
     return true;
   }
 }
}

function CheckBuLand() {
if(document.fGesuch)
 if(document.fGesuch.GsBuLand.selectedIndex > 0)
  document.fGesuch.GsLand.value = "D";
}

function CheckGsLand() {
if(document.fGesuch)
 if(document.fGesuch.GsLand.value > " " && document.fGesuch.GsLand.value != "D") 
  document.fGesuch.GsBuLand.selectedIndex = 0;
}

function CheckGsGruppe() {
if(document.fGesuch)
 if(document.fGesuch.GsGruppe) {
   document.fGesuch.LisAbr.value="J";
   document.fGesuch.submit();
 }
}

/* -------- Funktionen für Liste bzgl. Sortierung */
function CheckSortLis() {
if(document.fosort)
 if(document.fosort.OSortier) {
   document.fosort.submit();
 }
}

/* -------- Funktionen Fragebogeneingaben prüfen */
function FBPruefen() {
if(document.FBIndiv)
 if(document.FBIndiv.FbNachn.value > " "
 && document.FBIndiv.FbVorn.value > " "
 && document.FBIndiv.FbPLZ.value > " "
 && document.FBIndiv.FbOrt.value > " "
 && document.FBIndiv.FbStr.value > " "
 && document.FBIndiv.FbTel.value > " ") {
   opdank();
   return true;
 } else {
   alert("Bitte die farblich abgesetzten bzw. mit * gekennzeichneten Felder in jedem Fall erfassen,\n ansonsten kann Ihre Nachricht nicht weitergeleitet werden!");
   document.FBIndiv.FbAnrede.focus();
   return false;
 }
}

/* -------- Funktionen für Formulare mit KFZ-Kenn-Suche */
function CheckKFZ() {
if(document.kfzgo)
 if(document.kfzgo.FKFZKenn.selectedIndex > 0) 
  { document.kfzgo.FTKFZKenn.value = ""; }
}

function CheckTKFZ() {
if(document.kfzgo)
 if(document.kfzgo.FTKFZKenn.value > " ") 
  { document.kfzgo.FKFZKenn.selectedIndex = 0; }
}

/* -------- Funktionen bei Login von Inserenten */
function LeereInsLogin() {
if(document.InsLogin)
 { document.InsLogin.InsID.value = "";
    document.InsLogin.InsPW.value = "";
     if(document.InsLogin.InsPWNeu)
       document.InsLogin.InsPWNeu.value = "";
  }
}

function SetzeInsBut(cWert) {
 if(document.InsLogin) {
   document.InsLogin.InsBut12.value = cWert;
   if (cWert =='1')
    document.InsLogin.InsPW.value = "";
 }
}

function TesteInsNeuAlt() {
 if(document.InsLogin) {
  if (document.InsLogin.liNeuAlt) {
    if (document.InsLogin.liNeuAlt[1].checked == true) {
     document.InsLogin.InsBut12.value = "2";
     document.InsLogin.InsIDNeu.value = "";
    } else {
     document.InsLogin.InsBut12.value = "1";
     document.InsLogin.InsIDNeu.value = document.InsLogin.InsID.value;
     LeereInsLogin();
    }
  }
 }
}

function SetNeuInsLogin(cKenn) {
if(document.InsLogin)
 { document.InsLogin.InsLogZeige.value = cKenn;
    cErr = "";
    if(cKenn != "X") {
      if(document.InsLogin.InsID.value <= " ")
        cErr = cKenn;
      document.InsLogin.liNeuAlt[1].checked = true;
      document.InsLogin.InsBut12.value = "2";
      document.InsLogin.InsIDNeu.value = "";
    }
    if(cErr != "") {
      if (cKenn == "S") 
        alert("Bitte geben Sie zuerst Ihre bisherige EMail-Adresse an!")
      else
        alert("Bitte geben Sie zuerst Ihre bisherige EMail-Adresse\n und Ihr bisheriges Passwort an!");
      document.InsLogin.InsID.focus();
    }
    if(cErr=="") {
      if(cKenn == "P" || cKenn=="M")
        if(document.InsLogin.InsPW.value <= " ")
          cErr = cKenn;
      if(cErr != "") {
        alert("Bitte geben Sie zunächst auch Ihr bisheriges Passwort an!");
        document.InsLogin.InsPW.focus();
      }
    }
    if(cErr=="") {
      if(cKenn == "S")
        document.InsLogin.InsPW.value = "";
      document.InsLogin.submit();
    } else
      document.InsLogin.InsLogZeige.value = "X";
 }
}



/* -------- Funktionen bei SucherFormular */
function checkSucherEMail( form ) {
 if ( form.SucherID.value == "") {
   alert( "Bitte geben Sie zuerst Ihre EMail-Adresse ein!\n");
   form.SucherID.focus();
   return false;
 } else {
    if ( ! checknmemail(form.SucherID)) {
      form.SucherID.focus();
      return false;
    } else {
      return true;
    }
 }
}

