var calendarData= {

    /**
     * Liste des noms d'objets à utiliser.
     */
  	getBeans: function() {        
        return "";
    },   
        
    /**
     * Initialisation de la variable JSON
     */
    initJSON: function() {
    },
        
        
    /**
     * méthode appelée sur le onload de la page.      
     */
    rewrite: function() {   
    	if ($('date_arrivee_img')) {
    		var calendar1 = new MultiCalendars({
    			'arrivalID': 'arrivee',
    			'buttonID': 'date_arrivee_img',
    			'arrivalDayID': 'jour_arrivee',
    			'arrivalMonthID': 'mois_arrivee',
    			'arrivalYearID': 'annee_arrivee',
    			'nightsID': 'nb_nuit',
    			'departureID': 'depart'
    		});
    	Event.observe($("arrivee"), "change", function(event){calendar1.updateArrivalDate();calendar1.updateDepartureDate();});
      Event.observe($("jour_arrivee"), "change", function(event){calendar1.updateArrivalDate();calendar1.updateDepartureDate();});    		
      Event.observe($("mois_arrivee"), "change", function(event){calendar1.updateArrivalDate();calendar1.updateDepartureDate();});
      Event.observe($("annee_arrivee"), "change", function(event){calendar1.updateArrivalDate();calendar1.updateDepartureDate();});
      Event.observe($("nb_nuit"), "change", function(event){calendar1.updateArrivalDate();calendar1.updateDepartureDate();});    		  
    		
    		
    	}
    	
    	
    	var showHideBrandSelection = function(hide) {
    		$('brandSelection').style.display = hide ? 'none' : 'block';
    	};
    	
    	if ($('allBrands_YES') && $('allBrands_NO')) {
    		if ($('allBrands_YES').checked) {
    			showHideBrandSelection(true);
    		} else if ($('allBrands_NO').checked) {
    			showHideBrandSelection();
    		}
    		$('allBrands_YES').observe('click', function() {
    			showHideBrandSelection(true);
    		});
    		$('allBrands_NO').observe('click', function() {
    			showHideBrandSelection();
    		});
    	}
    	
    	// var displayFromCheckbox = function(checkbox, target) {
    	// 	if ($(checkbox)) {
    	// 		if ($(checkbox).checked) {
    	// 			$(target).style.display = 'block';
    	// 		}
    	// 		$(checkbox).observe('click', function() {
    	// 			$(target).style.display = this.checked ? 'block' : 'none';
    	// 		});
    	// 	}
    	// };
    	// 
    	// displayFromCheckbox('contrat_dispo', 'bloc_agencyContract');
    	// displayFromCheckbox('reserv_contrat', 'bloc_agencyAccountId');
    	// displayFromCheckbox('code_preferentiel', 'div_code_pref_a');
    	// displayFromCheckbox('porteur_carte', 'div_carte_accor_a');
  }
}
core.push(calendarData);