// JavaScript Document
var xpopup=null;
function sdpopup( clink ) {
	//xpopup=window.open("ausfuehrungen.htm","Probe");
	xpopup=window.open(clink,'Detail',"toolbar=no, width=450, height=550, status=no, scrollbars=no, resizable=no, menubar=no, captionbar=no" );
	xpopup.focus();
}

function validateform( cname, lenforceuser )
{
	var cErr;
	var lx;
	var nlen;
	var oform;

	oform = document.forms[cname]; 	
	nlen = oform.elements.length;
	
	for ( i = 0; i < nlen; i++ )
	{
		lx = false;
		if ( oform.elements[i].value.length == 0 || oform.elements[i].value == "---" )
		{
			switch (oform.elements[i].name)
			{
				case "anrede":	cErr = "##VAL_ANREDE##";
					break;
				case "nname":	cErr = "##VAL_NNAME##";
					break;
				case "vname":	cErr = "##VAL_VNAME##";
					break;
				case "strasse": cErr = "##VAL_STRASSE##";
					break;
				case "plz":		cErr = "##VAL_PLZ##";
					break;
				case "ort":		cErr = "##VAL_ORT##";
					break;
				case "nat":		cErr = "##VAL_NAT##";
					break;
				case "tel":		cErr = "##VAL_TEL##";
					break;
				case "email":	cErr = "##VAL_EMAIL##";
					break;
				case "benutzer":
					if (lenforceuser) {
						cErr = "##VAL_BENUTZER##";
						break;
					}
					else
					{
						lx = true;
					}
				case "passwort":
					if (lenforceuser) {
						cErr = "##VAL_PASSWORT##";
						break;
					}
					else
					{
						lx = true;
					}
				case "passwort2":
					if (lenforceuser) {
						cErr = "##VAL_PASSWORT2##";
						break;
					}
					else
					{
						lx = true;
					}
				default:
					if (lenforceuser) {
						if ( oform.passwort.value != oform.passwort2.value )
						{
							oform.passwort2.focus();
							alert("##VAL_PASS_NOTIDENT##");
							return false;
						}
					}
					lx = true;
			}

			if (!lx)
			{
				alert( cErr )
				oform.elements[i].focus()
				i = 1000;
				return false;	
			}
			
		}
	}
return true;
}
