tedIndex = vals.selected;

		sel.parentNode.style.display = (sel.options.length <= 1) ? 'none' : '';
		sel.vals = vals;
	}

	function cbi_toggle_wifi_mode(id)
	{
		cbi_toggle_wifi_htmode(id);
		cbi_toggle_wifi_band(id);
	}

	function cbi_toggle_wifi_htmode(id)
	{
		var mode = document.getElementById(id + '.mode');
		var bwdt = document.getElementById(id + '.htmode');

		cbi_set_values(bwdt, htmodes[mode.value]);
	}

	function cbi_toggle_wifi_band(id)
	{
		var mode = document.getElementById(id + '.mode');
		