sub ShowSearch(ShowType)
dim count
if ShowType<>1 and ShowType<>2 then
ShowType=1
end if
set rs=server.createobject("adodb.recordset")
sql = "select * from SmallClass order by SmallClassID desc"
rs.open sql,conn,1,1
set rsbig=server.createobject("adodb.recordset")
sqlbig = "select * from bigClass order by bigClassID desc"
rsbig.open sqlbig,conn,1,1
%>
<script language = "JavaScript">
var onecount;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("SmallClassName"))%>","<%= trim(rs("BigClassName"))%>","<%= trim(rs("SmallClassName"))%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.myform.SmallClassName.length = 1;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.myform.SmallClassName.options[document.myform.SmallClassName.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
var onecountt;
subcatbig = new Array();
<%
countt = 0
do while not rsbig.eof
%>
subcatbig[<%=countt%>] = new Array("<%= trim(rsbig("bigClassName"))%>","<%= trim(rsbig("BigbigClassName"))%>","<%= trim(rsbig("bigClassName"))%>");
<%
countt = countt + 1
rsbig.movenext
loop
rsbig.close
%>
onecountt=<%=countt%>;
function changelocationn(locationidd)
{
document.myform.BigClassName.length = 1;
var locationidd=locationidd;
var y;
for (y=0;y < onecountt; y++)
{
if (subcatbig[y][1] == locationidd)
{
document.myform.BigClassName.options[document.myform.BigClassName.length] = new Option(subcatbig[y][0], subcatbig[y][2]);
}
}
}
</script>
<table border="0" cellpadding="2" cellspacing="0" align="center">
<form method="Get" name="myform" action="search.asp">
<tr>
<td height="28">
<select name="Field" size="1">
<option value="Title" selected>Products name</option>
<option value="Content">Products content</option>
</select>
<%if ShowType=1 then%>
</td>
</tr>
<tr>
<td height="14">
<%end if%>
<select name="BigBigClassName" onChange="changelocationn(document.myform.BigBigClassName.options[document.myform.BigBigClassName.selectedIndex].value)" size="1">
<option selected value="">BigBigclass</option>
<%
if not (rsBigBigClass.bof and rsBigBigClass.eof) then
rsBigBigClass.movefirst
do while not rsBigBigClass.eof
response.Write "<option value='" & trim(rsBigBigClass("BigBigClassName")) & "'>" & trim(rsBigBigClass("BigBigClassName")) & "</option>"
rsBigBigClass.movenext
loop
end if
tsqlBigClass="select * from BigClass where BigBigClassName='"&BigBigClassName&"'"
Set trsBigClass= Server.CreateObject("ADODB.Recordset")
trsBigClass.open tsqlBigClass,conn,1,1