<%@ Page Title="" Language="C#" MasterPageFile="~/SiteMaster.Master" AutoEventWireup="true" CodeBehind="ControlCustomViewPage.aspx.cs" Inherits="MKInsight.Online.RRAM2.ControlsPrposedAndStandardControls.ControlCustomViewPage" %>

<%@ Register Src="../UIControls/Header.ascx" TagName="Header" TagPrefix="uc1" %>
<%@ Register Src="../UIControls/MessageBox.ascx" TagName="MessageBox" TagPrefix="uc2" %>
<%@ Register Assembly="UIWebControls" Namespace="UIWebControls" TagPrefix="cc4" %>
<%@ Register Src="../UIControls/PopupsHandler.ascx" TagName="PopupsHandler" TagPrefix="uc4" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="../UIControls/PopupPanel.ascx" TagName="PopupPanel" TagPrefix="uc5" %>
<%@ Register Assembly="UIWebControls" Namespace="UIWebControls" TagPrefix="cc4" %>
<%@ Register Src="../UIControls/MKControls/ControlsAuditTrail.ascx"
    TagName="ControlsAuditTrail" TagPrefix="uc6" %>
<%@ Register Src="../UIControls/Interface/LabelEx.ascx" TagName="LabelEx" TagPrefix="uc7" %>
<%@ Register Src="../UIControls/Interface/TextBoxEx.ascx" TagName="TextBoxEx" TagPrefix="uc8" %>
<%@ Register Src="../UIControls/Interface/MultilineTextBoxEx.ascx" TagName="MultilineTextBoxEx" TagPrefix="uc9" %>
<%@ Register Src="~/UIControls/Metabase/MetabaseViewer.ascx" TagPrefix="uc1" TagName="MetabaseViewer" %>

<%@ Register Src="../UIControls/EntityLibrary/EntityEffectiveness.ascx" TagName="EntityEffectiveness" TagPrefix="uc3" %>

<%@ Register Src="../UIControls/EntityLibrary/ManagedItemsState.ascx" TagName="ManagedItemsState" TagPrefix="uc10" %>

