function marketr_mobile_menu_open() {
  jQuery(".side_nav").addClass('show');
}
function marketr_mobile_menu_close() {
  jQuery(".side_nav").removeClass('show');
}

jQuery("#return-to-top").click(function () {
    jQuery("html, body").animate({ scrollTop: 0 }, 600);
});

var marketr_Keyboard_loop = function (elem) {
  var marketr_tabbable = elem.find('select, input, textarea, button, a').filter(':visible');
  var marketr_firstTabbable = marketr_tabbable.first();
  var marketr_lastTabbable = marketr_tabbable.last();
  marketr_firstTabbable.focus();

  marketr_lastTabbable.on('keydown', function (e) {
    if ((e.which === 9 && !e.shiftKey)) {
      e.preventDefault();
      marketr_firstTabbable.focus();
    }
  });

  marketr_firstTabbable.on('keydown', function (e) {
    if ((e.which === 9 && e.shiftKey)) {
      e.preventDefault();
      marketr_lastTabbable.focus();
    }
  });

  elem.on('keyup', function (e) {
    if (e.keyCode === 27) {
      elem.hide();
    };
  });
};


jQuery(window).scroll(function () {
    if (jQuery(this).scrollTop() >= 200) {
        jQuery("#return-to-top").fadeIn();
    } else {
        jQuery("#return-to-top").fadeOut();
    }
});