<%@ Page Title="" Language="C#" AutoEventWireup="false" Theme="Main_Theme" MasterPageFile="~/EmptyAjaxMaster.Master" CodeBehind="MetaSubTemplateEditor.aspx.cs" Inherits="MKinsight.Online.UIServices.Metabase.MetaSubTemplateEditor" MaintainScrollPositionOnPostback="true" %>

<%@ Register Src="~/UIControls/Metabase/MetabaseViewer.ascx" TagPrefix="uc1" TagName="MetabaseViewer" %>
<%@ Register Src="~/UIControls/MessageBox.ascx" TagPrefix="uc1" TagName="MessageBox" %>


<asp:Content ID="Content1" ContentPlaceHolderID="h" 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" />
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="cm" runat="server">
    <script>
        window.parent.parent.scrollTo(0, 0);

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

    <div>

        <uc1:MessageBox runat="server" ID="u_M" />
    </div>

    <div>
        <uc1:MetabaseViewer runat="server" ID="mb_Editor" />

    </div>

    <asp:Button ID="btn_MetadataSubElementOKClick" runat="server" Style="float: left" UseSubmitBehavior="false" />
    <asp:Button ID="btn_Delete" runat="server" ForeColor="Red" Style="float: right" />

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