// JS function for popups
var pop = null;

function popdown() {
  if (pop && !pop.closed) pop.close();
}

function popup(obj,w,h) {
  var url = (obj.getAttribute) ? obj.getAttribute('href') : obj.href;
  if (!url) return true;
  w = (w) ? w += 20 : 150;  // 150px*150px is the default size
  h = (h) ? h += 25 : 150;
  var args = 'width='+w+',height='+h+',resizable,scrollbars';
  popdown();
  pop = window.open(url,'',args);
  return (pop) ? false : true;
}

window.onunload = popdown;
window.onfocus = popdown;


// JS function for popup2 ???
function FensterOeffnen (Adresse) {
  Fenster1 = window.open(Adresse, "egt", "width=620,height=750,scrollbars=yes");
  Fenster1.focus();
}


// JS für Ausgabe Datum 
function DatumTMJ(t, m, j) {
  d = new Date ();
  var ausgabe;
  var monate = new Array ("Januar", "Februar", "März", "April",
              "Mai", "Juni", "Juli", "August", "September",
              "Oktober", "November", "Dezember");
  ausgabe = (t == "1" ? d.getDate () + '. ' : '')
  ausgabe += (m == "1" ? monate[d.getMonth ()] + ' ' : '')
  ausgabe += (j == "1" ? d.getFullYear () : '')
 
return ausgabe; 
}


// JS function for uncrypting spam-protected emails:
function UnCryptMailto(s) {	//
	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-(1));
	}
	return r;
}

// JS function for uncrypting spam-protected emails:
function linkTo_UnCryptMailto(s)	{	//
	location.href=UnCryptMailto(s);
}


