﻿var projectHost = window.location.protocol + "//" + window.location.host;
var clientIdPrefix = "ctl00_ctlPageContents_";
var startupParam = window.location.search;

function goPageExpired() {
    var t = window;
    if (t == t.parent) {
        t.location.href = projectHost + "/Mevzuat/islemler/main.aspx" + startupParam;
        return false;
    }

    while (t != t.parent) {
        t = t.parent;
    }

    t.location.href = projectHost + "/Mevzuat/default.aspx" + startupParam;
}

function resultMessage(result) {
    if (typeof (result.extraParamsResponse) != "undefined") {
        if (typeof (result.extraParamsResponse.msg) != "undefined") {
            Ext.MessageBox.show({ title: null, msg: result.extraParamsResponse.msg, icon: Ext.MessageBox.INFO, width: 300, buttons: Ext.MessageBox.OK });
        }

        if (typeof (result.extraParamsResponse.error) != "undefined") {
            Ext.MessageBox.show({ title: null, msg: result.extraParamsResponse.error, icon: Ext.MessageBox.ERROR, width: 300, buttons: Ext.MessageBox.OK });
        }

    }
}

function closeWindowGiveMessage(result) {
    window.parent.closeWindowGiveMessage(result);
}

function GiveMessage(result, mode) {
    resultMessage(result);
}

function checkGridSelection(grid) {
    if (grid.getSelectionModel().getSelected() == null) {
        Ext.MessageBox.show({ title: 'Mesaj', msg: "Lütfen işlem yapmak istediğiniz kaydı seçiniz", icon: Ext.MessageBox.INFO, width: 300, buttons: Ext.MessageBox.OK });
        return false;
    } else return true;
}

function deleteConfirm(msg) {
    return confirm(msg);
}

