



jQuery(document).ready(function () {

    
	$( "#GeboorteDatum" ).datepicker({
	
		dateFormat: 'DD, d MM, yy',
		regional: 'nl',
		
		onSelect: function(dateText, inst){
						var theDate = new Date(Date.parse($(this).datepicker('getDate')));
						var dateFormatted = $.datepicker.formatDate('d-m-yy', theDate);
						$('#GeboorteDatumFormat').val(dateFormatted);
					}
	});
	
	$('#menu ul > li').smoothMenu({
		direction: 'vertical',
		zIndex: 10,
		icon: false
	});	
	
	
	function limitChars(textid, limit, infodiv)
	{
		var text = $('#'+textid).val(); 
		var textlength = text.length;
		if(textlength > limit)
		{
			$('#' + infodiv).html('Uw bericht mag maximaal '+limit+' tekens zijn!');
			$('#'+textid).val(text.substr(0,limit));
			return false;
		}
		else
		{
			$('#' + infodiv).html('Nog '+ (limit - textlength) +' tekens over.');
			return true;
		}
	}
 
	$('#bericht').keyup(function(){
		limitChars('bericht', 300, 'counter');
	})
 
 
	//jQuery("#menu ul ul").not(".pShow").hide();

    //click event for the menu
   /* jQuery("#menu a").not('#menu ul ul ul a').click(function () {

         //var submenu = jQuery('p', this.parentNode);
		var submenu = $(this).parent().next().children('ul');
		var parentSubMenu = $(this).closest('ul');
		jQuery(submenu).slideDown("slow");
		jQuery("#menu ul ul").not(submenu).not(parentSubMenu).slideUp("slow");

		if($(this).attr('href')=='#')
			return false;
    });*/
   
});   
    



