function openwndw1()  {
	alert('N V S C A\n\nUw bericht wordt verzonden,\n\neven geduld svp ....\n\n');
}

function terug() {
    myWindowHandle = window.open('index.php','','width=400,height=400');
}

function formValidator(){
	// Make quick references to our fields
	var naam = document.getElementById('naam');
    var email = document.getElementById('email');
    var plaats = document.getElementById('plaats');
	var banknr = document.getElementById('banknr');
 //   var banknr = banknr.replace(/^\s+/,''); 
 //   var banknr = banknr.replace(/\s+$/,'');
 //   var banknr = banknr0.replace(" ","");
	var mgacc = document.getElementById('mgacc');
	
	// Check each input in the order that it appears in the form!
	if(notEmpty(naam, "Vul uw naam in, s.v.p.")){ 
        if(notEmpty(email, "Vul uw email-adres in, s.v.p.")) {
            if(notEmpty(plaats, "Vul uw woonplaats in, s.v.p.")) {
                if(isChecked(mgacc, "Geef aan: \'machtiging accoord\' s.v.p.")){
                    if(notEmpty(banknr, "Vul uw rekeningnummer in, s.v.p.")){
                       if(isNumeric(banknr, "Vul een geldig rekeningnummer in, s.v.p.\n(geen spaties, letters, etc., alleen cijfers)")){   
                           return true;
                       }
                   } 
                }   
            }        
        }	
    }		
	return false;	
}

function notEmpty(elem, helperMsg){
	if(elem.value.length == 0){
		alert(helperMsg);
		elem.focus(); // set the focus to this input
		return false;
	}
	return true;
}
function isNumeric(elem, helperMsg){
	var numericExpression = /^\d{5,10}$/;
	if(elem.value.match(numericExpression)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}
function isChecked(elem, helperMsg) {
	if(!elem.checked && document.nwlid.nl[0].checked){
		alert(helperMsg);
		elem.focus();
		return false;
	}else{
        return true;
	}
}


function vul_in() {
	this.document.write('echo "<textarea name=$jnotxt2 rows=\"2\" cols=\"40\" wrap=virtual>";');
	this.document.write('echo "$jnotxt2</textarea>\n";');
}


function help1(x)
{
     helpa = window.open("tekst/help01.html#"+x,"helpa","status=no,toolbar=no,width=400,height=300,directories=no,scrollbars=yes,resizable=yes,menubar=no,left=0,top=0");
	 helpa.focus();
}

function help2(x)
{
     helpb = window.open("tekst/help02.html#"+x,"helpb","status=no,toolbar=no,width=400,height=300,directories=no,scrollbars=yes,resizable=yes,menubar=no,left=0,top=0");
	 helpb.focus();
}

function help3()
{
     helpc = window.open("tekst/help03.html","helpc","status=no,toolbar=no,width=400,height=300,directories=no,scrollbars=yes,resizable=yes,menubar=no,left=0,top=0");
	 helpc.focus();
}

function mail_db()
{
     mail_db = window.open("../contact_db.php?dbwm=db","mail_db","status=no,toolbar=no,width=500,height=700,directories=no,scrollbars=yes,resizable=yes,menubar=no,left=30,top=30");
	 mail_db.focus();
}


function close_h()
{
    helpa.close ();
}


function toggleAnders(Val) {
    if(Val == 'anders') {
        document.getElementById('anders').style.visibility = 'visible';
    } else {
        document.getElementById('anders').style.visibility = 'hidden';
        document.getElementById('anders').value = '';
    }
}



