<%@ Page Title="" Language="C#" AutoEventWireup="false" CodeBehind="ProfileImageEditor.aspx.cs" Inherits="MKinsight.Online.UIServices.ProfileImageEditor" %>

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


<!DOCTYPE html >
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Crop Image</title>
    <meta http-equiv="cache-control" content="no-store" />
    <link href="../scripts/jquery/jquery.Jcrop.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../scripts/jquery/jquery_min.js"></script>
    <script type="text/javascript" src="../scripts/jquery/jquery.Jcrop.js"></script>
    <script type="text/javascript">

        jQuery.browser = {};
        (function () {
            jQuery.browser.msie = false;
            jQuery.browser.version = 0;
            if (navigator.userAgent.match(/MSIE ([0-9]+)\./)) {
                jQuery.browser.msie = true;
                jQuery.browser.version = RegExp.$1;
			}
        })();

        jQuery(document).ready(function () {
            jQuery('#imgCrop').Jcrop({
                onSelect: storeCoords
            });
        });

        function storeCoords(c) {
            jQuery('#X').val(c.x);
            jQuery('#Y').val(c.y);
            jQuery('#W').val(c.w);
            jQuery('#H').val(c.h);
        };


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

		}


    </script>
</head>
<body>
    <form id="form1" runat="server">
        <uc1:Header runat="server" ID="u_H" />



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



        <div>
            <asp:Panel ID="pnlUpload" runat="server">
                <asp:FileUpload ID="Upload" runat="server" />
                <br />
                <asp:Button ID="btnUpload" runat="server" OnClick="btnUpload_Click" Text="Upload" />
                <asp:Label ID="lblError" runat="server" Visible="false" />
            </asp:Panel>
            <asp:Panel ID="pnlCrop" runat="server" Visible="false">
                <asp:Image ID="imgCrop" runat="server" />
                <br />
                <asp:HiddenField ID="X" runat="server" />
                <asp:HiddenField ID="Y" runat="server" />
                <asp:HiddenField ID="W" runat="server" />
                <asp:HiddenField ID="H" runat="server" />
                <asp:Button ID="btnCrop" runat="server" Text="Crop" OnClick="btnCrop_Click" />
            </asp:Panel>
            <asp:Panel ID="pnlCropped" runat="server" Visible="false">
                <asp:Image ID="imgCropped" runat="server" />
            </asp:Panel>
        </div>
    </form>
</body>
</html>
