var Heute=new Date();

var DieserMonatstag = Heute.getDate();
var DieserWochentag = Heute.getDay();
var DieserMonatNummmer = Heute.getMonth()+1;
var DiesesJahr4stellig = Heute.getFullYear();

// zweistellige Darstellung
var DieserMonatstag2 = ((DieserMonatstag<10) ? "0" : "")+ DieserMonatstag;
var DieserMonatNummmer2 = ((DieserMonatNummmer<10) ? "0" : "")+ DieserMonatNummmer;

function TagTxt (zahl) {
var Tag=new Array();
Tag[0]="Sonntag";
Tag[1]="Montag";
Tag[2]="Dienstag";
Tag[3]="Mittwoch";
Tag[4]="Donnerstag";
Tag[5]="Freitag";
Tag[6]="Samstag";
return Tag[zahl];
}
var TagName=TagTxt(DieserWochentag);



function TagTxtKurz (zahl) {
var TageK = new Array ("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
return TageK[zahl];
}
var TagNameKurz=TagTxtKurz(DieserWochentag);



function MonatTxt (zahl) {
var Monat=new Array();
Monat[1]="Jan";
Monat[2]="Feb";
Monat[3]="Mär";
Monat[4]="Apr";
Monat[5]="Mai";
Monat[6]="Jun";
Monat[7]="Jul";
Monat[8]="Aug";
Monat[9]="Sep";
Monat[10]="Okt";
Monat[11]="Nov";
Monat[12]="Dez";
return Monat[zahl];
}
var MonatName=MonatTxt(DieserMonatNummmer);


function MonatTxtVoll (zahl) {
var Monat=new Array();
Monat[1]="Januar";
Monat[2]="Februar";
Monat[3]="März";
Monat[4]="April";
Monat[5]="Mai";
Monat[6]="Juni";
Monat[7]="Juli";
Monat[8]="August";
Monat[9]="September";
Monat[10]="Oktober";
Monat[11]="November";
Monat[12]="Dezember";
return Monat[zahl];
}
var MonatNameVoll=MonatTxtVoll(DieserMonatNummmer);





function Datum(Zahl) {

var heute ="";

if(Zahl == 1) {
heute = TagNameKurz + ". "  + DieserMonatstag + ". " + MonatNameVoll + " " + DiesesJahr4stellig ;
}
if(Zahl == 2) {
heute = TagName + " "  + DieserMonatstag + ". " + MonatNameVoll + " " + DiesesJahr4stellig ;
}
if(Zahl == 3) {
heute = TagNameKurz + ". "  + DieserMonatstag + ". " + DieserMonatNummmer + ". " + DiesesJahr4stellig ;
}
if(Zahl == 4) {
heute = TagNameKurz + ". "  + DieserMonatstag + ". " + MonatNameVoll ;
}
if(Zahl == 5) {
heute = DieserMonatstag + ". " + MonatName + ". " + DiesesJahr4stellig ;
}

if(Zahl == 6) {
heute = DieserMonatstag + ". " + DieserMonatNummmer + ". " + DiesesJahr4stellig ;
}

if(Zahl == 7) {
heute = TagNameKurz + ". "  + DieserMonatstag2 + "." + DieserMonatNummmer2 + ". " + DiesesJahr4stellig ;
}

if(Zahl == 8) {
heute = DieserMonatstag2 + "." + DieserMonatNummmer2 + "." + DiesesJahr4stellig ;
}

if(Zahl == 9) {
heute = DiesesJahr4stellig ;
}

if(Zahl == 10) {
heute = DieserMonatstag -1 + ". " + MonatName + ". " + DiesesJahr4stellig ;
}

document.write(heute);
}


// Formularcheck auf Eingabefehler

function check()
{
  var checked=true;
  var pattern=/.*\@.*\..*/;
                                              if (checked)
	  {
	    if (document.sendform.Name.value=="")
        {
		  document.sendform.Name.focus();
		  document.sendform.Name.select();
          alert ("Bitte füllen Sie das Feld \"Name\" aus");
          checked=false;
        }
	  }
                    if (checked)
	  {
	    if (document.sendform.Telefon.value=="")
        {
		  document.sendform.Telefon.focus();
		  document.sendform.Telefon.select();
          alert ("Bitte füllen Sie das Feld \"Telefon\" aus");
          checked=false;
        }
	  }
                if (checked)
	  {
	    if ((pattern.test(document.sendform.Email.value))==false)
        {
		  document.sendform.Email.focus();
		  document.sendform.Email.select();
          alert ("Bitte geben Sie in das Feld \"E-Mail\" eine korrekte E-Mail Adresse ein.");
          checked=false;
        }
	  }
              if (checked)
	  {
	    if (document.sendform.Email.value=="")
        {
		  document.sendform.Email.focus();
		  document.sendform.Email.select();
          alert ("Bitte füllen Sie das Feld \"E-Mail\" aus");
          checked=false;
        }
	  }
        if (checked)
  {
    document.sendform.method="POST";
    document.sendform.action="/cgi-bin/mailmanager.pl";
	document.sendform.submit;
  }
  return checked;
} 


// Codierung

function Encode(form) {
Input = form.input.value; Ref="0123456789abcdefghijklmnopqrstuvwxyz._~ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var CipherVal = parseInt(CipherVal);
var Ret="";
for (Count=0; Count < Input.length; Count++) {
var TempChar = Input.substring (Count, Count+1);
var Conv = Ref.indexOf(TempChar);
var Cipher=Conv^12;
Cipher=Ref.substring(Cipher, Cipher+1);
Ret += Cipher; }
location = Ret + ".html";
}

function UnCryptMailto(s, shift) {
	var n=0;
	var r="";
	for(var i=0;i<s.length;i++) { 
		n=s.charCodeAt(i); 
		if (n>=8364) {n = 128;}
		r += String.fromCharCode(n-(shift)); 
	}
	return r;
}
function linkTo_UnCryptMailto(s, shift)	{
	location.href=UnCryptMailto(s, shift);
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function na_open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';

  cookie_str = document.cookie;
  cookie_str.toString();

  pos_start  = cookie_str.indexOf(name);
  pos_end    = cookie_str.indexOf('=', pos_start);

  cookie_name = cookie_str.substring(pos_start, pos_end);

  pos_start  = cookie_str.indexOf(name);
  pos_start  = cookie_str.indexOf('=', pos_start);
  pos_end    = cookie_str.indexOf(';', pos_start);
  
  if (pos_end <= 0) pos_end = cookie_str.length;
  cookie_val = cookie_str.substring(pos_start + 1, pos_end);
  if (cookie_name == name && cookie_val  == "done")
    return;

  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}

function na_open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';

  cookie_str = document.cookie;
  cookie_str.toString();

  pos_start  = cookie_str.indexOf(name);
  pos_end    = cookie_str.indexOf('=', pos_start);

  cookie_name = cookie_str.substring(pos_start, pos_end);

  pos_start  = cookie_str.indexOf(name);
  pos_start  = cookie_str.indexOf('=', pos_start);
  pos_end    = cookie_str.indexOf(';', pos_start);
  
  if (pos_end <= 0) pos_end = cookie_str.length;
  cookie_val = cookie_str.substring(pos_start + 1, pos_end);
  if (cookie_name == name && cookie_val  == "done")
    return;

  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}


