  
  $(document).ready(
    function() {

      // CheckInDate
      $('#checkInDate').datepicker({ 
        showOn: 'both',
        buttonImageOnly: true,
        buttonImage: siteURL + '/templates/default/images/ajax/calendar.gif',
        buttonText: 'Calendar',
        minDate: new Date()
      });
      
      // Carry the first date to the second field
      $('#checkInDate').change(function() {
          if (!$('#checkOutDate').val()) {
            $('#checkOutDate').val($(this).val());          
          }
        }
      );
      
      // CheckOutDate
      $('#checkOutDate').datepicker({ 
        showOn: 'both',
        buttonImageOnly: true,
        buttonImage: siteURL + '/templates/default/images/ajax/calendar.gif',
        buttonText: 'Calendar',
        minDate: new Date()
      });

      // CheckInDate
      $('#checkInDate2').datepicker({ 
        showOn: 'both',
        buttonImageOnly: true,
        buttonImage: siteURL + '/templates/default/images/ajax/calendar.gif',
        buttonText: 'Calendar',
        minDate: new Date()
      });
      
      // Carry the first date to the second field
      $('#checkInDate2').change(function() {
          if (!$('#checkOutDate2').val()) {
            $('#checkOutDate2').val($(this).val());          
          }
        }
      );
      
      // CheckOutDate
      $('#checkOutDate2').datepicker({ 
        showOn: 'both',
        buttonImageOnly: true,
        buttonImage: siteURL + '/templates/default/images/ajax/calendar.gif',
        buttonText: 'Calendar',
        minDate: new Date()
      });
      
      // hide the default rooms
      $('.room-2').hide();
      $('.room-3').hide();
      $('.room-2').hide();
      $('.room-3').hide();
      $('.room-3').hide();
      $('.children-display').hide();
      
      
      // when rooms change, apply visual changes
      $('#rooms').change(
        function() {
          $('.room-1').hide(); $('.room-2').hide(); $('.room-3').hide(); // hide them
          var rooms = $(this).val();
          while (rooms > 0) {
            $('.room-' + rooms).fadeIn('slow');
            rooms--;
          }
          $('#room-display').show();
        }
      );

      // hide the default rooms
      $('.1room-2').hide();
      $('.1room-3').hide();
      $('.1room-2').hide();
      $('.1room-3').hide();
      $('.1room-3').hide();
      $('.1children-display').hide();
      
      
      // when rooms change, apply visual changes
      $('#1rooms').change(
        function() {
          $('.1room-1').hide(); $('.1room-2').hide(); $('.1room-3').hide(); // hide them
          var rooms = $(this).val();
          while (rooms > 0) {
            $('.1room-' + rooms).fadeIn('slow');
            rooms--;
          }
          $('#1room-display').show();
        }
      );
    }
  );
