<%@ page language="C#" autoeventwireup="true" inherits="admin_tupian_upload, Fm.Web" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    <link href="../admin/skin/css.css" rel="stylesheet" type="text/css" />
      <link href="/images/css/inbox.css"rel="stylesheet" type="text/css" />
    <script language=javascript>
    function Look()
    {
        var up=document.getElementById("FileUpload1");
        var img=document.getElementById("Image1");
        if(up.value!="")
        {
           img.src=up.value;
        }
    }
    //判断是否选择了图片
    function Yan()
    {
       var up=document.getElementById("FileUpload1");
       var thum=document.getElementById("Radio_Customize");
       if(thum.checked)
       {
            var h=document.getElementById("txt_height").value;
            var w=document.getElementById("txt_width").value;
            if(h=="")
            {
                alert("请输入自定义缩略图高度!");
                return false;
            }
            else if(w=="")
            {
                alert("请输入自定义缩略图宽度!");
                return false;
            }
            else if(up.value=="")
            {
                alert("请选择需要生成的图片!");
                return false;
            }
            else
            {
                return true;
            }
       }
       if(up.value=="")
       {
          alert("请选择需要生成的图片!");
          return false;
       }
       else
       {
           return true;
       }
    }
    //向父窗体返回缩略图路径
    function Return_url()
    {
         window.opener.GetPath(document.getElementById("Hidden1").value);
         this.close();
    }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table style="width:420px" align=center class="Ibx_gTable_Con">
            <tr>
                <td align="center">
                    图片上传</td>
            </tr>
            <tr>
                <td align="center">
                    <input id="Radio_Set" type="radio" name="thumnail" runat=server checked="true" />默认
                    <input id="Radio_Customize" type="radio" name="thumnail" runat=server />自定义
                    <input id="Radio_cause" type="radio" name="thumnail" runat=server />原图大小</td>
            </tr>
            <tr>
                <td align="center">
                    自定义缩略图:高:<input id="txt_height" type="text" runat=server style="width:60px" />宽:
                    <input id="txt_width" type="text" runat=server style="width:60px" /></td>
            </tr>
            <tr>
                <td>
<asp:FileUpload ID="FileUpload1" onchange="Look()" runat="server" Width="350px" /><asp:Button ID="Button1" OnClientClick="return  Yan()" runat="server" Text="上 传 " OnClick="Button1_Click" /></td>
            </tr>
            <tr>
                <td colspan="3" align=center>
                    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></td>
            </tr>
            <tr style="width:400px">
                <td align=center>
                    <img src="" id="Image1" width="400" height="300" runat="server" />
                    <input id="Hidden1" type="hidden" value="" runat="server" />
                    </td>
            </tr>
             <tr>
                <td align="center">
                    
                    <img src="skin/images/button_ok.gif" style="cursor:hand" onclick="Return_url()" /></td>
            </tr>
            
        </table>
    
    </div>
    </form>
</body>
</html>
