<%
function comadd(hw_id)
chkid hw_id
set rs=server.createobject("adodb.recordset")
rs.open "select sort_id from WrzcNethtml_hw where hw_id="&hw_id&"",conn,1,1
if rs.eof then
showerr "e"
else
sort_id=rs("sort_id")
end if
rs.close
set rs=nothing
if Request.Cookies("WrzcNethtml")("com")="" then
Response.Cookies("WrzcNethtml")("com")=hw_id
Response.Write "<script language=javascript>window.location.href='"&Request.ServerVariables("Http_Referer")&"';</script>"
response.End
elseif Request.Cookies("WrzcNethtml")("com")<>"" then
comid=split(request.Cookies("WrzcNethtml")("com"),"/")
for i=0 to ubound(comid) 
baksort=comid(i)
if hw_id=comid(i) then
showerr "e1"
else
set rs=server.createobject("adodb.recordset")
rs.open "select sort_id from WrzcNethtml_hw where hw_id="&baksort&"",conn,1,1
if rs.eof then
response.write "<script language=javascript>alert('Error');history.go(-1);</script>"
response.End
else
sort=rs("sort_id")
end if
rs.close
set rs=nothing
if sort<>sort_id then
showerr "e2"
end if
end if
next
Response.Cookies("WrzcNethtml")("com")=Request.Cookies("WrzcNethtml")("com")&"/"&hw_id
Response.Write "<script language=javascript>window.location.href='"&Request.ServerVariables("Http_Referer")&"';</script>"
response.End
end if
end function
function comdel(hw_id)
chkid hw_id
comid=split(Request.Cookies("WrzcNethtml")("com"),"/")
for i=0 to ubound(comid)
if hw_id<>comid(i) then
if com="" then
com=comid(i)
else
com=com&"/"&comid(i)
end if
end if
next
Response.Cookies("WrzcNethtml")("com")=com
Response.Write"<script language=javascript>window.location.href='"&Request.ServerVariables("Http_Referer")&"';</script>"
end function
function comdelall
Response.Cookies("WrzcNethtml")("com")=""
Response.Write"<script language=javascript>window.location.href='"&Request.ServerVariables("Http_Referer")&"';</script>"
end function
%>