// *** Fügt eine E-Mail-Adresse ein ***
function InsertMail(mailnam,mailsvr,maildom,text)
{
  if(text=="")
    document.write('<a href="mailto:'+mailnam+'@'+mailsvr+'.'+maildom+'">'+mailnam+'@'+mailsvr+'.'+maildom+'</a>');
  else
    document.write('<a href="mailto:'+mailnam+'@'+mailsvr+'.'+maildom+'">'+text+'</a>');
}

wincount=0;
function popup(loc,name,w,h,wintop,winleft,res,scrollb,menub,toolb,direct,locat,stat) {
	if(wincount>0 && newWin.closed!=true) {
		newWin.close();
		wincount--;
	}
	if(!wintop) wintop=0;
	if(!winleft) winleft=0;
	var attributes = "";
	
	attributes = attributes + "width=" + w;
	attributes = attributes + ",height=" + h;
	attributes = attributes + ",top=" + wintop;
	attributes = attributes + ",left=" + winleft;
	attributes = attributes + ",resizable=" + (res ? "no" : "yes");
	attributes = attributes + ",scrollbars=" + (scrollb ? "no" : "yes");
	attributes = attributes + ",menubar=" + (menub ? "yes" : "no");
	attributes = attributes + ",toolbar=" + (toolb ? "yes" : "no");
	attributes = attributes + ",directories=" + (direct ? "yes" : "no");
	attributes = attributes + ",location=" + (locat ? "yes" : "no");
	attributes = attributes + ",status=" + (stat ? "yes" : "no");

	newWin=window.open(loc,name,attributes);

	wincount++;
}

function chktxt(formname, formfeld, message, maxlength) {
	// maxlength = 0 -> Textlaenge erdal!
	var formfield = eval("document." + formname + "." + formfeld);
	if (formfield.value.length == 0) {
			alert(message);
			return false;
		}
	else {
		if ((maxlength > 0) && (formfield.value.length > maxlength)) {
			alert("Zu viel Text! " + formfeld);
			return false;
		}
		else return true;
	}
}

