function randomizeBackground() {
    var backgroundHtml = "images/Background";
    var backgroundIndex = "1";
    var random = Math.floor(Math.random() * 90);

    if (random > 83) {
        backgroundIndex = "4";
    }
    else if (random > 71) {
        backgroundIndex = "3";
    }
    else if (random > 47) {
        backgroundIndex = "2";
    }
    else {
        backgroundIndex = "1";
    }

    backgroundHtml += backgroundIndex;
    backgroundHtml += ".jpg";

    return backgroundHtml;
}

function resize() {
    $("body").width($(window).width() * .9);
    $("body").height($(window).height() * .9);
    $("body").css("line-height", $("body").height() + "px");
}

jQuery(document).ready(function () {
    $("#butterfly").attr("src", randomizeBackground());
    resize();
    $(window).resize(function () {
        resize();
    });
});
