<%--
  <copyright file="Upload.aspx" company="Microsoft">
    Copyright (C) Microsoft. All rights reserved.
  </copyright>
--%>
<%@ Page Language="C#" MasterPageFile="~/RemoteAccess.master" EnableEventValidation="false" Codebehind="Upload.aspx.cs" Inherits="Microsoft.WindowsServerSolutions.Web.FileAccess.UploadPage"%>

<%@ Register Assembly="WSSG.Web" Namespace="Microsoft.WindowsServerSolutions.Web.Controls"
    TagPrefix="cc" %>
<%@ Register Src="RichUpload.ascx" TagName="RichUpload" TagPrefix="uc1" %>
<%@ Import Namespace="Microsoft.WindowsServerSolutions.Web.FileAccess" %>
<%@ Import Namespace="Microsoft.WindowsServerSolutions.Web" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <cc:CssLoader ID="CssLoaderFS" runat="server" Src="css.css" />
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="PageContent" runat="server">
    <script type="text/javascript">
    //<![CDATA[
    function errorPanelShowError(msg) {
        var box = $R.messageBox(<%= Utils.JavaScriptHtmlMarkupGlobalString("UploadErrorTitle") %>, $R('<div class="multi-line">' + $R.escapeHtmlForDisplay(msg) + '</div>'),
             $R.MessageBoxLevel.Error, $R.MessageBoxButtons.Close);
        box.bind('keydown', function(e) {
            if (e.keyCode == 13) { // Dismiss On Enter
                box.collapse($R.MessageBoxResult.Close);
                return false; // Stop further Processing
            }
        });
        box.bind('lightbox-collapse', function() {
            box.remove();
        });
    }

    $R(function() {
        var oldRedirectFunc = $R.timeout.Redirect;
        $R.timeout.Redirect = function() {
            window.onbeforeunload = null;
            oldRedirectFunc();
        }

        $R.timeout.Initialize();
        $R.timeout.AttachEvents();

        $R("#PageInfo").text(<%= XssUtils.JavaScriptEncode(UploadDestinationDisplayText) %>);
    });
    //]]>
    </script>

    <uc1:RichUpload ID="RichUpload1" runat="server" />
</asp:Content>
