function show_error(field, msg){
	modal_window({
		message: '<div class="alert alert-danger">' + msg + '</div>',
		title: 'Error in ' + field,
		close: function(){
			$j('#' + field).focus();
			$j('#' + field).parents('.form-group').addClass('has-error');
		}
	});
	
	return false;
}

$j(function(){
	$j('#jours_conge').prop('readonly' , true);
	
	$j('#date_depart_souhaite-dd, #date_depart_souhaite-mm, #date_depart_souhaite').change(function(){
		var dds = get_date('date_depart_souhaite');
		var ddr = get_date('date_retour_conge');
		
		var today = new Date();
		var jourdds = Math.floor((ddr - dds) / 1000 / 60 / 60 / 24);
		
		$j('#jours_conge').val(jourdds);
	});
	
	$j('#date_depart_souhaite').change();
	
});

