<html>
<head>
<title>在线上传</title>
<meta http-equiv="Content-Type" content="text/html; charset={$CONFIG[charset]}">
<style>
INPUT {BORDER-RIGHT: #ccc 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #666 1px solid; PADDING-LEFT: 2px; BACKGROUND: #f9f9f9; PADDING-BOTTOM: 2px; BORDER-LEFT: #666 1px solid; COLOR: #333; PADDING-TOP: 2px; BORDER-BOTTOM: #ccc 1px solid;height:21px;}
.btn {PADDING-RIGHT: 5px; PADDING-LEFT: 5px; BORDER-LEFT-COLOR: #ddd; BACKGROUND: #ddd; BORDER-BOTTOM-COLOR: #666; PADDING-BOTTOM: 1px; MARGIN: 3px 0px; VERTICAL-ALIGN: middle; CURSOR: pointer; COLOR: #000; BORDER-TOP-COLOR: #ddd; PADDING-TOP: 4px; BORDER-RIGHT-COLOR: #666;height:25px;}

</style>
<script language="javascript" src="{HS_PATH}data/js/config.js"></script>
<script language="javascript" src="{HS_PATH}include/js/common.js"></script>
</head>
<body>
<script type="text/javascript">
function doCheck() {
	if(upload.uploadfile.value == '') {
		alert('请选择文件!');
		return false;
	}
	return true;
}
</script>
<table cellpadding="5" cellspacing="3" style="border:#EEEEEE 1px solid;">
  <tr>
    <th style="text-align:center;">图片上传</th>
  </tr>
	<form name="upload" method="post" action="{HS_PATH}upload.php?keyid={$keyid}&uploadtext={$uploadtext}&type={$type}&width={$width}&height={$height}&upload_dir={$upload_dir}" enctype="multipart/form-data" onSubmit="return doCheck();">
  <tr>
     <td class="tablerow" height="30">
	     <input type="hidden" name="save" value="1">
             <input name="uploadfile" type="file" class="btn" size="19"  {if $type}onchange="upload.previewpic.src=upload.uploadfile.value"{/if}>
             <input type="hidden" name="oldname">
             <input type="hidden" name="MAX_FILE_SIZE" value="{$maxfilesize}"> 
             <input type="submit" class="btn" name="submit" value="上传"><br>
			  <!--{if $type}<input style="width:100px" class="btn" type="button" name="submit" value=" 预览 " onClick="if(upload.uploadfile.value!='') upload.previewpic.src=upload.uploadfile.value">{/if} <br>
!-->
			 </td>
   </tr>
   {if $type=="water"}

	   {if $HS['water_type']==1} 
	  <tr>
		 <td class="tablerow">
				 水印文字：<input name="water_text" type="text" size="34" value="{$HS['water_text']}"> <br>
				 文字颜色：<input name="water_fontcolor" type="text" size="7" value="{$HS['water_fontcolor']}">
				 {$color_select("fontcolor","颜色",$HS['water_fontcolor'],0," onchange='upload.water_fontcolor.value=this.value'")}
				 文字大小：<input name="water_fontsize" type="text" size="5" value="{$HS['water_fontsize']}"> <br> 
				 水印位置：<select name="water_pos">
						{loop $poss $id $pos}
						 <option value="{$id}" {if $HS['water_pos']==$id}selected{/if}>{$pos}</option>
					{/loop}
					   </select>
				 </td>
	   </tr>
	   {elseif $HS['water_type']==2}
		<tr>
		 <td class="tablerow">水印图片：<input name="water_image" type="text" size="5" value="{$HS['water_image']}"> px</td>
	   </tr>
	   {/if}
  <tr>
     <td class="tablerow">说明：系统将按照指定的条件给图片加水印</td>
   </tr>
   {/if}

 {if $type}
 <tr>
 <td class="tablerow">
<img id="previewpic" onload="setpicWH(this,300,300)">
<script>
if(window.opener.myform.{$uploadtext}.value!="")
{
    upload.oldname.value = window.opener.myform.{$uploadtext}.value;
    upload.previewpic.src = '{HS_PATH}'+window.opener.myform.{$uploadtext}.value;
}
else
{
    upload.previewpic.src = "{HS_PATH}images/nopic.gif";
}
</script>
	</td>
   </tr>
{else}
<script>
if(window.opener.myform.{$uploadtext}.value!="")
{
    upload.oldname.value = window.opener.myform.{$uploadtext}.value;
}
</script>
{/if}
	</form>
</table>
</body>
</html>