<%@ Master Language="VB" AutoEventWireup="false" CodeBehind="ModalAdminPage.master.vb" Inherits="WebFoundations.WFPortal.UI.ModalAdminPage" %>
<%@ Register Src="~/WFAdmin/TagHeadAdmin.ascx" TagPrefix="wf" TagName="TagHeadAdmin" %>
<!DOCTYPE html>
<html>
<head runat="server">
    <title><%=Page.Title%></title>
    <wf:TagHeadAdmin runat="server" />
    <script type="text/javascript">
        function GetRadWindow() {
            var oWindow = null;
            try {
                if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
                else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;//IE (and Moz az well)
            } catch (error) { }
            return oWindow;
        }

        function CloseAndRebind() {
            try {
                var w = GetRadWindow();
                if (w) {
                    w.BrowserWindow.refreshGrid();
                    w.Close();
                } else {
                    w = window;
                    if (w) {
                        var o = w.opener;
                        if (o && o.refreshGrid) {
                            try {
                                o.refreshGrid();
                            } catch (error) { }
                        }
                        if (w && w.close) { w.close(); }
                    }
                }
            } catch (error) { }
        }

        function CloseAndRefresh(PartId, ObjectType, ProcessId) {
            CloseAndRebind();
        }

        function CancelEdit() {
            try {
                var w = GetRadWindow();
                if (w) {
                    w.Close();
                } else {
                    w = window;
                    if (w && w.close) { w.close(); }
                }
            } catch (error) { }
        }

        $(document).ready(function () {
            $("body").removeClass("loading");
        });
    </script>
    <asp:ContentPlaceHolder ID="TagHead" runat="server" />
</head>
<body class="wf-admin-modal loading">
    <form runat="server">
        <asp:ScriptManager runat="server" />
        <asp:ContentPlaceHolder ID="MainContent" runat="server" />
    </form>
</body>
</html>
