<!--#include file="../include/hf_conn.asp"-->
<!--#include file="checkadmin.asp"-->
<script language=javascript src=../include/mouse_on_title.js></script>
<%call checkmanage("02")%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="manage.css" type="text/css">
</head>
<BODY background="../images/admin/back.gif">

<%
action=request("ok")
flash2=request("flash2")
if action="" then 
Set rs = conn.Execute("select * from adv") 
if flash2="" then flash2=rs("flash2")
%>

	<table width="98%" border="1"  style="border-collapse: collapse; border-style: dotted; border-width: 0px"  bordercolor="#333333" cellspacing="0" cellpadding="2">
	<form action=adv5.asp method=post name=adv>
	
	<tr class=backs><td colspan=2 class=td height=18>横幅图片设置</td></tr>

    <tr>
      <td width=20% align=right height="18">图片类型</td><td><input type="radio" value="0" <%if flash2=0 then%>checked<% end if%> name="flash2" onClick="javascript:location.href='adv5.asp?flash2=0';">JPG/GIF格式的图片<br><input type="radio" value="1"  <%if flash2=1 then%> checked<% end if%> name="flash2"  onclick="javascript:location.href='adv5.asp?flash2=1';">flash格式的图片<br><input type="radio" value="2"  <%if flash2=2 then%> checked<% end if%> name="flash2"  onclick="javascript:location.href='adv5.asp?flash2=2';">隐藏横幅</td>
    </tr>

<%
if flash2=1 then
%>
    <tr>
      <td width=20% align=right height="18">Flash图片</td><td> <input type=text value="<%=rs("flash2url")%>" name=flash2url size=40 maxlength=100> <INPUT TYPE="button" value="浏览"  onClick="window.open('upload.asp?fuptype=adv&fupname=banner2&frmname=flash2url','blank_','scrollbars=yes,resizable=no,width=650,height=450')"></td>
    </tr>

    <tr>
      <td width=20% align=right height="18">Flash显示宽高</td><td> 宽：<input type=text value="<%=rs("flash2width")%>" name=flash2width  maxlength=3 size=6>象素&nbsp;&nbsp;   
        高：<input type=text value="<%=rs("flash2height")%>" name=flash2height size=6  maxlength=3>象素<br>[宽推荐值：560，高根据FLASH图片的实际宽高比决定]</td>
    </tr>
<%
elseif flash2=0 then
%>
    <tr>
      <td width=20% align=right height="18">JPG/GIF图片</td><td> <input type=text value="<%=rs("hf2pic")%>" name=hf2pic size=40 maxlength=100> <INPUT TYPE="button" value="浏览"  onClick="window.open('upload.asp?fuptype=adv&fupname=banner2&frmname=hf2pic','blank_','scrollbars=yes,resizable=no,width=650,height=450')"></td>
    </tr>
    <tr>
      <td width=20% align=right height="18">链接</td><td> <input type=text value="<%=rs("hf2url")%>" name=hf2url size=40 maxlength=100></td>
    </tr>
    <tr>
      <td width=20% align=right height="18">说明</td><td> <input type=text value="<%=rs("hf2tit")%>" name=hf2tit size=40 maxlength=100></td>
    </tr>
<%
end if
%>
	
	<tr><td colspan=2>
<INPUT name="ok" TYPE="hidden" value="ok"><INPUT name=action TYPE="submit" value="保存设置"></td></tr>
</form></table>
	<%
	rs.close
	conn.close
	set rs=nothing
	set conn=nothing
end if%>

<%              
if action="ok" then

	if flash2=1 then
	if trim(request.form("flash2url"))="" then er=1
	if not isNumeric(request.form("flash2width")) or not isNumeric(request.form("flash2height")) then er=3

	flash2url=request.form("flash2url")
	flash2url=split(flash2url,".")
	n=UBound(flash2url)
	if LCase(flash2url(n))<>"swf" then er=2

	elseif flash2=0 then
	if trim(request.form("hf2pic"))="" then er=1

	hf2pic=request.form("hf2pic")
	hf2pic=split(hf2pic,".")
	n=UBound(hf2pic)
	if LCase(hf2pic(n))<>"jpg" and LCase(hf2pic(n))<>"gif"  then er=2

	end if


	if er=1 then
	response.write "<script language='javascript'>"
	response.write "alert('填写不完整或者不符合要求，单击“确定”返回上一页！');"
	response.write "location.href='javascript:history.go(-1)';"
	response.write "</script>"
	response.end
	end if

	if er=2 then
	response.write "<script language='javascript'>"
	response.write "alert('您填写的图片格式不正确，单击“确定”返回上一页！');"
	response.write "location.href='javascript:history.go(-1)';"
	response.write "</script>"
	response.end
	end if

	if er=3 then
	response.write "<script language='javascript'>"
	response.write "alert('图片的宽高尺寸必须是数字，单击“确定”返回上一页！');"
	response.write "location.href='javascript:history.go(-1)';"
	response.write "</script>"
	response.end
	end if


     Set rs=Server.CreateObject("ADODB.Recordset")
	 sql="select * from adv"
	 rs.open sql,conn,1,3
 	 rs("flash2")=request.form("flash2")
	if flash2=1 then
 	 rs("flash2url")=trim(request.form("flash2url"))
 	 rs("flash2width")=trim(request.form("flash2width"))
 	 rs("flash2height")=trim(request.form("flash2height"))
	elseif flash2=0 then
 	 rs("hf2pic")=trim(request.form("hf2pic"))
 	 rs("hf2url")=trim(request.form("hf2url"))
 	 rs("hf2tit")=trim(request.form("hf2tit"))
	end if

	rs.update
	rs.close
	conn.close
	set rs=nothing
	set conn=nothing

	response.write "<script language='javascript'>"
	response.write "alert('首页中部的横幅图片设置成功！');"
	response.write "location.href='adv5.asp';"
	response.write "</script>"
	response.end
end if%>

</body>
</html>

