$(document).ready(function() {
  
  // Hide popups on mouseleave
  $(".faq-container .popup, .step-container .popup").mouseleave(function() {
    $(this).hide();
  });
  
  // Show popups inside the booking form
  $(".step-container .has-tips").focus(function() {
    $(this).next('.popup').hide().css({
      top: $(this).offset().top,
      left: $(this).offset().left + $(this).width(),
      position: 'absolute',
      display: 'block'
    }).show('fadeIn');
  }).blur(function() {
    $(this).next('.popup').hide();
  });

  // Show faq popups
  $(".faq-container ul li a").click(function() {
    $(this).closest('.faq-container').find('.popup').hide().removeClass("popped");
    $(this).next(".popup").addClass("popped").css({
      top: -89,
      left: -470,
      position: 'absolute',
      display: 'block'
    }).show('fadeIn');
    return false;
  });
  
  // Show colorbox when Read More buttons are clicked
  $(".box .bottom .read-more").each(function() {
   $(this).colorbox({html:$(this).next('.popup').html(), opacity:0.75, overlayClose: true, close:"Close"});
  });

});

