function checkfields ( strFile ){
isOK = true;

if (document.myform.nachricht.value == ""){
	document.myform.nachricht.focus();
	isOK = false;
	return isOK;
}

//Check Radio Buttons
radioCheck = false;
for(i=0;i<document.myform.anrede.length;i++){
	if(document.myform.anrede[i].checked) { radioCheck = true; }
}

if (document.myform.name.value == ""){
	document.myform.name.focus();
	isOK = false;
	return isOK;
}

if (document.myform.vorname.value == ""){
	document.myform.vorname.focus();
	isOK = false;
	return isOK;
}

//if ((document.myform.vorwahl.value != "") && (document.myform.vorwahl.value.match(/\d/g) == null)){
//	document.myform.vorwahl.focus();
//	isOK = false;
//	return isOK;
//}

if ((document.myform.tel.value != "") && (document.myform.tel.value.match(/\d/g) == null)){
	document.myform.tel.focus();
	isOK = false;
	return isOK;
}
if ((document.myform.fax.value != "") && (document.myform.fax.value.match(/\d/g) == null)){
	document.myform.fax.focus();
	isOK = false;
	return isOK;
}
if ((document.myform.mobile.value != "") && (document.myform.mobile.value.match(/\d/g) == null)){
	document.myform.mobile.focus();
	isOK = false;
	return isOK;
}
if (document.myform.email.value.match(/@/g) == null){
	document.myform.email.focus();
	isOK = false;
	return isOK;
}

if (!radioCheck || document.myform.land.selectedIndex == 0) {
	isOK = false;
}


return isOK;
}


function checkcustomerno ( strFile ) {
	isOK = true;
//if ((document.myform.kdnr.value != "") && (document.myform.kdnr.value.match(/\d/g) == null)){
//	document.myform.kdnr.focus();
//	isOK = false;
//}
	return isOK;
}


function checkform ( strFile ) {
	if(checkfields( strFile )) {
		if (checkcustomerno ( strFile )) {
			document.myform.submit();
		} else {
			if (document.all || document.layers) {
				strFile = strFile.replace(/XDALERT/,'XDCNO');
			} 
			openpopup(strFile,'popup',380,100,'');		
		}
	} else {
		if (document.all || document.layers) {
			strFile = strFile.replace(/XDALERT/,'XDFLD');
		} 
		openpopup(strFile,'popup',380,100,'');
	}
}