<%@ control language="C#" autoeventwireup="true" inherits="Knowledge_MultipleUpload, App_Web_4plofzsr" %>

<style type="text/css">
        .AddBuildingInputP
        {
            height:20px;
            width:280px;
            line-height:16px;
            background-image:url(Images/AddBuilding/inputBg.gif);
            background-position:center;
            background-repeat:repeat-x;
            border-top:solid 1px #7D7D7D;
            border-left:solid 1px #7D7D7D;
            border-right:solid 1px #C2C2C2;
            border-bottom:solid 1px #C2C2C2;
        }
        .btn
        {
            width:20px;
            heigth:20px;
            margin-left:3px;
        }
</style>
    
<script type="text/javascript">
        function checkPic(ele)
        {
            var fileName = ele.value;
            var pattern = /\.jpg$|\.jpeg$|\.gif$|\.png$|\.bmp$/gi;

            if(!pattern.test(fileName))
            {
                alert("图片格式不合规范！");
                return false;
            }
            else
            {
                return true;
            }
        }
        
        function addPic(ele)
        {
            var newPic = ele.cloneNode(true);
            newPic.childNodes[0].value = "";
            parent.document.getElementById("AddPicFrame").height = Number(parent.document.getElementById("AddPicFrame").height) + 20;
            document.getElementById("content").appendChild(newPic);
        }
        function removePic(ele)
        {
            if(ele.parentNode.childNodes.length > 1)
            {
                ele.parentNode.removeChild(ele);
                parent.document.getElementById("AddPicFrame").height = Number(parent.document.getElementById("AddPicFrame").height) - 20;
            }
        }
</script>
    
<form id="form1" runat="server" enctype="multipart/form-data" method="post">
        <%--<asp:HiddenField ID="wuYeID" runat="server" />--%>
        <div id="content">
            <div><input id="File1" type="file" runat="server" class="AddBuildingInputP" onchange="checkPic(this)" /><input type="button" title="添加更多图片" class="btn" value="+" onclick="addPic(this.parentNode)" /><input class="btn" title="移除该图片"  type="button" value="-" onclick="removePic(this.parentNode)" /></div>
        </div>
    </form>