<%@ Register TagPrefix="ftb" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
<%@ Page language="c#" Codebehind="VideoAdd.aspx.cs" AutoEventWireup="true" Inherits="XpShop.Manage.VideoAdd" validateRequest="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
  <head>
		<!--#include file="../inc/head2.inc"-->
        <title>添加视频</title>
        <script type="text/javascript" src="../inc/commond.js"></script>
        <script type="text/javascript">
            $(document).ready(function(){
                $('#rblSrcType').click(function(){
                    if($('[@name=rblSrcType][@checked]').val() == '0'){
                        $('#trFile').show();
                        $('#trSrc').hide();
                    }else{
                        $('#trFile').hide();
                        $('#trSrc').show();
                        $('#isChange').val('0');
                    };
                }).click();
                
                $('#ChangeFile').toggle(function(){
                    $(this).text('取消更换');
                    $('#isChange').val('1');
                    $('#loadcontrol').show();
                    $('#lbFileName').hide();
                },function(){
                    $(this).text('更换视频文件');
                    $('#isChange').val('0');
                    $('#loadcontrol').hide();
                    $('#lbFileName').show();
                });
                
                $('#btnCancel').click(function(){
                    <%if(Request.QueryString["vid"] != null) {%>
                        $('#frmModify',window.parent.document).hide().siblings(':not(\"#loadingContainer\")').show();	
                        window.parent.BindList();
                    <%}else{ %>
                        window.location.href='Video.aspx';
                    <%} %>
                    return false;
                });
                
                $('#btnSave').click(function(){
                    if($.trim($('#txtTitle').val())==''){alert('请填写视频名称');return false;};
                    if($('#ddlCategory').val()=='0'){alert('请填选择视频分类');return false;};
                    if($('[@name=rblSrcType][@checked]').val() == '1' && $.trim($('#txtSrc').val())==''){alert('请填写视频网络地址');return false;};
                });
            });
        </script>
  </head>
  <body>
		<div class="container">
		<div class="sub_container">
		<div class="sub_container_title"><a href="<%=AdminDefault%>" target="_top">桌面</a><img src="../images/admin_title.jpg" height="9" width="8" align="absMiddle"><asp:label id="lblTitleInfo" Runat="server" CssClass="tableHeaderText">视频添加</asp:label></div>
		<div class="sub_container_content">
		<form id="Form1" method="post" runat="server" enctype="multipart/form-data" target="upload">
		    <div class="frame">
		        <div class="frame_title"><asp:Label ID="lbTitle" Runat="server" CssClass="tableHeaderText">视频添加</asp:Label></div>
		        <div class="frame_content">
			        <table cellSpacing="0" cellPadding="0" class="ptable" style="width:99%">
				        <tr>
					        <th class="tl">视频名称：</th>
					        <td class="tr">
					            <asp:textbox id="txtTitle" runat="server" Columns="30" MaxLength="50"></asp:textbox>
					            
					        </td>
				        </tr>
				        <tr>
				            <th class="tl">视频分类：</th>
				            <td class="tr">
				                <asp:DropDownList ID="ddlCategory" runat="server"></asp:DropDownList>
				            </td>
				        </tr>
				        <tr>
				            <th class="tl">视频来源：</th>
				            <td class="tr">
				                <asp:RadioButtonList ID="rblSrcType" runat="server" RepeatDirection="horizontal">
				                    <asp:ListItem Value="0" Selected="true">本地上传</asp:ListItem>
				                    <asp:ListItem Value="1">网络</asp:ListItem>
				                </asp:RadioButtonList>
				            </td>
				        </tr>
				        <tr id="trFile">
				            <th class="tl">选择文件：</th>
				            <td class="tr"><span id="loadcontrol" style="display:<%=Request.QueryString["vid"] != null ? "none" : "inline" %>"><input type="file" runat="server" id="fileVideo" class="file" /></span><asp:Label runat="server" ID="lbFileName"></asp:Label>　　<span id="ChangeFile" style=" cursor:pointer; color:#blue; display:<%=Request.QueryString["vid"] != null ? "inline" : "none" %>">更换视频文件</span><input type="hidden" id="isChange" name="isChange" value="0" /></td>
				        </tr>
				        <tr id="trSrc">
				            <th class="tl">网络地址：</th>
				            <td class="tr"><asp:TextBox ID="txtSrc" runat="server"></asp:TextBox></td>
				        </tr>
				        <tr>
				            <th class="tl">状态：</th>
				            <td class="tr">
				                <asp:RadioButtonList ID="rblStatus" runat="server" RepeatDirection="horizontal">
				                    <asp:ListItem Value="1" Selected="true">发布</asp:ListItem>
				                    <asp:ListItem Value="0">未发布</asp:ListItem>
				                </asp:RadioButtonList>
				            </td>
				        </tr>
				        <tr>
				            <th class="tl">描述内容：</th>
				            <td class="tr">
				                <FTB:FREETEXTBOX id="ftbRemark" runat="Server" ImageGalleryPath="Upload/" ToolbarType="OfficeXP" ButtonPath="../images/ftb/officeXP/"
				                ButtonDownImage="True" ButtonOverImage="True" Width="800" Height="150"></FTB:FREETEXTBOX>
				            </td>
				        </tr>
				        <tr>
					        <td colSpan="2" class="center">
						        <asp:button id="btnSave" OnClick="btnSave_Click" runat="server" Text="保存" CssClass="inputbtn"></asp:button>
						        <asp:button id="btnCancel" runat="server" Text="返回列表" CausesValidation="False" CssClass="inputbtn"></asp:button>
						    </td>
				        </tr>
			        </table>
		        </div>
	        </div>
		</form>
		
		
		</div>
		</div>
		</div>
		<iframe id="upload" name="upload" style="height:0px;display:none" src="#"></iframe>
  </body>
</html>
