//menuefuntionen

 function menuClick(id){
  for(i=2;getSubMenuElem(i)!=null;i+=2){
   if(i==id){
    show(i);
   }
   else{
    hide(i);
   }
  }
 }

 function show(id){
//  alert("show - a - "+id);
  getSubMenuElem(id).style.visibility="visible";
//  alert("show - b");
  getSubMenuElem(id).style.display="inline";
//  alert("show - c");
  getSubMenuElem(id).style.textAlign="center";
//  alert("show - d");
  getMenuTitleElem(id).style.color="#666666";
//  alert("show - e");
  getMenuImgElem(id).src="/bilder/pfeil_anim.gif";
//  alert("show - f");
 }

 function hide(id){
//  alert("hide - a - "+id);
  getSubMenuElem(id).style.visibility="hidden";
//  alert("hide - b");
  getSubMenuElem(id).style.display="none";
//  alert("hide - c");
  getMenuTitleElem(id).style.color="#333333";
//  alert("hide - d");
  getMenuImgElem(id).src="/bilder/pfeil_grau.gif";
//  alert("hide - e");
 }

 function getSubMenuElem(i){
//  alert("getsubmenuelem("+i+") called!");
  return document.getElementById("sub"+i);
 }

 function getMenuTitleElem(id){
//  alert("getmenutitleelem("+i+") called!");
  return document.getElementById("div"+id);
 }

 function getMenuImgElem(id){
//  alert("getmenuimgelem("+i+") called!");
  return document.getElementById("img"+id);
 }

//datumsfunktionen

 function checkdate(datum){
//  alert(datum);
  var punkt1=datum.indexOf('.');
//  alert(punkt1);
  var tag=datum.substring(0,punkt1);
//  alert(tag);
  if(!(tag>=1 && tag<=31)){
//   alert("Tag out of bounds! tag="+tag);
   return false;
  }
  datum=datum.substring(punkt1+1,datum.length);
//  alert(datum);
  var punkt2=datum.indexOf('.');
//  alert(punkt2);
  var monat=datum.substring(0,punkt2);
//  alert(monat);
  if(!(monat>=1 && monat<=12)){
//   alert("Monat out of bounds! monat="+monat);
   return false;
  }
  var jahr=datum.substring(punkt2+1,datum.length);
//  alert(jahr);
  var currentdate = new Date();
  var currentyear = currentdate.getFullYear();
  if(!(parseInt(jahr)>1900 && parseInt(jahr)<currentyear+2)){
   return false;
  }
  return true;
 }
