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

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<%
			response.setHeader("Pragma", "No-cache");
			response.setHeader("Cache-Control", "no-cache");
			response.setDateHeader("Expires", 0);
		%>
		<title>上传引导图</title>

		<!--加载 js -->

		<link rel="stylesheet" type="text/css" href="../../style/default/main.css" />
		<script type="text/javascript" src="../common/js/jquery-1.6.2.min.js"></script>
		<script language="javascript" type="text/javascript" src="../javascript/commonUtil.js"></script>

		<style type="text/css">
<!--
body {
	margin:0px;
	padding:0px;

}

.pointer
{
	cursor:pointer

}
-->
</style>
	</head>
	<script language="JavaScript" type="text/javascript">
function sumbitTempFile()
{

var file = document.all.imgFile.value;

var emptyFlag =true;


if(file!='' )
{

   emptyFlag=false;
}


if(emptyFlag)
{
   alert('请选择图片！');
   return;
}




if(!file.match(/.jpg|.jpeg|.gif|.bmp/i))
{
	alert('文件类型必须为图片类型!');
	return;
}


 document.all.uploadForm.action="../../content/uploadContentGuideImg.cmd";
 document.all.uploadForm.submit();
 
 

 

 

}
</script>

	<body>


		<form method="post" name='uploadForm' id='uploadForm' enctype="multipart/form-data">


			<table id="uploadTable" border="0" cellpadding="0" cellspacing="0">
				<tr>

					<td>
						<input name="imgFile" type="file" id='imgFile' class="f_input">
						<input name="imgFileName" type="hidden" id='imgFileName' value="${param.imgFileName}">
					</td>

					<td>
						&nbsp
						<button type="button" id="save" onClick="javascript:sumbitTempFile();" class="f_input">
							<img src="../../core/style/default/images/ok.png" alt="" />
							确认
						</button>
					</td>
				</tr>

			</table>

			<table id="imgTable" border="0" cellpadding="0" cellspacing="0" style="display:none">
				<tr>

					<td>
						<img width="80" height="65" src="<cms:Domain/>/${param.imgFileURL}" />
					</td>

					<td>
						&nbsp
						<button type="button" id="save" onClick="javascript:deleteGuideImg();" class="f_input" style="cursor:pointer" >
							<img src="../../core/style/default/images/cross3.png" alt="" />
							删除
						</button>
					</td>
				</tr>

			</table>
			<input name="targetContentId" type="hidden" id='targetContentId' value="${param.contentId}">
			<input name="mode" type="hidden" id='mode' value="${param.mode}">
			<input type="hidden" name="newImgVal" id='newImgVal' value="${param.imgFileURL}">
			
		</form>

		<form method="post" name='deleteImgForm' id='deleteImgForm' />
			<input name="targetDeleteImg" type="hidden" id='targetDeleteImg'>
			<input name="contentId" type="hidden" id='contentId' value="${param.contentId}">
			<input name="modeForDelete" type="hidden" id='modeForDelete' value="${param.mode}">
		</form>

	</body>
</html>
<script type="text/javascript">
//alert("${param.mode}");
var callbackPath = "${param.imgFileURL}";
//alert(callbackPath);
if(callbackPath != '')
{
	//alert(callbackPath);
	document.all.uploadTable.style.display='none';
	document.all.imgTable.style.display='block';
}



window.parent.document.all['guideImgFrame'].style.height=document.body.scrollHeight;
window.parent.document.all['guideImgFrame'].style.width=document.body.scrollWidth;

//document.all.classImg.style.display='none';
//document.all.contentImg.style.display='none';
//document.all.headImg.style.display='none';

//alert(document.all.headImgFile.value);



function deleteGuideImg()
{
   var fileURL=callbackPath;	
   if(fileURL=='')
   {
     return;
   }
   
   document.all.targetDeleteImg.value=fileURL;
   
   document.all.deleteImgForm.action="../../content/deleteContentGuideImg.cmd";
   document.all.deleteImgForm.submit();


}

</script>


