function cats(num_cats)
{
	var checked = 1;
	for (var i = 0; i < num_cats; i++)
	{
		//This will loop through the cats. if just 1 is unchecked it will check them all, otherwise it will uncheck them all
		if (!document.getElementById('cats' + i).checked)
		{
			checked = 0;
			break;
		}
	}
	
	if (checked == 0)
	{
		for (i = 0; i < num_cats; i++)
		{
			document.getElementById('cats' + i).checked = true;
		}
	}
	else
	{
		for (i = 0; i < num_cats; i++)
		{
			document.getElementById('cats' + i).checked = false;
		}
	}
}

function themes(num_themes)
{
	var checked = 1;
	for (var i = 0; i < num_themes; i++)
	{
		//This will loop through the themes. if just 1 is unchecked it will check them all, otherwise it will uncheck them all
		if (!document.getElementById('themes' + i).checked)
		{
			checked = 0;
			break;
		}
	}
	
	if (checked == 0)
	{
		for (i = 0; i < num_themes; i++)
		{
			document.getElementById('themes' + i).checked = true;
		}
	}
	else
	{
		for (i = 0; i < num_themes; i++)
		{
			document.getElementById('themes' + i).checked = false;
		}
	}
}

function regions(num_regions)
{
	var checked = 1;
	for (var i = 0; i < num_regions; i++)
	{
		//This will loop through the regions. if just 1 is unchecked it will check them all, otherwise it will uncheck them all
		if (!document.getElementById('regions' + i).checked)
		{
			checked = 0;
			break;
		}
	}
	
	if (checked == 0)
	{
		for (i = 0; i < num_regions; i++)
		{
			document.getElementById('regions' + i).checked = true;
		}
	}
	else
	{
		for (i = 0; i < num_regions; i++)
		{
			document.getElementById('regions' + i).checked = false;
		}
	}
}
