function OpenPopupWindow(theURL) {window.open(theURL,'WeitereInformationen','toolbar=no,location=no,status=no,top=130,left=330,menubar=no,scrollbars=no,resizable=no,width=320,height=330');}
function OpenDetailImageView(theURL) {window.open(theURL,'WeitereInformationen','toolbar=no,location=no,status=no,top=130,left=330,menubar=no,scrollbars=no,resizable=no,width=320,height=330');}

function Bildwechsel(Pfad){
	document.bild.src=Pfad;	
}
function chkFormular(){

  ok = true;
  errorcolor = "#F0EBE8";
  meldung = "Sie haben folgende Felder nicht korrekt ausgefüllt:\n";
  for( i=0 ; i<document.KontaktForm.elements.length-3 ; i++) {
     document.KontaktForm.elements[i].style.background="#FFFFFF";
  }
  
  if(document.KontaktForm.Name.value == ""){
     document.KontaktForm.Name.style.background = errorcolor;
     meldung = meldung + "Name\n";
     ok = false;
  }
  
  if(document.KontaktForm.Strasse.value == ""){
     document.KontaktForm.Strasse.style.background = errorcolor;
     meldung = meldung + "Adresse\n";
     ok = false;
  } 

  if(document.KontaktForm.PLZ.value == ""){
     document.KontaktForm.PLZ.style.background = errorcolor;
     meldung = meldung + "Postleitzahl\n";
     ok = false;
  } 

  if(document.KontaktForm.Stadt.value == ""){
     document.KontaktForm.Stadt.style.background = errorcolor;
     meldung = meldung + "Wohnort\n";
     ok = false;
  } 

  if(document.KontaktForm.Email.value == ""){
    if((document.KontaktForm.Email.value.indexOf(' ') != -1) || (document.KontaktForm.Email.value.indexOf('@') == -1) || (document.KontaktForm.Email.value.indexOf('.') == -1 ) || (document.KontaktForm.Email.value.length < 6) ){
     document.KontaktForm.Email.style.background = errorcolor;
     meldung = meldung + "E-Mail\n";
     ok = false;}
  } 
  
  if(ok == false){
    alert(meldung);
    return (false);
  }
  else{
  	document.KontaktForm.submit();
	}
}

function chkRueckrufFormular(){

  ok = true;
  errorcolor = "#F0EBE8";
  meldung = "Sie haben folgende Felder nicht korrekt ausgefüllt:\n";
  for( i=0 ; i<document.Rueckruf.elements.length-3 ; i++) {
     document.Rueckruf.elements[i].style.background="#FFFFFF";
  }
  
  if(document.Rueckruf.Name.value == ""){
     document.Rueckruf.Name.style.background = errorcolor;
     meldung = meldung + "Name\n";
     ok = false;
  }
  
  if(document.Rueckruf.Telefon.value == ""){
     document.Rueckruf.Telefon.style.background = errorcolor;
     meldung = meldung + "Telefonnummer\n";
     ok = false;
  }


  if(document.Rueckruf.Email.value == ""){
    if((document.Rueckruf.Email.value.indexOf(' ') != -1) || (document.Rueckruf.Email.value.indexOf('@') == -1) || (document.Rueckruf.Email.value.indexOf('.') == -1 ) || (document.Rueckruf.Email.value.length < 6) ){
     document.Rueckruf.Email.style.background = errorcolor;
     meldung = meldung + "E-Mail\n";
     ok = false;}
  } 
  
  if(ok == false){
    alert(meldung);
    return (false);
  }
  else{
  	document.Rueckruf.submit();
	}
}
