<%@ Page Language="C#" AutoEventWireup="false" MasterPageFile="~/SiteMaster.Master"
    Theme="Main_Theme" MaintainScrollPositionOnPostback="true" CodeBehind="NewRiskAssessmentPage.aspx.cs"
    Inherits="MKInsight.Online.RRAM2.RiskAssessment.NewRiskAssessmentPage" %>

<%@ Register Src="../UIControls/Header.ascx" TagName="Header" TagPrefix="uc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="../UIControls/MessageBox.ascx" TagName="MessageBox" TagPrefix="uc2" %>
<%@ Register Src="../UIControls/Assessment/AssessmentEditorControl.ascx" TagName="AssessmentEditorControl"
    TagPrefix="uc3" %>
<%@ Register Src="../UIControls/Assessment/AssessmentMessages.ascx" TagName="AssessmentMessages"
    TagPrefix="uc4" %>
<%@ Register Src="../UIControls/PopupsHandler.ascx" TagName="PopupsHandler" TagPrefix="uc5" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <style>
        html{
            padding-left:3px;
            width:99%;
        }
    </style>
    <script type="text/javascript">
        function setdata(value) {
            PageMethods.SetData(value);
        }
    </script>

    <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' });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="c_M" runat="server">
    <asp:Panel runat="server" ID="p_h">
    </asp:Panel>
    <asp:UpdatePanel ID="up_E" runat="server">
        <ContentTemplate>
            <uc2:MessageBox ID="usc_M" runat="server" />
            <asp:Panel ID="pnl_e" runat="server">
                <div style="text-align: center;">

                    <asp:LinkButton ID="lnk_ViewAll" ForeColor="Red" runat="server"></asp:LinkButton>
                    <hr class="ee" />
                </div>
            </asp:Panel>
            <div style="text-align: center;">
                <asp:Panel ID="pnl_eAll" runat="server" BorderWidth="1" BorderColor="Gray" Visible="false">
                    <div>
                        <h3>
                            <asp:Label ID="lbl_ETtile" runat="server"></asp:Label></h3>
                    </div>
                    <div>
                        <asp:Panel ID="pnl_eAC" runat="server">
                        </asp:Panel>
                        <div>
                            <hr class="ee" />
                        </div>
                        <div>
                            <asp:LinkButton ID="lnk_EHide" runat="server" ForeColor="Green"></asp:LinkButton>
                        </div>
                    </div>

                </asp:Panel>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>

    <asp:MultiView ID="mv" runat="server">
        <asp:View ID="v_Select" runat="server">
            <asp:Panel ID="pnl_M" runat="server">
                <table>
                    <tr>
                        <td>
                            <asp:Label ID="lbl_SelectItem" runat="server" Text="Select New Entity for assessment from the list below:"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <table>
                                <tr>
                                    <td>
                                        <asp:RadioButtonList ID="rdb_Selection" runat="server" AutoPostBack="true">
                                            <asp:ListItem Text="DirectEntityLinks" Value="0" Selected="True"></asp:ListItem>
                                            <asp:ListItem Text="OtherEntityLinks" Value="1"></asp:ListItem>
                                        </asp:RadioButtonList>
                                    </td>
                                </tr>

                            </table>

                            <table id="tb_direct" runat="server">

                                <tr>
                                    <td>
                                        <asp:DropDownList ID="drp_Entities" runat="server">
                                        </asp:DropDownList>
                                    </td>
                                </tr>

                            </table>
                            <table id="tb_indirect" runat="server">
                                <tr>
                                    <td>

                                        <uc5:PopupsHandler ID="ph_AU" runat="server" />

                                    </td>

                                </tr>
                                <tr>
                                    <td>
                                        <uc5:PopupsHandler ID="ph_PU" runat="server" />
                                    </td>

                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
                <hr class="ee" />
                <div style="padding-left: 10px;">
                    <asp:LinkButton ID="btn_Start" runat="server"></asp:LinkButton>
                    &nbsp;<asp:LinkButton ID="lbl_NewCancel" runat="server"></asp:LinkButton>
                </div>
            </asp:Panel>

        </asp:View>
        <asp:View ID="vtree" runat="server">
            <asp:Panel ID="pmT" runat="server" Height="400px" ScrollBars="Both">
                <div style="vertical-align: top;">
                    <asp:TreeView ID="PoupTree" runat="server" ExpandDepth="1" OnTreeNodePopulate="PopulateNode"
                        PathSeparator="|" ShowCheckBoxes="All" EnableClientScript="False" PopulateNodesFromClient="False">
                    </asp:TreeView>
                </div>
                <br />
            </asp:Panel>
            <br />
            <div class="footer">
                <asp:Button ID="btn_TreeOK" runat="server" />
            </div>
        </asp:View>

        <asp:View ID="v_A" runat="server">

            <div>
                <asp:Panel ID="pnl_AssessmentButtons" runat="server" CssClass="w-bar">
                    
                    <asp:LinkButton runat="server" ID="tbl_Back" CssClass="w-button" Style="background: url(../images/back32.png); ">
                        <asp:Label ID="tbl_BackLabel" runat="server"></asp:Label>
                    </asp:LinkButton>

                  
                    <asp:LinkButton runat="server" ID="tbl_Delete" CssClass="w-button" Style="background: url(../images/delete32.png); ">
                        <asp:Label ID="tbl_DeleteLabel" runat="server"></asp:Label>
                    </asp:LinkButton>

                    
                    <asp:LinkButton runat="server" ID="tbl_Reassign" CssClass="w-button" Style="background: url(../images/user32.png); ">
                        <asp:Label ID="tbl_ReassignLabel" runat="server"></asp:Label>
                    </asp:LinkButton>

                </asp:Panel>

                <asp:Panel ID="p_save" runat="server" CssClass="w-bar">
                    
                    <asp:LinkButton runat="server" ID="tbl_Save">
                        <asp:Label ID="tbl_SaveLabel" runat="server" CssClass="w-button"></asp:Label>
                    </asp:LinkButton>

                    
                    <asp:LinkButton runat="server" ID="tbl_Draft">
                        <asp:Label ID="tbl_DraftLabel" ForeColor="Orange" runat="server" CssClass="w-button"></asp:Label>
                    </asp:LinkButton>

                    
                    <asp:LinkButton runat="server" ID="tbl_Submit">
                        <asp:Label ID="tbl_SubmitLabel" ForeColor="Blue" runat="server" CssClass="w-button"></asp:Label>
                    </asp:LinkButton>

                   

                    <asp:LinkButton runat="server" ID="tbl_Approve">
                        <asp:Label ID="tbl_ApproveLabel" ForeColor="Green" runat="server" CssClass="w-button"></asp:Label>
                    </asp:LinkButton>
                  

                </asp:Panel>

                <cc1:ModalPopupExtender ID="mdp" runat="server" TargetControlID="btn_pHandler" PopupControlID="p_submit"
                    BackgroundCssClass="modalBackground">
                </cc1:ModalPopupExtender>

                <asp:Button ID="btn_pHandler" runat="server" Text="Button" Style="display: none;" />

                <asp:Panel ID="p_submit" runat="server" style="display:none;">
                    <table class="FlagTable" style="background-color: #EEEEEF">
                        <tr>
                            <td>
                                <asp:LinkButton ID="btn_SubmitGeneral" runat="server" OnClick="OnSubmitForGeneralApproval"></asp:LinkButton>
                                <p>
                                    <asp:Label ID="lbl_SubmitGeneralInfo" runat="server"></asp:Label>
                                </p>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <hr class="ee" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <p>
                                    <asp:Label ID="lbl_SendSpecific" runat="server"></asp:Label>
                                </p>
                                <p>
                                    <asp:DropDownList ID="drp_Users" runat="server"></asp:DropDownList>
                                </p>
                                <p>
                                    <asp:Label ID="lbl_SendSpecificLabel" runat="server"></asp:Label>
                                </p>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Button ID="btn_Submit" runat="server" OnClick="OnSubmitForApproval" />
                                <asp:Button ID="btn_SubmitCancel" runat="server" OnClick="OnSubmitCancel" />
                            </td>
                        </tr>
                    </table>
                    <br />
                </asp:Panel>

                <uc4:AssessmentMessages ID="usc_AM" runat="server" />
                <uc3:AssessmentEditorControl ID="usc_A" runat="server" />
                <div style="height:300px;"></div>
            </div>




        </asp:View>
    </asp:MultiView>

    <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>
