function ChangeColumnsCount(count)
{
	SetCookie('columns', count);
	var s = location.href;
    
	if (s.match(/\.\d+$/) != null) location = s.replace(/\.\d+$/, '');
	else location.reload(true);
    //location = s.replace(/\.\d+$/, '');
}

function RefreshColumnsSelector()
{
	var e = document.getElementById('columns_count');
	if (e != null)
	{
		var count = GetCookie('columns');
		if (count == null) count = 5;

		for (var i = 0; i < e.options.length; i++)
		{
			/*
			if (e.options.item(i).value == count)
			{
				e.options.item(i).selected = true;
				e.selectedIndex = i;
			}
            */
            e.options.item(i).selected = e.options.item(i).value == count;
		}
	}
}