var savedId=0;

function showp(id) {
	if (savedId) { document.getElementById(savedId).style.visibility='hidden'; }
	id="person"+id;
	document.getElementById(id).style.visibility='visible';
	savedId=id;
}

function submitForm(arrayToHave) {
	var errorText="";
	for (var i=0; i<fieldsToHave.length; i++){
		if (!check_empty(document.form[fieldsToHave[i]].value) ){
			errorText+=document.form[fieldsToHave[i]].name+" ";
		}
	}
	
	if (errorText.length>0) {
		alert("Bitte folgende Felder ausfüllen:\n"+errorText);
	} else {
		document.form.submit();
	}
}

function check_empty(text) {
	return (text.length > 0);
}

function InsertMail(mailnam,mailsvr,maildom) {
	document.write('<a href="mailto:'+mailnam+'@'+mailsvr+'.'+maildom+'" class="txtLink">'+mailnam+'@'+mailsvr+'.'+maildom+'</a>');
}

