var newwin;
function launchwin(winurl, winname, width, height, x, y, scrolling, navigation){
	var winfeatures = "width=" + width + ",height=" + height + ",screenX=" + x + ",screenY=" + y + ",scrollbars=" + scrolling + ",toolbar=" + navigation + "";
	newwin = window.open(winurl,winname,winfeatures);
	if (newwin&&newwin.focus)setTimeout('newwin.focus();',250);
}
function cl(o){if (o.blur)o.blur();}

function checkForm(){
	var l=checkForm.arguments;
	var o=l[0];
	var bool=1;
	for (var i=1;i<l.length;i++) {
		var e=o[l[i]];
		var val=(e.options && !e.value)?e.options[e.selectedIndex].value:e.value;//NS4, select
		if (val==''){
			e.focus();
			alert("Bitte alle erforderlichen Felder ausfüllen!");
			return false;
		} else if ((l[i]=='email') && (!isEmail(e.value))){
			e.focus();
			e.select();
			alert("Bitte eine korrekte Email-Adresse eingeben!");
			return false;
		} else if ((l[i]=='datum') && (!isDate(e.value))){
			e.focus();
			e.select();
			alert("Bitte eine korrektes Datum eingeben!");
			return false;
		}        
	}
	return true;
}
function isEmail(email) {
	reg = /^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+\.)+([a-zA-Z]{2,3})$/;
	return reg.exec(email);
}
function isDate(d){
	var reg = /^[0-3][0-9].[0-1][0-9].20[0-9]{2}$/;
	return (reg.exec(d)!=null);
}