<%@ Page Title="" Language="C#" MasterPageFile="~/SiteMaster.Master" AutoEventWireup="true" CodeBehind="TrackingEditorPage.aspx.cs" MaintainScrollPositionOnPostback="true" Inherits="MKInsight.Online.ActionTracking.TrackingPages.TrackingEditorPage" %>

<%@ Register Src="../UIControls/MessageBox.ascx" TagName="MessageBox" TagPrefix="uc2" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="../UIControls/PopupPanel.ascx" TagName="PopupPanel" TagPrefix="uc15" %>
<%@ Register Src="../UIControls/TrackingControls/TrackingItemInfoControl.ascx" TagName="TrackingItemInfoControl" TagPrefix="uc4" %>
<%@ Register Src="../UIControls/TrackingControls/Views/ActionResultView.ascx" TagName="ActionResultView" TagPrefix="uc5" %>
<%@ Register Src="../UIControls/TrackingControls/Views/AllActionsView.ascx" TagName="AllActionsView" TagPrefix="uc6" %>
<%@ Register Src="~/UIControls/TrackingControls/NavigationMenu.ascx" TagPrefix="uc1" TagName="NavigationMenu" %>
<%@ 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>
    <script type='text/javascript' src="../scripts/popuppanel.js"></script>
    <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" />

    <style>
        .frame_x {
            background-color: #fff;
            border: solid 1px #D4DEE4;
            border-top: none;
        }

        td.valueField {
            width: 350px;
            color: red;
        }
    </style>
    <script type="text/javascript">

        function cb() {
            parent.$.colorbox.close();
            window.parent.location.href = window.parent.location.href;
        }

        function setdata(value) {
            PageMethods.SetData(value);
        }

        function SetObjectMethod(sender, value) {
            try {
                PageMethods.SetObjectD(sender.id, value, OnRequestComplete, OnRequestError);
            }
            catch (err) {

            }

        }

        function OnRequestError(error, userContext, methodName) {
        }

        function OnRequestComplete(result) {

            if (!result == "") {

                window.onbeforeunload = function (e) { if ((window.event.clientY < 0)) { return result; } };
                window.onbeforeunload = function () { var prm = Sys.WebForms.PageRequestManager.getInstance(); if (!prm._processingRequest) { return result; } };
                return true;
            }

            return false;

        }

        function clearlock() {
            alert('test');
        }
    </script>

    <link rel="stylesheet" type="text/css" href="../scripts/jquery/jqbox.css" />

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



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

