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').prop('readonly' , true);
	
	$j('#depart-dd, #depart-mm, #depart').change(function(){
		var dds = get_date('depart');
		var ddr = get_date('retour');
		
		var today = new Date();
		var jourdds = Math.floor((ddr - dds) / 1000 / 60 / 60 / 24);
		
		$j('#jours').val(jourdds);
	});
	
	$j('#depart').change();
	
});
