jQuery(function() {
	jQuery('#outboundDate').datepicker(					  
				{
				altField: '#outboundText', 
				altFormat: 'DD d MM yy', 
				minDate: 3, 
				showOn: 'focus',
				buttonImage: 'images_calendar/calendar3.png',
				buttonImageOnly: true,	
				onClose: function(date) 
					{
					var outboundDateObj = checkDate(date); 
					var inboundDateObj = checkDate(document.Search.inboundDate.value); 
					if (inboundDateObj<outboundDateObj) 
						{inboundDateObj = outboundDateObj; 
						inboundDateObj.setDate(inboundDateObj.getDate()+7); 
						jQuery('#inboundDate').datepicker('setDate', inboundDateObj); 
						}
					}
				}
	);
	
	jQuery('#inboundDate').datepicker(
				{
				altField: '#inboundText', 
				altFormat: 'DD d MM yy', 
				minDate: 0, 
				showOn: 'focus',
				buttonImage: 'images_calendar/calendar3.png',
				buttonImageOnly: true,					
				beforeShow: function(input) 
					{ 
					var outboundDateObj = checkDate(document.Search.outboundDate.value); 
						if (outboundDateObj) 
						{ 
						jQuery('#inboundDate').datepicker('option', 'minDate', outboundDateObj); 
						}
					}
				}
	);
	
	today = new Date;
	jour = today.getDate();
	mois = today.getMonth();
	annee = today.getFullYear();
	
	jQuery('#outboundDate').datepicker('setDate', new Date(annee,mois,jour+3));
	jQuery('#inboundDate').datepicker('setDate', new Date(annee,mois,jour+10));
});
document.Search.allerRetour[0].checked = true;
