function myRender() {



    /*



    menu:           #mjs-widget_6377



    background image:   #mjs-object_4192



    background overlay: #mjs-object_6426



    logo:           #mjs-object_6394



    reservation:        #mjs-widget_6378



    share btns:     #mjs-widget_6470, #mjs-widget_6471, #mjs-widget_6472, #mjs-widget_6473



    */



    var width = $(window).width(),



        height = $(window).height(),



        menu_height = $('#mjs-widget_6377').height(),



        logo_height = $('#mjs-object_6394').height(),



        share_height = $('#mjs-widget_6470').height(),







        url = $('#mjs-object_4192 img').attr('src'),







        share_top =  height - 20 - $('#mjs-widget_6470').height(),



        reservation_top = share_top - $('#mjs-widget_6378').height() - 10,



        logo_top = menu_height + (reservation_top - menu_height - logo_height) / 2;







    reservation_top = logo_top + (2 * height - logo_top + logo_height / 2 - reservation_top) / 2 - 50;







    // remove image



    $('#mjs-object_4192 .mjs-image-wrap').hide();   







    // resize image box



    $('#mjs-object_4192').css({



        'width': width,



        'height': height,



        'top': 0



    });



    $('#mjs-object_4192 .mjs-rel-wrapper').css({



        'width': width,



        'height': height



    });







    // make background fit window



    $('#mjs-object_4192 .mjs-rel-wrapper').css('background', 



        'url(' + url + ') 50% 50% / cover no-repeat');







    //resize overlay div



    $('#mjs-object_6426').css({



        'width': width,



        'height': height,



        'top': 0



    });







    // logo



    $('#mjs-object_6394').css('top', logo_top);







    // arage reservation button



    $('#mjs-widget_6378').css('top', reservation_top);







    // arange share buttons



    $('#mjs-widget_6470, #mjs-widget_6471, #mjs-widget_6472, #mjs-widget_6473').css('top', share_top -20);




 // replace background steak sencond time
    var steak_back = 'http://tacubanyc.com/images/TacubaHK1.jpg',
	menu_back = 'http://www.tacubanyc.com/food1.jpg';

    $(window).scroll(function (e) {
        var isVisible = isScrolledIntoView('#mjs-object_6961');
	    /*console.log(isVisible);*/
        if (isVisible) {
            $('#mjs-background img').attr('src', menu_back);
        } else {
            $('#mjs-background img').attr('src', steak_back);
        }
    });
}

function isScrolledIntoView(obj) {
    var docViewTop = $(window).scrollTop(),
        docViewBottom = docViewTop + $(window).height(),
        objTop = $(obj).offset().top,
        objBottom = objTop + $(obj).height();
    return objTop <= docViewBottom && objBottom >= docViewTop;
}

$(function() {
  $(window).off('resize').on('resize', myRender);
  myRender();
});




