<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<title></title>
<script type="text/javascript" language="JavaScript">
function in_array(a, s)
{
	var s = new String(s);
	s = s.toLowerCase();
	var a = new String(a);	
	a = a.toLowerCase();
	return (","+a+",").indexOf(","+s+",");
}

function get_extname(s)
{
	var s = new String(s)
	s = s.toLowerCase();
	if ((s.lastIndexOf(".")>-1) &&((s.length-1)>s.lastIndexOf("."))) 
	{		
		return s.substring(s.lastIndexOf(".")+1);
	}
	else
	{
		return false;
	}	
}

function previewPic(obj)
{		
	var allow_ext = new Array("gif");		
	if ((in_array(allow_ext, get_extname(obj.value)))>-1)
	{	
		document.uploadForm.Submit1.disabled = false;
		return true;
	}
	else
	{	
		alert(get_extname(obj.value)+" 格式不正确，只能以Gif图片做为模板背景！ :)");
		document.uploadForm.Submit1.disabled = true;
		document.uploadForm.reset();
		return false;
	}
}
</script>
</head>
<style>
TABLE {
	FONT-SIZE: 9pt; FONT-FAMILY: "Arial"; TEXT-DECORATION: none
}
.TableBorder
{
width:100%;background-color: #ffffff;
}
input{border:solid 1px #482400;BACKGROUND-COLOR: #E7DDD8;COLOR: #000000;FONT-FAMILY: "Arial";font-size: 12px;}
</style>
<BODY>
<table border="0" align=center cellpadding="0" cellspacing="0" class=Tableborder>
  <form name="uploadForm" method="POST" enctype="multipart/form-data" action="addusertheme_f_save.asp?filename=<%=request.querystring("filename")%>">
  <tr>
  <td Class=TdBg>
 <input type="file" name="file1" onChange="previewPic(this)">&nbsp;<input type="submit" value="上载" name="Submit1">
  </td>
  </tr>
  </form>
</table>
</body>
</html>
