var dontDelete = "extdbapp";

$('input[type=file]').change(function () {
    $('#path').val($('#fileUpload').val());
});

function openModal() {
    //var height = "480";
    var width = "640";
    var title = window.top.selectBackupLocation;
    var src = "Setting/ShellTreeView";
    openInModal('', src, title, width, '');
}
function setDataTo(object) {
    $('#path').val(object.object);
}
function save() {
    if ( $('#path').val() !== '') {
        var control = true;
        if (getQuery('type') === 2) {
            if ($('#path').val().toLowerCase().indexOf(dontDelete) <= 0) {

                if (confirm(window.top.attentionIrreversible)) {
                    control = true;
                    if (confirm(window.top.destroyData)) {
                        control = true;
                    }
                    else
                        control = false;
                }
                else
                    control = false;
            }
            else {
                showMsgModal(0, window.top.addressNotRetrieve);
                control = false;
            }
        }
        if (control) {
            ajax({
                loading: true,
                url: "GeneralApi/SaveBackUpRestor",
                data: { path: $('#path').val(), type: getQuery('type') || 1 },
                success: function (result) {
                    if (result)
                        showMsgModal(2, window.top.savedSuccessfully);
                }
            });
        }
    }
    else {
        alert(window.top.specifyPath)
    }
}