<script language=JavaScript>
<%dim i_1,j_1
	set rs_s=server.createobject("adodb.recordset")
	sql="select * from province order by shengorder"
	rs_s.open sql,conn,1,1
%>
	var selects=[];
	selects['0']=new Array(new Option('请选择城区','0'));
<%
	for i=1 to rs_s.recordcount
%>
	selects['<%=rs_s("ShengNo")%>']=new Array(

new Option('请选择县区','0'),
<%
	set rs_s1=server.createobject("adodb.recordset")
	sql="select * from city where shengid="&rs_s("id")&" order by shiorder"
	rs_s1.open sql,conn,1,1
	if rs_s1.recordcount>0 then 
	%>


	<%		for j=1 to rs_s1.recordcount
		if j=rs_s1.recordcount then 
%>
		new Option('<%=trim(rs_s1("shiname"))%>','<%=trim(rs_s1("shiNo"))%>'));
<%		else
%>
		new Option('<%=trim(rs_s1("shiname"))%>','<%=trim(rs_s1("shiNo"))%>'),
<%
		end if
		rs_s1.movenext
		next
	else 
%>
		new Option('','0'));
<%
	end if
	rs_s1.close
	set rs_s1=nothing
	rs_s.movenext
	next
rs_s.close
set rs_s=nothing
%>
	function chsel(){
		with (document.formpub){
			if(province.value) {
				city.options.length=0;
				for(var i=0;i<selects[province.value].length;i++){
					city.add(selects[province.value][i]);
				}
			}
		}
	}



</script>
<table border="0" width="" cellspacing="0" cellpadding="0">
				<form name="formpub" action="search.asp" method="post" >
					<tr>
						<td>
						
						<select size="1" name="province" onChange=chsel()  class="wenbenkuang">
          <option value="0" selected>请选择市区</option>
          <%dim tmpShengid
tmpShengid=0
province=int(province)
city=int(city)
set rs1_s=server.createobject("adodb.recordset")
sql2="select * from province  order by shengorder"
rs1_s.open sql2,conn,1,1
while not rs1_s.eof


           if rs1_s("ShengNo") =province  then
     
          tmpShengid=rs1_s("id")
%>
          <option value="<%=rs1_s("ShengNo")%>" selected ><%=trim(rs1_s("ShengName"))%></option>
          <%
     else
%>
          <option value="<%=rs1_s("ShengNo")%>" ><%=trim(rs1_s("ShengName"))%></option>
            <%
     end if        
 
    rs1_s.movenext
wend
rs1_s.close
set rs1_s=nothing
%>

        </select> <select size="1" size="18" name="city"  class="wenbenkuang"  >
                        <option value="0" >请选择城区</option>

            

 <%

set rs1_s=server.createobject("adodb.recordset")
sql2="select * from city where shengid="&tmpShengid&" order by shiorder"
rs1_s.open sql2,conn,1,1
while not rs1_s.eof

%>
  <option value="<%=rs1_s("ShiNo")%>" <%if city=rs1_s("ShiNo") then%>selected<%end if%>><%=trim(rs1_s("ShiName"))%></option>

      
          <%
    rs1_s.movenext
wend
rs1_s.close
set rs1_s=nothing
%>
					 </select><font color="#ff0000"> <select style="WIDTH: 60px" name="usearea" ID="Select6">
									   <%if usearea="" then%>
							<option value="0" selected>面积</option>
							<option value="0">不限</option>
							<option value="1">30以下</option>
							<option value="2">30-50</option>
							<option value="3">50-70</option>
							<option value="4">70-90</option>
							<option value="5">90-120</option>
							<option value="6">120以上</option>
							<%else%>
								<option value="0"  <%if usearea =0 then%> selected <%end if%>>面积</option>
							<option value="0">不限</option>
							<option value="1" <%if usearea =1 then%> selected <%end if%>>30以下</option>
							<option value="2" <%if usearea =2 then%> selected <%end if%>>30-50</option>
							<option value="3" <%if usearea =3 then%> selected <%end if%>>50-70</option>
							<option value="4" <%if usearea =4 then%> selected <%end if%>>70-90</option>
							<option value="5" <%if usearea =5 then%> selected <%end if%>>90-120</option>
							<option value="6" <%if usearea =6 then%> selected <%end if%>>120以上</option>
							<%end if%>
						</select> <select style="WIDTH: 90px" size="1" name="money" ID="Select7">
								   <%if money="" then%>
							<option value="0" selected>租金(元/月)</option>
							<option value="0">不限</option>
							<option value="1">200以下</option>
							<option value="2">200-500</option>
							<option value="3">500-800</option>
							<option value="4">800-100</option>
							<option value="5">1000-1500</option>
							<option value="6">1500-2000</option>
							<option value="7">2000-3000</option>
							<option value="8">3000以上</option>
								<%else%>
							<option value="0" <%if money =0 then%> selected <%end if%>>租金(元/月)</option>
							<option value="0">不限</option>
							<option value="1" <%if money =1 then%> selected <%end if%>>200以下</option>
							<option value="2" <%if money =2 then%> selected <%end if%>>200-500</option>
							<option value="3" <%if money =3 then%> selected <%end if%>>500-800</option>
							<option value="4" <%if money =4 then%> selected <%end if%>>800-1000</option>
							<option value="5" <%if money =5 then%> selected <%end if%>>1000-1500</option>
							<option value="6" <%if money =6 then%> selected <%end if%>>1500-2000</option>
							<option value="7" <%if money =7 then%> selected <%end if%>>2000-3000</option>
							<option value="8" <%if money =8 then%> selected <%end if%>>3000以上</option>
								<%end if%>
						</select>
						<select name="RequestSex" size="1" ID="Select8">
						   <%if pubsort="" then%>
							<option value="0" selected>性别要求</option>
							<option value="0">不限</option>
							<option value="1">男</option>
							<option value="2">女</option>
							<%else%>
							<option value="0"  <%if RequestSex =0 then%> selected <%end if%>>性别要求</option>
							<option value="0">不限</option>
							<option value="1"  <%if RequestSex =1 then%> selected <%end if%>>男</option>
							<option value="2"  <%if RequestSex =2 then%> selected <%end if%>>女</option>
							<%end if%>
						</select>
						
						<select name="havehouse"  size="1"><%if sort="" then%><option value="9">有无房</option>
						<option value="9">不限</option>
												<option value="0">有</option>
												<option value="1">无</option>
										
												   <%else%>
												<option value="9" <%if havehouse =9 then%> selected <%end if%>>有无房</option>
												<option value="9">不限</option>
												<option value="0" <%if havehouse =0 then%> selected <%end if%>>有</option>
												<option value="1" <%if havehouse =1 then%> selected <%end if%>>无</option>
											
												<%end if%>
						</select><%if address=""or address="地址关键字"  then%> <input onblur="javascript:if (this.value==''){this.value='地址关键字'}" onfocus="javascript:if (this.value=='地址关键字') {this.value=''}"
							type="text" maxLength="20" size="9" value="地址关键字" name="address" ID="Text1"><%else%> <input type="text" maxLength="20" size="9" value="<%=address%>" name="address" ID="Text1">
							<%end if%>
						<input type="submit" value="搜索" name="search12" ID="Submit1" class="wenbenkuang"></td>
						</form></tr>
				</table>