<%@ Register Src="../UIControls/ControlSection/ControlButtonActions.ascx" TagName="ControlButtonActions" TagPrefix="uc11" %>
<%@ Register Assembly="MKinsight.Online.UIServices" Namespace="Geekees.Common.Controls" TagPrefix="ct" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" src="../scripts/jquery/jquery_min.js"></script>
    <script type="text/javascript" src="../scripts/jquery/jquery.box-min.js"></script>
    <link rel="stylesheet" type="text/css" href="../scripts/jquery/jqbox.css" />

    <script type="text/javascript" src="../scripts/ASTJavascript/astreeview/astreeview_packed.js"></script>
    <link rel="stylesheet" type="text/css" href="../scripts/ASTJavascript/astreeview/astreeview.css" />
    <link rel="stylesheet" type="text/css" href="../scripts/ASTJavascript/asdropdowntreeview/dropdowntreeview.css" />

    <script>
        $(document).bind('cbox_open', function () {
            $('html').css({ overflow: 'hidden' });
        }).bind('cbox_closed', function () {
            $('html').css({ overflow: 'auto' });
        });

        function resizeIframe2(obj) {
            obj.style.height = obj.contentWindow.document.body.scrollHeight + 20 + 'px';
        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="c_M" runat="server">

    <asp:UpdatePanel ID="up_n" runat="server">

        <ContentTemplate>
            <uc1:Header ID="usc_Header" runat="server" />

            <uc2:MessageBox ID="usc_M" runat="server" />

            <asp:MultiView ID="mv" runat="server">

                <asp:View ID="vMain" runat="server">
                    <uc10:ManagedItemsState ID="u_manage" runat="server" />

                    <table id="tb_RiskUniverse" runat="server" style="width: 100%;">
                        <tr runat="server" id="tr_Menu">
                            <td class="left" colspan="2" style="border-top-width: 1px; border-top-color: black; height: 42px; background-color: whitesmoke; vertical-align: top;">

                                <asp:Panel ID="pn_Menu" runat="server" CssClass="w-bar">

                                    <asp:LinkButton runat="server" ID="tbl_New" CssClass="w-bar-item w-button" Style="background: url(../images/add32.png); background-repeat: no-repeat;">
                                        <asp:Label ID="tbl_NewLabel" runat="server"></asp:Label>
                                    </asp:LinkButton>

                                    <asp:LinkButton runat="server" ID="tbl_Search" CssClass="w-bar-item w-button" Style="background: url(../images/search32.png); background-repeat: no-repeat;">
                                        <asp:Label ID="tbl_SearchLabel" runat="server"></asp:Label>
                                    </asp:LinkButton>                                                                      

                                    <asp:LinkButton runat="server" ID="tbl_Import" CssClass="w-bar-item w-button" Style="background: url(../images/importreport32.png); background-repeat: no-repeat;" OnClientClick="$.colorbox({ transition: 'none', width: '95%', height: '95%', iframe: true,href:'ImportManagedControl.aspx?t=25' });  return false;">
                                        <asp:Label ID="tbl_ImportLabel" runat="server"></asp:Label>
                                    </asp:LinkButton>

                                    <asp:LinkButton runat="server" ID="tbl_ManagedStates" CssClass="w-bar-item w-button" Style="background: url(../images/elb32.png); background-repeat: no-repeat;">
                                        <asp:Label ID="tbl_ManagedStatesLabel" runat="server"></asp:Label>
                                    </asp:LinkButton>

                                    <asp:LinkButton runat="server" ID="tbl_UserEdit" CssClass="w-bar-item w-button" Style="background: url(../images/user32.png); background-repeat: no-repeat;" OnClientClick="$.colorbox({ transition: 'none', width: '95%', height: '95%', iframe: true,href:'ControlUserEditPage.aspx' });  return false;">
                                        <asp:Label ID="tbl_UserEditLabel" runat="server"></asp:Label>
                                    </asp:LinkButton>

                                </asp:Panel>

                            </td>
                        </tr>
                        <tr>
                            <td class="left" style="vertical-align: top;">


                                <cc4:MKGridView ID="dg_CS" runat="server" AllowPaging="True" AllowSorting="True"
                                    AutoGenerateColumns="False" BorderStyle="None" CellPadding="3" DataKeyNames="ID"
                                    OnRowDataBound="OnRowDataBound">
                                    <AlternatingRowStyle CssClass="alternatingrowstyle" />
                                    <FooterStyle BackColor="White" ForeColor="#000066" />
                                    <HeaderStyle CssClass="headerstyle" Font-Bold="True" HorizontalAlign="Left" Wrap="False" />
                                    <PagerStyle HorizontalAlign="Left" />
                                    <Columns>
                                        <asp:CommandField HeaderText="Select" ShowSelectButton="True" />
                                        <asp:BoundField DataField="ID" HeaderText="RiskControlsUniqueReference" SortExpression="ID" />
                                        <asp:BoundField DataField="RiskName" HeaderText="RiskName" SortExpression="RiskName">
                                            <ItemStyle Width="200px" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="Name" HeaderText="RiskControlsName" SortExpression="Name" />
                                        <asp:BoundField DataField="Ref" HeaderText="RiskControlsReference" SortExpression="Ref" />

                                        <asp:BoundField DataField="RAGStatusName" HeaderText="RiskControlsRAG" SortExpression="RAGStatusName" />
                                        <asp:BoundField DataField="StatusName" HeaderText="RiskControlsStatus" SortExpression="StatusName" />
                                        <asp:BoundField DataField="NextReviewDate" DataFormatString="{0:dd/MM/yyyy }" HeaderText="RiskControlsNextReviewDate"
                                            SortExpression="NextReviewDate" />
                                        <asp:BoundField DataField="LastReviewed" DataFormatString="{0:dd/MM/yyyy }" HeaderText="RiskControlsLastReviewed"
                                            SortExpression="LastReviewed" />
                                    </Columns>
                                    <PagerTemplate>
                                        <asp:Label ID="lbl_ShowRows" runat="server" Text="Show rows:" />
                                        <asp:DropDownList ID="ddlPageSize" runat="server" AutoPostBack="true" OnSelectedIndexChanged="OnSelectedIndexChanged">
                                            <asp:ListItem Value="10" />
                                            <asp:ListItem Value="20" />
                                            <asp:ListItem Value="50" />
                                            <asp:ListItem Value="100" />
                                            <asp:ListItem Value="150" />
                                            <asp:ListItem Value="500" />
                                        </asp:DropDownList>
                                        &nbsp;&nbsp;<asp:Label ID="lbl_page" runat="server" Text="Page" />
                                        <asp:TextBox ID="txtGoToPage" runat="server" AutoPostBack="true" CssClass="gotopage"
                                            OnTextChanged="GoToPageOnTextChanged" />
                                        <asp:Label ID="lbl_Of" runat="server" Text="of" />
                                        <asp:Label ID="lblTotalNumberOfPages" runat="server" />
                                        &nbsp;&nbsp;<asp:Button ID="btn_p" runat="server" CommandArgument="Prev" CommandName="Page"
                                            CssClass="previous" SkinID="_" ToolTip="Previous Page" />
                                        <asp:Button ID="btn_n" runat="server" CommandArgument="Next" CommandName="Page" CssClass="next" SkinID="_"
                                            ToolTip="Next Page" />
                                    </PagerTemplate>
                                    <SelectedRowStyle BackColor="#D6E8FF" />
                                </cc4:MKGridView>

                                <asp:Panel ID="pv" runat="server" Visible="False">
                                    
                                    <asp:Panel ID="tbM" runat="server" CssClass="w-bar">

                                        <asp:LinkButton runat="server"  CssClass="w-bar-item w-button" ID="tbl_Details" Style="background: url(../images/detail32.png); background-repeat: no-repeat;">
                                            <asp:Label ID="tbl_DetailsLabel" runat="server"></asp:Label>
                                        </asp:LinkButton>

                                        <asp:LinkButton runat="server"  CssClass="w-bar-item w-button" ID="tbl_Meta" Style="background: url(../images/metabase32.png); background-repeat: no-repeat;">
                                            <asp:Label ID="tbl_MetaLabel" runat="server"></asp:Label>
                                        </asp:LinkButton>

                                        <asp:LinkButton runat="server"  CssClass="w-bar-item w-button" ID="tbl_ManagedMeta" Style="background: url(../images/magnagedMetabase32.png); background-repeat: no-repeat;">
                                            <asp:Label ID="tbl_ManagedMetaLabel" runat="server"></asp:Label>
                                        </asp:LinkButton>

                                        <asp:LinkButton runat="server"  CssClass="w-bar-item w-button" ID="tbl_AuditTrail" Style="background: url(../images/history32.png); background-repeat: no-repeat;">
                                            <asp:Label ID="tbl_AuditTrailLabel" runat="server"></asp:Label>
                                        </asp:LinkButton>

                                    </asp:Panel>

                                    <asp:Panel ID="pn_a_1" runat="server">

                                        <uc11:ControlButtonActions ID="u_a_1" runat="server" />

                                    </asp:Panel>

                                    <table>
                                        <tr>
                                            <td style="vertical-align: top">
                                                <asp:Panel ID="pn_Details" runat="server">
                                                </asp:Panel>
                                            </td>
                                            <td style="vertical-align: top">

                                                <cc1:CollapsiblePanelExtender ID="u_cp" runat="server" CollapseControlID="p_cp"
                                                    CollapsedImage="../images/close16.png" ExpandControlID="p_cp" ExpandedImage="../images/close16.png"
                                                    ImageControlID="img_Types" TargetControlID="p_pc"
                                                    Collapsed="true" ExpandDirection="Horizontal">
                                                </cc1:CollapsiblePanelExtender>

                                                <asp:Panel ID="p_cp" runat="server">
                                                    <asp:ImageButton ID="img_Types" runat="server" ImageUrl="../images/close16.png" OnClick="img_Types_Click" />
                                                </asp:Panel>
                                                <asp:Panel ID="p_pc" runat="server">
                                                    <asp:Literal ID="lit_pControls" runat="server"> </asp:Literal>
                                                </asp:Panel>
                                            </td>
                                        </tr>
                                    </table>


                                    <uc3:EntityEffectiveness ID="u_cm" runat="server" />

                                    <asp:Panel ID="pn_Meta" runat="server" Visible="false">
                                        <uc1:MetabaseViewer runat="server" ID="mb_Metadata" />

                                    </asp:Panel>
                                    <asp:Panel ID="pn_Managedmetadata" runat="server" Visible="false">
                                        <uc1:MetabaseViewer runat="server" ID="mb_Managedmetadata" />
                                    </asp:Panel>

                                    <asp:Panel ID="pn_a_2" runat="server">

                                        <uc11:ControlButtonActions ID="u_a_2" runat="server" />

                                    </asp:Panel>

                                </asp:Panel>

                            </td>

                        </tr>
                    </table>
                </asp:View>
                <asp:View ID="vSearch" runat="server">
                    <div>
                        <asp:Panel ID="p_Search" runat="server">
                            <table>
                                <tr>
                                    <td colspan="2">
                                        <uc8:TextBoxEx ID="u_SRef" runat="server" />
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <uc8:TextBoxEx ID="u_SName" runat="server" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="left" colspan="2">
                                        <uc4:PopupsHandler ID="ph_SRAG" runat="server" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="left" colspan="2">
                                        <uc4:PopupsHandler ID="ph_SS" runat="server" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="left" colspan="2">
                                        <uc4:PopupsHandler ID="ph_SNRD" runat="server" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class=" " colspan="2" style="vertical-align: top;">
                                        <hr class="ee" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="left" colspan="2" style="vertical-align: top;">
                                        <asp:Button ID="btn_SSearch" runat="server" Text="Add" />
                                        <asp:Button ID="btn_SClear" runat="server" Text="Clear" />
                                        <asp:Button ID="btn_SCancel" runat="server" Text="Cancel" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="left" colspan="2" style="vertical-align: top;">&nbsp;
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                    </div>
                </asp:View>
                <asp:View ID="v_History" runat="server">
                    <div>
                        <asp:Button ID="btn_HCancel" runat="server" Text="Cancel" />
                    </div>
                    <hr class="ee" />
                    <div>
                        <uc6:ControlsAuditTrail ID="usc_History" runat="server" />
                    </div>
                </asp:View>
            </asp:MultiView>
            <asp:Button ID="btn_pHandler" runat="server" Text="Button" Style="display: none;" />
            <asp:Panel ID="p" runat="server" CssClass="frame" Style="display: none;">
                <div class="overlay">
                    <div style="float: right; margin-top: -28px; margin-right: -10px;">
                        <asp:ImageButton ID="ImageButton1" ImageUrl="~/images/jq/close.png" runat="server" />
                    </div>

                    <div class="floatright">
                        <asp:Button ID="btn_TopOK" runat="server" />
                    </div>
                    <uc5:PopupPanel ID="usc_PP" runat="server" />
                    <div class="divpok">
                        <asp:Button ID="btn_POK" runat="server" />
                    </div>
                </div>
            </asp:Panel>
            <cc1:ModalPopupExtender ID="mdp" runat="server" TargetControlID="btn_pHandler" PopupControlID="P"
                BackgroundCssClass="modalBackground">
            </cc1:ModalPopupExtender>
            <cc1:DragPanelExtender ID="dpE" runat="server" DragHandleID="pnlHeader" TargetControlID="p" />
        </ContentTemplate>

    </asp:UpdatePanel>
    <asp:UpdateProgress ID="pr" runat="server" AssociatedUpdatePanelID="up_n" DisplayAfter="40">
        <ProgressTemplate>
            <div class="UpdateProgressBackground">
                <center>
                    <div class="UpdateProgressContent">
                        <h3>
                            <asp:Label ID="lbl_Wait" runat="server"></asp:Label></h3>
                        <br />
                        <img id="Img1" src="~/images/ajax.gif" alt="" runat="server" />
                    </div>
                </center>
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <script>
        try {
            $(document).ready(function () {

                var xPos1, yPos1, timer1;

                var prm = Sys.WebForms.PageRequestManager.getInstance();
                prm.add_beginRequest(BeginRequestHandler);
                prm.add_endRequest(EndRequestHandler);

                function BeginRequestHandler(sender, args) {

                    try {
                        yPos1 = $(window).scrollTop();
                    } catch (err) { }
                }

                function EndRequestHandler(sender, args) {
                    try {
                        $(window).scrollTop(yPos1);
                        timer1 = window.setTimeout(function () { $(window).scrollTop(yPos1); }, 100);

                        $(window).scrollTop(yPos1);
                    }
                    catch (err) { }
                }

            });
        }
        catch (err) { }

    </script>
</asp:Content>
