function Checkform(){
var doc = document.frmRRCN;
var msg = "Bedankt voor uw inschrijving klik op OK om door te gaan.\n\n"
	if(doc.naam.value.length<1) {
	   alert("Je achternaam moet nog ingevuld worden.");
	   doc.CHECKED.value="FALSE";
	   doc.naam.focus();
	}
	else if(doc.rnaam.value.length<1) {
	   alert("Je roepnaam moet nog ingevuld worden.");
	   doc.CHECKED.value="FALSE";
	   doc.rnaam.focus();
	}
	else if(doc.vletter.value.length<1) {
	   alert("Je voorletter(s) moet(en) nog ingevuld worden.");
	   doc.CHECKED.value="FALSE";
	   doc.vletter.focus();
	}
	else if(doc.gebd.value.length<1) {
	   alert("Je geboorte datum moet nog ingevuld worden.");
	   doc.CHECKED.value="FALSE";
	   doc.gebd.focus();
	}
	else if(doc.sex.value == 0) {
	   alert("Je moet nog aangeven of je man of vrouw bent.");
	   doc.CHECKED.value="FALSE";
	   doc.sex.focus();
	}
	else if(doc.straat.value.length<1) {
	   alert("De straat met huisnummer moet nog ingevuld worden.");
	   doc.CHECKED.value="FALSE";
	   doc.straat.focus();
	}
	else if(doc.pc.value.length<1) {
	   alert("De postcode moet nog ingevuld worden.");
	   doc.CHECKED.value="FALSE";
	   doc.pc.focus();
	   
	}
	else if(doc.plaats.value.length<1) {
	   alert("De plaats moet nog ingevuld worden.");
	   doc.CHECKED.value="FALSE";
	   doc.plaats.focus();
	}
	else if((doc.tel.value.length>1)&&(!isPhoneNumber(doc.tel.value))){
	   	alert("Het telefoonnummer is niet juist ingevuld!\nHet moet uit 10 cijfers bestaan.");
	   	doc.CHECKED.value="FALSE";
	   	doc.tel.value="";
	   	doc.tel.focus();
	}
	else if(doc.mat_jn.value == 0) {
	   alert("Je moet nog aangeven of je al een handbike hebt.");
	   doc.CHECKED.value="FALSE";
	   doc.mat_jn.focus();
	}
	else if((doc.mat_jn.value == "ja")&&(doc.mat.value<1)){
		if (isblank(doc.mat.value)){
			alert("Je moet nog aangeven welk type handbike je hebt.");
			doc.CHECKED.value="FALSE";
	   		doc.mat.focus();
		}
	}
	else if((doc.mat_jn.value == "ja")&&(doc.hoelang.value<1)){
		if (isblank(doc.hoelang.value)){
			alert("Je moet nog aangeven hoelang je al rijdt.");
			doc.CHECKED.value="FALSE";
	   		doc.hoelang.focus();
		}
	}
	else if(doc.ver_jn.value == 0) {
	   alert("Je moet nog aangeven of je al lid bent van een andere vereniging.");
	   doc.CHECKED.value="FALSE";
	   doc.ver_jn.focus();
	}
	else if((doc.ver_jn.value == "ja")&&(doc.ver.value<1)){
		if (isblank(doc.ver.value)){
			alert("Je moet nog aangeven van welke vereniging je lid bent.");
			doc.CHECKED.value="FALSE";
	   		doc.ver.focus();
		}
	}
	else if(doc.cat_jn.value == 0) {
	   alert("Je moet nog aangeven of je al gekeurd of ingedeeld bent in een categorie.");
	   doc.CHECKED.value="FALSE";
	   doc.cat_jn.focus();
	}
	else if((doc.cat_jn.value == "ja")&&(doc.cat.value<1)){
		if (isblank(doc.cat.value)){
			alert("Je moet nog aangeven in welke categorie je ingedeeld bent.");
			doc.CHECKED.value="FALSE";
	   		doc.cat.focus();
		}
	}
	else if(doc.bond_jn.value == 0) {
	   alert("Je moet nog aangeven of je aangesloten bent bij een bond.");
	   doc.CHECKED.value="FALSE";
	   doc.bond_jn.focus();
	}
	else if((doc.bond_jn.value == "ja")&&(doc.bond.value<1)){
		if (isblank(doc.bond.value)){
			alert("Je moet nog aangeven bij welke bond je aangesloten bent.");
			doc.CHECKED.value="FALSE";
	   		doc.bond.focus();
		}
	}
	else if((doc.bond_jn.value == "ja")&&((doc.lic_jn.value == " "))){
		alert("Je moet nog aangeven of je een wedstrijdlicentie hebt.");
	   doc.CHECKED.value="FALSE";
	   doc.lic_jn.focus();
	}
	else if(doc.datum.value.length<1) {
	   alert("De datum van ondertekening moet nog ingevuld worden.");
	   doc.CHECKED.value="FALSE";
	   doc.datum.focus();
	}
	else if(confirm(msg)){
	   	doc.CHECKED.value="TRUE";
		doc.submit();
	}
}

// A utility function that returns true if a string contains only 
// whitespace characters.
function isblank(s){
    for(var i = 0; i < s.length; i++) {
        var c = s.charAt(i);
        if ((c != ' ') && (c != '\n') && (c != '\t')) return false;
    }
    return true;
}

// Removes all characters which appear in string bag from string s.
function stripCharsInBag (s, bag)

{   var i;
    var returnString = "";

    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.

    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

// Check whether string s is empty.
function isEmpty(s)
{   return ((s == null) || (s.length == 0))
}

// isDigit (Char c)
// Returns true if character c is a digit 
// (0 .. 9).
function isDigit (c)
{   return ((c >= "0") && (c <= "9"))
}

// isInteger (STRING s)
// 
// Returns true if all characters in string s are numbers.
//
// Accepts non-signed integers only. Does not accept floating 
// point, exponential notation, etc.
//
// We don't use parseInt because that would accept a string
// with trailing non-numeric characters.

function isInteger (s)

{   var i;

    if (isEmpty(s)){
			return false;
		} else {
		
	    // Search through string's characters one by one
	    // until we find a non-numeric character.
	    // When we do, return false; if we don't, return true.
	
	    for (i = 0; i < s.length; i++)
	    {   
	        // Check that current character is number.
	        var c = s.charAt(i);
	
	        if (!isDigit(c)) return false;
	    }
	
	    // All characters are numbers.
	    return true;
		}
}

// isPhoneNumber (STRING s)
// 
// isPhoneNumber returns true if string s is a valid Phone Number, 
// must be 10 digits, or if string is empty.
// 

function isPhoneNumber (s){
	s = stripCharsInBag(s,"-() ");
   	if (isEmpty(s)) {
		return true;
	}else{ 
		return (isInteger(s) && s.length == 10)
	}
}

	