function inschrijven()
{

jQuery.ajax({
   type: "POST",
   url: "./ajax/inschrijvingen.php",
   data: jQuery('#inschrijven').serialize(),
   success: function(msg)
   {
	    jQuery('#inschrijferrors').css({'display':'none'});
	    jQuery('#inschrijfgelukt').css({'display':'none'});
	   
	   if(msg != true)
	   {
		   jQuery('#inschrijferrors').html(msg);
		   jQuery('#inschrijferrors').fadeIn(500);
	   }
	   else
	   {
		   jQuery('#inschrijfgelukt').fadeIn(500);
	   }
   }
 });
}

jQuery(document).ready(function() {	

	//select all the a tag with name equal to modal
	//jQuery('a[name=modal]').click(function(e) {
	jQuery('#mask').ready(function(e) {
		//Cancel the link behavior
		//e.preventDefault();
		
		//Get the A tag
		var id = jQuery('a[name=modal]').attr('href');
	
		//Get the screen height and width
		var maskHeight = Math.max(Math.max(document.body.scrollHeight, document.documentElement.scrollHeight),
						Math.max(document.body.offsetHeight, document.documentElement.offsetHeight),
						Math.max(document.body.clientHeight, document.documentElement.clientHeight)); // echt 100% hoog.
		var maskWidth = jQuery(window).width();
	
		//Set heigth and width to mask to fill up the whole screen
		jQuery('#mask').css({'width':maskWidth,'height':maskHeight});
		
		//transition effect		
		jQuery('#mask').fadeIn(1000);	
		jQuery('#mask').fadeTo("fast",0.8);	
	
		//Get the window height and width
		var winH = 	jQuery(window).height();
		var winW = jQuery(window).width();
              
		//Set the popup window to center
		jQuery(id).css('top',  (winH / 2) - (jQuery(id).height() / 2));
		jQuery(id).css('left', (winW / 2) - (jQuery(id).width() / 2));
	
		//transition effect
		jQuery(id).fadeIn('fast');
	});
	
	//if close button is clicked
	jQuery('.popup_window .close').click(function (e) {
		//Cancel the link behavior
		e.preventDefault();
		
		jQuery('#mask').fadeOut(1000);
		jQuery('.popup_window').fadeOut(1000);
		//jQuery('#boxes #dialog').width(553);
	});		
	
	//if mask is clicked
	jQuery('#mask').click(function () {
		jQuery(this).fadeOut(1000);
		jQuery('.popup_window').fadeOut(1000);
	});		
	
	

		
	jQuery('#popup_boxes #popup_dialog').click(function () {
		//jQuery(this).width(1200);
		//jQuery(this).css({"margin":"0 auto;"});
		jQuery(this).animate({
			width: "890px",
			marginLeft: "-168.5px"
		},600);

	});



	
	
});


function clickclear(thisfield, defaulttext) {
if (thisfield.value == defaulttext) {
thisfield.value = "";
}
}

function clickrecall(thisfield, defaulttext) {
if (thisfield.value == "") {
thisfield.value = defaulttext;
}
}

function cookieSubmit(){
	var popupCookie = document.getElementById('popupCookie').checked;
	if(popupCookie)
	{
		//Ajax
		jQuery.ajax({
			url: "./ajax/setcookie.php"
		});
	}
}


