<%@ page contentType="text/html; charset=GBK" session="false"%>
<%@ taglib uri="/cmsTag" prefix="cms"%>
<%@ page contentType="text/html; charset=GBK"%>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<%
			response.setHeader("Pragma", "No-cache");
			response.setHeader("Cache-Control", "no-cache");
			response.setDateHeader("Expires", 0);
		%>
		<title>添加视频</title>

		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
		<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
		<link href="../style/blue/css/main.css" type="text/css" rel="stylesheet" />
		<link href="../style/blue/css/reset-min.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="../common/js/jquery-1.7.gzjs"></script>
		
		<script language="javascript" type="text/javascript" src="../javascript/commonUtil.js"></script>
		<script language="javascript" type="text/javascript" src="../javascript/AC_RunActiveContent.js"></script>
		<script type="text/javascript" src="../javascript/dialog/lhgdialog.min.js?skin=iblue"></script>
		<script type="text/javascript" src="../javascript/uuid.js"></script>
		<script type="text/javascript" src="../style/blue/js/tab_change.js"></script>
		<script language="javascript" type="text/javascript" src="../javascript/My97DatePicker/WdatePicker.js"></script>
		<script>
		$(window).load(function()
		{
		   $('#appearStartDateTime').mousedown
		   (
		      function()
		      {
		         WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});
		      }
		   );
		   
		   $('#appearEndDateTime').mousedown
		   (
		      function()
		      {
		         WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});
		      }
		   );
		   
		    
		})
		 //去掉点击链接 虚线边框
	      window.onload=function()
	      {
	     	for(var i=0; i<document.links.length; i++)
	     	{
	     		document.links[i].onclick=function(){this.blur()};
	     	}
	      }
		</script>




	</head>

	<body>
		<div class="breadnav">
			<table width="99.9%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td align="left">
						&nbsp;
						<img src="../style/blue/images/home.gif" width="16" height="16" class="home" />
						当前位置：
						<a href="#">内容管理</a> &raquo; 添加视频
					</td>
					<td align="right">

					</td>
				</tr>
			</table>
		</div>
		<div style="height:25px;"></div>
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td class="mainbody" align="left" valign="top">
					<!--main start-->
					<div class="addtit">
						<img src="../style/blue/icon/application-import.png" width="16" height="16" />
						视频信息
					</div>

					<form action="../../content/addVideo.cmd" id="photoForm" name="photoForm" method="post">
						<table width="100%" border="0" cellpadding="0" cellspacing="0" class="form-table">
							<tr>
								<td width="13%" class="input-title">
									所属栏目:
								</td>
								<td class="td-input">
									<select name="classId" id="classId">
										<option value="-9999">
											选择视频所属栏目
										</option>
										<cms:DisplayClass modelId="3" initClassId="${param.classId}" />
									</select>
								</td>
							</tr>
							<tr>
								<td width="13%" class="input-title">
									视频标题
								</td>
								<td width="87%" class="td-input">
									<input id="title" name="title" type="text" class="form-input" size="60" />
									<span class="red">*</span><span class="ps"></span>
								</td>
							</tr>

							<tr>
								<td width="13%" class="input-title">
									短标题
								</td>
								<td width="87%" class="td-input">
									<input id="simpleTitle" name="simpleTitle" type="text" class="form-input" size="40" />
									<span class="red">*</span><span class="ps"></span>
								</td>
							</tr>

							<tr>
								<td class="input-title">
									视频
								</td>
								<td class="td-input">
									<iframe id="uploadFrame" name="uploadFrame" frameborder=0 src="UploadVideo.jsp?autostart=true&videoURL=extools/player/empty.flv" width="100%" height="330" scrolling=no></iframe>
								</td>
							</tr>

							<tr>
								<td class="input-title">
									视频描叙
								</td>
								<td class="td-input">
									<textarea id="videoDesc" name="videoDesc" cols="53" rows="5" class="form-textarea" style="width:415px; height:60px;"></textarea>
								</td>
							</tr>

							<tr>
								<td class="input-title">
									是否转换FLV
								</td>
								<td class="td-input">
									<input name="convertToFlv" type="radio" value="1" checked />
									<span class="STYLE12">是</span> &nbsp;
									<input name="convertToFlv" type="radio" value="0" />
									<span class="STYLE12">否</span>

								</td>
							</tr>

							<tr>
								<td class="input-title">
									截图数量
								</td>
								<td class="td-input">
									<input id="snapshotImgCount" name="snapshotImgCount" type="text" class="form-input" size="3" value="1" />
								</td>
							</tr>

							<tr>
								<td class="input-title">
									作者
								</td>
								<td class="td-input">
									<input id="author" name="author" type="text" class="form-input" value="" size="35" maxlength="50" />
								</td>
							</tr>

							<tr>
								<td class="input-title">
									创建者
								</td>
								<td class="td-input">
									<input id="creator" name="creator" size="35" maxlength="60" type="text" class="form-input" />
								</td>
							</tr>

							<tr>
								<td class="input-title">
									引导图
								</td>
								<td class="td-input">
									<iframe src="UploadContentGuideImg.jsp?mode=new" scrolling="no" frameborder="0" id="guideImgFrame" name="guideImgFrame"></iframe>
								</td>
							</tr>

							<tr>
								<td class="input-title">
									发布时间
								</td>
								<td class="td-input">
									<table width="405" border="0" cellpadding="0" cellspacing="0">
										<tr>
											<td width="37%">
												<input id="appearStartDateTime" name="appearStartDateTime" size="21" maxlength="30" type="text" class="f_input_time" />
											</td>
											<td width="7%" class="font_style_center">
												至
											</td>
											<td width="56%">
												<input id="appearEndDateTime" name="appearEndDateTime" size="21" maxlength="30" type="text" class="f_input_time" />
											</td>
									</table>
								</td>
							</tr>




							<tr>
								<td class="input-title">
									视频宽度
								</td>
								<td class="td-input">
									<input id="width" name="width" size="15" maxlength="20" type="text" class="form_input" value="400" />
								</td>
							</tr>

							<tr>
								<td class="input-title">
									视频高度
								</td>
								<td class="td-input">
									<input id="height" name="height" size="15" maxlength="20" type="text" class="form_input" value="220" />
								</td>
							</tr>

							<tr>
								<td class="input-title">
									自动播放
								</td>
								<td class="td-input">
									<input id="autoStart" name="autoStart" type="radio" value="true" checked />
									<span class="STYLE12">自动</span> &nbsp;
									<input id="autoStart" name="autoStart" type="radio" value="false" />
									<span class="STYLE12">点击播放</span> &nbsp;
								</td>
							</tr>

							<tr>
								<td class="input-title">
									是否重复播放
								</td>
								<td class="td-input">
									<input id="repeatFlag" name="repeatFlag" type="radio" value="none" checked />
									<span class="STYLE12">否</span> &nbsp;
									<input id="repeatFlag" name="repeatFlag" type="radio" value="always" />
									<span class="STYLE12">是</span> &nbsp;
								</td>
							</tr>


							<tr>
								<td class="input-title">
									播放质量
								</td>
								<td class="td-input">
									<input id="quality" name="quality" type="radio" value="high" checked />
									<span class="STYLE12">高</span> &nbsp;
									<input id="quality" name="quality" type="radio" value="mid" />
									<span class="STYLE12">一般</span> &nbsp;
								</td>
							</tr>

							<tr>
								<td class="input-title">
									是否支持全屏
								</td>
								<td class="td-input">
									<input id="allowFullScreen" name="allowFullScreen" type="radio" value="true" checked />
									<span class="STYLE12">支持</span> &nbsp;
									<input id="allowFullScreen" name="allowFullScreen" type="radio" value="false" />
									<span class="STYLE12">不支持</span> &nbsp;
								</td>
							</tr>

						</table>
						<!-- hidden -->
						<input type="hidden" id="fileName" name="fileName" />

						<input type="hidden" id="videoURL" name="videoURL" />

						<input type="hidden" id="videoName" name="videoName" />

						<input type="hidden" id="guideImg" name="guideImg" />

						<input type="hidden" id="eventKey" name="eventKey" />

					</form>
					<table width="100%" border="0" cellspacing="0" cellpadding="0" >
						<tr class="btnbg100">
							<td width="40%" class="input-title"></td>
							<td width="87%" class="td-input">
								<a onclick="javascript:submitVideo();" class="btnwithico"><img src="../style/icons/tick.png" width="16" height="16" /><b>确认&nbsp;</b> </a>
								<a href="javascript:;" class="btnwithico" onclick=""><img src="../style/icon/close.png" width="16" height="16"><b>取消&nbsp;</b> </a>
							</td>
							<td valign="top">
								<br />
							</td>
						</tr>
					</table>


				</td>
			</tr>

			<tr>
				<td height="10">
					&nbsp;
				</td>
			</tr>
		</table>
		<!--[if lt IE 7]>
        <script type="text/javascript" src="js/unitpngfix.js"></script>
