$(function(){

	// Datepicker
	$('#datepicker').datepicker({
		inline: true
	});
	
	//hover states on the static widgets
	$('#dialog_link, ul#icons li').hover(
		function() { $(this).addClass('ui-state-hover'); }, 
		function() { $(this).removeClass('ui-state-hover'); }
	);
	
	$("#type_route").change(function() {
		$(".switch").css('visibility','hidden');
		
		if($(this).val() == 'Fietsroute') {			
			$(".fiets").css('visibility','visible');
		}
		if($(this).val() == 'Wandelroute') {			
			$(".wandel").css('visibility','visible');
		}
	}).change();	
	
});

function validateForm() {
	
	if($("#lastname").val() == '') {		
		$("#lastname").css('backgroundColor','#eee');
		$("#lastname").after(' <span style="color:red;">verplicht</span>');
		
		return false;
	}
	
	if($("#phone").val() == '') {
		$("#phone").css('backgroundColor','#eee');
		$("#phone").after(' <span style="color:red;">verplicht</span>');
		
		return false;
	}
	
	if($("#email").val() == '') {
		$("#email").css('backgroundColor','#eee');
		$("#email").after(' <span style="color:red;">verplicht</span>');
		
		return false;
	}
	
	return true;
}
