<%@ 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 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>
		<cms:Content id="${param.id}" modelName="视频">
			<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/editVideo.cmd" id="videoForm" name="videoForm" method="post">
							<table width="100%" border="0" cellpadding="0" cellspacing="0" class="form-table">
								<tr>
									<td class="input-title" width="13%">
										所属栏目:
									</td>
									<td class="td-input" width="87%">
										<cms:Class id="${Info.classId}">
											<span class="STYLE1"><font color='red'>${Class.className}</font> </span>
										</cms:Class>
									</td>
								</tr>
								<tr>
									<td class="input-title">
										标题:
									</td>
									<td class="td-input">
										<textarea id="vititle" name="title" cols="53" rows="2" class="form-textarea">${Info.title}</textarea>
									</td>
								</tr>
								<tr>
									<td class="input-title">
										副标题:
									</td>
									<td class="td-input">
										<input type="text" size="45" id="simpleTitle" name="simpleTitle" class="form-input" value="${Info.simpleTitle}"></input>
									</td>
								</tr>
								<tr>
									<td class="input-title">
										视频:
									</td>
									<td class="td-input">
										<iframe id="uploadFrame" name="uploadFrame" frameborder=0 src="UploadVideo.jsp?videoURL=${Info.videoUr}&snapshotImg=${Info.snapshotImg}&autostart=false" width="100%" height="330" scrolling=no></iframe>
									</td>
								</tr>

								<tr>
									<td class="input-title">
										截图:
									</td>
									<td class="td-input">
										<table width="50%">
											<tr>
												<td>
													<cms:SMSIMAGE contentId="${param.id}">
														<img src="<cms:Domain/>/${SPSSIMG.imgFullPath}" height="60" width="80" onclick="javascript:changeSnapshotImg('${Info.videoURL}','${SPSSIMG.imgFullPath}');" />
													</cms:SMSIMAGE>
												</td>
											</tr>
										</table>
									</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="${Info.snapshotImgCount}" />
									</td>
								</tr>

								<tr>
									<td class="input-title">
										作者:
									</td>
									<td class="td-input">
										<input id="author" name="author" type="text" class="form-input size=" 35"  axlength="50" value="${Info.author}" />
									</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" value=${Info.creator } />
									</td>
								</tr>
								<tr>
									<td class="input-title">
										视频描叙:
									</td>
									<td class="td-input">
										<textarea id="videoDesc" name="videoDesc" cols="53" rows="4" class="form-textarea">${Info.title}</textarea>
									</td>
								</tr>

								<tr>
									<td class="input-title">
										引导图:
									</td>
									<td class="td-input">
										<iframe src="UploadContentGuideImg.jsp?imgFileURL=${Info.guideImg}&contentId=${Info.contentId}" 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="form-input_time" value="${Info.appearStartDateTime}" />
												</td>
												<td width="7%" class="font_style_center">
													至
												</td>
												<td width="56%">
													<input id="appearEndDateTime" name="appearEndDateTime" size="21" maxlength="30" type="text" class="form-input_time" value="${Info.appearEndDateTime}" />
												</td>
										</table>
									</td>
								</tr>


								<tr>
									<td class="input-title">
										视频宽度:
									</td>
									<td class="td-input">
										<input id="width" name="width" size="35" maxlength="60" type="text" class="form-input" value="${Info.width}" />
									</td>
								</tr>

								<tr>
									<td class="input-title">
										视频高度:
									</td>
									<td class="td-input">
										<input id="height" name="height" size="35" maxlength="60" type="text" class="form-input" value="${Info.height}" />
									</td>
								</tr>

								<tr>
									<td class="input-title">
										自动播放:
									</td>
									<td class="td-input">
										<input id="autoStart" name="autoStart" type="radio" value="true" />
										<span class="STYLE12">自动</span> &nbsp;
										<input id="autoStart" name="autoStart" type="radio" value="false" />
										<span class="STYLE12">点击播放</span> &nbsp;
										<script type="text/javascript" language="javascript">
														initRadio('autoStart','${Info.autoStart}');
													</script>
									</td>
								</tr>

								<tr>
									<td class="input-title">
										是否重复播放:
									</td>
									<td class="td-input">
										<input id="repeatFlag" name="repeatFlag" type="radio" value="none" />
										<span class="STYLE12">否</span> &nbsp;
										<input id="repeatFlag" name="repeatFlag" type="radio" value="always" />
										<span class="STYLE12">是</span> &nbsp;
										<script type="text/javascript" language="javascript">
														initRadio('repeatFlag','${Info.repeatFlag}');
											    </script>
									</td>
								</tr>

								<tr>
									<td class="input-title">
										播放质量:
									</td>
									<td class="td-input">
										<input id="quality" name="quality" type="radio" value="high" />
										<span class="STYLE12">高</span> &nbsp;
										<input id="quality" name="quality" type="radio" value="mid" />
										<span class="STYLE12">一般</span> &nbsp;
										<script type="text/javascript" language="javascript">
														initRadio('quality','${Info.quality}');
													</script>
									</td>
								</tr>

								<tr>
									<td class="input-title">
										是否支持全屏:
									</td>
									<td class="td-input">
										<input id="allowFullScreen" name="allowFullScreen" type="radio" value="true" />
										<span class="STYLE12">支持</span> &nbsp;
										<input id="allowFullScreen" name="allowFullScreen" type="radio" value="false" />
										<span class="STYLE12">不支持</span> &nbsp;
										<script type="text/javascript" language="javascript">
														initRadio('allowFullScreen','${Info.allowFullScreen}');
													</script>
									</td>
								</tr>

								<tr>
									<td class="feet" colspan="2" />
								</tr>
							</table>


							<!-- hidden -->
							<input type="hidden" id="contentId" name="contentId" value="${Info.contentId}" />
							<input type="hidden" id="classId" name="classId" value="${Info.classId}" />
							<input type="hidden" id="videoName" name="videoName" value="${Info.videoName}" />
							<input type="hidden" id="fileName" name="fileName" />
							<input type="hidden" id="videoURL" name="videoURL" value="${Info.videoURL}" />
							<input type="hidden" id="oldVideoURL" name="oldVideoURL" value="${Info.videoURL}" />
							<input type="hidden" id="guideImg" name="guideImg" />
							<input type="hidden" id="snapshotImg" name="snapshotImg" value="${Info.snapshotImg}" />
							<!-- hidden -->

						</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="javascript:history.go(-1)"><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]-->
		</cms:Content>
	</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()
{  
   //alert(document.all.upload.contentWindow.document.getElementById("classImgURL").value); 

   noSubmitFlag = false;
   
   document.all.guideImg.value=document.all.guideImgFrame.contentWindow.document.getElementById("imgFileName").value;
   
   var fileName = document.all.uploadFrame.contentWindow.document.getElementById("videoFile").value;;
   
   var videoName = document.all.uploadFrame.contentWindow.document.getElementById("videoName").value;
   
   if("" != videoName)	
   {	
     document.getElementById("videoName").value=videoName;
   }
   
   
   if("" != fileName)	
   {	
     document.getElementById("fileName").value=fileName;
   	 document.all.videoURL.value=fileName;
   }
   
   videoForm.submit();
}

function changeSnapshotImg(videoURL,imgPath)
{

	var frame = document.getElementById('uploadFrame');
	frame.src="UploadVideo.jsp?videoURL="+videoURL+"&snapshotImg="+imgPath+"&autostart=false";
    
    document.getElementById('snapshotImg').value='<cms:Domain/>/UPLOAD/GUIDE/'+imgPath;
}


</script>
