//
jQuery(document).ready(function($) {

  // nivo slider
  $(window).load(function() {
    $('#slider').nivoSlider({effect:'fade', animSpeed:500, pauseTime:5000, directionNav:false, controlNav:true});
  });
  
  // booking
  $('a.open-close-form').click(function(e) {
    $('.booking-form').slideToggle();
    e.preventDefault();
  });

  // rooms slider
  $( "#my-slider" ).slider({
    min: 18,
    max: 1604,
    value: 18,
    slide: function(event, ui) {$('.nom').text(ui.value)},
    change: function(event, ui) {
      var the_value = $("#my-slider").slider("value");
            
      $('.rooms .page').each(function(index) {
        
        the_size = $(this).parent().attr('class');
        var the_real_size = the_size.substr(5);
        
        if ( the_value > the_real_size ) {
          $(".size-"+the_real_size).hide();
        }
        else {
          $(".size-"+the_real_size).show();
        }
      });
  
    }
  });

}); 










