<!--
var s=["s1","s2","s3"];
var t=["t1","t2","t3"];

var opt0 = ["--请选择--","--请选择--","--请选择--"];
var opt1 = ["--请选择--","--请选择--","--请选择--"];

function setup()
{
	for(i=0;i<s.length-1;i++)
		document.getElementById(s[i]).onchange=new Function("change("+(i+1)+")");
	change(0);

	for(i=0;i<t.length-1;i++)
		document.getElementById(t[i]).onchange=new Function("change1("+(i+1)+")");
	change1(0);
}

function change(v){
	var str="0";
	for(i=0;i<v;i++){ str+=("_"+(document.getElementById(s[i]).selectedIndex-1));};
	var ss=document.getElementById(s[v]);
	with(ss){
		length = 0;
		options[0]=new Option(opt0[v],opt0[v]);
		if(v && document.getElementById(s[v-1]).selectedIndex>0 || !v)
		{
			if(dsy.Exists(str)){
				ar = dsy.Items[str];
				for(i=0;i<ar.length;i++)options[length]=new Option(ar[i],ar[i]);
				if(v)options[1].selected = true;
			}
		}
		if(++v<s.length){change(v);}
	}
}

function change1(r){
	var str1="0";
	for(i=0;i<r;i++){ str1+=("_"+(document.getElementById(t[i]).selectedIndex-1));};
	var tt=document.getElementById(t[r]);
	with(tt){
		length = 0;
		options[0]=new Option(opt1[r],opt1[r]);
		if(r && document.getElementById(t[r-1]).selectedIndex>0 || !r)
		{
			if(dsy.Exists(str1)){
				ar = dsy.Items[str1];
				for(i=0;i<ar.length;i++)options[length]=new Option(ar[i],ar[i]);
				if(r)options[1].selected = true;
			}
		}
		if(++r<t.length){change1(r);}
	}
}

function Dsy(){
	this.Items = {};
}
Dsy.prototype.add = function(id,iArray){
	this.Items[id] = iArray;}
Dsy.prototype.Exists = function(id){
	if(typeof(this.Items[id]) == "undefined") return false;
	return true;
}
//-->