
function _(_id){
	if(document.getElementById && document.getElementById(_id)) return document.getElementById(_id);
	else return null;
}



var email_pattern=/^([a-zA-Z_]*)@(([A-Za-z\-]*)\.){1,2}([A-Za-z]{2,3})$/;

function check_form(form_name){
	req=document.getElementsByTagName("label");
	form=document.forms[form_name];
	for(i=0;i<req.length;i++){
		if(!((k=req[i].lang) && (obj=form.elements[k]))) continue;
		if(obj[0]) continue;
		if(obj.value==""){
			alert("Bitte überprüfen Sie Ihre Eingabe");
			obj.focus();
			return false;
		}
		if(obj.name=="email" && !email_pattern.test(obj.value)){
			alert("Email is not valid!");
			obj.focus();
			return false;
		}
	}
	form.submit(); 
	return false;
}



function encrypt_mail(id){
	var mail=_(id).title+"@"+_(id).name;
	_(id).href="mailto:"+mail;
	_(id).innerHTML=mail;
	_(id).title="";
}