</asp:Content>

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

    <asp:UpdatePanel ID="sup" runat="server">
        <ContentTemplate>


            <asp:Button ID="btn_partial_refresh" runat="server" OnClick="btn_partial_refresh_Click" Style="display: none;" />

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

            <asp:Panel ID="tb_A" runat="server" CssClass="w-bar" style="margin-top: 1px !important;">

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

                <asp:LinkButton runat="server" ID="tbl_RA" CssClass="w-button" Style="background: url(../images/recent32.png); " OnClick="OnViewClick">
                    <asp:Label ID="tbl_RALabel" runat="server"></asp:Label>
                </asp:LinkButton>

                <asp:LinkButton runat="server" ID="tbl_MA" CssClass="w-button" Style="background: url(../images/myactions32.png); " OnClick="OnViewClick">
                    <asp:Label ID="tbl_MALabel" runat="server"></asp:Label>
                </asp:LinkButton>

                <asp:LinkButton runat="server" ID="tbl_AA" CssClass="w-button" Style="background: url(../images/allactions32.png); " OnClick="OnViewClick">
                    <asp:Label ID="tbl_AALabel" runat="server"></asp:Label>
                </asp:LinkButton>

                <asp:LinkButton runat="server" ID="tbl_RE" CssClass="w-button" Style="background: url(../images/report32.png); " OnClick="OnViewClick">
                    <asp:Label ID="tbl_RELabel" runat="server"></asp:Label>
                </asp:LinkButton>

                <asp:LinkButton runat="server" ID="tbl_AuditReport" CssClass="w-button" Style="background: url(../images/AuditReport32.png); " PostBackUrl="~/AuditReport/AuditReportsPage.aspx?type=2">
                    <asp:Label ID="tbl_AuditReportLabel" runat="server"></asp:Label>
                </asp:LinkButton>

                <asp:LinkButton runat="server" ID="tbl_Info" CssClass="w-button" Style="background: url(../images/info32.png); " OnClientClick="$.colorbox({ transition: 'none', width: '95%',top:'10', height: '95%', iframe: true,href:'InformationPage.aspx' });return false;">
                    <asp:Label ID="tbl_InfoLabel" runat="server"></asp:Label>
                </asp:LinkButton>

            </asp:Panel>

            <table style="width: 100%">

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

                        <asp:HiddenField ID="width" runat="server" />
                        <script type="text/javascript">
                            $(document).ready(function () { document.getElementById('<%:width.ClientID%>').value = $(window).width(); });
                        </script>

                        <asp:Panel ID="p_L" runat="server">
                            <uc5:ActionResultView ID="u_RA" runat="server" />
                            <uc6:AllActionsView ID="u_AA" runat="server" />
                        </asp:Panel>

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

                        <asp:Panel ID="p_R" runat="server" CssClass="panel" Visible="false" Style="margin-top: -3px;">
                            <p>
                            </p>
                            <uc4:TrackingItemInfoControl ID="u_Info" runat="server" />

                            <div class="w-bar" runat="server" id="div_actionBar">
                              
                                <asp:LinkButton runat="server" ID="tbl_Save" OnClick="OnSave" CssClass="w-button" Style="background: url(../images/save32.png); " OnClientClick="window.onbeforeunload = function (e) { };">
                                    <asp:Label ID="tbl_SaveLabel" runat="server"  Font-Bold="true"></asp:Label>

                                </asp:LinkButton>


                                <asp:LinkButton runat="server" ID="tbl_Close" OnClick="OnCloseAction" CssClass="w-button" Style="background: url(../images/Close32.png); ">
                                    <asp:Label ID="tbl_CloseLabel" runat="server" ></asp:Label>

                                </asp:LinkButton>

                            
                                <asp:LinkButton runat="server" ID="tbl_MoveActions" Visible="false" CssClass="w-button" Style="background: url(../images/folder_up32.png); " OnClientClick="$.colorbox({ transition: 'none', width: '95%',top:'10', height: '95%', iframe: true,href:'MoveActionPage.aspx' });return false;">
                                    <asp:Label ID="tbl_MoveActionsLabel" runat="server" ></asp:Label>

                                </asp:LinkButton>

                            </div>

                            <asp:Panel ID="p_tree" runat="server" Visible="false">
                                <asp:TreeView runat="server" ID="tree" OnTreeNodePopulate="PopulateChildNodes"
                                    OnSelectedNodeChanged="OnSelectedNodeChanged">
                                </asp:TreeView>
                            </asp:Panel>

                            <uc1:NavigationMenu runat="server" ID="u_Toolbar" />

                            <asp:Panel ID="pn_F" runat="server">
                            </asp:Panel>

                            <asp:Panel ID="pn_C" runat="server"></asp:Panel>

                            <div class="w-bar" runat="server" id="div_actionBar2">
                               
                                <asp:LinkButton runat="server" ID="tbl_Save2" OnClick="OnSave" CssClass="w-button" Style="background: url(../images/save32.png); " OnClientClick="window.onbeforeunload = function (e) { };">
                                    <asp:Label ID="tbl_SaveLabel2" runat="server"  Font-Bold="true"></asp:Label>

                                </asp:LinkButton>
                                                             
                                <asp:LinkButton runat="server" ID="tbl_Close2" CssClass="w-button" Style="background: url(../images/Close32.png); " OnClick="OnCloseAction">
                                    <asp:Label ID="tbl_CloseLabel2" runat="server" ></asp:Label>

                                </asp:LinkButton>
                                                           
                                <asp:LinkButton runat="server" ID="tbl_MoveActions2" Visible="false" CssClass="w-button" Style="background: url(../images/folder_up32.png); " OnClientClick="$.colorbox({ transition: 'none', width: '95%',top:'10', height: '95%', iframe: true,href:'MoveActionPage.aspx' });return false;">
                                    <asp:Label ID="tbl_MoveActionsLabel2" runat="server" ></asp:Label>

                                </asp:LinkButton>

                            </div>

                        </asp:Panel>

                        <asp:UpdateProgress ID="pr" runat="server" AssociatedUpdatePanelID="sup"  DisplayAfter="200">
                            <ProgressTemplate>
                                <div class="UpdateProgressBackground">
                                    <center>
                                        <div class="UpdateProgressContent">
                                            <h3>
                                                <asp:Label ID="lbl_Wait" runat="server"></asp:Label></h3>
                                            <br />
                                            <img src="../images/ajax.gif" alt="" />
                                        </div>
                                    </center>
                                </div>
                            </ProgressTemplate>
                        </asp:UpdateProgress>

                        <cc1:ModalPopupExtender ID="mdp" runat="server" TargetControlID="btn_pHandler" PopupControlID="Pxc" RepositionMode="RepositionOnWindowScroll"
                            BackgroundCssClass="modalBackground_x" BehaviorID="ModalBehaviour">
                        </cc1:ModalPopupExtender>
                        <cc1:DragPanelExtender ID="dpE" runat="server" DragHandleID="pnlHeader" TargetControlID="pxc" />
                        <asp:Button ID="btn_pHandler" runat="server" Style="display: none;" />
                        <asp:Panel ID="Pxc" runat="server" CssClass="frame_x" Style="display: none; margin-top: 10px; position: fixed;">
                            <div class="overlay">

                                <uc15:PopupPanel ID="usc_PP" runat="server" />
                                <asp:Panel ID="p_t" runat="server" Height="200px" ScrollBars="Both">
                                    <asp:TreeView ID="PoupTree" runat="server" ExpandDepth="1" OnTreeNodePopulate="PopulateNode"
                                        PathSeparator="|" ShowCheckBoxes="All" EnableClientScript="False" PopulateNodesFromClient="False">
                                    </asp:TreeView>
                                </asp:Panel>

                                <div class="divpok">
                                    <asp:Button ID="btn_POK" runat="server" OnClick="OnOK" />
                                </div>

                            </div>

                        </asp:Panel>

                    </td>

                </tr>
            </table>

            <script>
                $(document).ready(function () {



                });
            </script>

        </ContentTemplate>

    </asp:UpdatePanel>

    <div style="height: 100px;"></div>
    <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>




