$(document).ready(function(){

//	//var startDate = new Date("Jun 3, 2010 16:12:00");
//	var startDate = new Date("Jun 11, 2010 16:00:00");
//	var currentDate = new Date();
//
//	var seconds = Math.round((startDate - currentDate) / 1000);
//
//	$('#counter').countDown({
//		startFontSize:  '22px',
//		endFontSize:  '22px',
//		duration:  1000,
//		startNumber:  seconds,
//		endNumber:  0,
//		callBack:  function(me) {
//			$(me).text('Het WK is begonnen!').css('font-size','22px');
//			$('.countext').text('');
//		}
//	});

});



$(function() {
	$("#contactsubmit").click(function() {
		// validate and process form here
		$("#naamerror").html("");
		$("#emailerror").html("");
		$("#onderwerperror").html("");
		$("#berichterror").html("");

		error = 0;

		if($("#naam").val() == ""){
			$("#naamerror").html("U heeft geen naam opgegeven");
			$("#naam").focus();
			error = 1;
		}
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;

		if($("#email").val() == "" || reg.test($("#email").val()) == false){
			$("#emailerror").html("U heeft geen geldig e-mail adres opgegeven");
			$("#email").focus();
			error = 1;
		}
		if($("#onderwerp").val() == ""){
			$("#onderwerperror").html("U heeft geen onderwerp opgegeven");
			$("#onderwerp").focus();
			error = 1;
		}
		if($("#bericht").val() == ""){
			$("#berichterror").html("U heeft geen bericht opgegeven");
			$("#bericht").focus();
			error = 1;
		}
		if(error == 0){
			$("form").submit();
		}
		
	});
});  

