<!--#include file="conn.asp"-->
<!--#include file="inc/const.asp"-->
<!--#include file="YD_pet_conn.asp"-->
<!--#include file="inc/plus_check.asp"-->

<%
Response.Buffer = True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0 
Response.CacheControl = "no-cache" 

dim menu,savem,rsbank,rssql,chentitle,chenbackasp,stats,errmsg,founderr,action
chentitle="宠物物品箱"
Dv_plus.name="petcenter"
'Dv_plus.checklogin()
Dvbbs.LoadTemplates("")
Dvbbs.Stats="宠物物品箱"
Dvbbs.Nav()
Dvbbs.Head_var 0,"","宠物中心","YD_petcenter.asp"

if DvBBS.UserId = 0 then
	AlarmErrmsg
else
	'宠物插件状态
	if DEF_PET_close>1 then
		'暂时关掉开始
		if not dvbbs.master then
			call showmessage("调试中,请以后再来~","index.asp")
		end if
		'暂时关掉结束
	end if
	dim money,smoney,saveday,allmoney,time1,time2,daikuang,dkdu,daiday,sucmsg
	dim Form_userphoto,Form_FaceUrl,Form_FaceWidth,Form_FaceHeight
	Dim Rs,SQL
	set rs=Dvbbs.execute("select userWealth from [Dv_User] where UserID="&DvBBS.UserId)
	money=rs("userWealth")
	rs.close
	
	sql = "SELECT * FROM mypetdata WHERE username='"&DvBBS.MemberName&"' "
	rs.open sql,connpet,1,3
	if rs.eof then
		call showmessage("你还没有宠物啊，快攒钱去买吧~","YD_petshop.asp")
	else

		'注册宠物随身物品和属性
		dim today,pett,petlevel,petep,petshowlevel,levelpic,intval,level1,petpic,pethp,petmaxhp
		dim petatk,petdef,updat,newpettoday,petsp,petsex,petpk
		dim hpf,spf,mypetdead,petdead,mypetsex,str,ski,def,vit,szd,skill,hpmaxskill
		dim item1,item2,item3,item4,item5,mypet,mypetsx,imgset
		today = date()
		pett= DateDiff("d", rs("petregdate"), today)
		petlevel = sqr((Log(rs("mypetexp")) / Log(10)) * (Log(rs("mypetexp")) / Log(10)) * (Log(rs("mypetexp")) / Log(10)) * (Log(rs("mypetexp")) / Log(10)) * (Log(rs("mypetexp")) / Log(10)))
		petep = int (100 * (petlevel - int (petlevel)))
		petshowlevel = int (petlevel + 1)
		levelpic=int(petshowlevel/10)
		if levelpic>10 then levelpic=11 end if
		level1=int(petshowlevel)
		petpic=rs("mypetname")
		pethp=rs("mypethp")
		str=rs("str")
		ski=rs("ski")
		def=rs("def")
		vit=rs("vit")
		szd=rs("szd")+petshowlevel*5-str-ski-def-vit
		skill=rs("skill")+petshowlevel-rs("atkskill")-rs("defskill")-rs("lifeskill")-rs("luckskill")-rs("learnskill")-rs("hpmaxskill")
		petatk=rs("mypetatk")+rs("item1Num")+rs("item2Num")+int(str/2)
		petdef=rs("mypetdef")+rs("item3Num")+rs("item4Num")+rs("item5Num")+int(ski/2)
		updat=0
		'获取生命上限
		hpmaxskill=1

		if rs("hpmaxskill")>0 then
			hpmaxskill=1+rs("hpmaxskill")/100
		end if

		if rs("hpmaxskill")>30 then
			hpmaxskill=1.2+rs("hpmaxskill")/100
		end if
 
		if rs("hpmaxskill")>100 then
			hpmaxskill=1.5+rs("hpmaxskill")/100
		end if 

		petmaxhp = int((rs("mypetmaxhp")+vit)*hpmaxskill)
		petsp=rs("mypetsp")-pett*DEF_PET_basicsp2

		if petsp>DEF_PET_basicsp then
			petsp=DEF_PET_basicsp
		end if

		if pett>0 then
			updat=1
		end if

		hpf= int(100 * (pethp / petmaxhp)) - 1
		spf= int(100 * (petsp / DEF_PET_basicsp)) - 1

		if pethp<1 then
			pethp=0
			mypetdead=1
			updat=1
		elseif petsp<1 then
			petsp=0
			mypetdead=1
			updat=1
		else 
			mypetdead=0
			updat=1
		end if

		if pethp<1 or petsp<1 then
			petdead="死亡"
		else
			petdead="生存"
		end if

		if rs("mypetsex")<2 then 
			petsex="雄"
		else 
			petsex="雌"
		end if

		if rs("openpk")<2 then 
			petpk="等待挑战"
		else 
			petpk="拒绝挑战"
		end if

		if hpf >= 98 then hpf = hpf - 2 end if
		if spf >= 98 then spf = spf - 2 end if
		dim petkill
		if petdead="死亡" then
			petkill="d-"
		else
			petkill=""
		end if

		if updat=1 then
			sql = "UPDATE mypetdata SET mypetlevel="& petshowlevel &",mypethp="& pethp &",mypetsp="&petsp&",mypetdead="&mypetdead&",petregdate="&Pet_NowString&" WHERE username='"& DvBBS.MemberName &"'"
			connpet.ExeCute(sql)
			updat=0
		end if

		'宠物物品
		item1 = rs("item1")
		if isNull(item1) or item1="" then item1=0
		item2 = rs("item2")
		if isNull(item2) or item2="" then item2=0
		item3 = rs("item3")
		if isNull(item3) or item3="" then item3=0
		item4 = rs("item4")
		if isNull(item4) or item4="" then item4=0
		item5 = rs("item5")
		if isNull(item5) or item5="" then item5=0
		mypet = rs("mypet")
		mypetsx = rs("mypetsx")
		imgset = rs("imgset") 
		dim tmoney,sword,tmp,necklace,head,body,foot,rndNum
		if request("action") = "" then
			action = "givesell"
		else
			action = lcase(request("action"))
		end if

		'注册宠物物品箱中物品
		Dim Rs2,SQL2,hpitem,spitem,expitem,atkitem,defitem,liveitem,weopitem,amoritem,jewel,ring,it1,it1n,it2,it2n,it3,it3n,it4,it4n,it5,it5n,it6,it6n,it7,it7n,it8,it8n
		dim tempname,tempclass,tempNum,tempN,it,temp,tempp
		sql2 = "SELECT * FROM useritem WHERE username='"&Dvbbs.MemberName&"' "
		set rs2=connpet.ExeCute(sql2)
		hpitem=rs2("hpitem")
		spitem=rs2("spitem")
		expitem=rs2("expitem")
		liveitem=rs2("liveitem")
		weopitem=rs2("weopitem")
		amoritem=rs2("amoritem")
		jewel=rs2("jewel")
		ring=rs2("ring")
		it1=rs2("it1")
		it1n=rs2("it1n")
		it2=rs2("it2")
		it2n=rs2("it2n")
		it3=rs2("it3")
		it3n=rs2("it3n")
		it4=rs2("it4")
		it4n=rs2("it4n")
		it5=rs2("it5")
		it5n=rs2("it5n")
		it6=rs2("it6")
		it6n=rs2("it6n")
		it7=rs2("it7")
		it7n=rs2("it7n")
		it8=rs2("it8")
		it8n=rs2("it8n")

		'判断物品栏是否已经满
		tempp=0
		if it8=0 then tempp=8 end if
		if it7=0 then tempp=7 end if
		if it6=0 then tempp=6 end if
		if it5=0 then tempp=5 end if
		if it4=0 then tempp=4 end if
		if it3=0 then tempp=3 end if
		if it2=0 then tempp=2 end if
		if it1=0 then tempp=1 end if

		'用很无聊的循环使用变量得到每种道具的名字……
		dim rs3,swordname,necklacename,headname,bodyname,footname
		set rs3 = connpet.execute("select * from petitemshop where itemclass='sword' and itemnum="&item1)
		swordname = rs3("itemname")
		rs3.close
		set rs3 = connpet.execute("select * from petitemshop where itemclass='necklace' and itemnum="&item2)
		necklacename = rs3("itemname")
		rs3.close
		set rs3 = connpet.execute("select * from petitemshop where itemclass='head' and itemnum="&item3)
		headname = rs3("itemname")
		rs3.close
		set rs3 = connpet.execute("select * from petitemshop where itemclass='body' and itemnum="&item4)
		bodyname = rs3("itemname")
		rs3.close
		set rs3 = connpet.execute("select * from petitemshop where itemclass='foot' and itemnum="&item5)
		footname = rs3("itemname")
		rs3.close

		'触发事件
		select case action
			'装备物品
			case "sell"				
				tempNum = Clng(request("tempNum"))	'物品等级
				tempclass = Checkstr(request("tempclass"))	'物品类型
				tempName = Checkstr(request("tempName"))   '物品名称
				it=cint(request("it"))			'物品栏位置

				select case tempclass
					case "sword" 
						temp=1
					case "necklace"
						temp=2
					case "head"
						temp=3
					case "body"
						temp=4
					case "foot"
						temp=5
				end select

				'判断身上是否有装备
				if rs("item"&temp)<>0 then
					call showmessage("你的身上装备了物品<br>请卸下身上的物品后重新装备","YD_petitbox.asp")
				else
					select case it
						case 1
							connpet.execute("update [useritem] set it1=0,it1n=0 where username='"&DvBBS.MemberName&"'")
							tempN = it1n
						case 2
							connpet.execute("update [useritem] set it2=0,it2n=0 where username='"&DvBBS.MemberName&"'")
							tempN = it2n
						case 3
							connpet.execute("update [useritem] set it3=0,it3n=0 where username='"&DvBBS.MemberName&"'")
							tempN = it3n
						case 4
							connpet.execute("update [useritem] set it4=0,it4n=0 where username='"&DvBBS.MemberName&"'")
							tempN = it4n
						case 5
							connpet.execute("update [useritem] set it5=0,it5n=0 where username='"&DvBBS.MemberName&"'")
							tempN = it5n
						case 6
							connpet.execute("update [useritem] set it6=0,it6n=0 where username='"&DvBBS.MemberName&"'")
							tempN = it6n
						case 7
							connpet.execute("update [useritem] set it7=0,it7n=0 where username='"&DvBBS.MemberName&"'")
							tempN = it7n
						case 8
							connpet.execute("update [useritem] set it8=0,it8n=0 where username='"&DvBBS.MemberName&"'")
							tempN = it8n
					end select

					select case temp
						case 1
							connpet.execute("update [mypetdata] set item1="&tempNum&",item1num="&tempN&" where username='"&DvBBS.MemberName&"'")
						case 2
							connpet.execute("update [mypetdata] set item2="&tempNum&",item2num="&tempN&" where username='"&DvBBS.MemberName&"'")
						case 3
							connpet.execute("update [mypetdata] set item3="&tempNum&",item3num="&tempN&" where username='"&DvBBS.MemberName&"'")
						case 4
							connpet.execute("update [mypetdata] set item4="&tempNum&",item4num="&tempN&" where username='"&DvBBS.MemberName&"'")
						case 5
							connpet.execute("update [mypetdata] set item5="&tempNum&",item5num="&tempN&" where username='"&DvBBS.MemberName&"'")
					end select

					call showmessage("您已成功装备了"&tempname,"YD_petitbox.asp")
				end if

			'丢弃物品	
			case "buy"
				tempName = Checkstr(request("tempName"))		'物品名称
				it=cint(request("it"))			'物品栏位置

				select case it
					case 1
						connpet.execute("update [useritem] set it1=0,it1n=0 where username='"&DvBBS.MemberName&"'")
					case 2
						connpet.execute("update [useritem] set it2=0,it2n=0 where username='"&DvBBS.MemberName&"'")
					case 3
						connpet.execute("update [useritem] set it3=0,it3n=0 where username='"&DvBBS.MemberName&"'")
					case 4
						connpet.execute("update [useritem] set it4=0,it4n=0 where username='"&DvBBS.MemberName&"'")
					case 5
						connpet.execute("update [useritem] set it5=0,it5n=0 where username='"&DvBBS.MemberName&"'")
					case 6
						connpet.execute("update [useritem] set it6=0,it6n=0 where username='"&DvBBS.MemberName&"'")
					case 7
						connpet.execute("update [useritem] set it7=0,it7n=0 where username='"&DvBBS.MemberName&"'")
					case 8
						connpet.execute("update [useritem] set it8=0,it8n=0 where username='"&DvBBS.MemberName&"'")
				end select

				call showmessage("您已成功丢弃了"&tempname,"YD_petitbox.asp")

			'卸下物品
			case "nosell"
				it=cint(request("it")) 	 '物品栏位置
				if tempp=0 then 
					call showmessage("您的物品箱已满","YD_petitbox.asp")
				else
					tempNum = rs("item"&it)           '物品等级
					tempN=rs("item"&it&"Num") 		  '物品强度
					select case it
						case 1
							set rs3 = connpet.execute("select * from petitemshop where itemclass='sword' and itemnum="&rs("item"&it))
							tempclass=rs3("id")
							connpet.execute("update [mypetdata] set item1=0,item1num=0 where username='"&DvBBS.MemberName&"'")

							select case tempp
								case 1
									connpet.execute("update [useritem] set it1="&tempclass&",it1n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 2
									connpet.execute("update [useritem] set it2="&tempclass&",it2n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 3
									connpet.execute("update [useritem] set it3="&tempclass&",it3n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 4
									connpet.execute("update [useritem] set it4="&tempclass&",it4n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 5
									connpet.execute("update [useritem] set it5="&tempclass&",it5n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 6
									connpet.execute("update [useritem] set it6="&tempclass&",it6n="&tempN&" where username='"&DvBBS.MemberName&"'")							
								case 7
									connpet.execute("update [useritem] set it7="&tempclass&",it7n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 8
									connpet.execute("update [useritem] set it8="&tempclass&",it8n="&tempN&" where username='"&DvBBS.MemberName&"'")							
							end select
		
						case 2
							set rs3 = connpet.execute("select * from petitemshop where itemclass='necklace' and itemnum="&rs("item"&it))
							tempclass=rs3("id")
							connpet.execute("update [mypetdata] set item2=0,item2num=0 where username='"&DvBBS.MemberName&"'")

							select case tempp
								case 1
									connpet.execute("update [useritem] set it1="&tempclass&",it1n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 2
									connpet.execute("update [useritem] set it2="&tempclass&",it2n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 3
									connpet.execute("update [useritem] set it3="&tempclass&",it3n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 4
									connpet.execute("update [useritem] set it4="&tempclass&",it4n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 5
									connpet.execute("update [useritem] set it5="&tempclass&",it5n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 6
									connpet.execute("update [useritem] set it6="&tempclass&",it6n="&tempN&" where username='"&DvBBS.MemberName&"'")							
								case 7
									connpet.execute("update [useritem] set it7="&tempclass&",it7n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 8
									connpet.execute("update [useritem] set it8="&tempclass&",it8n="&tempN&" where username='"&DvBBS.MemberName&"'")							
							end select

						case 3
							set rs3 = connpet.execute("select * from petitemshop where itemclass='head' and itemnum="&rs("item"&it))
							tempclass=rs3("id")
							connpet.execute("update [mypetdata] set item3=0,item3num=0 where username='"&DvBBS.MemberName&"'")
							select case tempp
								case 1
									connpet.execute("update [useritem] set it1="&tempclass&",it1n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 2
									connpet.execute("update [useritem] set it2="&tempclass&",it2n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 3
									connpet.execute("update [useritem] set it3="&tempclass&",it3n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 4
									connpet.execute("update [useritem] set it4="&tempclass&",it4n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 5
									connpet.execute("update [useritem] set it5="&tempclass&",it5n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 6
									connpet.execute("update [useritem] set it6="&tempclass&",it6n="&tempN&" where username='"&DvBBS.MemberName&"'")							
								case 7
									connpet.execute("update [useritem] set it7="&tempclass&",it7n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 8
									connpet.execute("update [useritem] set it8="&tempclass&",it8n="&tempN&" where username='"&DvBBS.MemberName&"'")							
							end select

						case 4
							set rs3 = connpet.execute("select * from petitemshop where itemclass='body' and itemnum="&rs("item"&it))
							tempclass=rs3("id")
							connpet.execute("update [mypetdata] set item4=0,item4num=0 where username='"&DvBBS.MemberName&"'")
							select case tempp
								case 1
									connpet.execute("update [useritem] set it1="&tempclass&",it1n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 2
									connpet.execute("update [useritem] set it2="&tempclass&",it2n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 3
									connpet.execute("update [useritem] set it3="&tempclass&",it3n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 4
									connpet.execute("update [useritem] set it4="&tempclass&",it4n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 5
									connpet.execute("update [useritem] set it5="&tempclass&",it5n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 6
									connpet.execute("update [useritem] set it6="&tempclass&",it6n="&tempN&" where username='"&DvBBS.MemberName&"'")							
								case 7
									connpet.execute("update [useritem] set it7="&tempclass&",it7n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 8
									connpet.execute("update [useritem] set it8="&tempclass&",it8n="&tempN&" where username='"&DvBBS.MemberName&"'")							
							end select

						case 5
							set rs3 = connpet.execute("select * from petitemshop where itemclass='foot' and itemnum="&rs("item"&it))
							tempclass=rs3("id")
							connpet.execute("update [mypetdata] set item5=0,item5num=0 where username='"&DvBBS.MemberName&"'")
							select case tempp
								case 1
									connpet.execute("update [useritem] set it1="&tempclass&",it1n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 2
									connpet.execute("update [useritem] set it2="&tempclass&",it2n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 3
									connpet.execute("update [useritem] set it3="&tempclass&",it3n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 4
									connpet.execute("update [useritem] set it4="&tempclass&",it4n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 5
									connpet.execute("update [useritem] set it5="&tempclass&",it5n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 6
									connpet.execute("update [useritem] set it6="&tempclass&",it6n="&tempN&" where username='"&DvBBS.MemberName&"'")							
								case 7
									connpet.execute("update [useritem] set it7="&tempclass&",it7n="&tempN&" where username='"&DvBBS.MemberName&"'")
								case 8
									connpet.execute("update [useritem] set it8="&tempclass&",it8n="&tempN&" where username='"&DvBBS.MemberName&"'")							
							end select		
							rs3.close

					end select
				end if
				call showmessage("您已成功卸下装备","YD_petitbox.asp")

			'npc物品
			case "npc"
				tempName = Checkstr(request("tempName"))       '物品名称
				it=cint(request("it")) 			    	 '物品栏位置

				tempN = rs2("it"&it&"n")
				if tempN=0 then
					call showmessage("把我当什么了，这种垃圾我才不要呢","YD_petitbox.asp")
				end if

				if rs2("it"&it)=0 then
					call showmessage("刷钱者，杀无赦","YD_petitbox.asp")
				end if

				randomize
				dim npc1,npc2
				npc2=Int((100*Rnd)+10)		'产生100到10的随机整数
				npc1=int((tempN*npc2)/5)
				Dvbbs.execute("UPDATE [DV_user] SET userWealth=userWealth+"&npc1&" WHERE username='"&DvBBS.MemberName&"'")
				Call UpdateUserInfo(npc1,0,0,0,0,0)
				select case it
					case 1
						connpet.execute("update [useritem] set it1=0,it1n=0 where username='"&DvBBS.MemberName&"'")
					case 2
						connpet.execute("update [useritem] set it2=0,it2n=0 where username='"&DvBBS.MemberName&"'")
					case 3
						connpet.execute("update [useritem] set it3=0,it3n=0 where username='"&DvBBS.MemberName&"'")
					case 4
						connpet.execute("update [useritem] set it4=0,it4n=0 where username='"&DvBBS.MemberName&"'")
					case 5
						connpet.execute("update [useritem] set it5=0,it5n=0 where username='"&DvBBS.MemberName&"'")
					case 6
						connpet.execute("update [useritem] set it6=0,it6n=0 where username='"&DvBBS.MemberName&"'")
					case 7
						connpet.execute("update [useritem] set it7=0,it7n=0 where username='"&DvBBS.MemberName&"'")
					case 8
						connpet.execute("update [useritem] set it8=0,it8n=0 where username='"&DvBBS.MemberName&"'")
				end select

				call showmessage("您以"&npc1&"的价格出售了"&tempname,"YD_petitbox.asp")
		end select
	end if
	call main()
End If
Set Dv_plus=Nothing
Dvbbs.Footer

sub main()
%>
<table class=tableborder1 cellspacing=1 cellpadding=3 align=center>
  <tr>
    <th height=27 align=center><%=Dvbbs.stats%></th>
  </tr>
  <tr>
    <td class=TableBody1 valign=top width="100%" height="278" align=center>
      <table width="766" cellspacing="0" cellpadding="0" height="295">
	<tr>
	  <td width="253" rowspan="2" valign=top height="295">
	    <table width="79%" align="center" cellpadding="3" cellspacing="3">
	      <tr>
		<td width="100%" align="center">我的资料</td>
	      </tr>
	      <tr>
		<td align="center">
		<%
		'用户头像调用开始
		If IsNumeric(Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@userwidth").text) And IsNumeric(Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@userheight").text) And Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@userheight").text<>"" And Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@userwidth").text<>"" Then
			If Clng(Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@userheight").text)=Clng(Dvbbs.Forum_Setting(39)) And Clng(Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@userwidth").text)=Clng(Dvbbs.Forum_Setting(38)) Then
				response.write "<img src="&Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@userface").text&">"
			Else
				response.write "<img src="&Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@userface").text&" width=100 height=100>"
			End If
		Else
			response.write "<img src=images/logo_2.gif>"
		End If
		'用户头像调用结束
		%>
		</td>
	      </tr>
	      <tr>
		<td align="center"><nobr>现金货币: <%=money%></nobr></td>
	      </tr>
	    </table>
	    <br>
	    <table width="90%" align="center" cellpadding="3" cellspacing="3">
	      <tr>
		<td align="center">
		<!-- #include file=YD_petnav.asp -->
		</td>
	      </tr>
	    </table>
	    <br>
	    <table width="79%" align="center" cellpadding="3" cellspacing="3">
	      <tr>
		<td width="100%" align="center"><img src="YD_plus/YD_pet/PET/27.gif"></td>
	      </tr>
	    </table>
	    <br>
	  </td>
	  <td width="549" height="235">
	    <table cellpadding="0" cellspacing="0" width="100%">
	      <tr>
		<td width="100%">
		  <table width="456" border="0" cellspacing="2" cellpadding="2">
		    <tr>
		      <td width="166" align="right"><font color="#FF0000">点击装备就能卸下</font></td>
		      <td width="105" align="center"><a href="YD_petitbox.asp?action=nosell&it=3"><img src="YD_plus/YD_pet/PET/head/<%=rs("item3")%>.gif" border="0" alt="<%=headname%> 防御力 <%=rs("item3Num")%>"></a></td>
		      <td width="165"><font color="#FF0000">点击装备就能卸下</font></td>
		    </tr>
		    <tr>
		      <td width="166" align="right"><a href="YD_petitbox.asp?action=nosell&it=1"><img height=30 src="YD_plus/YD_pet/PET/sword/<%=rs("item1")%>.gif" border="0" alt="<%=swordname%> 攻击力 <%=rs("item1Num")%>"></a></td>
		      <td rowspan="2" width="105" align="center">
			<%if rs("imgset")=-1 then%>
				<img src="YD_plus/YD_pet/PET/<%=petpic%>/<%=petkill%><%=petpic%><%=levelpic%>.gif" border="0">
			<%else%>
				<img src="YD_plus/YD_pet/PET/<%=petpic%>/<%=petkill%><%=petpic%><%=imgset%>.gif" border="0">
			<%end if%>
		      </td>
		      <td width="165"><a href="YD_petitbox.asp?action=nosell&it=4"><img src="YD_plus/YD_pet/PET/body/<%=rs("item4")%>.gif" border="0" alt="<%=bodyname%> 防御力 <%=rs("item4Num")%>"></a></td>
		    </tr>
		    <tr>
		      <td width="166" align="right"><a href="YD_petitbox.asp?action=nosell&it=2"><img src="YD_plus/YD_pet/PET/necklace/<%=rs("item2")%>.gif" border="0" alt="<%=necklacename%> 攻击力 <%=rs("item2Num")%>"></a></td>
		      <td width="165"><a href="YD_petitbox.asp?action=nosell&it=5"><img src="YD_plus/YD_pet/PET/foot/<%=rs("item5")%>.gif" border="0" alt="<%=footname%> 防御力 <%=rs("item5Num")%>"></a></td>
		    </tr>
		  </table>
		  <table width="100%" border="0" cellpadding="1" cellspacing="1">
		    <tr>
		      <td width="33%" align="left">
			宠物名称：<%=mypet%><br>
			宠物性别：<%=petsex%><br>
			宠物状态：<%=petdead%><br>
			宠物属性：<%=mypetsx%><br>
			宠物PK：<%=petpk%><br>
			宠物转生：<%=rs("relive")%><br>
			宠物级别：<%=petshowlevel%>
		      </td>
		      <td width="33%">
			力量：<%=str%><br>
			皮肤：<%=ski%><br>
			敏捷：<%=def%><br>
			体力：<%=vit%><br>
			攻击力：<%=petatk%><br>
			防御力：<%=petdef%><br>
			素质点：<%=szd%>
		      </td>
		      <td width="33%">
			HP : <%=pethp%> / <%=petmaxhp%><br>
			<table width="120" border="0" cellspacing="0" cellpadding="0" bordercolor="#000000">
			  <tr>
			    <TD width=3 height=13><IMG height=13 src="YD_plus/YD_pet/RPG/img_left.gif" width=3></TD>
			    <TD width=114 background=YD_plus/YD_pet/RPG/img_backing.gif height=13><img src="YD_plus/YD_pet/RPG/orange.gif" width="<%=hpf%>%" height="9"><img src="YD_plus/YD_pet/RPG/hp.gif" height="9"></td>
			    <TD width=3 height=13><IMG height=13 src="YD_plus/YD_pet/RPG/img_right.gif" width=3></TD>
			  </tr>
			</table>
			SP : <%=petsp%> / <%=DEF_PET_basicsp%><br>
			<table width="120" border="0" cellspacing="0" cellpadding="0" bordercolor="#000000">
			  <tr>
			    <TD width=3 height=13><IMG height=13 src="YD_plus/YD_pet/RPG/img_left.gif" width=3></TD>
			    <TD width=114 background=YD_plus/YD_pet/RPG/img_backing.gif height=13><img src="YD_plus/YD_pet/RPG/green.gif" width="<%=spf%>%" height="9"><img src="YD_plus/YD_pet/RPG/mp.gif" height="9"></td>
			    <TD width=3 height=13><IMG height=13 src="YD_plus/YD_pet/RPG/img_right.gif" width=3></TD>
			  </tr>
			</table>
			EXP : <%=petep%>%[<%=rs("mypetexp")%>]<br>
			<table width="120" border="0" cellspacing="0" cellpadding="0" bordercolor="#000000">
			  <tr>
			    <TD width=3 height=13><IMG height=13 src="YD_plus/YD_pet/RPG/img_left.gif" width=3></TD>
			    <TD width=114 background=YD_plus/YD_pet/RPG/img_backing.gif height=13><img src="YD_plus/YD_pet/RPG/blue.gif" width="<%=petep%>%" height="9"><img src="YD_plus/YD_pet/RPG/exp.gif" height="9"></td>
			    <TD width=3 height=13><IMG height=13 src="YD_plus/YD_pet/RPG/img_right.gif" width=3></TD>
			  </tr>
			</table>
		      </td>
		    </tr>
		  </table>
		</td>
	      </tr>
	      <tr>
		<td width="100%">
		  <table border="0" cellpadding="0" cellspacing="0" width="80%" align="center">
		    <tr>
		      <td width="25%" align="center">
			<IMG height=40 src="YD_plus/YD_pet/PET/wp.gif" width=40><BR>
			武器升级材料
		      </td>
		      <td width="25%" align="center">拥有数量：<%=weopitem%></td>
		      <td width="25%" align="center">
			<IMG height=40 src="YD_plus/YD_pet/PET/am.gif" width=40><BR>
			防具升级材料
		      </td>
		      <td width="25%" align="center">拥有数量：<%=amoritem%></td>
		    </tr>
		    <tr>
		      <td width="25%" align="center">
			<IMG height=40 src="YD_plus/YD_pet/PET/wp.gif" width=40><BR>
			钻石
		      </td>
		      <td width="25%" align="center">拥有数量：<%=jewel%></td>
		      <td width="25%" align="center">
			<IMG height=40 src="YD_plus/YD_pet/PET/am.gif" width=40><BR>
			求婚戒指
		      </td>
		      <td width="25%" align="center">拥有数量：<%=ring%></td>
		    </tr>
		  </table>
		</td>
	      </tr>
	    </table>
	  </td>
	</tr>
	<tr>
	  <td width="549" valign=top align="left"> 
	<%
	if action<>"buy" and action<>"sell" and action<>"givesell" then
		rs.open sql,connpet,1,1
		if rs.bof and rs.eof then response.write "</td></tr></table>" :  Set Dv_plus=Nothing : Dvbbs.Footer : response.end
			rs.movefirst
			do while not rs.eof
				rs.movenext
			loop
			rs.close
		elseif action = "givesell" then
			SQL = "SELECT * FROM mypetdata WHERE username='"&DvBBS.MemberName&"'"
			set rs = connpet.execute(SQL)
	%>
	    <table cellSpacing=1 cellPadding=3 width=438 align=center border=0 width="100%" height="63">
	      <tr>
		<td width="114" height="17" align=center>物品名称</td>
		<td width="114" height="17" align=center>物品形象</td>
		<td width="114" height="17" align=center>攻击/防御</td>
		<td width="120" height="17" align=center colspan="3">装备/出售/丢弃</td>
	      </tr>
	<%
	if it1<>0 then
		set rs3 = connpet.execute("select * from petitemshop where id="&it1)
		tempname = rs3("itemname")
		tempclass=rs3("itemclass")
		tempNum=rs3("itemNum")
		it=1
		rs3.close
	%>
	      <tr>
		<td width="114" height="32" align=center><%=tempname%></td>
		<td width="114" height="32" align=center><IMG height=30 src="YD_plus/YD_pet/PET/<%=tempclass%>/<%=tempNum%>.gif" width=30></td>
		<td width="114" height="32" align=center>＋ <%=it1n%></td>
		<td height="32" align=center width="40">
		<form action="YD_petitbox.asp" method="post">
		<input type="submit" value="装备">
		<input type="hidden" name="action" value="sell">
		<input type="hidden" name="tempname" value="<%=tempname%>">
		<input type="hidden" name="tempclass" value="<%=tempclass%>">
		<input type="hidden" name="tempN" value="<%=it1n%>">
		<input type="hidden" name="tempNum" value="<%=tempNum%>">
		<input type="hidden" name="it" value="<%=it%>">
		</form>
		</td>
		<td height="32" width="40" align="center">
		<form action="YD_petitbox.asp" method="post">
		<input type="submit" value="出售">
		<input type="hidden" name="action" value="npc">
		<input type="hidden" name="tempname" value="<%=tempname%>">	
		<input type="hidden" name="tempclass" value="<%=tempclass%>">
		<input type="hidden" name="tempN" value="<%=it1n%>">
		<input type="hidden" name="tempNum" value="<%=tempNum%>">
		<input type="hidden" name="it" value="<%=it%>">
		</form>
		</td>
		<td height="32" width="40" align="center">
		<form action="YD_petitbox.asp" method="post">
		<input type="submit" value="丢弃">
		<input type="hidden" name="action" value="buy">
		<input type="hidden" name="tempname" value="<%=tempname%>">
		<input type="hidden" name="tempclass" value="<%=tempclass%>">
		<input type="hidden" name="tempN" value="<%=it1n%>">
		<input type="hidden" name="tempNum" value="<%=tempNum%>">
		<input type="hidden" name="it" value="<%=it%>">
		</form>
		</td>
	      </tr>
	<%
	end if

	if it2<>0 then
		set rs3 = connpet.execute("select * from petitemshop where id="&it2)
		tempname = rs3("itemname")
		tempclass=rs3("itemclass")
		tempNum=rs3("itemNum")
		it=2
		rs3.close
	%>
	      <tr>
		<td width="114" height="32" align=center><%=tempname%></td>
		<td width="114" height="32" align=center><IMG height=30 src="YD_plus/YD_pet/PET/<%=tempclass%>/<%=tempNum%>.gif" width=30></td>
		<td width="114" height="32" align=center>＋ <%=it2n%></td>
		<td height="32" align=center width="40">
		<form action="YD_petitbox.asp" method="post">
		<input type="submit" value="装备">
		<input type="hidden" name="action" value="sell">
		<input type="hidden" name="tempname" value="<%=tempname%>">
		<input type="hidden" name="tempclass" value="<%=tempclass%>">
		<input type="hidden" name="tempN" value="<%=it2n%>">
		<input type="hidden" name="tempNum" value="<%=tempNum%>">
		<input type="hidden" name="it" value="<%=it%>">
		</form>
		</td>
		<td height="32" width="40" align="center"><form action="YD_petitbox.asp" method="post">
		<input type="submit" value="出售">
		<input type="hidden" name="action" value="npc">
		<input type="hidden" name="tempname" value="<%=tempname%>">
		<input type="hidden" name="tempclass" value="<%=tempclass%>">
		<input type="hidden" name="tempN" value="<%=it2n%>">
		<input type="hidden" name="tempNum" value="<%=tempNum%>">
		<input type="hidden" name="it" value="<%=it%>">
		</form>
		</td>
		<td height="32" width="40" align="center">
		<form action="YD_petitbox.asp" method="post">
		<input type="submit" value="丢弃">
		<input type="hidden" name="action" value="buy">
		<input type="hidden" name="tempname" value="<%=tempname%>">
		<input type="hidden" name="tempclass" value="<%=tempclass%>">
		<input type="hidden" name="tempN" value="<%=it2n%>">
		<input type="hidden" name="tempNum" value="<%=tempNum%>">
		<input type="hidden" name="it" value="<%=it%>">
		</form>
		</td>
	      </tr>
	<%
	end if

	if it3<>0 then
		set rs3 = connpet.execute("select * from petitemshop where id="&it3)
		tempname = rs3("itemname")
		tempclass=rs3("itemclass")
		tempNum=rs3("itemNum")
		it=3
		rs3.close
	%>
	      <tr>
		<td width="114" height="32" align=center><%=tempname%></td>
		<td width="114" height="32" align=center><IMG height=30 src="YD_plus/YD_pet/PET/<%=tempclass%>/<%=tempNum%>.gif" width=30></td>
		<td width="114" height="32" align=center>＋ <%=it3n%></td>
		<td height="32" align=center width="40">
		<form action="YD_petitbox.asp" method="post">
		<input type="submit" value="装备">
		<input type="hidden" name="action" value="sell">
		<input type="hidden" name="tempname" value="<%=tempname%>">
		<input type="hidden" name="tempclass" value="<%=tempclass%>">
		<input type="hidden" name="tempN" value="<%=it3n%>">
		<input type="hidden" name="tempNum" value="<%=tempNum%>">
		<input type="hidden" name="it" value="<%=it%>">
		</form>
		</td>
		<td height="32" width="40" align="center">
		<form action="YD_petitbox.asp" method="post">
		<input type="submit" value="出售">
		<input type="hidden" name="action" value="npc">
		<input type="hidden" name="tempname" value="<%=tempname%>">
		<input type="hidden" name="tempclass" value="<%=tempclass%>">
		<input type="hidden" name="tempN" value="<%=it3n%>">
		<input type="hidden" name="tempNum" value="<%=tempNum%>">
		<input type="hidden" name="it" value="<%=it%>">
		</form>
		</td>
		<td height="32" width="40" align="center">
		<form action="YD_petitbox.asp" method="post">
		<input type="submit" value="丢弃">
		<input type="hidden" name="action" value="buy">
		<input type="hidden" name="tempname" value="<%=tempname%>">
		<input type="hidden" name="tempclass" value="<%=tempclass%>">
		<input type="hidden" name="tempN" value="<%=it3n%>">
		<input type="hidden" name="tempNum" value="<%=tempNum%>">
		<input type="hidden" name="it" value="<%=it%>">
		</form>
		</td>
	      </tr>
	<%
	end if

	if it4<>0 then
		set rs3 = connpet.execute("select * from petitemshop where id="&it4)
		tempname = rs3("itemname")
		tempclass=rs3("itemclass")
		tempNum=rs3("itemNum")
		it=4
		rs3.close
	%>
	      <tr>
		<td width="114" height="32" align=center><%=tempname%></td>
		<td width="114" height="32" align=center><IMG height=30 src="YD_plus/YD_pet/PET/<%=tempclass%>/<%=tempNum%>.gif" width=30></td>
		<td width="114" height="32" align=center>＋ <%=it4n%></td>
		<td height="32" align=center width="40">
		<form action="YD_petitbox.asp" method="post">
		<input type="submit" value="装备">
		<input type="hidden" name="action" value="sell">
		<input type="hidden" name="tempname" value="<%=tempname%>">
		<input type="hidden" name="tempclass" value="<%=tempclass%>">
		<input type="hidden" name="tempN" value="<%=it4n%>">
		<input type="hidden" name="tempNum" value="<%=tempNum%>">
		<input type="hidden" name="it" value="<%=it%>">
		</form>
		</td>
		<td height="32" width="40" align="center">
		<form action="YD_petitbox.asp" method="post">
		<input type="submit" value="出售">
		<input type="hidden" name="action" value="npc">
		<input type="hidden" name="tempname" value="<%=tempname%>">
		<input type="hidden" name="tempclass" value="<%=tempclass%>">
		<input type="hidden" name="tempN" value="<%=it4n%>">
		<input type="hidden" name="tempNum" value="<%=tempNum%>">
		<input type="hidden" name="it" value="<%=it%>">
		</form>
		</td>
		<td height="32" width="40" align="center">
		<form action="YD_petitbox.asp" method="post">
		<input type="submit" value="丢弃">
		<input type="hidden" name="action" value="buy">
		<input type="hidden" name="tempname" value="<%=tempname%>">
		<input type="hidden" name="tempclass" value="<%=tempclass%>">
		<input type="hidden" name="tempN" value="<%=it4n%>">
		<input type="hidden" name="tempNum" value="<%=tempNum%>">
		<input type="hidden" name="it" value="<%=it%>">
		</form>
		</td>
	      </tr>
	<%
	end if

	if it5<>0 then
		set rs3 = connpet.execute("select * from petitemshop where id="&it5)
		tempname = rs3("itemname")
		tempclass=rs3("itemclass")
		tempNum=rs3("itemNum")
		it=5
		rs3.close
	%>	
	      <tr>
		<td width="114" height="32" align=center><%=tempname%></td>
		<td width="114" height="32" align=center><IMG height=30 src="YD_plus/YD_pet/PET/<%=tempclass%>/<%=tempNum%>.gif" width=30></td>
		<td width="114" height="32" align=center>＋ <%=it5n%></td>
		<td height="32" align=center width="40">
		<form action="YD_petitbox.asp" method="post">
		<input type="submit" value="装备">
		<input type="hidden" name="action" value="sell">
		<input type="hidden" name="tempname" value="<%=tempname%>">
		<input type="hidden" name="tempclass" value="<%=tempclass%>">
		<input type="hidden" name="tempN" value="<%=it5n%>">
		<input type="hidden" name="tempNum" value="<%=tempNum%>">
		<input type="hidden" name="it" value="<%=it%>">
		</form>
		</td>
		<td height="32" width="40" align="center">
		<form action="YD_petitbox.asp" method="post">
		<input type="submit" value="出售">
		<input type="hidden" name="action" value="npc">
		<input type="hidden" name="tempname" value="<%=tempname%>">
		<input type="hidden" name="tempclass" value="<%=tempclass%>">
		<input type="hidden" name="tempN" value="<%=it5n%>">
		<input type="hidden" name="tempNum" value="<%=tempNum%>">
		<input type="hidden" name="it" value="<%=it%>">
		</form>
		</td>
		<td height="32" width="40" align="center">
		<form action="YD_petitbox.asp" method="post">
		<input type="submit" value="丢弃">
		<input type="hidden" name="action" value="buy">
		<input type="hidden" name="tempname" value="<%=tempname%>">
		<input type="hidden" name="tempclass" value="<%=tempclass%>">
		<input type="hidden" name="tempN" value="<%=it5n%>">
		<input type="hidden" name="tempNum" value="<%=tempNum%>">
		<input type="hidden" name="it" value="<%=it%>">
		</form>
		</td>
	      </tr>
	<%
	end if

	if it6<>0 then
		set rs3 = connpet.execute("select * from petitemshop where id="&it6)
		tempname = rs3("itemname")
		tempclass=rs3("itemclass")
		tempNum=rs3("itemNum")
		it=6
		rs3.close
	%>	
	      <tr>
		<td width="114" height="32" align=center><%=tempname%></td>
		<td width="114" height="32" align=center><IMG height=30 src="YD_plus/YD_pet/PET/<%=tempclass%>/<%=tempNum%>.gif" width=30></td>
		<td width="114" height="32" align=center>＋ <%=it6n%></td>
		<td height="32" align=center width="40">
		<form action="YD_petitbox.asp" method="post">
		<input type="submit" value="装备">
		<input type="hidden" name="action" value="sell">
		<input type="hidden" name="tempname" value="<%=tempname%>">
		<input type="hidden" name="tempclass" value="<%=tempclass%>">
		<input type="hidden" name="tempN" value="<%=it6n%>">
		<input type="hidden" name="tempNum" value="<%=tempNum%>">
		<input type="hidden" name="it" value="<%=it%>">
		</form>
		</td>
		<td height="32" width="40" align="center">
		<form action="YD_petitbox.asp" method="post">
		<input type="submit" value="出售">
		<input type="hidden" name="action" value="npc">
		<input type="hidden" name="tempname" value="<%=tempname%>">
		<input type="hidden" name="tempclass" value="<%=tempclass%>">
		<input type="hidden" name="tempN" value="<%=it6n%>">
		<input type="hidden" name="tempNum" value="<%=tempNum%>">
		<input type="hidden" name="it" value="<%=it%>">
		</form>
		</td>
		<td height="32" width="40" align="center">
		<form action="YD_petitbox.asp" method="post">
		<input type="submit" value="丢弃">
		<input type="hidden" name="action" value="buy">
		<input type="hidden" name="tempname" value="<%=tempname%>">
		<input type="hidden" name="tempclass" value="<%=tempclass%>">
		<input type="hidden" name="tempN" value="<%=it6n%>">
		<input type="hidden" name="tempNum" value="<%=tempNum%>">
		<input type="hidden" name="it" value="<%=it%>">
		</form>
		</td>
	      </tr>
	<%
	end if

	if it7<>0 then
		set rs3 = connpet.execute("select * from petitemshop where id="&it7)
		tempname = rs3("itemname")
		tempclass=rs3("itemclass")
		tempNum=rs3("itemNum")
		it=7
		rs3.close
	%>	
	      <tr>
		<td width="114" height="32" align=center><%=tempname%></td>
		<td width="114" height="32" align=center><IMG height=30 src="YD_plus/YD_pet/PET/<%=tempclass%>/<%=tempNum%>.gif" width=30></td>
		<td width="114" height="32" align=center>＋ <%=it7n%></td>
		<td height="32" align=center width="40"><form action="YD_petitbox.asp" method="post">
		<input type="submit" value="装备">
		<input type="hidden" name="action" value="sell">
		<input type="hidden" name="tempname" value="<%=tempname%>">
		<input type="hidden" name="tempclass" value="<%=tempclass%>">
		<input type="hidden" name="tempN" value="<%=it7n%>">
		<input type="hidden" name="tempNum" value="<%=tempNum%>">
		<input type="hidden" name="it" value="<%=it%>">
		</form>
		</td>
		<td height="32" width="40" align="center">
		<form action="YD_petitbox.asp" method="post">
		<input type="submit" value="出售">
		<input type="hidden" name="action" value="npc">
		<input type="hidden" name="tempname" value="<%=tempname%>">
		<input type="hidden" name="tempclass" value="<%=tempclass%>">
		<input type="hidden" name="tempN" value="<%=it7n%>">
		<input type="hidden" name="tempNum" value="<%=tempNum%>">
		<input type="hidden" name="it" value="<%=it%>">
		</form>
		</td>
		<td height="32" width="40" align="center">
		<form action="YD_petitbox.asp" method="post">
		<input type="submit" value="丢弃">
		<input type="hidden" name="action" value="buy">
		<input type="hidden" name="tempname" value="<%=tempname%>">
		<input type="hidden" name="tempclass" value="<%=tempclass%>">
		<input type="hidden" name="tempN" value="<%=it7n%>">
		<input type="hidden" name="tempNum" value="<%=tempNum%>">
		<input type="hidden" name="it" value="<%=it%>">
		</form>
		</td>
	      </tr>
	<%
	end if

	if it8<>0 then
		set rs3 = connpet.execute("select * from petitemshop where id="&it8)
		tempname = rs3("itemname")
		tempclass=rs3("itemclass")
		tempNum=rs3("itemNum")
		it=8
		rs3.close
	%>	
	      <tr>
		<td width="114" height="32" align=center><%=tempname%></td>
		<td width="114" height="32" align=center><IMG height=30 src="YD_plus/YD_pet/PET/<%=tempclass%>/<%=tempNum%>.gif" width=30></td>
		<td width="114" height="32" align=center>＋ <%=it8n%></td>
		<td height="32" align=center width="40">
		<form action="YD_petitbox.asp" method="post">
		<input type="submit" value="装备">
		<input type="hidden" name="action" value="sell">
		<input type="hidden" name="tempname" value="<%=tempname%>">
		<input type="hidden" name="tempclass" value="<%=tempclass%>">
		<input type="hidden" name="tempN" value="<%=it8n%>">
		<input type="hidden" name="tempNum" value="<%=tempNum%>">
		<input type="hidden" name="it" value="<%=it%>">
		</form>
		</td>
		<td height="32" width="40" align="center">
		<form action="YD_petitbox.asp" method="post">
		<input type="submit" value="出售">
		<input type="hidden" name="action" value="npc">
		<input type="hidden" name="tempname" value="<%=tempname%>">
		<input type="hidden" name="tempclass" value="<%=tempclass%>">
		<input type="hidden" name="tempN" value="<%=it8n%>">
		<input type="hidden" name="tempNum" value="<%=tempNum%>">
		<input type="hidden" name="it" value="<%=it%>">
		</form>
		</td>
		<td height="32" width="40" align="center">
		<form action="YD_petitbox.asp" method="post">
		<input type="submit" value="丢弃">
		<input type="hidden" name="action" value="buy">
		<input type="hidden" name="tempname" value="<%=tempname%>">
		<input type="hidden" name="tempclass" value="<%=tempclass%>">
		<input type="hidden" name="tempN" value="<%=it8n%>">
		<input type="hidden" name="tempNum" value="<%=tempNum%>">
		<input type="hidden" name="it" value="<%=it%>">
		</form>
		</td>
	      </tr>
	<%end if%>
	    </table>
	<%
	rs2.close
	rs.close
	end if
	%>
	  </td>
	</tr>
      </table>
    </td>
  </tr>
</table>
<%
end sub
%>