
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body { margin:0; padding:0;
	font-size: 12px;
}
#show{position:absolute; top:-22222px; left:-22222px; overflow:auto}
.ipt2 {BORDER: #999999 1px solid; FONT-SIZE: 12px; BACKGROUND: #ffffff; HEIGHT: 22px}
-->
</style>
<script language="javascript">
<!--
function mysub()
{
document.getElementById("esave").style.visibility="visible";
}
-->
</script>
<script language="javascript">
<!--
var img=null;
var maxfile=500;
function chkimg(inp)
{ if(inp!=""){
    //alert(inp);
    if(img)img.removeNode(true);
    img=document.createElement("img");
    img.attachEvent("onreadystatechange",isimg);
    img.attachEvent("onerror",notimg);
    img.src=inp;}
}
function notimg()
{
    alert("您插入的不是图片(必须为jpg|gif|png|bmp)，请重新选择插入");
}
function isimg()
{   
    show.insertAdjacentElement("BeforeEnd",img);
	var hei=img.offsetHeight;
	var wid=img.offsetWidth;
	var size=Math.round(img.fileSize/1024);
	document.getElementById("show1").innerHTML="图片大小:"+ Math.round(img.fileSize/1024) +"KB,宽度"+ img.offsetWidth +"×高度"+ img.offsetHeight+"";
   // alert("图片大小" +size  +"KB\r图片宽度"+ wid +"\r图片高度"+ hei);
	if( Math.round(img.fileSize/1024)>maxfile)
	{alert("图片大小" + size +"KB,超过最大文件"+maxfile+"KB,请重新选择文件");}
}
// -->
</script>
<title></title></head>
<body>
<form name="form1" method="post" action="pads_1.asp" enctype="multipart/form-data" >
<div name="esave" id="esave" style="position:absolute; top:18px; left:40px; z-index:10; visibility:hidden">上传中,请稍候...</div>
<input name="back_form" type="hidden" value="myform.pic"/>
&nbsp;&nbsp;<input type="file" name="file1" value="" onpropertychange="chkimg(this.value)" class="ipt2">
<input type="submit" name="Submit" value="加入图片" class="button" onClick="javascript:mysub()">无图请留空,文件不大于<font color="#FF0000">200</font>K<span id="show1"></span><span id="show"></span>
</form>
</body>
</html>