<![endif]-->

	</body>
</html>

<script type="text/javascript" language="javascript">

var noSubmitFlag=true;

//退出事件,注意:若是href触发事件,必须用onclick代替,IE下,onbeforeunload发生时间晚于onclick
window.onbeforeunload = beforeAction;
//window.onunload=unloadAction;

function beforeAction()
{
  if(false==noSubmitFlag)
  {
  	return;
  }
  
  var targetFile = document.all.uploadFrame.contentWindow.document.getElementById("videoFile").value;
  
  if(''==targetFile)
  {
  	return;
  }
 

  var url = '../../common/deleteTemp.cmd?fileType=video&fileName='+ targetFile;
  
  $.ajax({type:'POST',async:true,url:url,success:
  	function(data, textStatus)
  	{
         return;
  	}
  }
  );
}

function unloadAction()
{
	alert("确认退出?");
}


function submitVideo()
{  
   var uuid = new UUID().id;
   
   //alert(uuid);
   document.getElementById("eventKey").value="convertFLV"+uuid;
   //alert(document.all.upload.contentWindow.document.getElementById("classImgURL").value); 

   noSubmitFlag = false;
   
   var guideImg = document.all.guideImgFrame.contentWindow.document.getElementById("imgFileName").value;
   document.getElementById("guideImg").value=guideImg;
   
   var fileName = document.all.uploadFrame.contentWindow.document.getElementById("videoFile").value;
   var videoName = document.all.uploadFrame.contentWindow.document.getElementById("videoName").value;
    var videoURL = document.all.uploadFrame.contentWindow.document.getElementById("videoURL").value

   document.getElementById("fileName").value=fileName;
   document.getElementById("videoName").value=videoName;
   document.all.videoURL.value=videoURL;
   
   if( getRadioCheckedValue("convertToFlv") == 1 && fileName.lastIndexOf(".flv") == -1)
   {
   		   $.dialog
   		   ({ 
		   		title :'视频转换进度',
		    	width: '400px', 
		    	height: '200px', 
		     	lock: true, 
    
    			content: 'url:<cms:Domain/>/core/content/ShowOperStatus.jsp?eventKey=convertFLV'+uuid
           });
   }
   
   photoForm.submit();
}





</script>

