
﻿/* French initialisation for the jQuery UI date picker plugin. */
jQuery(function($){
$.datepicker.regional['fr'] = {
closeText: 'Fermer',
prevText: '&#x3c;Préc',
nextText: 'Suiv&#x3e;',
currentText: 'Courant',
monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin',
'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun',
'Jul','Aoû','Sep','Oct','Nov','Déc'],
dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'],
weekHeader: 'Sm',
dateFormat: 'dd/mm/yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['fr']);
});
function handleDatePickerBackground()
{
$( 'div#devis-express-form input.date' ).each(function( index, item ) {
if ( $( item ).val().length )
{
$( item ).attr( 'style', 'background-image : none;' );
}
else
{
$( item ).removeAttr( 'style' );
}
});
}
$( function() {
$( 'div#devis-express-form select.destination').bind( 'change', function( event ) {
if ( $( 'div#devis-express-form select.destination').val() !== '' )
{
$.ajax( {
url: getHotelsURL + '/' + $( 'div#devis-express-form select.destination').val(),
dataType: 'json',
beforeSend: function() {
$( 'div#devis-express-form select.hotel').hide().after( '<div class="loading"></div>' );
$( 'div#devis-express-form select.hotel option[value!=""]').remove();
},
success: function( data ) {
$.each( data, function( index, value ) {
$( 'div#devis-express-form select.hotel').append( '<option value="' + value.node_id +'">'+value.name+'</option>')
} );
},
complete: function() {
$( 'div#devis-express-form select.hotel').show();
$( 'div.loading', $( 'div#devis-express-form select.hotel').parent() ).remove();
}
} );
}
} );
$( 'div#devis-express-form input.date' ).datepicker({beforeShow: function(input) {
$( input ).attr( 'style', 'background-image : none;' );
},
onClose: function( txt, inst) {
handleDatePickerBackground();
}
});
$( 'div#devis-express-form input.date' ).bind( 'change', function() {
handleDatePickerBackground();
});
handleDatePickerBackground();
} );

