
// Resize height of background on page load
$(document).ready(function() {
    // Set the heights once more 
     adjustHeights();
     // call light box
     $(".share-this-page").colorbox({width:"412px", height:"565px", iframe:true});
     $(".subscribe-for-updates").colorbox({width:"422px", height:"345px", iframe:true});
     $(".first.where-to-buy").colorbox({width:"722px", height:"650px", iframe:true});
     
});
// Reset background height
function adjustHeights() {
    // Run JQuery
    $(document).ready(function() {
        // Get content height
        mainBodyHeight = $("#mainBody").height();
        // Get window height
        windowHeight = $(window).height();
        // Check if content height is bigger than window height
        if (mainBodyHeight > windowHeight) {
            mHeight = mainBodyHeight;
        }
        else {
            mHeight = windowHeight;
        }
        // Reset height in CSS file
        $("#background-left, #background-right").height(mHeight);  // Set both to equal height
    });
}
// Resize height of background on page resize
$(window).resize(function() {
    adjustHeights();  // Set the heights once more
});