<%@ page contentType="text/html;charset=GBK" %>
<%@ taglib prefix="c" uri="/WEB-INF/c.tld"%>
<html>
<head>
  <title>上传图片</title>
<script type="text/javascript" src="popup.js"></script>

<style type="text/css">
html, body {
  background: ButtonFace;
  color: ButtonText;
  font: 11px Tahoma,Verdana,sans-serif;
  margin: 0px;
  padding: 0px;
}
body { padding: 5px; }
table {
  font: 11px Tahoma,Verdana,sans-serif;
}
form p {
  margin-top: 5px;
  margin-bottom: 5px;
}
.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
border-bottom: 1px solid black; letter-spacing: 2px;
}
form { padding: 0px; margin: 0px; }
</style>
</head>
<script language="javascript">
	function previewAD ( ){
		var field = main.imageFile ;
		if ( main.imageFile.value == "" ){
			alert("你还没有选择图片呢!");
			return false;
		}
		if ((field.value.toLowerCase().indexOf(".gif") <= -1) &&
        		(field.value.toLowerCase().indexOf(".jpg") <= -1) &&
        		(field.value.toLowerCase().indexOf(".png") <= -1))
    		{
        		alert("对不起，只能上传gif/jpg/png图片文件!");
        		return false;
    		}
		var feature = "width=";
		feature += window.screen.width -10;
		feature += ",";
		feature += "height=";
		feature += window.screen.height-100;
		feature += ",";
		feature += "left=0,top=0,scrollbars=yes";
		
		window.open("/info_admin/ad/index.htm",null,feature);
	}
	function check (obj ){
		var field = obj.imageFile ;
		if ( obj.imageFile.value == "" ){
			alert("你还没有选择图片呢!");
			return false;
		}
		if ((field.value.toLowerCase().indexOf(".gif") <= -1) &&
        		(field.value.toLowerCase().indexOf(".jpg") <= -1) &&
        		(field.value.toLowerCase().indexOf(".png") <= -1))
    		{
        		alert("对不起，只能上传gif/jpg/png图片文件!");
        		return false;
    		}
		obj.sure.disabled = true ;
		return true;
		
	}
</script>
<body onLoad="javascript: window.resizeTo(400, 200);">
<div class="title">上传图片</div>

<form action="/info_admin/upload_ad.jsp" name="main" method="post" enctype="multipart/form-data" onSubmit="javascript:return check(this);">
  <table border="0" width="100%" >
    <tbody>
      <tr> 
        <td  align="right">选择本地图片:</td>
        <td align="left"><input name="imageFile" type="file" size="20" title="选择一个本地的图片">
		<input name="deleteFile" type="hidden" value="<c:out value='${param.deleteFile}'/>">
        </td>
      </tr>
    </tbody>
  </table>
<table width="100%">
 <tr>
  <td valign="bottom"  align="center">
	<input name="sure" type="submit" value="确定">
	<input name="" type="button" value="预览广告图片效果" onClick="javascript: previewAD();">
	<input name="" type="reset" value="取消" onClick="javascript: window.opener=null;window.close();">
  </td>
 </tr>
</table>
</form>
</body>
</html>
