function rentABikeBoxCustomer(){
  var box = jQuery('.rentabikeBox');
  if(jQuery('#rentabike_customer:checked').length>0){
      box.fadeIn();
  }else{
    box.fadeOut();
    jQuery("input[name*='body_height']").val('');
  }
}

function rentABikeBoxFellow(el){
  var header = jQuery('.showRentBikeHeader');
  var checkedInputs = jQuery(".booking .mitreisende input[name*='status']:checked");
  var inputs = jQuery(".booking .mitreisende input[name*='status']");
  
  if(checkedInputs.length>0){
    if(jQuery(':visible', header).length==0){
      header.fadeIn();
    }
  }
  
  inputs.each(function(){
    if( jQuery(this).is(':checked') && jQuery(this).parent().next('.showRentBike').not(':visible') ){
      jQuery(this).parent().next('.showRentBike').fadeIn();
    }else if( jQuery(this).parent().next('.showRentBike').is(':visible') ){
      jQuery(this).parent().next('.showRentBike').fadeOut();
    }
  });
  
  if(jQuery(".booking .mitreisende input[name*='status']:checked").length==0){
    header.fadeOut();
  }
  
}

jQuery.noConflict();
jQuery(document).ready(function(){
  rentABikeBoxCustomer();
  rentABikeBoxFellow();
  jQuery("#rentabike_customer").change(function(){
    rentABikeBoxCustomer();
  });
  
  if(jQuery(".booking input[name*='singleroom']").length==0){
    jQuery(".singleRoomCon").remove();
  }
  
  jQuery(".booking .mitreisende input[name*='status']").change(function(){
    rentABikeBoxFellow(this);
  });
});
