
//
function checkSearch(formular) {
			   if ( (formular.typ.selectedIndex == 0) && 
				    (formular.ort.selectedIndex == 0) && 
				    (formular.preis1.selectedIndex == 0) && 
				    (formular.preis2.selectedIndex == 0) && 
				    (formular.objektno.value == '') 
			      ) {
			      alert (sucheMeldung);
			      return false;
			  }
			  return true;
}

//
function checkNewsletter(formular) {
			if ( (formular.email.value == '') || (formular.email.value == '$sprachen{39}') || (!checkEmail(formular.email.value)) ) {
				alert(emailMeldung);
				formular.email.focus();
				return false;
			}
			return true;
}

// prüft eine E-Mailadresse auf formale Gültigkeit
function checkEmail(s) {
 var a = false;
 var res = false;
 if(typeof(RegExp) == 'function')  {
  var b = new RegExp('abc');
  if(b.test('abc') == true){
	  a = true;
  }
 }

 if(a == true) {
  reg = new RegExp('^([a-zA-Z0-9\\-\\.\\_]+)'+
                   '(\\@)([a-zA-Z0-9\\-\\.]+)'+
                   '(\\.)([a-zA-Z]{2,4})$');
  res = (reg.test(s));
 }
 else {
  res = (s.search('@') >= 1 &&
         s.lastIndexOf('.') > s.search('@') &&
         s.lastIndexOf('.') >= s.length-5)
 }
 return(res);
}

// suche ein und ausblenden
function toggleSuche(what) {
  if (what) {
   	document.getElementById('suche2').style.visibility = what;
  }
  else {
    if ((document.getElementById('suche2').style.visibility == 'hidden') || (!document.getElementById('suche2').style.visibility)) {
    	document.getElementById('suche2').style.visibility = 'visible';
    }
    else {
    	document.getElementById('suche2').style.visibility = 'hidden';
	}
  }
}

