// ===== Scroll to Top ====
jQuery(document).ready(function () {
    jQuery(window).scroll(function () {
        if (jQuery(this).scrollTop() >= 50) {        // If page is scrolled more than 50px
            jQuery('#return-to-top').fadeIn(200);    // Fade in the arrow
        } else {
            jQuery('#return-to-top').fadeOut(200);   // Else fade out the arrow
        }
    });
    jQuery('#return-to-top').click(function () {      // When arrow is clicked
        jQuery('body,html').animate({
            scrollTop: 0                       // Scroll to top of body
        }, 1000);
    });
});

jQuery(document).ready(function () {
    jQuery(window).scroll(function () {
        if (jQuery(this).scrollTop() >= 50) {        // If page is scrolled more than 50px
            jQuery('#return_to_top').fadeIn(200);    // Fade in the arrow
        } else {
            jQuery('#return_to_top').fadeOut(200);   // Else fade out the arrow
        }
    });
    jQuery('#return_to_top').click(function () {      // When arrow is clicked
        jQuery('body,html').animate({
            scrollTop: 0                       // Scroll to top of body
        }, 1000);
    });
});
