// oeffnet ein neues popUpWindow
function popupwin(gallery, total)
{
  options = "toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,location=no,directories=no,width=500,height=500";
  window.open("galerie.asp?gallery="+gallery+"&current=1&total="+total,"",options);
}

// checkt die Eingaben
function checkform(){
	if (document.formular._MailFromName.value == '')
	{
		alert("Sie müssen das Feld 'Name' ausfüllen");
		document.formular._MailFromName.focus();
		return false;
	}
	if (document.formular.adresse.value != '' && document.formular.plzort.value == '')
	{
		alert("Bitte geben Sie Postleitzahl und Ort an.");
		document.formular.plzort.focus();
		return false;
	}
	if (document.formular._MailFrom.value != '' && !isEmail(document.formular._MailFrom.value))
	{
		alert("Bitte geben Sie eine gültige E-Mail-Adresse an.");
		document.formular._MailFrom.focus();
		return false;
	}
	if (document.formular.adresse.value == '' && document.formular._MailFrom.value == '' && document.formular.telefon.value == '')
	{
		alert("Bitte geben Sie Ihre Adresse, Telefonnummer oder E-Mail-Adresse an.");
		document.formular.adresse.focus();
		return false;
	}
	if (document.formular.nachricht.value == '')
	{
		alert("Bitte bringen Sie im Feld 'Ihre Nachricht' eine Mitteilung an.");
		document.formular.nachricht.focus();
		return false;
	}
	return true;
}

// gibt TRUE zuerueck, wenn in EMAIL mindestens einmal '@' und einmal '.' vorkommt
function isEmail(email){
  if (email.indexOf("@")!=-1 && email.indexOf(".")!=-1){
    return true;
  }else{
    return false;
  }
}

// gibt TRUE zurueck, wenn WORD leer oder =0 ist oder nur aus SPACES besteht
function isEmptyString(word){
  num = new Number(word);
  return (num == 0);
}

function back(){
	history.back()
}

function test(){ alert("test") }