﻿$.changesPending = false;

function resetChangesPending() {
    $.changesPending = false;
}

function setChangesPending() {
    if (!$.changesPending) {
        $.changesPending = true;

        $('a').addClass('prompt');

        $('a.prompt').click(function() {
            if (!$(this).hasClass('ignore') && $.changesPending)
                return confirm("You are about to navigate away from this page, all unsaved changes will be lost. Are you sure?");
        });
    }
}

function ConfirmDelete(value) {
    return confirm("Are you sure you want to delete this " + value + "?");
}

function DeleteNotAllowed() {
    return confirm("It is not possible to delete a Page that has Sub Pages. Delete all Sub Pages for this Page first.");
}

function ConfirmApproval() {
    return confirm("Are you sure you want to send this page for approval?");
}

function ConfirmReject() {
    return confirm("Are you sure you want to Reject this page?");
}
