var select = 0;

function toonInschrijving(soort) {
	if (select < 2 && soort == 1) {
		i = 11
		soort = 0
		for (var i=0; i < document.inschrijfform.length; i++) {
		 	if (document.inschrijfform[i].type == 'checkbox') {
				if (document.inschrijfform[i].checked) soort = 1
			}
		}
		select = soort
	}
	if (soort == 2) select = 2
	if (document.getElementById("inschrijf")) {
		if (select == 0) {
			document.getElementById("inschrijf").style.display = "none";
		} else {
			document.getElementById("inschrijf").style.display = "";
		}
	}
}

function toonGegevens() {
	if (document.inschrijfform.soort[0].checked){
		document.getElementById("bekend").style.display = ""
		document.getElementById("nieuw").style.display = "none"
	} else {
		document.getElementById("bekend").style.display = "none"
		document.getElementById("nieuw").style.display = ""
	}
}

function wijzignaw() {
	foutmelding = ""
	if (document.nawform.voornaam.value == '') foutmelding = foutmelding + 'Voornaam\r\n'
	if (document.nawform.achternaam.value == '') foutmelding = foutmelding + 'Achternaam\r\n'
	if (document.nawform.adres.value == '') foutmelding = foutmelding + 'Adres\r\n'
	if (document.nawform.postcode.value == '') foutmelding = foutmelding + 'Postcode\r\n'
	if (document.nawform.plaats.value == '') foutmelding = foutmelding + 'Plaats\r\n'
	if (document.nawform.telefoon.value == '') foutmelding = foutmelding + 'Telefoon\r\n'
	if (document.nawform.email.value == '') foutmelding = foutmelding + 'Email\r\n'
	if (foutmelding != "") {
	   alert ("De volgende velden zijn niet ingevuld:\r\n\r\n" + foutmelding)
		return fout
	} else {
		document.nawform.submit();
   }
}

function Wijzigendata() {
	var i=11;
	fout = false
	while (document.getElementById("annuleer" + i)) {
		if(document.getElementById("wijzig" + i)) {
			if(document.getElementById("wijzig" + i).selectedIndex > 0 && document.getElementById("annuleer" + i).checked) {
			   alert("FOUT: voor " + document.getElementById("datum"+ i).value + " zowel annuleren als nieuwe datum ingevoerd")
				fout = true
			}
		}
		i++;
	}
	if (!fout) document.wijzigdata.submit();
}

function herstelnaw() {
	document.nawform.reset();
}

function opnieuw() {
	document.inschrijfform.action='default.asp?tra=3&id=' + document.inschrijfform.id.value
	document.inschrijfform.submit()
}

function melding(tekst) {
	if (tekst != '') alert(tekst);
}

function testInschrijf() {
	ok = 0
	for (var i=0; i < document.inschrijfform.length; i++) {
		if (document.inschrijfform[i].type == 'radio') {
			if (document.inschrijfform[i].checked) ok = 1
		}
		if (document.inschrijfform[i].type == 'checkbox') {
			if (document.inschrijfform[i].checked) ok = 1
		}
	}
	if (ok == 1) {
		document.getElementById('inschrijfbutton').style.display = ''
		document.getElementById('resetbutton').style.display = ''
	} else {
		document.getElementById('inschrijfbutton').style.display = 'none'
		document.getElementById('resetbutton').style.display = 'none'
	}
}

function inschrijfHerstel() {
	document.inschrijfform.reset()
	testInschrijf()
}

function setReserve(naam) {
	alert(naam)
}

