<%@ 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;

}

.uploadImg
{
	cursor:pointer

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

var file = document.all.templetFile.value;

var emptyFlag =true;


if(file!='' )
{

   emptyFlag=false;
}


if(emptyFlag)
{
   alert('请选择模板文件！');
   return;
}




if(!file.match(/.jsp|.html|.zip|.js|.css|.htm/i))
{
	alert('文件类型必须是: .jsp, .html, .htm, !');
	return;
}

 //alert("${param.currentEntry}");

 document.all.uploadForm.action="../../templet/uploadTempletFile.cmd?currentEntry=${param.currentEntry}";
 
 document.getElementById('divProcessing').style.display='';
 
 document.all.uploadForm.submit();
 
 

 

 

}
</script>

	<body>


		<form method="post" name='uploadForm' id='uploadForm' target="uploadTarget" enctype="multipart/form-data">
			<fieldset style="width:175px">
				<legend class="title_td">
					所选模板
				</legend>

				<table>
					<tr>

						<td>
							<input name="templetFile" type="file" id='templetFile' size="30">
							<input name="templetFileName" type="hidden" id='templetFileName' value="${param.templetFileName}">
						</td>
					</tr>
					<tr>

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

	<iframe name="uploadTarget" style="width:0px;height:0px;border:0px" id="uploadTarget" onload="javascript:uploadCallback('${param.successMsg}');">



	</iframe>
	<div id="divProcessing" style="width:200px;height:30px;position:absolute;left:20px;top:20px;display:none">
		<table border=0 cellpadding=0 cellspacing=1 bgcolor="#000000" width="100%" height="100%">
			<tr>
				<td bgcolor=#3A6EA5>
					<marquee align="middle" behavior="alternate" scrollamount="5">
						<font color=#FFFFFF>...模版上传中...请等待...</font>
					</marquee>
				</td>
			</tr>
		</table>
	</div>

	<script type="text/javascript">
//document.all.classImg.style.display='none';
//document.all.contentImg.style.display='none';
//document.all.headImg.style.display='none';

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

function uploadCallback(msg)
{

	if(msg=='OK')
	{
		alert("模板文件导入成功!");
		window.close();
	}
	else if(msg=='ERROR')
	{
	    alert("模板文件导入失败!")
	    document.forms.uploadForm.reset();
	}
	
}

</script>
</html>

