function nachricht(meldung,pfad) {
  if (document.readyState == "complete") {
      alert(meldung);
      location.href = pfad;
   } else {
      setTimeout("nachricht('"+meldung+"','"+pfad+"')",500);
   }
}

function Loeschen(id, name) {
  check = confirm ("Soll '"+name+"' wirklich gelöscht werden?");
  if(check == true) {
    document.getElementsByName("id")[0].value = id;
    document.formular.submit();
   }
}

function pDatum(f) {
var string = f.value;
    string = string.replace(/[-\/,]/g, '.'); // Trennzeichen normalisieren
    string = string.replace(/[^0-9.: ]/g, ''); // ungültige Zeichen entfernen

if(string.length=="0")
  f.value = "";

var teil = string.split(".");

if(teil[0].length>2)
  f.value = "";

if(teil[0].length<2)
  teil[0] = "0"+teil[0];

if(teil[1].length<2)
  teil[1] = "0"+teil[1];

if(teil[2].length<4)
  teil[2] = 2000 + parseInt(teil[2]);

f.value = teil[0] + "." + teil[1] + "." + teil[2];
}

function pUhr(f) {
var string = f.value;
    string = string.replace(/[-\/.,]/g, ':'); // Trennzeichen normalisieren
    string = string.replace(/[^0-9.: ]/g, ''); // ungültige Zeichen entfernen

if(string.length=="0")
  f.value = "";

var teil = string.split(":");

if(teil[0].length>2)
  f.value = "";

if(teil[0].length<2)
  teil[0] = "0"+teil[0];

if(teil[1].length<2)
  teil[1] = "0"+teil[1];

f.value = teil[0] + ":" + teil[1];
}
