// A utiliser sur les liens de retour
function Annulation(url) {

    var popup = '<div class="modalAnnulation modal fade" tabindex="-1" role="dialog">' +
        '<div class="modal-dialog" role="document">' +
        '<div class="modal-content">' +
        '<div class="modal-header">' +
        '<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>' +
        '<h4 class="modal-title">Annulation</h4>' +
        '</div>' +
        '<div class="modal-body">' +
        '<p>Vous risquez de perdre les donn&eacute;es non sauvegard&eacute;es. Etes vous s&ucirc;r de vouloir continuer ?</p>' +
        '</div>' +
        '<div class="modal-footer">' +
        '<button type="button" class="btn btn-default" data-dismiss="modal">Fermer</button>' +
        '<a href="' + url + '" class="btn btn-primary">Continuer</a>' +
        '</div>' +
        '</div>' +
        '</div>' +
        '</div>';

    if (!$(".modalAnnulation").length > 0) {
        $('body').append(popup);
    } else {
        $(".modalAnnulation").replaceWith(popup);
    }

    $(".modalAnnulation").modal('show');
}

// A utiliser sur des suppressions directes sans page de récapitulatif
function Suppression(url) {

    var popup = '<div class="modalSuppresion modal fade" tabindex="-1" role="dialog">' +
        '<div class="modal-dialog" role="document">' +
        '<div class="modal-content">' +
        '<div class="modal-header">' +
        '<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>' +
        '<h4 class="modal-title">Suppression</h4>' +
        '</div>' +
        '<div class="modal-body">' +
        '<p>La suppression est d&eacute;finitive. Etes vous s&ucirc;r de vouloir continuer ?</p>' +
        '</div>' +
        '<div class="modal-footer">' +
        '<button type="button" class="btn btn-default" data-dismiss="modal">Fermer</button>' +
        '<a href="' + url + '" class="btn btn-primary">Continuer</a>' +
        '</div>' +
        '</div>' +
        '</div>' +
        '</div>';

    if (!$(".modalSuppresion").length > 0) {
        $('body').append(popup);
    } else {
        $(".modalSuppresion").replaceWith(popup);
    }

    $(".modalSuppresion").modal('show');
}
