

<script language="JavaScript">
var onecount;
onecount=0;
subcat = new Array();
        
		<%
		i=0
		set rs2=server.createobject("ADODB.Recordset")
            sql2="select shi_id,shi_name,sheng_id from sc_shi"
            rs2.open sql2,conn,1,3
            If Not rs2.Eof Then 
            do while not rs2.eof
			
            %>
			subcat[<%=i%>] = new Array("<%=rs2("shi_name")%>","<%=rs2("sheng_id")%>","<%=rs2("shi_id")%>");
            <%
			i=i+1
              rs2.movenext
              loop
              end if
              rs2.close
              set rs2=nothing
            %>

onecount=<%=i%>;

var onecount4;
onecount4=0;
subcat4 = new Array();
     
<%
		i=0
		set rs3=server.createobject("ADODB.Recordset")
            sql3="select a.qu_id,a.qu_name,a.shi_id,b.shi_name,b.sheng_id from sc_qu a inner join sc_shi b on a.shi_id=b.shi_id"
            rs3.open sql3,conn,1,3
            If Not rs3.Eof Then 
            do while not rs3.eof
			
            %>
			subcat4[<%=i%>] = new Array("<%=rs3("qu_name")%>","<%=rs3("sheng_id")%>","<%=rs3("shi_id")%>","<%=rs3("qu_id")%>");
            <%
			i=i+1
              rs3.movenext
              loop
              end if
              rs3.close
              set rs3=nothing
            %>

onecount4=<%=i%>;

	 

 
 
 
function changelocation(locationid)
    {
    document.postart.city_two.length = 0; 
	document.postart.city_two.options[0] = new Option('选择城市','');
	document.postart.city_three.length = 0; 
	document.postart.city_three.options[0] = new Option('选择城市','');
    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.postart.city_two.options[document.postart.city_two.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    
	
	function changelocation4(locationid,locationid1)
    {
    document.postart.city_three.length = 0; 
    document.postart.city_three.options[0] = new Option('选择城市','');
    var locationid=locationid;
	 var locationid1=locationid1;
    var i;
    for (i=0;i < onecount4; i++)
        {
            if (subcat4[i][2] == locationid)
            { 
			if (subcat4[i][1] == locationid1)
			{
                document.postart.city_three.options[document.postart.city_three.length] = new Option(subcat4[i][0], subcat4[i][3]);
            }        
        }
       } 
    }            
</script>
<form name="postart">
<select onchange="changelocation(document.postart.city_one.options[document.postart.city_one.selectedIndex].value)" id="select" size="1" name="city_one">
            <option selected="" value="">选择城市</option>
 <%set rs1=server.createobject("ADODB.Recordset")
            sql1="select sheng_id,sheng_name from sc_sheng"
            rs1.open sql1,conn,1,3
            If Not rs1.Eof Then 
            do while not rs1.eof
            %>
			<option value='<%=rs1("sheng_id")%>'><%=rs1("sheng_name")%></option>
            <%
              rs1.movenext
              loop
              end if
              rs1.close
              set rs1=nothing
            %>
          </select>
		  <select onchange="changelocation4(document.postart.city_two.options[document.postart.city_two.selectedIndex].value,document.postart.city_one.options[document.postart.city_one.selectedIndex].value)" id="select6" name="city_two">

		  </select>
		  <select id="select7" name="city_three">
          
         
		
		  </select>
		  </form>