
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;
}

function change(c,v){
	var str="0";
	var dsy = window.select[c].dsy;
	var s = window.select[c].Sel;
	for(i=0;i<v;i++){ str+=("_"+document.getElementById(s[i]).selectedIndex);};
	var ss=document.getElementById(s[v]);
	with(ss){
		length = 0;
		if(dsy.Exists(str)){
			var ar = dsy.Items[str];
			for(i=0;i<ar.length;i++) {
				var ot = ar[i][0];var ov = ar[i][1] ? ar[i][1] : ot;
				options[length]=new Option(ot,ov);
			}
		}
		else { options[0]=new Option("ÇëÑ¡Ôñ","ÇëÑ¡Ôñ");}
		if(++v<s.length){change(c,v);}
	}
}

function setup(iDsy,iS)
{
	if(!window.select)
	{ window.select = new Array();};
	var counter = window.select.length;
	window.select[counter] = { dsy: iDsy, Sel: iS };
	for(i=0;i<iS.length-1;i++)
		document.getElementById(iS[i]).onchange=new Function("change("+counter+","+(i+1)+")");
	change(counter,0);
}