<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="FileType.ascx.cs" Inherits="PowerEasy.Module.General.WebSite.Admin.Controls.FieldControl.FileType" %>
<table>
    <tr class='tdbg'>
        <td class='tdbg' colspan="2" align='left'>
            <div class="DivWordBreak">
                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td style="width: 400px">
                            <asp:HiddenField ID="HdnSoftUrls" runat="server" />
                            <pe:ExtendedListBox ID="eLstListBox" Width="400px" Height="94px" size="2" runat="server">
                            </pe:ExtendedListBox>
                            <input type="text" runat="server" id="inputvalue" style="width: 398px; margin-top: 4px;"
                                class="inputtext" value="软件地址1|http://" /><br />
                            <pec:FloatingDialog ID="FileFloatingDialog" Visible="false" runat="server" ShowType="1"
                                Width="550" Height="350" Name="从已上传文件中选择" Skin="inputbutton" Title="从已上传文件中选择" />
                            <input id="<%= m_JSPrefix %>UploadButton" type="button" class="inputbutton" value="上传文件..." />
                        </td>
                        <td valign="top">
                            <input type="button" class="inputbutton" value="向上移动" onclick="UpOrder('<%= eLstListBox.ClientID %>');" /><br />
                            <input type="button" class="inputbutton" value="向下移动" onclick="DownOrder('<%= eLstListBox.ClientID %>');" /><br />
                            <input type="button" class="inputbutton" value="<%= Resources.DynamicPageResources.Controls_FieldControl_FileType_input3 %>"
                                onclick="return <%= m_JSPrefix %>ModifySoftUrl('<%= eLstListBox.ClientID %>');" /><br />
                            <input type="button" class="inputbutton" value="<%= Resources.DynamicPageResources.Controls_FieldControl_FileType_input4 %>"
                                onclick="<%= m_JSPrefix %>DelSoftUrl('<%= eLstListBox.ClientID %>');" /><br />
                            <input type="button" class="inputbutton" value="<%= Resources.DynamicPageResources.Controls_FieldControl_FileType_input2 %>"
                                onclick="<%= m_JSPrefix %>AddSoftUrl('<%= eLstListBox.ClientID %>');" />
                        </td>
                    </tr>
                </table>
                <span style="color: Green">
                    <%= Description %>
                </span>
                <div id="floatingDialog<%=m_JSPrefix%>" style="position: absolute; width: 500px;
                    height: 350px;" class="floatingDialog">
                    <div id="floatingDialog_handle<%=m_JSPrefix%>" class="fdtop floatingDialog_handle">
                        <dl>
                            <dd>
                                <ul>
                                    <li class="close"><a id="close<%=m_JSPrefix%>" href="javascript:" title="关闭" class="floatingDialogClose">
                                    </a></li>
                                    <li class="title">上传文件</li>
                                </ul>
                            </dd>
                        </dl>
                    </div>
                    <div id="floatingDialog_content<%=m_JSPrefix%>" class="floatingDialog_content" style="height: 20px;">
                        <%-- <pe:FileUploadControl ID="uploader" runat="server" ModuleName = "Node" CustomReturnJSFunction="<%= m_JSPrefix %>DealwithUpload" ModelId="<%= m_ModelID %>" FieldName = "<%= FieldName %>"NodeId="<%= RequestString("NodeId") %>" IsAddFileRecord = "true" />--%>
                        <pe:FileUploadControl ID="Uploader" runat="server" Pattern="Simple" />
                    </div>
                    <div class="fdbottom">
                        <dl>
                            <dt></dt>
                        </dl>
                    </div>
                    <iframe id="iframe_IE6_Z-Index<%=m_JSPrefix%>" width="100%" frameborder="0" height="80px"
                        style="position: absolute; top: 0px; z-index: -1; border-style: none;"></iframe>
                </div>
            </div>
        </td>
    </tr>
    <tr>
        <td class='tdbgleft' align='right' style="width: 20%;">
            <strong>
                <asp:Literal ID="Literal2" Text="<%$ Res : Controls_FieldControl_FileType_Literal2, 文件大小 ：%>"
                    runat="server"></asp:Literal>&nbsp;</strong>
        </td>
        <td class='tdbg'>
            <asp:TextBox ID="TxtFileSize" runat="server"></asp:TextBox>&nbsp;K
        </td>
    </tr>
</table>
<script type="text/javascript">
jQuery(document).ready(function() {
    if ($.browser.msie && $.browser.version === "6.0") {
            var overlay;
            $("#<%= m_JSPrefix %>UploadButton").click(function (event) {
                var floatingDialog = $("#floatingDialog<%=m_JSPrefix%>");
                overlay = $('<div id="jqDnrFloatDivBg" style="background-color: rgb(0, 0, 0);filter:Alpha(opacity=40); position: absolute; top: 0px; left: 0px; opacity: 0.6; z-index: 49; width: 1216px; height: 1855px; "><iframe style="position:absolute;width:100%;height:100%;_filter:alpha(opacity=0);opacity=0;border-style:none;"></iframe> </div>');
                $("body").append(overlay);
				$(document).on('click', '#jqDnrFloatDivBg', function(event){
                //$('#jqDnrFloatDivBg').live("click", function (event) {
                    floatingDialog.hide();
                    $(this).remove();
                });
                floatingDialog.attr("z-index", 50);
                var bodyTop = document.documentElement.scrollTop + document.body.scrollTop;
                floatingDialog.show();
                floatingDialog.offset({ top: bodyTop+30, left: ($('body').width() - floatingDialog.width()) / 2 })
            });
            $('#close<%=m_JSPrefix%>').click(function (event) {

                $("#floatingDialog<%=m_JSPrefix%>").hide();
                overlay.remove();
            });
        } else {
            jQuery("#floatingDialog<%=m_JSPrefix%>").floatForm({ controlTag: "#<%= m_JSPrefix %>UploadButton" });
        }
});


function   tofloat(f,dec)   {     
  if(dec<0)   return   "Error:dec<0!";     
    result=parseInt(f)+(dec==0?"":".");     
    f-=parseInt(f);     
  if(f==0)     
    for(i=0;i<dec;i++)   result+='0';     
  else   {     
    for(i=0;i<dec;i++)   f*=10;     
    result+=parseInt(Math.round(f));     
  }     
  return result;     
}

function <%= m_JSPrefix %>ChangeHiddenFieldValue()
{
    var obj = document.getElementById("<%= HdnSoftUrls.ClientID %>");
    var softUrls = document.getElementById("<%= eLstListBox.ClientID %>");
    var value = "";
    for(i=0;i<softUrls.length;i++)
    {
        if(value!="")
        {
            value = value+ "$$$";
        }
        value = value + softUrls.options[i].value;
    }
    obj.value = value;
}

function <%= m_JSPrefix %>DealwithUploadErrMessage(message)
{
    alert(message);
}
</script>
