function deleteBudgetLimit(e) {
    var button = $(e.currentTarget);
    var budgetLimitId = button.data('budget-limit-id');
    var url = deleteBudgetLimitUrl.replace('REPLACEME', budgetId.toString();
    return false;
}

function createAltAvailableBudget(e) {
    $('#defaultModal').empty().load(createAltAvailableBudgetUri, function () {
        $('#defaultModal').modal('show');
    });
    return false;
}

function updateAvailableBudget(e) {
    var button = $(e.currentTarget);
    var abId = parseInt(button.data('id'));
    if (0 === abId) {
        $('#defaultModal').empty().load(createAvailableBudgetUri, function () {
            $('#defaultModal').modal('show');
        });
    }
    if (abId > 0) {
        // edit URL.
        $('#defaultModal').empty().load(editAvailableBudgetUri.replace('REPLACEME', abId), function () {
            $('#defaultModal').modal('show');
        });
    }
    return false;
}


function drawBudgetedBars() {
    "use strict";
    $.each($('.budgeted_bar'), function (i, v) {
        var bar = $(v);
        var budgeted = parseFloat(bar.data('budgeted'));
        var available = parseFloat(bar.data('available'));
        var budgetedTooMuch = budgeted > available;
        var pct;
        if (budgetedTooMuch) {
            // budgeted too much.
            pct = (available / budgeted) * 100;
            bar.find('.progress-bar-danger').css('width', pct + '%');
            bar.find('.progress-bar-warning').css('width', (100 - pct) + '%');
            bar.find('.progress-bar-info').css('width', 0);
        } else {
            pct = (budgeted / available) * 100;
            bar.find('.progress-bar-danger').css('width', 0);
            bar.find('.progress-bar-warning').css('width', 0);
            bar.find('.progress-bar-info').css('width', pct + '%');
        }
        //$('#budgetedAmount').html(currencySymbol + ' ' + budgeted.toFixed(2));
    });
}

function drawSpentBars() {
The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.