<%
function exportPinPai()
%>
<table width="11%" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC"> 
 <tr bgcolor="#FFFFFF"> 
<td width="32%" height="24"><div style="width:50px;">产地：</div></td> 
<td width="68%"><select id="s1" name="s1"></select></td> 
</tr> 
<tr bgcolor="#FFFFFF"> 
<td height="24">厂家：</td> 
<td><select id="s2" name="s2"></select></td> 
</tr> 
<tr bgcolor="#FFFFFF"> 
<td height="24">品牌：</td> 
<td><select id="s3" name="s3"></select></td> 
</tr> 
<tr bgcolor="#FFFFFF"> 
<td height="24">型号：</td> 
<td><select id="s4" name="s4"></select></td> 
</tr>
</table>
<script language="JavaScript">
<!--
function LianDong(arr, sel)
{
 var me = this;
 this.$ = function(o)
 {
  return document.getElementById(o);
 }

 this.sub = function (i, pid)
 {
  for (var j=i+1; j<sel.length; j++)
  {
   me.$(sel[j]).length = 0;
   me.$(sel[j]).options[0] = new Option("---请选择---", "");
  }
  for ( var j = 0; j < arr.length; j++)
  {
   if (arr[j][1] == pid)
   {
    me.$(sel[i+1]).options[me.$(sel[i+1]).length] = new Option(arr[j][2], arr[j][0]);
   }
  }
 }

 this.init = function()
 {
  me.sub(-1,"0");
  for (var i=0; i<sel.length-1; i++)
  {
   me.$(sel[i]).onchange = function()
   {
    var i;
    for (i=0; me.$(sel[i])!=this; i++);
    me.sub(i, me.$(sel[i]).value);
   }
  }
 }

 this.init();
}

var array=new Array();
<%
set rs_cd = server.CreateObject("adodb.recordset")
rs_cd.open "select sortName,id,parentId from carSort ",conn,1,1
i_cd = 0
do while not rs_cd.eof

response.write "array["& i_cd &"]=new Array('"& rs_cd("id") &"','"& rs_cd("parentId") &"','"& rs_cd("sortName") &"');"&vbcrlf

i_cd = i_cd + 1
rs_cd.movenext
loop

rs_cd.close
set rs_cd = nothing
%>
var select = new Array("s1","s2","s3","s4");
var liandong=new LianDong(array, select);
//-->
</script>
<%
end function

'call exportPinPai()
'response.write request.Form("s1")&"<br>"&request.Form("s2")&"<br>"&request.Form("s3")&"<br>"&request.Form("s4")&"<br>"
%>