function showShelf(id) { $(id).show(); }

function setShelf(s) {

    if (ews && ews.Editor) {
        ews.Editor.NextLoadJavascript("showShelf('" + s + "')");
        ews.Editor.Layout();
    }
}

$(document).ready(function () {
    $('#shelf-link').click(function (event) {
        $('#top-shelf-content').slideToggle('slow', function () { setShelf("#top-shelf-content"); });
        $('#shelf-link').toggleClass('open');
    });

    $('#ewsmenu_utilities li:first').addClass('first');

    $('#home-buttons div a div div').append('<span></span>');

    if ($('.thebgimage img').length > 0) {

        if ($('.thebgimage img').attr("src")) {
            var imgUrl = $('.thebgimage img').attr("src");


            $('body').css({ 'background-image': 'url(' + imgUrl + ')', 'background-position': 'top center', 'background-repeat': 'no-repeat' });


            $('#wrapper').css({
                "background": 'none'

            });


        }


    }

}); 
