			function make_sorting_active(active_id_param)
			{
				active_id_param = String(active_id_param);
				if(active_id_param.search('y_')>0)
					active_id = active_id_param;
				active_li = document.getElementById(active_id);
				if(!active_li)
					return false;
				else
					active_li = active_li.parentNode;

				active_li.className = 'active';
			}

			function change_sorting(xml_url, sorting)
			{
				cur_sort = get_cookie('sorting');
				if(!cur_sort || first)
				{
					cur_sort = 'by_alphabet';
					first = false;
				}
				cur_tab = document.getElementById(active_id);
				cur_tab.parentNode.className = '';

				make_sorting_active(sorting)
				
				set_cookie('sorting', sorting, 24);
				set_cookie('sorting_url', xml_url, 24);
				unset_cookie('page');

				if(document.getElementById('sbox'))
					dynamic_sorting_change();
				else
				{
					//w = window.open();
					//w.document.write(xml_url);
					var o = new BxXslTransform(xml_url, "{$theme_url}1.xsl", "", update_link_list_sorting);
				}
			}

			function dynamic_sorting_change()
			{
				clone = document.getElementById('sbox').firstChild.cloneNode(false);
				document.getElementById('sbox').innerHTML = '';
				document.getElementById('sbox').appendChild(clone);

				if(typeof(show_sbox) != 'undefined')
					show_sbox(get_cookie(get_cookie('mode') ? get_cookie('mode') : '0'));
				if(typeof(sbox_scroll) != 'undefined')
					sbox_scroll(document.getElementById('sbox'));
			}

			function update_link_list_sorting(r)
			{
				var e = document.getElementById('links_body');
				e.innerHTML = r;
			}
