<%@ page language="C#" autoeventwireup="true" inherits="V5Shop.Admin.Template_Picture_Upload_Dialog, V5Shop.Shop.Template" enableviewstatemac="false" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<!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="../css/css.css" rel="stylesheet" type="text/css">
    <link href="../css/css_list.css" rel="stylesheet" type="text/css">
    <link href="../css/control.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" language="javascript" src="Control_Upload.js"></script>
    
</head>
<body>
    <form id="photoupload" runat="server">
        <div style="margin:5px;">
            <div align="left">
                <input type="hidden" name="FolderName" value="<%=FolderName %>" />
                <asp:FileUpload ID="FileUpload1" runat="server" />
            </div>
            <div align="left">
                <div class="note" id="photoupload-status"></div>
			    <ul class="photoupload-queue" id="photoupload-queue">
				    <li style="display: none" />
			    </ul>
            </div>
            <div align="left">
                <asp:Button ID="btnUpload" runat="server" Text="上传图片" CssClass="button" />
            </div>
        </div>
    </form>
    
    <script language="javascript">
        var isFF = false;
        //if (navigator.appVersion.indexOf("MSIE") == -1){
	    //    isFF = true;
	    //}else{
	        if($('FileUpload1')){
	            window.addEvent('load', function()
	            {
		            var input = $('FileUpload1');
		            var uplooad = new FancyUpload(input, {
			            swf: 'Swiff.Uploader.swf',
			            queueList: 'photoupload-queue',
			            container: $E('h1'),
			            buttonName : "请选择您要上传的图片",
			            txtUploading : "图片正在上传中...",
			            txtUploadFail : "上传失败",
			            txtUploadSuccess : "图片上传成功！",
			            onAllComplete : aaaa
		            });

		            $('photoupload-status').adopt(new Element('a', {
			            href: 'javascript:void(null);',
			            events: {
				            click: uplooad.clearList.bind(uplooad, [false])
			            }
		            }).setHTML(''));
	            });
	        }
	    //}
	    function aaaa()
	    {
	        alert('图片批量上传成功！');
	        window.opener.location.href="<%=url %>";
	        window.close();
	        
	    }
	    
	    //function   window.onunload(){alert('这就是你要做的事,关闭网页之后做的！')}   
        //function   window.onbeforeunload(){alert('这就是你要做的事,关闭网页之前做的！')}   
    </script>
</body>
</html>
