function SetzeSessionCookie(name, wert) {
  document.cookie = escape(name) + "=" + escape(wert);
}

function SetzeAlleSessionCookies() {
  SetzeSessionCookie('name', document.getElementById('un').value);
  SetzeSessionCookie('email', document.getElementById('em').value);
  SetzeSessionCookie('kommentar', document.getElementById('km').value);
}


function HoleSessionCookie(name) {
var cookiename = name + "=";
var allecookies = document.cookie;
var anfang, ende;
if (allecookies.length > 0) {    //Hat die Datei einen Inhalt?
   anfang = allecookies.indexOf(cookiename);
   if (anfang > -1) {         // Gibt es das gesuchte Cookie?
   anfang += cookiename.length;   // Nach dem Namen und dem = den Wert
   ende = allecookies.indexOf(";", anfang);  // bis zum nächsten Eintrag
   if (ende > -1) {        // ; gefunden
   return unescape(allecookies.substring(anfang, ende));
   } else {             // ohne weiteren Eintrag (letzter Wert)
  return unescape(allecookies.substring(anfang, allecookies.length));
   }
   } else {
     return "";
   }
} else {
  return "";
}
}

function HoleAlleSessionCookies() {
  document.getElementById('un').value=HoleSessionCookie('name');
  document.getElementById('em').value=HoleSessionCookie('email');
  document.getElementById('km').value=HoleSessionCookie('kommentar');
}
