function sl_aoK(k,v,s,e) {
	k++;
	var newe=new Option(v,k,false,false);
	var ref=document.getElementById(s);
	if (ref != null) {ref.options[ref.options.length]=newe;}
	if (e){ref.selectedIndex=k}
}
function sl_agsKonf() {
	for (i in sl_uniqmg) {sl_aoK(i,sl_uniqmg[i],"sl_CA")}	
	for (i in sl_fo) {sl_aoK(i,sl_fo[i],"sl_FO")}
	document.getElementById("sl_CL").selectedIndex=0;
	//quell(document.body.innerHTML)
}

function sl_asK(fn) {
	caK = sl_agfK('sl_CA');	
	foK = sl_agfK('sl_FO');	
	if (caK){				
		if(fn == 1)
			{
				var ref = document.getElementById("sl_CL");
				ref.length=1;
				mvA = sl_mgmv[caK-1].split('_');
				for (i in mvA) {sl_aoK(mvA[i],sl_mv[mvA[i]],"sl_CL")}					
			}
		clK = sl_agfK('sl_CL'); 
		if (clK) {fts=sl_f[clK-1];}
		else 
			{
				fts=sl_mgf[caK-1];
				var ref = document.getElementById("sl_FO");		
				ref.selectedIndex=0	
			}		
		var ref = document.getElementById("sl_FO");
		ref.length=1;			
		if(fts.length==2) 
			{
				sl_aoK(0,sl_fo[0],'sl_FO');
				sl_aoK(1,sl_fo[1],'sl_FO')
				if(fn != 3) {foK=0;}
			}
		else 
			{			
			if(fts.match(/B/i)) {sl_aoK(0,sl_fo[0],'sl_FO');}		
			if(fts.match(/D/i)) {sl_aoK(1,sl_fo[1],'sl_FO');}
			foK=1;
			}		
		ref.selectedIndex=foK	
	}	
	else
	{
		var ref = document.getElementById("sl_CL");
		ref.length=1;
		ref.selectedIndex=0	
		if(fn == 1)
			{
				var ref = document.getElementById("sl_FO");
				ref.length=1;	
				_aoK(0,sl_fo[0],'sl_FO');
				_aoK(1,sl_fo[1],'sl_FO')	
				ref.selectedIndex=0	
			}
	}
}
function sl_agfK(f,w){
	ref=document.getElementById(f);
  	if (ref != null) {
		fv=ref.options[ref.selectedIndex].value;		
		if (w) {fv=ref.options[ref.selectedIndex].text}
		if (fv=="def") {fv=false}
		return fv;
	}
}
function open_sl(slurl) {
	//s="scrollbars=yes,directories=no,menubar=no,toolbar=no,width=800,height=600,status=yes,resizable=yes";
	caK = sl_agfK('sl_CA');
	clK = sl_agfK('sl_CL');
	foK = sl_agfK('sl_FO');
	//alert(caK + " " + clK +" " +foK)
	if(caK && clK){slurl+="&"+sl_mvid[clK-1]}
	else if(caK){slurl+="&"+sl_mid[caK-1]}
	if(foK){slurl+="&auswahl.motor="+sl_fok[foK-1]}	
	ccpop3(slurl, 0)
}


