function load_selects(frm, nn, cid, ccid, startup ){
	if( cid == 1 )	disable(frm,nn);
	j = 0;
	if( ccid == -1 || !SELOPT[ccid] || !SELOPT[ccid].length ){
		f = frm["cid_" + cid ];
		f.options.length = 0;
		f.options[0] = new Option( WORDEMPTY, -1, true, true );
		disable(frm,nn,cid);
	}
	else{
		if( SELOPT[ccid] && SELOPT[ccid].length ){
			var select = 0;
			f = frm["cid_" + cid ];
			if (f!=null){
			f.options.length = 0;
			f.options[0] = new Option( WORDEMPTY, -1, true, true );
			for( i in SELOPT[ccid] ){
				len = f.options.length;
				f.options[len] = new Option( SELOPT[ccid][i], i );
				if( PAROPT[nn][i] == 1 && startup == 1 ){
					select = len;
				}
				j++;
			}
			f.options[select].selected = true;
			}
			enable( frm,nn,cid );
			if( cid == 0 )  ajax_get("geo", URL[nn][1]+"&c="+f.value, "response", "rewrite");
			if( cid == 1 )  ajax_get("geo", URL[nn][2]+"&c="+f.value, "response", "rewrite");
		}
		else{
			if( cid == 2 ){
				disable(frm,nn,2);
			}
			
		}
	}
	
	if( cid == 0 && startup != 1 ){
		disable(frm,nn);
	}
}



function enable(frm,nn,num ){
	var o = D.getElementById( "cdiv"+nn+"_"+num );
	if( !o ) return false;
	if (num>0){
	var n = D.getElementById( "cdname"+nn+"_"+num );
	n.innerHTML=WORD[num];
	}
	o.style.visibility = "visible";
	frm.ccid1.value = 1;
	if( num == 2 ) {
		frm.ccid2.value = 1;
	}
}

function disable(frm,nn,num ){
    if( !num ) {
		disable(frm,nn,1 );
		disable(frm,nn,2 );
	}
	var o = D.getElementById( "cdiv"+nn+"_"+num );
	if( !o ) return false;
	o.style.visibility = "hidden";
	
	frm.ccid2.value = 0;
	if( num == 1 ) {
	    frm.ccid1.value = 0;
	}
	if (num>0){
	var n = D.getElementById( "cdname"+nn+"_"+num );
	n.innerHTML="";
	}
	
}