
		function checkDate(ele_focus){
			var stamp = new Date();
			stamp.setFullYear(stamp.getFullYear()-18,stamp.getMonth(),stamp.getDate()-1);
						
			var jaar = document.getElementsByName( 'jaar' )[0];
			var maand = document.getElementsByName( 'maand' )[0];
			var dag = document.getElementsByName( 'dag' )[0];
		
		    var objSelectedDate = new Date();
			
			if(jaar && maand && dag){
			
				if(jaar.value > 0 && maand.value > 0 && dag.value > 0){
					objSelectedDate.setFullYear(jaar.value,(maand.value-1),dag.value);
					
					if(objSelectedDate > stamp){
						alert("Je moet ouder dan 18 jaar zijn om mee te mogen doen.");
						ele_focus.value="";
						ele_focus.focus();
					}
				}
			}
		}
		
		function doPost(){
			var form = document.getElementById('aanmeldform1');
			 
			if(!isFormFilled(form)){
			 
				var objstraatnaam = document.getElementsByName('straat')[0];
				var objplaatsnaam = document.getElementsByName('woonplaats')[0];
				var objland = document.getElementsByName('land')[0];
			
				objstraatnaam.disabled = false;
				objplaatsnaam.disabled = false;
				objland.disabled = false;
			
				form.submit();
			}
		
		}
			
		 
		function showAanmeldStatusWin(){
					
			var container = document.getElementById('containerstatus');
			container.innerHTML = "";
			
			container.style.position= "absolute";
			container.style.top = "700px";	
			container.style.zIndex = "10";
			container.style.display= "block";	
			//container.style.height = 200+"px";
			container.style.width = 548+"px";
			//container.style.backgroundColor = "#FFFFFF";
			
			
			if(xmlhttp.readyState==4){
				container.innerHTML = xmlhttp.responseText;
			}
			
		
		}
		
		
		function showAanmeldStatusWin2(html){
		
			var myHtml = "";
			
			
			
			
			myHtml += '	<div id="statwin2">';
			myHtml += '		<div id="aantop" style="background-image: url(template/image/aanmeldvenster/boven.jpg); background-repeat: no-repeat; width: 548px; height: 9px; background-position: top left;">';
			myHtml += '		</div>';
			myHtml += '	<div id="aanmid" style="background-image: url(template/image/aanmeldvenster/mid.jpg); background-repeat: repeat-y; width: 548px; background-position: top left; margin-bottom: 0px; ">';
			myHtml += '		';
			myHtml += '		<table style="width:600px;"><tr><td style="vertical-align:middle;*vertical-align:bottom;line-height:16px;height:50px;"><h1>Gegevens onjuist</h1></td><td style="vertical-align: middle; text-align: left;"><a href="javascript:;" onclick="document.getElementById(\'statwin2\').style.zIndex=\'0\'; document.getElementById(\'statwin2\').style.display=\'none\';"><img src="./template/image/aanmeldvenster/sluitknop.jpg" border="0" title="scherm sluiten" alt="scherm sluiten" /></a></td></tr></table>'	;	
			myHtml += '';
			myHtml += '<p>&nbsp;'+html+'</p><br /><br /> ';
		
			myHtml += '</div><div id="aanbottom" style="margin-top: 0px; background-image: url(template/image/aanmeldvenster/onder.jpg); background-repeat: no-repeat; background-position: top left; width: 548px; height: 10px;">';
			myHtml += '</div>';
			myHtml += '</div>';
		
		
		
					
			var container = document.getElementById('containerstatus');
			container.innerHTML = "";
			
			container.style.position= "absolute";
			container.style.top = "700px";	
			container.style.zIndex = "10";
			container.style.display= "block";	
			//container.style.height = 200+"px";
			container.style.width = 548+"px";
			//container.style.backgroundColor = "#FFFFFF";
			
			container.innerHTML = myHtml;
			
			
		
		}
		
		
		function checkWachtwoord(){
		
			var wachtwoord1 = document.getElementsByName( 'wachtwoord' )[0];
			var wachtwoord2 = document.getElementsByName( 'hwachtwoord' )[0];
			
			
				if(!wachtwoord1.value.match(/[0-9]/) || !wachtwoord1.value.match(/[a-z]/)){ 
					showAanmeldStatusWin2("Wachtwoorden moeten aan de volgende criteria voldoen:<br /> &nbsp;- 6 tot 14 karakters lang zijn. <br /> &nbsp;- Een kleine letter hebben. <br /> &nbsp;- Een cijfer hebben. <br /> &nbsp;- De 2 wachtwoorden moeten hetzelfde zijn.");
					ele = document.getElementById("wachtwoord_field");
					ele2 = document.getElementById("hwachtwoord_field");
					if(ele)ele.style.color = "#FF0000";
					if(ele2)ele2.style.color = "#FF0000";
					
					return false;
				}else if(wachtwoord1.value != wachtwoord2.value){
					showAanmeldStatusWin2("De wachtwoorden zijn niet hetzelfde.");
					ele = document.getElementById("wachtwoord_field");
					ele2 = document.getElementById("hwachtwoord_field");
					if(ele)ele.style.color = "#FF0000";
					if(ele2)ele2.style.color = "#FF0000";
					
					return false;
				}else if(wachtwoord1.value.length <6){
					ele = document.getElementById("wachtwoord_field");
					ele2 = document.getElementById("hwachtwoord_field");
					if(ele)ele.style.color = "#FF0000";
					if(ele2)ele2.style.color = "#FF0000";
					showAanmeldStatusWin2("Het wachtwoord moet langer zijn dan 6 tekens.");
					return false;
				}else if(wachtwoord1.value.length >14){
					ele = document.getElementById("wachtwoord_field");
					ele2 = document.getElementById("hwachtwoord_field");
					if(ele)ele.style.color = "#FF0000";
					if(ele2)ele2.style.color = "#FF0000";
					showAanmeldStatusWin2("Het wachtwoord is te lang.");
					return false;
				}
			
			return true;
		}


	function isFormFilled(form) {
	
		var verplicht =  Array("email", "voorletter", "achternaam", "geslacht", "postcode1", "huisnummer","wachtwoord", "hwachtwoord", "jaar", 			"dag", 			"maand", 		"straat", "woonplaats", "emailtype", "land", "opleiding", "tel", "telabbo",  "interesses[]" );
		var verplicht2 = Array("email", "voorletter", "achternaam", "geslacht", "postcode1", "huisnummer","wachtwoord", "hwachtwoord", "geboortedatum", "geboortedatum","geboortedatum", "straat", "woonplaats", "emailtype", "land", "opleiding", "tel", "tel", 	"interesses" );
		
		
		
		fault = true;
		mainFault = false;
		
		for(i=0;i<verplicht.length;i++){
			
			var ele23 = document.getElementsByName(verplicht[i])[0];
			if(ele23){
				if(ele23.type == "radio" || ele23.type == "checkbox"){
					var chkEles =  document.getElementsByName(verplicht[i]);
					var chkFault = true;
					
					for(chkI=0; chkI<chkEles.length;chkI++){
						if(chkEles[chkI].checked==true){
							chkFault=false;
							break;
						}	
					}
					
					if(chkFault){
						ele = document.getElementById(verplicht2[i]+"_field")
						if(ele)ele.style.color = "#FF0000";
					}else{
						ele = document.getElementById(verplicht2[i]+"_field")
						if(ele)ele.style.color = "#663300";
					}
					
				}else{
					//alert("1");
					if(ele23.value == ""){
								
						ele = document.getElementById(verplicht2[i]+"_field")
						if(ele)ele.style.color = "#FF0000";
					
						mainFault = true;				
					}else{
						ele = document.getElementById(verplicht2[i]+"_field")
						if(ele)ele.style.color = "#663300";
				
					
						//ele23.style.border = "1px inset #000000";
					}
				}
			}
			
			
		}
		
		mainFault= !checkWachtwoord();
		
		
		return mainFault;
	}
		
		
		
		
		

