<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 size="1" name="room" ID="Select3">
              <%if room="" then%>
							<option value="9"  selected>室</option>
							<option value="9" >-</option>
							<option value="0" >0</option>
							<option value="1">1</option>
							<option value="2" >2</option>
							<option value="3" >3</option>
							<option value="4" >4</option>
							<option value="5" >5</option>
							<%else%>
								<option value="9" <%if room =9 then%> selected <%end if%>>室</option>
							<option value="9" >-</option>
							<option value="0" <%if room=0 then%> selected <%end if%>>0</option>
							<option value="1" <%if room=1 then%> selected <%end if%>>1</option>
							<option value="2" <%if room=2 then%> selected <%end if%>>2</option>
							<option value="3" <%if room=3 then%> selected <%end if%>>3</option>
							<option value="4" <%if room=4 then%> selected <%end if%>>4</option>
							<option value="5" <%if room=5 then%> selected <%end if%>>5</option>
							<%end if%>
						</select> <select size="1" name="hall" ID="Select4">
						   <%if hall="" then%>
							<option value="9" selected>厅</option>
							<option value="9">-</option>
							<option value="0">0</option>
							<option value="1">1</option>
							<option value="2">2</option>
							<option value="3">3</option>
							<option value="4">4</option>
							<option value="5">5</option>
							<%else%>
							<option value="9" <%if hall =9 then%> selected <%end if%>>厅</option>
							<option value="9" >-</option>
							<option value="0" <%if hall=0 then%> selected <%end if%>>0</option>
							<option value="1" <%if hall=1 then%> selected <%end if%>>1</option>
							<option value="2" <%if hall=2 then%> selected <%end if%>>2</option>
							<option value="3" <%if hall=3 then%> selected <%end if%>>3</option>
							<option value="4" <%if hall=4 then%> selected <%end if%>>4</option>
							<option value="5" <%if hall=5 then%> selected <%end if%>>5</option>
							<%end if%>
						</select> <select size="1" name="toilet" ID="Select5">
								   <%if toilet="" then%>
							<option value="9" selected>卫</option>
							<option value="9">-</option>
							<option value="0">0</option>
							<option value="1">1</option>
							<option value="2">2</option>
							<option value="3">3</option>
							<option value="4">4</option>
							<option value="5">5</option>
							<%else%>
							<option value="9"  <%if toilet =9 then%> selected <%end if%>>卫</option>
							<option value="9">-</option>
							<option value="0" <%if toilet =0 then%> selected <%end if%>>0</option>
							<option value="1" <%if toilet =1 then%> selected <%end if%>>1</option>
							<option value="2" <%if toilet =2 then%> selected <%end if%>>2</option>
							<option value="3" <%if toilet =3 then%> selected <%end if%>>3</option>
							<option value="4" <%if toilet =4 then%> selected <%end if%>>4</option>
							<option value="5" <%if toilet =5 then%> selected <%end if%>>5</option>
							<%end if%>
						</select> <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="pubsort" size="1" ID="Select8">
						   <%if pubsort="" then%>
							<option value="0" selected>发布类型</option>
							<option value="0">全部</option>
							<option value="1">本站</option>
							<option value="2">中介</option>
							<option value="3">个人</option>
							<%else%>
							<option value="0"  <%if pubsort =0 then%> selected <%end if%>>发布类型</option>
							<option value="0">全部</option>
							<option value="1"  <%if pubsort =1 then%> selected <%end if%>>本站</option>
							<option value="2"  <%if pubsort =2 then%> selected <%end if%>>中介</option>
							<option value="3"  <%if pubsort =3 then%> selected <%end if%>>个人</option>
							<%end if%>
						</select>
						
						<select name="sort"  size="1"><%if sort="" then%><option value="0">物业类型</option>
												<option value="0">全部</option>
												<option value="1">普通住宅</option>
												<option value="2">小高层住宅</option>
												<option value="3">高层住宅</option>
												<option value="4">别墅</option>
												<option value="5">写字楼</option>
												<option value="6">店面房</option>
												<option value="7">厂房</option>
												<option value="8">车库车位</option>
												<option value="9">公寓</option>
												<option value="10">单身公寓</option>
												<option value="11">其他</option>
												   <%else%>
												<option value="0" <%if sort =0 then%> selected <%end if%>>物业类型</option>
												<option value="0">全部</option>
												<option value="1" <%if sort =1 then%> selected <%end if%>>普通住宅</option>
												<option value="2" <%if sort =2 then%> selected <%end if%>>小高层住宅</option>
												<option value="3" <%if sort =3 then%> selected <%end if%>>高层住宅</option>
												<option value="4" <%if sort =4 then%> selected <%end if%>>别墅</option>
												<option value="5" <%if sort =5 then%> selected <%end if%>>写字楼</option>
												<option value="6" <%if sort =6 then%> selected <%end if%>>店面房</option>
												<option value="7" <%if sort =7 then%> selected <%end if%>>厂房</option>
												<option value="8" <%if sort =8 then%> selected <%end if%>>车库车位</option>
												<option value="9" <%if sort =9 then%> selected <%end if%>>公寓</option>
												<option value="10" <%if sort =10 then%> selected <%end if%>>单身公寓</option>
												<option value="11" <%if sort =11 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>