// script for updating/saving project request pages
$(function() {
    $.fn.checkChanges = function() {

        var _self = this;

        $(_self).on('keyup change keydown', function(e) {
            $('body').addClass('changedInput');

        });


        $(window).on('beforeunload ', function() {
            if ($('.changedInput').length) {
                saveWizardPage(currSaveIndex, false);
            }
        });
    };

    $.fn.checkDelete = function() {

        var _self = this;

        $(_self).on('click', function(e) {
            $('body').addClass('changedInput');

        });
    };

    $('input, textarea').checkChanges();
    $('a.delete').checkDelete();
});
